Commit Graph

226 Commits (ebecb854b116f8fc3e56c2af0d00d43016313c38)

Author SHA1 Message Date
Dennis Schridde 9bffb40f82 stackPop can utilise stackReduce
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4357 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 15:01:15 +00:00
Dennis Schridde 3eecd4fd7b Move interp*2string to script*2string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4356 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 14:57:35 +00:00
Dennis Schridde 10670360cd Cleaned stackPush and stackShutdown, stackRemoveTop can remove more than 1 item now.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4355 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 13:52:31 +00:00
Dennis Schridde 44d2b96472 Removed unused (commented out) chunk of stack manipulation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4354 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 13:27:19 +00:00
Dennis Schridde ee286efa0f Fix lexer memleaks
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4348 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 11:28:25 +00:00
Dennis Schridde 9019233d1a Properly copy string->string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4347 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 10:26:15 +00:00
Dennis Schridde 6fdc8dd8b1 Dont store values and types seperately.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4346 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 02:35:26 +00:00
Dennis Schridde 53e30f187e Remove debugging junk
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4345 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 01:58:40 +00:00
Dennis Schridde cb2e3c3201 New interpreter functions for initialisation, cleanup and copy (incl. conversion, will be used later). Shall replace special string handling.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4344 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 01:54:27 +00:00
Dennis Schridde b9f91361fc Minor cleanup of script parser
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4343 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 01:06:00 +00:00
Dennis Schridde 02ae258b75 Was printing the wrong opcode for binary/unary operators
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4341 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 00:48:41 +00:00
Dennis Schridde 480314fed0 Enhance copeprint capabilities and add more 2string functions for the scripting engine.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4340 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 00:45:03 +00:00
Dennis Schridde ce8e1d1846 - Generic cleanup
- Strings are not equivalent to anything, only convertible (mistake in one of my last commits)
- Clarify names
- Print user types


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4339 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 00:27:56 +00:00
Dennis Schridde 5412840e85 Print another binary operator: concatenation.
You still should not call traceOn() from a script or enable interpTrace in the code...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4328 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 22:53:09 +00:00
Dennis Schridde 13c531f6cb Print float values, too. (script debug)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4326 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 22:22:56 +00:00
Dennis Schridde 679bfea007 Cleanup stackPopParams and make it handle the different INTERP_VAL types correctly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4325 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 22:09:31 +00:00
Dennis Schridde e402233597 Add type to string function (i.e. to be used for error messages). Allow bool, int, float to be converted into strings in interpCheckEquiv().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4323 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 20:57:07 +00:00
Dennis Schridde 10f2ccfd56 TRUE->true, FALSE->false (except in scripts)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:51:17 +00:00
Roman C a1008c093d Reduce amount of junk in the MSVC compilation output by about 70%.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4279 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 22:15:28 +00:00
Roman C 3b1c952de1 Speed up script execution when "--debug script" is not enabled.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4228 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 17:42:07 +00:00
Roman C 8478728699 Get rid of an unnecessary debug() call.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4225 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 17:23:28 +00:00
Per Inge Mathisen a622880946 Increase warning level and do cosmetic cleanup and remove dead code in events.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4208 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-21 16:52:10 +00:00
Roman C 3e615ea55f Add a missing definition of a flex symbol.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4159 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-20 01:09:52 +00:00
Roman C cfea441525 Aivolution AI:
-AI became more talkative
-more phrases can be recognized and used as commands
-cleanups

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4158 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-19 21:02:03 +00:00
Dennis Schridde 2537bfc61c Cleanup #includes a bit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4107 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 12:39:08 +00:00
Dennis Schridde a80115b63e Port r4075: Fix "array subscribt is above array bounds"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4076 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 17:58:04 +00:00
Dennis Schridde cb2f0a30df Patch MSVC Solution file to depend on SQLite and change eol-style to native for them, since otherwise patches will not apply.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4044 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-14 18:16:04 +00:00
Giel van Schijndel 33216b2e9d Move all stuff that actually belongs in CPPFLAGS (but is called CFLAGS) to AM_CPPFLAGS
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3988 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-10 10:50:58 +00:00
Dennis Schridde d8409c9819 - Don't define CFLAGS anymore, export WZ_CFLAGS instead, which can be overridden by make commandlines
- Set -DYY_NO_INPUT only in those places where needed
- Add some previously forgotten CFLAGS where needed
- Remove extranous -lintl from WIN32_LIBS
- Remove apparently unnecessary directory from Mac include (png_util doesn't need it either)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3986 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-10 02:01:46 +00:00
Dennis Schridde 9f44219b1c Move addition of CFLAGS from configure.ac to the places they are actually needed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3983 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-09 20:08:42 +00:00
Dennis Schridde 3858daf4a1 Reset MSVC version from 9 to 8, since otherwise MSVC8 will refuse to load the project files. (bug #11219)
Does MS provide some kind of templating system? Like autotools generate Makefiles from Makefile.am.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3950 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 11:28:40 +00:00
Dennis Schridde d3455b699a Properly set include/library directories for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3949 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 01:45:45 +00:00
Dennis Schridde 1c979f5fd9 Make lex/yacc rules terminals, since lexer/parser files cannot be autogenerated.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3847 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-20 12:06:26 +00:00
Dennis Schridde b7e36a5b77 Require devpkg to be in ./devpkg/ for msvc.
This saves the trouble of having to edit the paths for lib/include dirs and enables us to have the FlexBison.rules there, too.
Thus FlexBison.rules is removed and to be found in the msvc devpkg from now on.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3657 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-02 18:17:58 +00:00
Dennis Schridde 31a863a90b Setup eol-style CRLF for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3473 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 20:49:48 +00:00
Dennis Schridde 1c44cf8568 path #938 by Bugginator: MSVC projectfile updates. You need the static libraries from http://download.gna.org/warzone/development/devpkg/2.1/msvc80/ now.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3472 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 19:57:50 +00:00
Dennis Schridde d7bbab46af Set eol-style and mime-type for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3471 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 19:55:59 +00:00
Dennis Schridde 3f6b52bef1 src/game.c: Minor beautification.
configure.ac: YY_NO_INPUT prevents Flex from defining input(), which we do not need, since we use our own YY_INPUT instead. Maybe we should use Flex's function instead?
lib/script/script_parser.y: scriptStoreVarTypes() was defined but never used.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3300 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-01 15:18:25 +00:00
Giel van Schijndel c51bd8ae10 * Get rid of a large quantity of unused parameters
* Turn some signed integers ("int" or "SDWORD") into unsigned integers where it made more sence (and signed integers caused warnings about comparing signed with unsigned integers)
 * At some places cast to an unsigned integer (where the type of the expression is a signed integer but the result of it logically _always_ is an absolute value)
 * Remove unused struct-type EVENT_INIT
 * Convert use of malloc->memcpy->free to one single realloc call (and now make sure to actually check realloc's return value, which wasn't done with the malloc call)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3037 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-10 23:15:46 +00:00
Dennis Schridde c64b565f14 Patch #872 by Buginator. Untested by me since in Bugs we trust. ;)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3020 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 19:10:34 +00:00
Dennis Schridde fde3e48eb1 Remove rules which could not ever be matched. The behaviour shouldn't change. If some Lex guru finds a mistake, please tell me. :)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3001 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-08 00:32:51 +00:00
Giel van Schijndel f5602b4778 * Replace a large amount of strncpy() calls with the safer strlcpy()
* Fix an error in src/game.c where we would use the wrong size as parameter to strlcpy()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2640 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 16:18:52 +00:00
Giel van Schijndel bd37e62cb2 * Replace a lot of strncat(dst, src, sizeof(dst) - strlen(dst) - 1) calls with the less bloated strlcat(dst, src, sizeof(dst)) form
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2637 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 15:47:17 +00:00
Giel van Schijndel 6b4cba1700 * Rename pLevelName to aLevelName (hungarian notation is a pain. Especially when it's wrong!)
* Get rid of several magic numbers
 * Some const correctness
 * Replace a huge amount of strcpy(), strcat(), strncpy() and strncat() calls with a strlcpy() and strlcat() calls respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 14:35:35 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 21:11:29 +00:00
Roman C d042bb5203 Fixed c99-style variable declaration in script_lexer.l
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2536 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-08 14:21:09 +00:00
Giel van Schijndel ad3f3442f6 * Fix a segfault introduced in r2532 which was triggered when loading *.slo scripts with #define directives in them
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2533 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-06 14:22:49 +00:00
Giel van Schijndel f7e793cf31 * Load SCRIPT files (*.slo) directly from their files rather than an intermediate memory buffer
* In function dataScriptLoad, make "printHack" a "static const" instead of a local non-const variable (emphasizes that it really is a compile-time constant; also towards the compiler btw, GCC treats a static const var as a preprocessor macro with static type checking)
 * Move global variables pScrInputFiles (formerly pScrInputBuffer), scr_include_stack_ptr, scr_num_macros, scr_macro_stack_ptr, pScrMacroBuffer and scrInclLine from script_parser.y to script_lexer.l and mark them static to disallow external linkage (to make it a little bit better encapsulated and localised)
 * Make function scriptCompile return a SCRIPT_CODE* pointer instead of a BOOL and writing the same pointer into an output pointer (instead upon failure it now returns NULL)
 * Move some of the functionality of scriptCompile to new function scriptSetInputFile instead (which is based upon scriptSetInputBuffer)
 * Modify script_lexer.l to read include files directly from the files rather than an intermediate memory buffer (by means of a modified YY_INPUT macro)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2532 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-05 22:44:18 +00:00
Roman C e5f977e0f1 Scripting engine:
-increased possible length of a macro name

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2493 4a71c877-e1ca-e34f-864e-861f7616d084
2007-09-29 14:41:46 +00:00
Roman C 5d39df302d Added more phrases recognized by 1.10 and Aivolution AIs as help requests.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2432 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-24 13:21:31 +00:00
Dennis Schridde 20fe87c0f4 AM: Add lexers to BUILT_SOURCES and CLEAN_FILES as well.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2427 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 13:16:09 +00:00
Dennis Schridde e232e9a6b5 Yacc warning fixes by Pseudonym404 (http://forums.wz2100.net/index.php?topic=148.msg7837#msg7837):
- adding *.tab.c to BUILD_SOURCES and CLEANFILES before *.tab.h in applicable Makefile.am files causes *.tab.c to be the file that triggers the %.tab.h %.tab.c: %.y rule, resulting in the command run being "bison -y  -d -o[...].tab.c [...].y", not "bison -y  -d -o[...].tab.h [...].y", which (aside from being correct syntax Wink ) stops "warning: conflicting outputs to file `[...].tab.h'"
- chat_parser.y had %token _T_A declared twice, second instance removed
- audp_parser.y had trailing | signs (presumably from when NULL wasn't commented out)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2426 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 13:03:09 +00:00
Giel van Schijndel 707e156265 * Fix warning about "null argument where non-null required"
* Turn macro ALLOC_VARIDENTDECL partially into a static inline function
 * Remove -Wno-nonnull since this warning shouldn't appear anymore now
Patch by pseudonym404 with some changes by me ( http://forums.wz2100.net/index.php?topic=148.msg7723#msg7723 )

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2377 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-14 19:24:29 +00:00
Roman C c1f1288f53 Turn some ASSERTs into debug(LOG_ERROR, ... )
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2371 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-13 10:35:18 +00:00
Per Inge Mathisen 00b0b8c322 Fix signedness warning
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2116 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-15 15:59:54 +00:00
Roman C 7337171595 Show correct line number of the error in the input script file when using script includes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2108 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-15 13:11:09 +00:00
Per Inge Mathisen 2e99433ad0 Rename a few files for consistent naming. base.h -> basedef.h.
bulletdef.h -> projectiledef.h. weapons.h -> weapondef.h.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2063 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 19:56:16 +00:00
Per Inge Mathisen 077433f02f Audit more globals not being set correctly to NULL.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1850 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 17:56:34 +00:00
Giel van Schijndel d65f88beb5 * Replace a lot of heap usage with malloc/free usage
* Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1815 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 20:46:30 +00:00
Giel van Schijndel 704c6bc653 * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
* Remove usage of widgCopyString

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1807 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 16:49:58 +00:00
Dennis Schridde 6fa36aa0e9 + const, - unused
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1795 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-03 13:46:50 +00:00
Roman C 600e947bab - added two additional chat commands which can be recognized by AI
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1589 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 12:03:18 +00:00
Roman C 8fb6fd5b3c - increase number of allowed script instruction until the interpreter recognizes an infinite loop
- increase total number of scripts object variables to handle larger AI scripts

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1585 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-05 15:28:21 +00:00
Dennis Schridde ce16856887 FREE->free, MALLOC->malloc (sed+review)
This patch will create crashes where the code expects FREE to set the pointer to NULL! (Those problems should be fixed anyway.)
The only occassion where I saw this is when quiting a game, so it is not too much of an issue.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1459 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 10:43:05 +00:00
Stefan Huehner c0a44c70e2 Make some more char* -> const char*
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1452 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-13 15:04:08 +00:00
Per Inge Mathisen 96cb7cafc5 Ressurect -Wno-unused-label. Reorganize string.h includes so that
_GNU_SOURCE can take effect first, to silence stpcpy() warnings from 
bison generated code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1416 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 12:44:50 +00:00
Dennis Schridde 8952155c7a - Add -Wextra to debug=yes, as it doesn't generate so many new warnings
- Add -Wno-nonnull to debug=strict to make it compile (Remove it from AM_CFLAGS)
- Remove -Wno-unused-label as this warning is not generated anymore
- Fix a "... from incompatible pointer type" warning which led to a lot of strings (and associated functions) in the widget area becoming const
- Maybe found the reason for images in UTF-8 strings


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1405 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 14:41:22 +00:00
Roman C 0faf85229b Scripting Language:
-simple data types are lowercase on default
-casts using uppercase still allowed for compatibility with campaign scripts
-updated scripting manual accordingly

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1391 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 13:27:41 +00:00
Giel van Schijndel 26f2672bfd * remove macro PTRVALID
* replace all instances of PTRVALID(ptr,size) by (ptr != NULL)
 * remove asserts of style ASSERT( x == NULL || x != NULL ) because they would evaluate to true always anyhow and as such wouldn't ever trigger
 * remove macros iV_HeapAlloc and iV_HeapFree and replaced them with MALLOC and FREE respectively (that's what they expanded to anyway)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1348 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 13:20:41 +00:00
Gerard Krol 42ed587327 Per's removal of the memory heap system. Now MALLOC is just malloc, and not some wrapper around a wrapper that will allocate it from a specific pool.
The MSVC poject will need to be updated I guess, as some files were deleted.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1343 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 10:33:26 +00:00
Dennis Schridde 3b09a756df - Remove unneeded gettext files and instead create them via autopoint
- Remove unneeded checks from autogen.sh (all of them are also checked in configure.ac)
- Move AM_CPPFLAGS=-$(top_srcdir), which was included in nearly every Makefile, to configure.ac
- Remove -g from CFLAGS for usual builds. This should be set by the buildscripts instead
- Remove CFLAGS_OVERRIDE, which was rendered obsolete by the above change


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1332 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-02 17:21:05 +00:00
Roman C 89f67fc187 Scripting Engine:
-fixed local string variables now being cleared between function calls
-implemented a setBit() scripting function to work with bitfields

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1318 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-01 16:22:01 +00:00
Roman C 1c2ec5e07d Enabled recursive function calls for scripts.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1311 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-31 16:03:21 +00:00
Dennis Schridde 4107156595 Another buildsystem update:
- Do not modify CFLAGS inside automake Makefiles
- Add NEWS and INSTALL to comply with GNU standards
- Use aclocal's include functionality instead of acinclude.m4


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1296 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-29 12:41:18 +00:00
Dennis Schridde 8c2c3c97a8 Clean yacc headers properly
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1295 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-29 10:08:12 +00:00
Dennis Schridde 2a74242eb3 - Replaced various vectors with Vector3i and Vector3f (idea by Watermelon)
- Vector3i from lib/ivis also used in lib/audio, maybe want to move it to some more generic place?
- Replace iPoint with Vector2i
- Remove additional integer type declarations from pietypes.h
- Rename all iSprite to iTexture
- Various warning fixes: Unsigned/signed comparisons, uninitialized variables, declared but not defined symbols
- Replace DEBUG_BLOCK with DEBUG_MALLOC (it was virtually the same)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1245 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 16:20:16 +00:00
Gerard Krol 4465a061c1 Fix warnings, and revert r1241 for effects.c (validatePie really needs a prototype at the top)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1242 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-15 23:17:09 +00:00
Dennis Schridde 7e12df4e35 - Backport r1228 (lib/script/script_parser.y, not initializing ppsLocalVarVal leads to segfault)
- Change some idention and whitespaces


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1229 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-13 20:49:03 +00:00
Roman C b0218cad3e Fixed saving and loading of script string variables.
NOTE: this will break old save games (at least skirmish ones).

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1168 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-23 20:45:05 +00:00
Per Inge Mathisen daaac4b5e3 Clean up redundant copy&paste code. Patch by Gerard Krol with
some stylistic and extra changes by me.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1158 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-21 22:38:52 +00:00
Per Inge Mathisen d3cadd9e4a Start making the code conform to -Wextra
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1146 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 16:46:48 +00:00
Per Inge Mathisen 79b3875fc4 This commit fixes all warnings (on my system). -Werror added for
debug builds. Hopefully this will not cause too much pain, but
rather increase code quality for the future.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1144 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 14:10:44 +00:00
Per Inge Mathisen 929c4bf2ab Set eol-style for files missing this.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1143 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 14:02:24 +00:00
Per Inge Mathisen 9640c6a42d Fix mixed line endings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1142 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 14:01:41 +00:00
Per Inge Mathisen 714d15e7e8 Attempt to fix mixed line endings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1141 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 13:57:33 +00:00
Dennis Schridde 8a70df4064 Use some more advanced Automake techniques like noinst_HEADERS. Changes partly autogenerated by KDevelop, so this should be compatible with Automake 1.6.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1118 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 14:36:03 +00:00
Roman C cd70a98588 - fixed compilation of script functions consisting of a single return statement
- minor cleanups

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1112 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-14 22:12:48 +00:00
Roman C da3f1e25f8 - removed some ASSERSs doubling debug() error output
- when script runtime error occurs wz first outputs error information and then asserts, not vice versa
- printCallStack() script function will output script call stack to standard output

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1107 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-14 18:29:26 +00:00
Ari Johnson 05bd724b1c Fixed script state saving and loading on big-endian machines
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1100 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-14 03:39:17 +00:00
Roman C 1ac2942948 Make use of the script type compatibility table during compilation of vlo and slo files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1098 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-12 15:46:54 +00:00
Roman C f13a111a5c Scripting engine update:
-added script call stack trace output on script runtime error
-added STRUCTURE getTileStructure(INT tileX, INT tileY) script function to get a structure on a certain map position
-fixed two stackPopParams() calls with too many actual parameters

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1087 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-10 15:23:47 +00:00
Giel van Schijndel 991b9ceb12 patch by Gerard as provided in message with ID <45CC4A2E.4060706@student.tudelft.nl>:
* fixes usage of negative array index

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1082 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-09 16:29:32 +00:00
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Dennis Schridde f723a42e50 Proposed fix for non-MSVC buildsystems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@984 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-09 22:07:58 +00:00
Dennis Schridde 711af01772 New MSVC project files with custom build rules to support automatic lexer/parser generation.
The include changes might break other buildsystem, I'll fix that when I am back on Linux.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@983 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-09 21:13:58 +00:00
Giel van Schijndel 38a3d8ee82 * cast some void*(*) variables to their respective types
* remove -fno-gnu-keywords from GCC because it seems to be only for C++/ObjectC (Doh!), and the variant for C (being -fno-asm) additionally disables inlines which we definitely don't want disabled
 * remove a large function which reserves memory without it ever being used *at*all* (from hci.*, mapdisplay.* and intelmap.c), also remove a function parameter from another function in mapdisplay.c, (it was this parameter that required the other functions to reserve memory)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@971 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-08 13:40:12 +00:00
Roman C ddbc2564b5 Lexical parser update:
-Fixed endless recursion in one of the lexical parser rules.
-Disabled log warnings when no meaningful information could be extracted form a player chat message.
-Small update to the lexical chat parser rules.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@966 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-07 19:44:04 +00:00
Roman C bebc8316da -fixed FLEX YY_CURRENT_BUFFER glitch
-added asserts to some scripting functions

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@956 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-04 18:15:17 +00:00
Giel van Schijndel 3d23a48076 * expand the use of compiler-guards (C preprocessor macros) so that not only the forward declarations and referring macros are guarded, but the referred functions as well
* remove some unused things: variables, macros (MEMORYREPORT, MEMORYTREAP)
 * fix some signing errors:
  * change assignments of/comparisons with -1 to unsigned variables ((-1) directly, not through a preprocessor directive) to ~0 (left OpenAL-code alone)
  * remove some casts to (SDWORD) in comparisons which actually cause signed/unsigned errors rather than fix them
  * redefine some vars as unsigned

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@955 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-04 17:03:32 +00:00
Roman C 3bfab0ce95 -Implemented C-like #include preprocessor directive for the scripting engine, can be used up to depth of MAX_SCR_INCLUDE_DEPTH. Unlike C counterpart main purpose is to reuse executable and non-executable code.
Example:
#include "multiplay/skirmish/my_include.slo"

-Implemented C-like #define preprocessor directive. Nested macros allowed with up to depth of MAX_SCR_MACRO_DEPTH.
-Added a script function for a fast feature iteration (returns burning as well as non-burning oil resources)
-Replaced some custom Pumpkin routines with default FLEX routines
-Some cleanups

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@950 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-02 20:12:14 +00:00