if (strchr(name, ',')) {
prog_section_function function;
prog_section_def def;
-
+
char *find = strchr(name, ',') + 1;
/* skip whitespace */
prog_section_function empty_function = {0,0,0,0,0,0,0,{0}};
prog_section_statement empty_statement = {0,{0},{0},{0}};
int i = 0;
-
+
/* omit creation of null code */
if (opts_omit_nullcode)
return;
prog_section_statement s1 = { INSTR_STORE_F, {30}, {OFS_PARM0}, {0}};
prog_section_statement s2 = { INSTR_CALL1, {29}, {0}, {0}};
prog_section_statement s3 = { INSTR_RETURN, {0}, {0}, {0}};
-
+
code_chars_put("m_init", 0x6);
code_chars_put("print", 0x5);
code_chars_put("hello world\n", 0xC);
void code_write() {
prog_header code_header = {0};
prog_section statements;
- prog_section defs;
- prog_section fields;
- prog_section functions;
- prog_section globals;
+ prog_section defs;
+ prog_section fields;
+ prog_section functions;
+ prog_section globals;
prog_section strings;
FILE *fp = NULL;
size_t it = 1;
{
ir_value *out = NULL;
ir_instr *in = NULL;
-
+
int ot = TYPE_VOID;
switch (opcode) {
case INSTR_ADD_F:
*/
lex_file *lex_include(lex_file *lex, const char *file) {
lex_file *set = NULL;
-
+
util_strrq(file);
if (strncmp(lex->name, file, strlen(lex->name)) == 0) {
error(lex, ERROR_LEX, "Source file cannot include itself\n");
" %s -a<file> -i<file> -oprog.dat -- assemble together(allowed multiple -i<file>)\n"
" example:\n"
" %s -cfoo.qc -ibar.qc -oqc.dat -afoo.qs -ibar.qs -oqs.dat\n", app, app, app, app, app);
-
+
printf(" additional flags:\n"
" -debug -- turns on compiler debug messages\n"
" -memchk -- turns on compiler memory leak check\n"
" -help -- prints this help/usage text\n"
" -std -- select the QuakeC compile type (types below):\n");
-
+
printf(" -std=qcc -- original QuakeC\n"
" -std=ftqecc -- fteqcc QuakeC\n"
" -std=qccx -- qccx QuakeC\n"
" -std=gmqcc -- this compiler QuakeC (default selection)\n");
-
+
printf(" codegen flags:\n"
" -fdarkplaces-string-table-bug -- patches the string table to work with bugged versions of darkplaces\n"
" -fomit-nullcode -- omits the generation of null code (will break everywhere see propsal.txt)\n");
util_meminfo();
return 0;
-
+
clean_params_usage:
for (itr = 0; itr < items_elements; itr++)
mem_d(items_data[itr].name);
/* add the compile-time constant */
{
constant c;
-
+
c.name = util_strdup(name),
c.type = TYPE_VECTOR,
c.value[0] = compile_calc_x;
if (!ptrn) return;
data = (void*)((uintptr_t)ptrn-sizeof(struct memblock_t));
info = (struct memblock_t*)data;
-
+
util_debug("MEM", "released: % 8u (bytes) address 0x%08X @ %s:%u\n", info->byte, data, file, line);
mem_db += info->byte;
mem_dt++;