Apply some const
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user