Commit Graph

696 Commits

Author SHA1 Message Date
Bill Currie 7f69f593d3 configure.ac:
define default include and lib paths for qfcc
ruamoko:
	{cl_menu,game}/Makefile.am:
		conform to the new qfcc library linking rules
	lib/Makefile.am:
		install the libs to ${prefix}/lib/ruamoko
qfcc:
	linker.[ch]:
		support path searching for -llib and make linker_add_lib search for
		libfoo.a for -lfoo in the paths, or just a single dir search for the
		libname otherwise.
	options.c:
		support -L libpath and setup the default include and lib paths
		also change most strdup calls to save_string
	qfcc.c:
		check for foo.a as well as -lfoo when deciding whether the file is
		an object file or lib file.
2002-11-01 18:05:12 +00:00
Bill Currie 7af99f422f expr.c:
fix a braino that caused only sizeof expr to work
linker.c:
	print an error message if unable to open the lib
qc-parse.y:
	revamp expression parsing so casting is done via (type)expr rather than
	type(expr)
	make it so pointers to pointers don't need ()s
2002-10-31 22:58:59 +00:00
Bill Currie 9a1223cae2 need 14, not 4 for precache_sound 2002-10-30 05:06:03 +00:00
Bill Currie 912db0336e clean out the cmdlib crap from quakefs.c and nuke qfcc's last dependency
on cmdlib.h (and nuke qfcc's cmdlib.h itself:)
2002-10-30 02:31:29 +00:00
Bill Currie d2cedecfb0 make -t shortcut for --traditional work as pointed out by Dmitry Antipov
(dmitry.antipov@mail.ru)
2002-10-29 15:24:17 +00:00
Bill Currie 4ad8ed1fc2 *sigh* twice now forgot to remove that test code :P 2002-10-26 03:41:34 +00:00
Bill Currie 2679ade8cd forgot 0X0 was just as valid as 0x0 2002-10-26 03:41:10 +00:00
Bill Currie 99cdcc9bd7 support hex numbers 2002-10-26 03:23:19 +00:00
Bill Currie 567b905590 copyright block work 2002-10-22 14:53:18 +00:00
Bill Currie 4ee013c5ba don't seg on null strings 2002-10-20 03:43:14 +00:00
Bill Currie 9f8d7fbca7 re-write the hashing so pointers get merged only if they point to the same
def
2002-10-20 03:31:49 +00:00
Bill Currie 262baccd0e remove debug code :P 2002-10-20 03:31:08 +00:00
Bill Currie 7bb6dd7197 make chained structure assignments (mostly) work. found a bug in the
handling of pointer immediates which needs fixing before this will work in
general
2002-10-20 02:35:12 +00:00
Bill Currie 6ece3bc481 don't use move for non-structs. it wasn't an optimisation anyway. this
fixes the internal error when compiling the quake1 progs
2002-10-20 01:25:15 +00:00
Bill Currie 54564a4726 structure copies now seem to work 2002-10-16 17:07:01 +00:00
Bill Currie 0c0e4b23de d'oh, temps are never global 2002-10-16 06:39:49 +00:00
Bill Currie 5a182b7cd4 turns out that flags == 0 is quite valid (d'oh) 2002-10-16 06:33:14 +00:00
Bill Currie 5eeb8bbda2 bah, bison decided to re-arange my tokens! 2002-10-16 06:31:00 +00:00
Bill Currie 7542a2457f replace @argc and @argv with @args.count and @args.list. @args is of type
@va_list making it possible (though not yet: need to implement structure
copy) to pass ... params around.
2002-10-16 02:28:08 +00:00
Bill Currie 27effb5075 make struct_t and enum_t globally visible, re-do how enum info is stored
and make it possible to create a structure using a pre-existing type
2002-10-16 02:05:39 +00:00
Bill Currie 6af57049d5 make pointers work a bit better 2002-10-16 02:04:06 +00:00
Bill Currie 3b3b90ef4a fix for new bison 2002-10-16 01:53:56 +00:00
Bill Currie f95510bd46 make vector.x work for structure fields (which actually makes vectors more
useful in structures:)
2002-10-09 20:35:25 +00:00
Bill Currie 7e4e1a1f96 partial support for accessing vector components as .x .y and .z rather than
_x _y and _z
2002-10-09 19:30:43 +00:00
Bill Currie 22d3cf9664 rename the def_void and dev_function defs 2002-10-09 19:17:45 +00:00
Bill Currie 823822301f support emitting bind sub-expressions 2002-10-09 19:16:55 +00:00
Bill Currie a20bb946f6 type.[ch]:
provide a vector structure def so vector.[xyz] can be implemented
def.c:
	record the return address in get_temp to aid debugging
2002-10-08 22:35:37 +00:00
Bill Currie bca275944c record the type of the result of a bind expr 2002-10-08 18:20:09 +00:00
Bill Currie f992090b18 don't do extra manipulations for unnamed defs 2002-10-08 18:03:23 +00:00
Bill Currie 9d8d570269 using Qseek on a pak sub-file should work better. this should make oggs in
paks work.
2002-09-27 04:27:19 +00:00
Bill Currie d8a38ae648 don't fuss with function defs that aren't initialized 2002-09-19 06:01:06 +00:00
Bill Currie 317c02539b macro-ize --with-{clients,servers} and implement --with-tools using the new
macro
2002-09-17 22:19:14 +00:00
Bill Currie ece9660099 get @system working (Closes: #52). I'm not happy with the name of this
operator and I'm very open to suggestions, but it seems to work. What
@system does is to mark a def in such a way that the linker will allow it
to be redefined /once/ giving the programmer control over where and when
a def is defined, but initializing it elsewhere. This is most useful when
working with v6 progs and separate compliation as the `system' defs need to
be in a certain order in certain locations or the resuting progs.dat file
will be incompatable with non-qf 0.5 servers.
2002-09-17 18:42:35 +00:00
Bill Currie b94077200f make it so id can be assigned to any class or object pointer 2002-09-16 20:32:32 +00:00
Bill Currie 4a34960d95 a bit of code cleanup 2002-09-16 17:37:22 +00:00
Bill Currie 412db7e27d "for example" is more appropriate than "that is" 2002-09-16 15:42:11 +00:00
Bill Currie eb4aa7ccec produce better code for v6 % 2002-09-13 17:38:19 +00:00
Bill Currie 308ff7163f emit.c:
implement % for v6 code. hacky, but it works :) (Closes: #29)
expr.c:
	emit the body of a block expresion before emitting its result (needed
	for v6 %)
2002-09-13 17:12:26 +00:00
Bill Currie 1e5402a30a Closes: #50
idstuff.c:
	don't write the defs at offset 0 to progdefs.h
qfcc.c:
	generate progdefs.h and the crc for v6 code when linking object files
	to the progs.dat
2002-09-13 15:42:07 +00:00
Bill Currie 090e65bc09 mark allocated fields constant 2002-09-12 18:34:17 +00:00
Bill Currie d7eea11c91 static defs are initialized too 2002-09-12 18:30:24 +00:00
Bill Currie 842a9d2eb0 linker.c:
don't seg on uninitialized fields
qc-parse.y:
	support @extern and @static blocks (eg, @extern { ... };)
2002-09-12 17:13:19 +00:00
Bill Currie aae378c0a2 delete temporary .qfo files for (eg) qfcc -o test.dat test.qc 2002-09-11 18:17:45 +00:00
Bill Currie 324b89696a create new_*_expr functions for all basic expression types except ex_poitner
and use them instead of new_expr and setting the fields each time. Serious
code cleanup :)
2002-09-11 16:21:26 +00:00
Bill Currie e5227076e0 put in some error checking on the Qopen calls 2002-09-10 15:46:50 +00:00
Bill Currie 867f964740 * taniwha salutes while taps is played 2002-09-10 15:36:32 +00:00
Bill Currie 05d437a3c1 make @extern and @static available to v6 progs 2002-09-10 04:07:34 +00:00
Bill Currie f6cdbdf63c make sure an initialized def has the correct source file and line info 2002-09-07 06:45:51 +00:00
Bill Currie 2ba3585d06 fix a braino with ~float const 2002-09-05 17:40:14 +00:00
Bill Currie 27b0314e2e don't do the ObjQC types if --traditional is used 2002-09-04 21:47:27 +00:00
Bill Currie 1d35f4dd9e make ~ work for v6 progs by implementing ~x as -1 - x (will give bogus
results if x has fractional bits, but it's better than it was:)
2002-09-04 16:18:52 +00:00
Bill Currie 882d0f25ce the code memory block can move around so take the address of a statement
after statments have been emitted, not before.
2002-08-30 05:33:34 +00:00
Bill Currie 5da6fbe59c check for uninitialized variables used in function args 2002-08-29 03:06:00 +00:00
Bill Currie ec47e08e1c go back to using QFile, quakeio.h and quakefs.h 2002-08-27 07:16:28 +00:00
Bill Currie 2658c3098f use the LoadFile in libQFutil 2002-08-26 00:31:07 +00:00
Bill Currie aaab480676 fix a bunch of potential malloc (0) calls 2002-08-25 23:16:07 +00:00
Bill Currie 3e87e3ecdf allow ';' after @class ... 2002-08-20 21:13:18 +00:00
Bill Currie 371e92c448 finally fix chained function calls /properly/. need to make sure /all/ args
get their user count incremented, not just the head of the chain
2002-08-20 17:21:32 +00:00
Bill Currie c927b2e834 quakefs.c:
allow . and .. in a path so long as the result doesn't escape from the
	game directory
cl_menu/Makefile.am:
	don't strip source paths
optoins.qc:
	use InputLine object
def.c:
	use notice to show stray temps
emit.c:
	make sure expression args get emitted for function calls
expr.c:
	'C' is a cast
	rewrite cast_expr to handle casted pointere derefs
2002-08-20 06:11:10 +00:00
Bill Currie 5d7135600e gah, that /did/ work, dunno what happend. must have done a tweak before
committing again :/ This currently produces some pseudo warnings about
dangling temps, but that's better than producing broken code
2002-08-20 02:52:04 +00:00
Bill Currie b99a72e876 pr_obj.c:
call obj_find_message with super instead of class when doing a super
	lookup
client_menu.[ch]:
	use the InputLine object instead of directly using the api
InputLine.r:
	builint functions are = #0, not = 0 :P
function.[ch]:
	provide copy_params
method.[ch]
	provide copy_keywordargs
expr.c:
	call inc_users for the parm temp if it's a bind expression
	revers a copy of the selector when building the selector name so the
	selector doesn't get mangled
qc-parse.y:
	catch erronous func = const inintializers (should be func = #const)
2002-08-20 02:09:34 +00:00
Bill Currie a94bdb199f @sizeof (foo) should work now 2002-08-18 04:08:02 +00:00
Bill Currie c1c6c05cf5 pr_obj.c:
delay class fixups so order doesn't matter
class.c:
	write out the class and category diffs properly
2002-08-16 22:53:37 +00:00
Bill Currie 932ac624bd more error checking fixes 2002-08-16 20:49:32 +00:00
Bill Currie 8a431570b8 generate the selector name in the correct order for selector expressions 2002-08-16 19:50:16 +00:00
Bill Currie cab813c559 check the scope when checking for duplicate vector sub-defs 2002-08-16 16:51:00 +00:00
Bill Currie 45a1ef2140 allow assignment of any pointer type to void pointers 2002-08-15 20:13:18 +00:00
Bill Currie 36ca7b55bd fix several problems caused by insufficient error checking and some double
Qclose calls
2002-08-15 18:53:03 +00:00
Bill Currie 09ce2b0662 make sure a class' super class gets referenced when the class is implemented
to ensure the super class' object file gets linked in when it's in a library
2002-08-14 03:55:23 +00:00
Bill Currie fabaf84745 fix a missing reloc ref for .this 2002-08-14 03:44:41 +00:00
Bill Currie 53b257c918 preprocessising fixes, including detecting when to stop at the preprocessing
stage.
2002-08-13 22:02:07 +00:00
Bill Currie 8474f145d1 remove debug print 2002-08-13 21:54:10 +00:00
Bill Currie 0840678465 handle extern -> defined transition properly for vectors 2002-08-13 21:19:30 +00:00
Bill Currie 2f4094344b don't change the hidden parm type for protocol methods until they're used in a class 2002-08-13 21:18:17 +00:00
Bill Currie fa6f3cb09d loop over the method list correctly 2002-08-13 21:17:20 +00:00
Bill Currie 3971786ee1 clean up a follow on error for calling an undefined function 2002-08-13 21:16:42 +00:00
Bill Currie cd6f82c2c9 fix Class mangling when compiling multipe source files to objects 2002-08-13 17:03:26 +00:00
Bill Currie a431a2783c byteswap the reloc def field too (fixes the qfcc seg on big-endian systems) 2002-08-09 04:06:50 +00:00
Bill Currie ff8ea15c09 solaris compile fixes 2002-08-09 04:06:17 +00:00
Bill Currie 8de4d28238 print cpp invocation for win32 too 2002-08-02 19:09:02 +00:00
Brian Koropoff 439f9838d3 Whoops, missed some stuff that needed to be in idparse.h 2002-07-31 22:13:15 +00:00
Bill Currie 7c26fa28dc another cmdlib function dies 2002-07-31 16:42:21 +00:00
Bill Currie 5f65a53e81 fix a bug with obj_msgSend and obj_msgSend_super when more than one file is
compiled
2002-07-23 18:51:47 +00:00
Bill Currie 1e49f0d0c3 fix a segfault (what was I thinking when I wrote that line?) 2002-07-23 05:44:45 +00:00
Bill Currie c2a7564d55 implement -l, but -L isn't supported yet and the full lib name must be given 2002-07-21 07:12:17 +00:00
Bill Currie f1423cb0b3 print the cpp command line if verbosity is high enough 2002-07-20 05:20:40 +00:00
Ragnvald Maartmann-Moe IV e6ea44a9ad ? tools/qfcc/source/qfodump
Not anymore.
2002-07-19 14:13:37 +00:00
Bill Currie 60520e7981 allow things like pointer == pointer for different pointer types that are in
the same heirarchy
2002-07-18 05:16:12 +00:00
Bill Currie 95bbb6803d be a little clearer about cpp errors 2002-07-17 19:56:30 +00:00
Bill Currie fb4ef47af6 make the filename output high verbosity 2002-07-17 19:00:16 +00:00
Bill Currie e72b25144e relocate the strings in an initialized array/struct 2002-07-17 18:49:58 +00:00
Bill Currie 8d6c491390 fix branches (been broken for a while :/) 2002-07-17 18:45:17 +00:00
Bill Currie 90fa657a5f fix array type string parsing 2002-07-17 17:59:42 +00:00
Bill Currie 2c94688e87 default options.outputfile to "progs.dat" if not specified when linking 2002-07-17 17:49:17 +00:00
Bill Currie 5ea3042eec fix -c -o ... 2002-07-17 17:43:51 +00:00
Bill Currie 7fcdef1943 make sure current_type is set properly for struct fields 2002-07-17 17:17:05 +00:00
Bill Currie b0d568d85f local defs for debug info now work 2002-07-17 15:40:08 +00:00
Bill Currie 17cd41883e get the source line for the function from a more reliable location 2002-07-17 14:39:54 +00:00
Bill Currie 980be66c0e bah, missed this file 2002-07-17 14:21:52 +00:00
Bill Currie 34da93f251 get line numbers working on link and fix a bug in the creation of aux
functions
2002-07-17 14:19:30 +00:00
Bill Currie 8a96b5bbbc oops, forgot to remove the debug print :) 2002-07-16 22:00:55 +00:00
Bill Currie 678a45cfe2 entity fields seem to work. I guess this means separate compilation is now
useful :)
2002-07-16 21:59:47 +00:00
Bill Currie c36b7e36d2 fix external vectors and only complain about undefined externals that are
actually used
2002-07-16 20:09:14 +00:00
Bill Currie ac1392eb74 object.r:
define __obj_exec_class, obj_msgSend and obj_msgSend_super for the way
	qfcc now handles these defs
pr_edict.c:
	PR_ValueString now checks that the function is valid before trying to
	print its name.
class.c:
	__obj_exec_class is now extern
linker.c:
	fix more mangled relocs
method.c:
	obj_msgSend and obj_msgSend_super are now extern
qfcc.c:
	fixes so obj_module_t doesn't get zapped
type.c:
	fixes so obj_module_t doesn't get zapped
2002-07-16 19:03:56 +00:00
Bill Currie 3b1825b692 fix the mangled relocs. oo hello world works again 2002-07-16 17:35:40 +00:00
Bill Currie 17c2def821 def merging seems to mostly work (have some problems with method lists) 2002-07-16 06:40:34 +00:00
Bill Currie 4d214bfea1 more hacks 2002-07-16 04:38:17 +00:00
Bill Currie 4d69deb205 class.c:
use the correct type when creating the class def
struct.c:
	save the name
2002-07-16 04:37:51 +00:00
Bill Currie bf858856b8 fix a /really/ silly error that broke def relocations 2002-07-15 22:10:03 +00:00
Bill Currie a4ad662b63 make a little more robust 2002-07-15 21:58:39 +00:00
Bill Currie 295a9c1115 move external defs from the external table to the global table when they
get defined
2002-07-15 21:49:46 +00:00
Bill Currie 463c5724db clean up some duplicated code by using some template macros 2002-07-15 21:45:32 +00:00
Bill Currie b9a237b13d rename qfo_function_t to qfo_func_t and similar for other qfo *function* in
obj_file.[ch]
2002-07-15 21:37:52 +00:00
Bill Currie 8539d7987f make @self and @this work for separate compilation 2002-07-14 05:40:38 +00:00
Bill Currie 06390e10e6 more relocs fixups. my little OO hello world progs works now :) 2002-07-14 03:41:13 +00:00
Bill Currie e550ad670a more linking fixes, including seting up relocations. not quite working yet 2002-07-13 06:09:03 +00:00
Bill Currie 9b6980ac7b fix an off by one error that was mangling functions 2002-07-13 03:21:27 +00:00
Bill Currie 58ecbd1171 new_struct doesn't like "" names 2002-07-13 03:20:45 +00:00
Bill Currie c0880a94a9 print the name of the duplicate struct 2002-07-13 03:20:17 +00:00
Bill Currie c6ad0ff819 fixup_relocs doesn't need qfo any more 2002-07-13 02:24:06 +00:00
Bill Currie b48d71fdcc make qfo functions 0 based. now having weird def problems :/ 2002-07-12 22:27:40 +00:00
Bill Currie e6fc66aaa9 grr, and another one :P 2002-07-12 21:44:04 +00:00
Bill Currie b1b3c148e7 fix a bug in the parsing of structures 2002-07-12 21:43:27 +00:00
Bill Currie d80b448281 select the correct function when fixing its def 2002-07-12 21:14:46 +00:00
Bill Currie 2a121d000f fix a couple of dumb bugs and update the function number calculation 2002-07-12 20:43:11 +00:00
Bill Currie 06c03dd074 make local defs always come after global defs in linked qfo files and make
function relocations work better
2002-07-12 20:26:51 +00:00
Bill Currie 5a6907d969 some minor improvements 2002-07-12 20:22:06 +00:00
Bill Currie b9b9f03e82 keep short defs out too 2002-07-12 16:01:40 +00:00
Bill Currie 3cf754db30 keep the return def out of .qfo files (for now, anyway) 2002-07-12 15:54:46 +00:00
Bill Currie ddd7d82bcf quick and dirty util to dump the defs in a .qfo file 2002-07-12 06:19:02 +00:00
Bill Currie 24d473c386 more linking fixes 2002-07-12 06:17:24 +00:00
Bill Currie ce8f071b7c implement partial linking (doesn't work any better than full, though :P) 2002-07-12 04:50:31 +00:00
Bill Currie 33b3fd1887 fix some misc linking bugs 2002-07-12 03:26:47 +00:00
Bill Currie 0f5f68623f it's as broken as all-get-out, but object files can now be linked 2002-07-11 22:38:23 +00:00
Bill Currie a9899087d3 fix a bunch of silly bugs and get the linked output written (hangs, though) 2002-07-11 21:04:09 +00:00
Bill Currie 4d1dbc8cc1 re-write qfo writing from progs, make qfo creation easier, (mostly) finish
the linker. now for testing :)
2002-07-11 20:17:26 +00:00
Bill Currie de89733c5b fix a missing & that was causing problems with writing function refs 2002-07-11 20:14:45 +00:00
Bill Currie bc5beea311 getting closer to being able to link 2002-07-11 17:06:15 +00:00
Bill Currie 2df43ef941 make data handling a little easier 2002-07-11 15:42:20 +00:00
Bill Currie 1db26eea86 can't call pointer_type untill after the types are chained 2002-07-09 19:00:52 +00:00
Bill Currie 2cb6138f2b fix a silly segfault and make statement allocation saner 2002-07-08 20:31:59 +00:00
Bill Currie c1894db59f split the emit stuf out of expr.h into emit.h 2002-07-08 18:53:07 +00:00
Bill Currie e815669b7a finish (for now:/) qfo_to_progs 2002-07-08 16:13:06 +00:00
Bill Currie 24e242ed35 move the type strings into their own string pool so the progs strings don't
get cluttered
2002-07-08 05:26:50 +00:00
Bill Currie 598edb26fd parse a type back from its encoding (some info will be lost) 2002-07-08 05:10:05 +00:00
Bill Currie 4c8e157db2 nuke pr.statement_linenums as it was redundant and the info never used anyway 2002-07-08 03:05:44 +00:00
Bill Currie 5b98893003 bah, getting my "last changes vs last compile" backwards again :/ 2002-07-05 20:19:13 +00:00
Bill Currie 8a402381e6 redo how progs strings are stored so multiple pools can exist 2002-07-05 20:02:10 +00:00
Bill Currie 7132e67f60 type encoding improvements 2002-07-05 16:59:25 +00:00
Bill Currie 0ef4a7513d d'oh, I thought I tested with those lines in :/ 2002-07-03 21:38:14 +00:00