]> git.rm.cloudns.org Git - xonotic/gmqcc.git/log
xonotic/gmqcc.git
12 years ago-Wlocal-shadows - note that -std=gmqcc is very different from the rest
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 19:54:19 +0000 (21:54 +0200)]
-Wlocal-shadows - note that -std=gmqcc is very different from the rest

12 years agosplitting parser_find_local up into find_local and find_param - find_local also takes...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 19:42:52 +0000 (21:42 +0200)]
splitting parser_find_local up into find_local and find_param - find_local also takes a bool-ptr to tell the caller if it was a local or a global

12 years agoquotes around the variable name in some messages
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 19:35:47 +0000 (21:35 +0200)]
quotes around the variable name in some messages

12 years agoremove trailing \n from 2 error messages
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 19:32:29 +0000 (21:32 +0200)]
remove trailing \n from 2 error messages

12 years agoset olddecl so we don't access a NULL value when a variable already exists
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 19:31:53 +0000 (21:31 +0200)]
set olddecl so we don't access a NULL value when a variable already exists

12 years agooops - parsewarning returns true on -Werror, so we gotta invert here
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 19:07:23 +0000 (21:07 +0200)]
oops - parsewarning returns true on -Werror, so we gotta invert here

12 years ago-Wtoo-few-parameters on by deafult - for -std=gmqcc it's always an error
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 19:04:16 +0000 (21:04 +0200)]
-Wtoo-few-parameters on by deafult - for -std=gmqcc it's always an error

12 years agoast_type_adopt - ast_entfield now adopts the full type of the field
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 18:30:24 +0000 (20:30 +0200)]
ast_type_adopt - ast_entfield now adopts the full type of the field

12 years ago-Wmissing-return-values, off by default, ignored with -std=gmqcc because in that...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 18:19:43 +0000 (20:19 +0200)]
-Wmissing-return-values, off by default, ignored with -std=gmqcc because in that standard it'll error

12 years agodata/vars.qc - when declaring a function, and it had a prototype - use the new parame...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 18:16:51 +0000 (20:16 +0200)]
data/vars.qc - when declaring a function, and it had a prototype - use the new parameter names instead of the ones from the prototype, otherwise things get messy

12 years agoast_unary needs to set its type
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 18:02:18 +0000 (20:02 +0200)]
ast_unary needs to set its type

12 years agoDisable the member-of namespace check when -std != gmqcc
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 17:43:34 +0000 (19:43 +0200)]
Disable the member-of namespace check when -std != gmqcc

12 years agomove the member-of check for '.' to after applying the previous dot operators so...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 17:42:38 +0000 (19:42 +0200)]
move the member-of check for '.' to after applying the previous dot operators so we don't need parens around 'a.b' of 'a.b.c = x'

12 years agodata/functions.qc for some more tests
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 17:39:48 +0000 (19:39 +0200)]
data/functions.qc for some more tests

12 years agoast_call: adopt the funciton's return type
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 17:37:51 +0000 (19:37 +0200)]
ast_call: adopt the funciton's return type

12 years agoast_return_delete: check if self->operand is actually set before ast_unref-ing it
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 16:01:52 +0000 (18:01 +0200)]
ast_return_delete: check if self->operand is actually set before ast_unref-ing it

12 years agoUse the current context, not the one from a NULL value... for ast_return
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 16:00:20 +0000 (18:00 +0200)]
Use the current context, not the one from a NULL value... for ast_return

12 years ago parse 'return' without values better
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 15:58:51 +0000 (17:58 +0200)]
 parse 'return' without values better

12 years agoast_return should accept NULL as value to create a simple 'return' without a value
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 15:58:38 +0000 (17:58 +0200)]
ast_return should accept NULL as value to create a simple 'return' without a value

12 years agoFixup some possibly uninitialized value when parsing 'return'
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 15:48:21 +0000 (17:48 +0200)]
Fixup some possibly uninitialized value when parsing 'return'

12 years agoset expression.next to NULL in ast_block_set_type if it won't be set to a new value
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 15:46:02 +0000 (17:46 +0200)]
set expression.next to NULL in ast_block_set_type if it won't be set to a new value

12 years agoDon't re-add defs which had a prototype
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 15:42:38 +0000 (17:42 +0200)]
Don't re-add defs which had a prototype

12 years agoadding data/proto.qc
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 15:32:32 +0000 (17:32 +0200)]
adding data/proto.qc

