From 9a1ec9aaa3ba0dd680ce26d17ed02ff793212605 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Tue, 2 Oct 2012 16:01:35 +0200 Subject: [PATCH] code_crc added, initializing to 0 --- code.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)) { -- 2.39.2