Commit Graph

149 Commits (f2351935aca338aabb043e8545d37b88dd62379b)

Author SHA1 Message Date
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