12 years agoast_value_copy should copy the expression substructure as well - exposing ast_value_c...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 15:16:20 +0000 (17:16 +0200)]
ast_value_copy should copy the expression substructure as well - exposing ast_value_copy to the outside since the parser needs to copy complete types when multiple variables are declared with commas

12 years agoinitialize the ast_expression node in ast_shallow_type properly as well
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:58:17 +0000 (16:58 +0200)]
initialize the ast_expression node in ast_shallow_type properly as well

12 years agoinitialize the ast_expression node in ast_type_copy properly
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:57:22 +0000 (16:57 +0200)]
initialize the ast_expression node in ast_type_copy properly

12 years agokeep the filenames of all lexed files in a global lex_filenames vector because we...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:47:33 +0000 (16:47 +0200)]
keep the filenames of all lexed files in a global lex_filenames vector because we don't strdup the filenames into lex_ctx, but copy the pointer

12 years agoset parser->lex to NULL after closing
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:42:17 +0000 (16:42 +0200)]
set parser->lex to NULL after closing

12 years agodon't deallocate the parser on a compile error -_-
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:40:20 +0000 (16:40 +0200)]
don't deallocate the parser on a compile error -_-

12 years agoast_member's are now kept, since they are used like variables: multiple times
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:38:50 +0000 (16:38 +0200)]
ast_member's are now kept, since they are used like variables: multiple times

12 years agoAdd a comment about why we don't delete the owner
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:32:07 +0000 (16:32 +0200)]
Add a comment about why we don't delete the owner

12 years agoDoh... wrong comment type
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:30:28 +0000 (16:30 +0200)]
Doh... wrong comment type

12 years agoast_member will not unref/delete the owner: first of all the owner is always an ast_v...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:30:09 +0000 (16:30 +0200)]
ast_member will not unref/delete the owner: first of all the owner is always an ast_value, which won't get deleted anyway, secondly: the ast_members are collected and deleted after the owners, so ast_unref(owner) will cause invalid memory access

12 years agoast_block_collect: add to ast_block->collect and set the node's .keep=true, those...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:27:40 +0000 (16:27 +0200)]
ast_block_collect: add to ast_block->collect and set the node's .keep=true, those will now always be deleted by the ast_block dtor

12 years agoinitialize ast_block->collect properly
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:25:21 +0000 (16:25 +0200)]
initialize ast_block->collect properly

12 years agocollect vector-member locals in ast_block->collect, like a garbage collection...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:24:26 +0000 (16:24 +0200)]
collect vector-member locals in ast_block->collect, like a garbage collection...

12 years agoRevert "let ast_node have a use-counter, helpful for the parser to delete unused...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:20:45 +0000 (16:20 +0200)]
Revert "let ast_node have a use-counter, helpful for the parser to delete unused fields which otherwise get lost in the void"

This reverts commit 25ffd11aa63c018632f3906092622353f79a8129.

12 years agoRevert "ast_usecount macro for convenience"
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:20:36 +0000 (16:20 +0200)]
Revert "ast_usecount macro for convenience"

This reverts commit e86c8ff0eb55b40c5a30accd5915be3a9b08e784.

12 years agoRevert "delete ast_members from parser->locals when they were unused"
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:20:23 +0000 (16:20 +0200)]
Revert "delete ast_members from parser->locals when they were unused"

This reverts commit cdeffb6de9b92b7c498380d802d3250ef9ba73aa.

12 years agodelete ast_members from parser->locals when they were unused
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:20:17 +0000 (16:20 +0200)]
delete ast_members from parser->locals when they were unused

12 years agoast_usecount macro for convenience
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:18:51 +0000 (16:18 +0200)]
ast_usecount macro for convenience

12 years agolet ast_node have a use-counter, helpful for the parser to delete unused fields which...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:16:43 +0000 (16:16 +0200)]
let ast_node have a use-counter, helpful for the parser to delete unused fields which otherwise get lost in the void

12 years agoclear lex->modelname
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 14:04:20 +0000 (16:04 +0200)]
clear lex->modelname

12 years agoclear all the remaining vectors in the parser
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 13:59:29 +0000 (15:59 +0200)]
clear all the remaining vectors in the parser

12 years agoclear items_data in main
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 13:58:20 +0000 (15:58 +0200)]
clear items_data in main

12 years agoclean lex->frames in lex_close
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 13:57:21 +0000 (15:57 +0200)]
clean lex->frames in lex_close

12 years agofree parser->fields and parser->locals at parser_cleanup
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 13:55:50 +0000 (15:55 +0200)]
free parser->fields and parser->locals at parser_cleanup

