Fix C programs

This commit is contained in:
Jack May 2018-10-30 22:52:59 -07:00 committed by Michael Vines
parent 0529f36fde
commit bc13248e1c
4 changed files with 10 additions and 8 deletions

View File

@ -6,7 +6,7 @@ ifneq ($(V),1)
_@ :=@
endif
SYSTEM_INC_DIRS ?= -isystem $(dir $(lastword $(MAKEFILE_LIST)))inc
SYSTEM_INC_DIRS ?= -Isystem -I$(dir $(lastword $(MAKEFILE_LIST)))inc
INC_DIRS ?=
SRC_DIR ?= ./src
OUT_DIR ?= ./out
@ -50,11 +50,13 @@ help:
@echo ' - Output files will be placed in the directory: $(OUT_DIR)'
@echo ''
@echo 'User settings'
@echo ' - The following setting are overridable on the command line, default values shown'
@echo ' - The following setting are overridable on the command line, default values shown:'
@echo ' - Show commands:'
@echo ' V=1'
@echo ' - List of include dirs:'
@echo ' INC_DIRS=$(INC_DIRS)'
@echo ' - List of systme include dirs:'
@echo ' INC_DIRS=$(SYSTEM_INC_DIRS)'
@echo ' - Location of source files:'
@echo ' SRC_DIR=$(SRC_DIR)'
@echo ' - Location to place output files:'
@ -88,7 +90,7 @@ $(OUT_DIR)/%.o: $(OUT_DIR)/%.bc
@echo "[llc] $@ ($<)"
$(_@)$(LLC) $(LLC_FLAGS) -o $@ $<
-include $(wildcard $(OUT_DIR)/*.d)
-include $(wildcard $(OUT_DIR)/%.d)
PROGRAM_NAMES := $(notdir $(basename $(wildcard src/*.c)))

View File

@ -99,8 +99,8 @@ typedef struct {
SolPubkey *key; /** Public Key of the account owner */
int64_t *tokens; /** Numer of tokens owned by this account */
uint64_t userdata_len; /** Length of userdata in bytes */
uint8_t *userdata; /** On-chain data owned by this account */
SolPubkey *program_id; /** Program that owns this account */
const uint8_t *userdata; /** On-chain data owned by this account */
const SolPubkey *program_id; /** Program that owns this account */
} SolKeyedAccounts;
/**
@ -154,7 +154,7 @@ SOL_FN_PREFIX bool sol_deserialize(
const uint8_t *input,
uint64_t num_ka,
SolKeyedAccounts *ka,
uint8_t **data,
const uint8_t **data,
uint64_t *data_len
) {
if (num_ka != *(uint64_t *)input) {

View File

@ -13,7 +13,7 @@
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccounts ka[NUM_KA];
uint8_t *data;
const uint8_t *data;
uint64_t data_len;
if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) {

View File

@ -13,7 +13,7 @@
extern bool entrypoint(const uint8_t *input) {
SolKeyedAccounts ka[NUM_KA];
uint8_t *data;
const uint8_t *data;
uint64_t data_len;
if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) {