Skip to content

Commit

Permalink
Solve some typos (#322)
Browse files Browse the repository at this point in the history
* Solve some typos

* Fix comment

* Fix lib comments:
  • Loading branch information
guibescos authored Nov 29, 2022
1 parent fd32f3c commit 165a9bc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions program/c/src/oracle/model/price_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ price_model_scratch_footprint( uint64_t cnt ) { /* Assumes price_model_cnt_valid
large ... typically a multiple of 3 but this is not required,
quote[i] for i in [0,cnt) are the quotes of interest on input, p25,
p50, p75 point to where to write model outputs, scratch points to a
suitable footprint srcatch region).
suitable footprint scratch region).
Returns a pointer to the quotes sorted in ascending order. As such,
the min and max and any other rank statistic can be extracted easily
Expand All @@ -68,7 +68,7 @@ price_model_scratch_footprint( uint64_t cnt ) { /* Assumes price_model_cnt_valid
worst cases. This function uses no heap / dynamic memory allocation.
It is thread safe provided it passed non-conflicting quote, output
and scratch arrays. It has a bounded call depth ~lg cnt <= ~64 (this
could reducd to O(1) by using a non-recursive sort/select
could reduce to O(1) by using a non-recursive sort/select
implementation under the hood if desired). */

int64_t * /* Returns pointer to sorted quotes (either quote or ALIGN_UP(scratch,int64_t)) */
Expand Down
2 changes: 1 addition & 1 deletion program/c/src/oracle/sort/tmpl/sort_stable.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ SORT_IMPL(stable_node)( SORT_KEY_T * x,
SORT_IDX_T k = (SORT_IDX_T)0;

/* Note that nl and nr are both at least one at this point so at least
one interation of the loop body is necessary. */
one iteration of the loop body is necessary. */

for(;;) { /* Minimal C language operations */
if( SORT_BEFORE( yr[k], yl[j] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion program/c/src/oracle/util/avg.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/* Portable robust integer averaging. (No intermediate overflow, no
assumptions about platform type wides, no assumptions about integer
signed right shift, no signed integer division, no implict
signed right shift, no signed integer division, no implicit
conversions, etc.) */

#include "sar.h"
Expand Down
4 changes: 2 additions & 2 deletions program/c/src/oracle/util/prng.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "hash.h" /* includes stdint.h */

/* prng_t should be treated as an opaque handle of a pseudo random
number generator. (It technically isn't here to faciliate inlining
number generator. (It technically isn't here to facilitate inlining
of prng operations.) */

struct prng {
Expand Down Expand Up @@ -65,7 +65,7 @@ prng_private_contract( uint64_t seq ) {
prng_new takes ownership of the memory region pointed to by mem
(which is assumed to be non-NULL with the appropriate footprint and
alingment) and formats it as a prng. The pseudo random number
alignment) and formats it as a prng. The pseudo random number
generator stream will initialized to use sequence random sequence
"seq" and will start at index "idx". Returns mem (which will be
formatted for use). The caller will not be joined to the region on
Expand Down
12 changes: 4 additions & 8 deletions program/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@ use {
solana_program::entrypoint,
};

// Below is a high lever description of the rust/c setup.
// Below is a high level description of the rust/c setup.

// As we migrate from C to Rust, our Rust code needs to be able to interact with C
// As we migrate from C to Rust, our Rust code needs to be able to interact with C.
// build-bpf.sh is set up to compile the C code into a two archive files
// contained in `./program/c/target/`
// - `libcpyth-bpf.a` contains the bpf version for production code
// - `libcpyth-native.a` contains the systems architecture version for tests

// We also generate bindings for the types and constants in oracle.h (as well as other things
// included in bindings.h), these bindings can be accessed through c_oracle_header.rs
// Bindings allow us to access type definitions, function definitions and constants. In order to
// add traits to the bindings, we use the parser in build.rs. The traits must be defined/included
// at the the top of c_oracle_headers.rs. One of the most important traits we deal are the Borsh
// serialization traits.
// We also generate bindings for the constants in oracle.h (as well as other things
// included in bindings.h).

entrypoint!(process_instruction);

0 comments on commit 165a9bc

Please sign in to comment.