12 years agofix a MEM_VECTOR_CLEAR to be done AFTER clearing the contents...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 13:53:35 +0000 (15:53 +0200)]
fix a MEM_VECTOR_CLEAR to be done AFTER clearing the contents...

12 years agoDelete fields in parser_cleanup
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 13:51:53 +0000 (15:51 +0200)]
Delete fields in parser_cleanup

12 years agothe opening paren is now an operator - to fix up the precedence rules, now 'anentity...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 13:25:45 +0000 (15:25 +0200)]
the opening paren is now an operator - to fix up the precedence rules, now 'anentity.afunction()' compiles

12 years agoadd 'local' keyword in fields.qc, it's for qcc standard anyway
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:56:15 +0000 (14:56 +0200)]
add 'local' keyword in fields.qc, it's for qcc standard anyway

12 years agoget rid of additional trailing \n on parseerror
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:55:37 +0000 (14:55 +0200)]
get rid of additional trailing \n on parseerror

12 years agoWARN_ERROR -> opts_werror in parser.c
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:51:12 +0000 (14:51 +0200)]
WARN_ERROR -> opts_werror in parser.c

12 years agofields: testing function-fields
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:50:30 +0000 (14:50 +0200)]
fields: testing function-fields

12 years agoreplacing WARN_ERROR with opts_werror
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:36:33 +0000 (14:36 +0200)]
replacing WARN_ERROR with opts_werror

12 years agoFix indentation of lexer.c - was still using some tabs there
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:27:19 +0000 (14:27 +0200)]
Fix indentation of lexer.c - was still using some tabs there

12 years agolexer now turns '(' into an operator if noops=false
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:26:25 +0000 (14:26 +0200)]
lexer now turns '(' into an operator if noops=false

12 years agodebug warn def on top of the flag list
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 12:23:38 +0000 (14:23 +0200)]
debug warn def on top of the flag list

12 years agoadd the type of whatever is 'not a function' to that error message
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 10:45:51 +0000 (12:45 +0200)]
add the type of whatever is 'not a function' to that error message

12 years agoAdd an error output in the ast where I missed one (there are probably more places...
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 10:45:29 +0000 (12:45 +0200)]
Add an error output in the ast where I missed one (there are probably more places which need one)

12 years agoadd LOAD for TYPE_FUNCTION as LOAD_FNC so we can actually access function fields
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 10:44:17 +0000 (12:44 +0200)]
add LOAD for TYPE_FUNCTION as LOAD_FNC so we can actually access function fields

12 years agoparser_strdup to wrap util_strdup and actually dup empty strings
Wolfgang (Blub) Bumiller [Sat, 18 Aug 2012 10:26:21 +0000 (12:26 +0200)]
parser_strdup to wrap util_strdup and actually dup empty strings

12 years agoSupport for $modelname and $framerestore
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 19:02:56 +0000 (21:02 +0200)]
Support for $modelname and $framerestore

12 years agoDon't expand frame macros when they don't have a $ prefix
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 18:49:58 +0000 (20:49 +0200)]
Don't expand frame macros when they don't have a $ prefix

12 years agoAdded support for some modelgen/spritegen commands
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 18:47:31 +0000 (20:47 +0200)]
Added support for some modelgen/spritegen commands

12 years ago'$' is now its own token, used for modeldata
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 18:03:53 +0000 (20:03 +0200)]
'$' is now its own token, used for modeldata

12 years agodata/fields.qc now tests fieldpointer parameters - requires -std=qcc to build
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:39:43 +0000 (16:39 +0200)]
data/fields.qc now tests fieldpointer parameters - requires -std=qcc to build

12 years agoCALL instructions need to offset the st++ too
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:38:57 +0000 (16:38 +0200)]
CALL instructions need to offset the st++ too

12 years agoFix a possible endless loop in ir_values_overlap
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:38:36 +0000 (16:38 +0200)]
Fix a possible endless loop in ir_values_overlap

12 years agoentityfield tests
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:29:41 +0000 (16:29 +0200)]
entityfield tests

12 years agoprog_leavefunction needs to take the ++st into account - otherwise INSTR_RETURN ends...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:28:59 +0000 (16:28 +0200)]
prog_leavefunction needs to take the ++st into account - otherwise INSTR_RETURN ends up skipping the instruction after the calling INSTR_CALL

