Commit Graph

247 Commits (ba36ac6cfd69466d2b36b5cba82fedb2fa6513da)

Author SHA1 Message Date
Roman C 03073c8038 Memory leak fix for event.c. Patch by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5035 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 10:34:48 +00:00
Roman C f7c684f964 Make it possible for AI to recognize some new words and phrases needed for new commands.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5034 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 10:24:09 +00:00
Roman C 3d2dc99003 Scripting:
-allow creation of unit templates on the fly
-allow direct access to major weapon stats from within scripts

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5014 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-10 13:20:23 +00:00
Giel van Schijndel 4e60f65e8f Don't #include "script_parser.tab.h" in lib/script/stack.c as we don't depend on the parser's token definitions there
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4856 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 15:18:42 +00:00
Giel van Schijndel ab2bafd7a4 Merge r4271 from deprecated 2.1 branch into trunk:
* Make log output use LOG_SCRIPT instead of LOG_NEVER and LOG_WARNING
 * Some random cleanups


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4788 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 15:21:23 +00:00
Giel van Schijndel 61c8bbc4b9 * Don't "Guarantee nul-termination" after snprintf as snprintf does that itself already (per the C99 spec)
* Use strlcpy for copying strings instead of snprintf "%s"
 * Don't cast the return value from vsnprintf to (void)
 * When we use va_start make sure to use va_end as well...
 * Fix indentation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 14:21:41 +00:00
Giel van Schijndel 1252538097 * Make pIdent for VAR_SYMBOL and FUNC_SYMBOL const so that we're const correct with the function tables in scripttabs.c
* Replace "nstr = malloc(strlen(str) + 1); strcpy(nstr, str);" by using "nstr = strdup(str);" instead
 * Remove a non-sensical self-assignment ("pIdent = pIdent;")
 * In scriptAddVariable:
  * "Overallocate" for the new VAR_SYMBOL so that we can store the identifier in that single chunk of memory
   * This allows deallocating the entire structure with a single free() call (which prevents problems with the constness change to VAR_SYMBOL mentioned above)
  * Don't take ownership of the memory pointed to by psVarIdent->pIdent, just copy its contents instead
  * Make FREE_VARIDENTDECL a function instead: freeVARIDENTDECL
   * In this function also free psDcl->pIdent


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4696 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 15:18:28 +00:00
Giel van Schijndel 10eac267e3 Remove unused global variable psLocalVarsTemp
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4694 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 15:04:24 +00:00
Giel van Schijndel 457c7005f3 * Remove global variable psLocalVars which was __always__ NULL
* Remove unused function scriptClearLocalVariables() (which was effectively a NOP due to psLocalVars being NULL)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4691 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 14:56:49 +00:00
Giel van Schijndel f494f40dde Remove global var psFunctions which is __always__ NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4690 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 14:18:06 +00:00
Roman C 4c5d34f22b Scripting engine:
Allow global variable declarations to be mixed with trigger and event/function declaration. This allows us to #include script files which variable/event declaration.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4667 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-17 15:59:43 +00:00
Roman C 2734594eef Don't abuse interpCheckEquiv() since most type checking is done during compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4659 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-16 19:14:58 +00:00
Roman C 89fc6d5edd Allow a script to have more than strings at a time.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4614 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-14 20:12:27 +00:00
Roman C 49903f9593 Get rid of unnecessary warnings when compiling release build using MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4462 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 15:56:39 +00:00
Per Inge Mathisen be566a7d6d Add -Wcast-align and -Wmissing-declarations to autoconf debug builds, and fix warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4403 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 23:28:44 +00:00
Dennis Schridde e28cf1ce77 Using the kludge for GNU Flex < 2.5.30 was slightly incorrect. Correct way is present in 2.5.9 already.
Additionaly use the kludge found on http://flex.sourceforge.net/manual/faq_002dmemory_002dleak.html


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4384 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 11:05:19 +00:00
Dennis Schridde f888cc5b69 Revert 4344-4347, 4355, 4357, 4358, 4362: They caused too much slowdown in the scripting engine
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4379 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 18:38:25 +00:00
Dennis Schridde 89d1ea6a3d Old versions of GNU Flex (i.e. 2.5.4) dont provide yylex_destroy
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4376 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 17:09:16 +00:00
Dennis Schridde e6e09ee72a Differ between deep (i.e. incl strings) and non-deep (just the pointer) copies
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4362 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 21:43:39 +00:00
Dennis Schridde ffc7a71601 Make MSVC happy
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4359 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 16:42:16 +00:00
Dennis Schridde 496e781146 Dont allocate the string again during direct copy
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4358 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 15:37:16 +00:00
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