X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=gmqcc.h;h=7da3d649ba5a0fbf75c8b106f4c86f53944a5644;hp=835931df990a5431399f463728053f652321ce72;hb=d8c09c200a681ae12d078559dac526aa2c8cc951;hpb=15d1277158f9e4e235129fedcf2b8b79c4b833b9 diff --git a/gmqcc.h b/gmqcc.h index 835931d..7da3d64 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013, 2014 + * Copyright (C) 2012, 2013, 2014, 2015 * Dale Weiler * Wolfgang Bumiller * @@ -359,27 +359,6 @@ fs_dir_t *fs_dir_open (const char *); int fs_dir_close (fs_dir_t *); fs_dirent_t *fs_dir_read (fs_dir_t *); - -/* correct.c */ -typedef struct correct_trie_s { - void *value; - struct correct_trie_s *entries; -} correct_trie_t; - -correct_trie_t* correct_trie_new(void); - -typedef struct { - char ***edits; - size_t **lens; -} correction_t; - -void correct_del (correct_trie_t*, size_t **); -void correct_add (correct_trie_t*, size_t ***, const char *); -char *correct_str (correction_t *, correct_trie_t*, const char *); -void correct_init(correction_t *); -void correct_free(correction_t *); - - /* code.c */ /* Note: if you change the order, fix type_sizeof in ir.c */ @@ -789,17 +768,17 @@ typedef struct { } qc_exec_stack_t; typedef struct qc_program_s { - char *filename; + char *filename; prog_section_statement_t *code; prog_section_def_t *defs; prog_section_def_t *fields; prog_section_function_t *functions; - char *strings; - qcint_t *globals; - qcint_t *entitydata; - bool *entitypool; + char *strings; + qcint_t *globals; + qcint_t *entitydata; + bool *entitypool; - const char* *function_stack; + const char* *function_stack; uint16_t crc16; @@ -825,6 +804,20 @@ typedef struct qc_program_s { size_t xflags; int argc; /* current arg count for debugging */ + + /* cached fields */ + struct { + qcint_t frame; + qcint_t nextthink; + qcint_t think; + } cached_fields; + + struct { + qcint_t self; + qcint_t time; + } cached_globals; + + bool supports_state; /* is INSTR_STATE supported? */ } qc_program_t; qc_program_t* prog_load (const char *filename, bool ignoreversion); @@ -973,7 +966,7 @@ typedef struct { extern opts_cmd_t opts; -#define OPTS_GENERIC(f,i) (!! (((f)[(i)/32]) & (1<< (unsigned)((i)%32)))) +#define OPTS_GENERIC(f,i) (!! (((f)[(i)/32]) & (1U << (unsigned)((i)%32)))) #define OPTS_FLAG(i) OPTS_GENERIC(opts.flags, (i)) #define OPTS_WARN(i) OPTS_GENERIC(opts.warn, (i))