12 years agoNOT for entity, function and string - we're not constant-folding it for functions...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:24:47 +0000 (16:24 +0200)]
NOT for entity, function and string - we're not constant-folding it for functions and entities right now

12 years agounary NOT operator for float and vector
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:21:19 +0000 (16:21 +0200)]
unary NOT operator for float and vector

12 years agoeven in non-qcc mode we need to search the variables for fields because of field...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:21:09 +0000 (16:21 +0200)]
even in non-qcc mode we need to search the variables for fields because of field-pointers

12 years agoverbose error about unhandled operators
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:07:00 +0000 (16:07 +0200)]
verbose error about unhandled operators

12 years agolexer: recognize != as operator when noops=false
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 14:06:12 +0000 (16:06 +0200)]
lexer: recognize != as operator when noops=false

12 years agoFix an error message
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 13:59:09 +0000 (15:59 +0200)]
Fix an error message

12 years agoprint a proper error message when a function lacks a body
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 13:31:46 +0000 (15:31 +0200)]
print a proper error message when a function lacks a body

12 years agoAllow fieldpointer parameters in functions, allow function fields again
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 13:27:06 +0000 (15:27 +0200)]
Allow fieldpointer parameters in functions, allow function fields again

12 years agoactivate -Wfield-redeclared by default
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 13:15:46 +0000 (15:15 +0200)]
activate -Wfield-redeclared by default

12 years agoallow redeclaration of fields, but warn about them
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 13:14:39 +0000 (15:14 +0200)]
allow redeclaration of fields, but warn about them

12 years agoReorganizing expression parsing to allow prefix-operators like unary minus
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 13:11:03 +0000 (15:11 +0200)]
Reorganizing expression parsing to allow prefix-operators like unary minus

12 years agoOP_PREFIX flag for ~ and !
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 12:24:12 +0000 (14:24 +0200)]
OP_PREFIX flag for ~ and !

12 years agounary - operator implemented, adding imm_vector_zero and imm_float_zero since those...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 12:23:18 +0000 (14:23 +0200)]
unary - operator implemented, adding imm_vector_zero and imm_float_zero since those should be accessible quickly

12 years ago-_- file->filename
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 12:05:04 +0000 (14:05 +0200)]
-_- file->filename

12 years agoutil_fopen...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 12:01:47 +0000 (14:01 +0200)]
util_fopen...

12 years agofopen -> fopen_s on windows
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 11:45:45 +0000 (13:45 +0200)]
fopen -> fopen_s on windows

12 years agosscanf -> sscanf_s on windows
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 11:44:53 +0000 (13:44 +0200)]
sscanf -> sscanf_s on windows

12 years agostrcpy->memcpy in util_getline
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 11:01:30 +0000 (13:01 +0200)]
strcpy->memcpy in util_getline

12 years agomake the 'vector' type use qcfloat instead of float
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 10:58:54 +0000 (12:58 +0200)]
make the 'vector' type use qcfloat instead of float

12 years agoit's not undefined, stupid
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 10:58:26 +0000 (12:58 +0200)]
it's not undefined, stupid

12 years agocast mem_a returns in util_getline
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 10:38:00 +0000 (12:38 +0200)]
cast mem_a returns in util_getline

12 years agoadd some missing casts to some mem_a
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 10:34:28 +0000 (12:34 +0200)]
add some missing casts to some mem_a

12 years agoShutup visual studio...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 10:32:01 +0000 (12:32 +0200)]
Shutup visual studio...

12 years agoReplacing execloop.h ... wish I could just use a copy of DP's execloop, I hate licenses
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 10:10:24 +0000 (12:10 +0200)]
Replacing execloop.h ... wish I could just use a copy of DP's execloop, I hate licenses

12 years agoinclude stdio.h in exec.c for snprintf...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 09:36:28 +0000 (11:36 +0200)]
include stdio.h in exec.c for snprintf...

12 years agodon't try to access function-local functions outside of functions...
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 09:36:16 +0000 (11:36 +0200)]
don't try to access function-local functions outside of functions...

12 years agotest for constants
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 09:34:11 +0000 (11:34 +0200)]
test for constants

12 years agoassigning values to constant globals
Wolfgang (Blub) Bumiller [Thu, 16 Aug 2012 09:33:29 +0000 (11:33 +0200)]
assigning values to constant globals

12 years agoir.c: strcmp->memcpy
Wolfgang (Blub) Bumiller [Wed, 15 Aug 2012 15:02:48 +0000 (17:02 +0200)]
ir.c: strcmp->memcpy