Apply some const

This commit is contained in:
Michael Vines
2018-10-29 19:56:24 -07:00
parent 4aba05d749
commit 71d6eaacef
5 changed files with 23 additions and 23 deletions

View File

@@ -6,17 +6,17 @@
#include <sol_bpf_c.h>
/**
* Numer of SolKeyedAccounts expected. The program should bail if an
* Number of SolKeyedAccounts expected. The program should bail if an
* unexpected number of accounts are passed to the program's entrypoint
*/
#define NUM_KA 3
extern bool entrypoint(uint8_t *input) {
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccounts ka[NUM_KA];
uint8_t *data;
uint64_t data_len;
if (!sol_deserialize((uint8_t *)input, NUM_KA, ka, &data, &data_len)) {
if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) {
return false;
}

View File

@@ -6,17 +6,17 @@
#include <sol_bpf_c.h>
/**
* Numer of SolKeyedAccounts expected. The program should bail if an
* Number of SolKeyedAccounts expected. The program should bail if an
* unexpected number of accounts are passed to the program's entrypoint
*/
#define NUM_KA 1
extern bool entrypoint(uint8_t *input) {
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccounts ka[NUM_KA];
uint8_t *data;
uint64_t data_len;
if (!sol_deserialize((uint8_t *)input, NUM_KA, ka, &data, &data_len)) {
if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) {
return false;
}
sol_print_params(1, ka, data, data_len);

View File

@@ -173,7 +173,7 @@ SOL_FN_PREFIX Result game_keep_alive(Game *self, SolPubkey *player,
}
/**
* Numer of SolKeyedAccounts expected. The program should bail if an
* Number of SolKeyedAccounts expected. The program should bail if an
* unexpected number of accounts are passed to the program's entrypoint
*
* accounts[0] On Init must be player X, after that doesn't matter,
@@ -183,13 +183,13 @@ SOL_FN_PREFIX Result game_keep_alive(Game *self, SolPubkey *player,
*/
#define NUM_KA 3
extern bool entrypoint(uint8_t *input) {
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccounts ka[NUM_KA];
uint8_t *data;
uint64_t data_len;
int err = 0;
if (!sol_deserialize((uint8_t *)input, NUM_KA, ka, &data, &data_len)) {
if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) {
return false;
}

View File

@@ -54,7 +54,7 @@ SOL_FN_PREFIX bool update(Dashboard *self, Game *game, SolPubkey *game_pubkey) {
}
/**
* Numer of SolKeyedAccounts expected. The program should bail if an
* Number of SolKeyedAccounts expected. The program should bail if an
* unexpected number of accounts are passed to the program's entrypoint
*
* accounts[0] doesn't matter, anybody can cause a dashboard update
@@ -63,13 +63,13 @@ SOL_FN_PREFIX bool update(Dashboard *self, Game *game, SolPubkey *game_pubkey) {
*/
#define NUM_KA 3
extern bool entrypoint(uint8_t *input) {
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccounts ka[NUM_KA];
uint8_t *data;
uint64_t data_len;
int err = 0;
if (!sol_deserialize((uint8_t *)input, NUM_KA, ka, &data, &data_len)) {
if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) {
return false;
}