use reference counting for temp defs and call PR_FreeTempDefs at the end
of emit_sub_expr as well as emit_expr.
fix a (relatively harmless) bug in type processesing of foo.bar =
another builtin by name, and returns it.
Soon I'll change all our new builtins to by allocated dynamically, as
well as changing the number checkfunction uses, and happily break
everything that uses them :D
integer constants and float function args/return values.
pr_comp.h:
o add the integer opcodes to pr_opcode_e
pr_edict.c:
o add "quaternion" and "integer" to type_name[]
o support quatnernion and integers types when printing values
o support the integer opcodes when bounds checking
pr_exec.c
o enable the integer opcodes
pr_opcode:
o add the integer opcodes to the opcode table
o logical operators all result in an integer rather than a value
expr.h:
o rename int_val to integer_val
qfcc.h:
o kill another magic number
expr.c:
o move the opcode to string conversion out of type_mismatch and into
get_op_string
o rename int_val to integer_val
o general integer type support.
o generate an internal comipiler error for null opcodes rather than
segging.
pr_imm.c:
o rename int_val to integer_val
o support integer constants, converting to float when needed.
pr_lex.c:
o magic number death and support quaternions and integers in type_size[]
qc-lex.l
o rename int_val to integer_val
o support quaternion and integer type keywords
qc-parse.y:
o rename int_val to integer_val
o use binary_expr instead of new_binary_expr for local initialized
variables
builtins.c:
o rename int_val to integer_val
o fix most (all?) of the INT related FIXMEs
defs.qc:
o use integer instead of float where it makes sense
main.c:
o read_result is now integer rather than float
main.qc:
o float -> integer where appropriate
o new test for int const to float arg
rearrange def_t a little and add def_next (leaving next free for other
uses)
pr_def.c:
use def_next instead of next to link /all/ of the named defs
qfcc.c:
ditto
define PROG_ID_VERSION as 6 and redefine PROG_VERSION as 0x00fff001
(0.fff.001) for the new qc features.
pr_edict.c:
support version 6 and version 0.fff.001 progs
qfcc.h:
add version field to options_t
add min_version field to opcode_t
pr_opcode.c:
set the minumum version of each opcode (gee, that table is getting ugly)
filter out opcodes with too high a min_version when initializing the opcode
hash tables.
qfcc.c:
update help output.
accept --id to limit code generation to id compatable (ver 6) progs.
default progs generation to 0.fff.001
Detect assignments to initialized globals and give an error, unless the --cow
(copy on write) option is given, and then allocate a new global for the var,
clear its initialized flag.
Relocate all globals.
termporary variables sit in one pool of memory (at the end of the globals)
thus drasticly reducing globals requirements. This works because the whole
lot is declared to be in the function's local variable space which is copied
to the locals stack in the progs engine.
to get the opcode from the table record rather than the location within the
table (ewww). gives a nice speed boost /and/ makes the opcode table easier to
maintain.
add OP_ADD_S. WARNING!!! this /will/ move.
progs.h:
add prototype for PR_PrintStatement
pr_edict.c:
add OP_ADD_S support in the progs checker
pr_exec.c:
implement OP_ADD_S
tools/qfcc/include/.gitignore:
add config.h.in
qfcc.h:
nuke PR_NameImmediate and change PR_ParseImmediate's prototype (see
pr_imm.c)
pr_comp.c:
add ADD_S, adjust for PR_ParseImmediate's prototype, make
PR_ParseExpression work with non-sequential opcodes (slow, will work on
that next). Fix up initialised global parsing.
pr_imm.c:
nuke PR_NameImmediate. didn't work well and wasn't such a good idea anyway.
PR_ParseImmediate now accepts a def_t * arg. if null, will allocate a
new global def, otherwise it will initialize the def passed in.
qwaq/main.c:
sports some debugging code (dumps info about the progs it's running)
qwaq/main.qc:
better ADD_S testing
WARNING: this fixes a scope bug in qcc and thus you WILL get different (but
now correct) code for the following:
float foo;
void () bar =
{
local float foo;
foo = 0;
}
ie, the local foo will, as is correct, now be a separate var to the global
foo.
remove includes of qdefs.h and compat.h
pr_comp.h:
merge pr_comp.h from quake and qfcc, removing the copy in qfcc
cmdlib.[ch]:
nuke the endian code.
qendian.c:
initialise the LittleLong etc pointers at compile time rather than run
time
com.c (both nq and qw):
nuke the LittleLong etc init code
everything else:
fix up after the qtypes.h cleanup