Commit Graph

9924 Commits

Author SHA1 Message Date
Bill Currie 302934a1e4 Remove some dead code. 2018-10-15 20:52:46 +09:00
Bill Currie 2a2754e581 More ways to break qfcc :/ 2018-10-15 19:48:19 +09:00
Bill Currie 6c53be928b Support returning vector expressions.
Currently fails due to a scheduling problem when the vector expression
contains functions.
2018-10-13 23:32:53 +09:00
Bill Currie 0f5f2a125a Use a reliable reference for calculating progs offsets.
Now that pr->zone can be null, it cannot be used as a reference. Fixes
random crashes when using qfprogs (random due to heap randomization).
2018-10-13 23:23:45 +09:00
Bill Currie aaab18c9a7 Nuke a dead field.
It looks like ex_temp_t.expr was never really used, and I have no idea
what I had intended (not surprising after ~17 years).
2018-10-13 12:07:50 +09:00
Bill Currie 2f2edae43b Make error, warning and notice give compiler file/line too.
But only when verbosity > 1 (-vv).
2018-10-13 09:31:00 +09:00
Bill Currie 4828934e50 Fix a equality check typo.
Fixes bad code generation when assigning to vector.x in a function with no
parameters and the vector is the first local var.
2018-10-12 23:39:05 +09:00
Bill Currie 78e0a8dc52 Support assigning non-constant vector expressions. 2018-10-12 22:05:17 +09:00
Bill Currie e03dfa29b4 Clean up the module .ctor construction a little. 2018-10-12 21:09:36 +09:00
Bill Currie f56d25cda6 Don't double print messages. 2018-10-12 20:46:45 +09:00
Bill Currie 668896aa82 More diagnostic improvements. 2018-10-12 16:01:11 +09:00
Bill Currie 71b3d30aa1 Make the ice a little more informative. 2018-10-12 14:51:39 +09:00
Bill Currie f58c2fef5a Switch QF's quaterions from wxyz to xyzw.
After messing with SIMD stuff for a little, I think I now understand why
the industry went with xyzw instead of the mathematical wxyz. Anyway, this
will make for less pain in the future (assuming I got everything).
2018-10-12 14:33:55 +09:00
Bill Currie b7aa5bb8fe Fix an oops messing up edict size. 2018-10-12 14:33:26 +09:00
Bill Currie f8606ebab8 Fix a object file segfault when spaces have no data.
ie, don't attempt to copy memory from a null pointer (just copy the null
pointer).
2018-10-12 14:00:34 +09:00
Bill Currie 3bd9f96b07 Make internal error messages a little more helpful.
They now include the file and line of the compiler as well.
2018-10-12 13:57:59 +09:00
Bill Currie 3656cb966c Fix some bison deprecation warnings. 2018-10-12 09:32:49 +09:00
Bill Currie 3bc664811e Fix lost error count tracking. 2018-10-11 22:03:14 +09:00
Bill Currie a096babb1f Duplicate memory when creating a qfo from progs.
Fixes some double-free bugs when linking after compiling.
2018-10-11 21:37:01 +09:00
Bill Currie f673ab9c3d Fix misreporting of failed progs load. 2018-10-11 13:39:48 +09:00
Bill Currie 33cbc500e8 Fix a segfault when setting up the stack.
Yup, putting {}s around even single statements under flow control (if, etc)
is a good idea. Wonder if there's a gcc warning for that...
2018-10-11 13:34:08 +09:00
Bill Currie 6252faa069 Fix a size error in OP_LOAD_Q.
C&P from OP_LOAD_V :/
2018-10-11 13:25:32 +09:00
Bill Currie 364c2d2c2b Add a stack and push and pop instructions.
The stack is for data, not return addresses.
2018-10-11 13:24:03 +09:00
Bill Currie 9501d30a8f Fix up a missing const attribute.
The problem with having such a complex build system :P
2018-10-11 11:29:12 +09:00
Bill Currie 61185813fa Cleaner handling of zone_size/zone. 2018-10-11 10:22:10 +09:00
Bill Currie 82809eb856 Simplify the call to PR_LoadProgsFile.
I've decided that setting pr.max_edicts and pr.zone_size as part of the
local progs initialization rather than in PR_LoadProgsFile makes more
sense. For one, it is unlikely for the limits to change every time progs is
reloaded. Also, they seem to be a property of the VM rather than the progs.
However, there is nothing stopping the caller from updating max_edicts and
zone_size every call.
2018-10-11 10:06:48 +09:00
Bill Currie 4872c56e2d Mark the end of the v6 opcodes. 2018-10-11 10:05:36 +09:00
Bill Currie 673b45be05 Add diagnostic hooks. 2018-10-09 12:46:13 +09:00
Bill Currie d95c01be1a More defspace tests. 2018-10-09 12:45:26 +09:00
Bill Currie 6f28ab2a68 Add basic quaternion multiplication tests. 2018-10-09 12:44:46 +09:00
Bill Currie ba3220e4d1 Fix a format oops.
I had never noticed the error...
2018-10-09 12:42:21 +09:00
Bill Currie 34bcf7faab Do a pure/const/noreturn/format attribute pass.
I always wanted these, but as gcc now provides warnings for functions that
could do with such attributes, finding all the functions is much easier.
2018-10-09 12:42:21 +09:00
Bill Currie 05fd2d8cdd Start work on a unit test for defspace. 2018-09-09 22:37:09 +09:00
Bill Currie 3a4667318c Fix the qfcc test autodependencies. 2018-09-09 22:36:20 +09:00
Bill Currie d1cb15664f Fix some spelling issues in a comment. 2018-09-09 22:34:24 +09:00
Bill Currie 71569b45c9 Pre-format diagnostic messages.
This will make it easier to hook diagnostics enabling unit tests.
2018-09-09 18:09:32 +09:00
Bill Currie 113e0d82ba Fix a signed comparison error.
Not sure how this fix got lost.
2018-09-09 16:48:19 +09:00
Bill Currie aebd9288cd Force thread count to 1 when pthreads is unavailable.
Don't want the thread count being misreported.
2018-09-09 13:41:22 +09:00
Bill Currie fa1514798b Print the number of threads used by qfvis. 2018-09-09 13:41:00 +09:00
Bill Currie 06ab36de3d Slight cleanup of winding allocation.
It seems gcc doesn't care if the & is present when calculating field
offsets, but it not being there bothered me very much and might as well use
our "standard" macro anyway.
2018-09-09 13:38:32 +09:00
Bill Currie db3df6f8a7 Fix a bunch of dead increments. 2018-09-09 11:12:04 +09:00
Bill Currie 3f638d95ba Remove a possibly spurious break.
I'm not certain despair actually meant for the break to be there. It
certainly would have sped up the game a bit but at the expense of proper
blood trails in the software renderers.
2018-09-09 10:54:38 +09:00
Bill Currie 62793b2dc2 Fix some potentially garbage assignments.
These are the ones where I could easily make scan-build happy. They do seem
to be potential holes where invalid data in one place could result in use
of uninitialized values.
2018-09-09 09:54:16 +09:00
Bill Currie 59e85b7d5e Fix a pile of dead assignments.
Some were actual bugs!
2018-09-08 22:23:57 +09:00
Bill Currie 59b04dbcca Make many qfo int fields unsigned.
I don't remember why I thought signed was a good idea, but unsigned does
make more sense for most fields.
2018-09-08 19:45:19 +09:00
Bill Currie f75ff2d269 Fix some null argument issues. 2018-09-07 22:30:44 +09:00
Bill Currie 1eb1622420 Fix some strncat issues. 2018-09-07 21:27:34 +09:00
Bill Currie 8f028b8a0d Fix some double frees. 2018-09-07 20:03:19 +09:00
Bill Currie 8fd5be0ee0 Fix a pile of sizeof goofs.
While scan-build wasn't what I was looking for, it has proven useful
anyway: many of the sizeof errors were just noise, but a few were actual
bugs (allocating too much or too little memory).
2018-09-07 20:00:57 +09:00
Bill Currie 575a67b2a1 mat4 test case fixes.
The tests cases themselves were buggy.
2018-08-26 15:06:08 +09:00