From: Wolfgang (Blub) Bumiller Date: Tue, 2 Oct 2012 14:01:35 +0000 (+0200) Subject: code_crc added, initializing to 0 X-Git-Tag: 0.1-rc1~29 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9a1ec9aaa3ba0dd680ce26d17ed02ff793212605;p=xonotic%2Fgmqcc.git code_crc added, initializing to 0 --- diff --git a/code.c b/code.c index c2a670f..bf46cc0 100644 --- a/code.c +++ b/code.c @@ -63,6 +63,7 @@ VECTOR_MAKE(prog_section_function, code_functions ); VECTOR_MAKE(int, code_globals ); VECTOR_MAKE(char, code_chars ); +uint16_t code_crc; uint32_t code_entfields; void code_init() { @@ -71,6 +72,9 @@ void code_init() { prog_section_def empty_def = {0, 0, 0}; int i = 0; + code_crc = 0; + code_entfields = 0; + /* omit creation of null code */ if (OPTS_FLAG(OMIT_NULL_BYTES)) return; @@ -87,8 +91,6 @@ void code_init() { code_statements_add(empty_statement); code_defs_add (empty_def); code_fields_add (empty_def); - - code_entfields = 0; } uint32_t code_genstring(const char *str) @@ -189,7 +191,7 @@ bool code_write(const char *filename) { if (opts_forcecrc) code_header.crc16 = opts_forced_crc; else - code_header.crc16 = 0; /* TODO: */ + code_header.crc16 = code_crc; code_header.entfield = code_entfields; if (OPTS_FLAG(DARKPLACES_STRING_TABLE_BUG)) {