Commit Graph

247 Commits (ba36ac6cfd69466d2b36b5cba82fedb2fa6513da)

Author SHA1 Message Date
Christian Ohm cb1497c259 Fix a few spelling errors reported by Paul Wise.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7859 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:33 +02:00
Per Inge Mathisen 8c16a47ef0 Fix broken sources after 'make clean' in tarball generated by 'make dist'. Reported by 'JimPansen' in the forums.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7671 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-09 23:44:11 +02:00
Giel van Schijndel 6bdbda9343 Allow code passing and retrieving of enums as vararg parameters in C++ as well.
In C++ enums are treated differently from integers in some cases, causing GCC to emit some rather nasty abort()-like code (x86/x64 instruction "ud2a") when used as the type for va_arg().

This was the compiler message generated:
{{{
stack.c:339: warning: ‘INTERP_TYPE’ is promoted to ‘int’ when passed through ‘...’
stack.c:339: note: (so you should pass ‘int’ not ‘INTERP_TYPE’ to ‘va_arg’)
stack.c:339: note: if this code is reached, the program will abort
}}}

NOTE: Compiling as C++ now works (as does the produced code), using: {{{./configure CC=g++ CFLAGS=-fpermissive --enable-debug=relaxed}}}

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6957 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-06 13:09:10 +02:00
Gerard Krol 71bc279c9e Fix some spelling errors in debug messages and comments. Patch by Paul Wise <pabs3>.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6832 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-11 11:51:40 +00:00
Per Inge Mathisen 5da9b30f7d Fix missing files in makefiles so that 'make dist' can be run again.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6792 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-07 18:09:58 +00:00
Buginator df0ada9a50 Fixes crash when certain scripts fail to compile, it don't allocate storage, so we shouldn't (try to) reference / free() it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6736 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-28 02:17:20 +00:00
Guangcong Luo 1f5ab803ed Updated MinGW32 makefiles; fix "multiple half-tracks" bug.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6639 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-15 05:49:09 +00:00
Buginator 55d3044f15 Updated MSVC project & solution file(s).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6637 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-15 05:42:09 +00:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Dennis Schridde fcca92459c We no longer need to respect 8-char filename limits, be clear in naming instead
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6616 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:23 +00:00
Dennis Schridde 0c5d56b35a Move endian_* functions into a dedicated header and do not include it from frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6614 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:14 +00:00
Dennis Schridde cbbc58d1e9 Move files which extend a c std library header to a filename of similar name
Extension functions dealing with ...
 * strings are in string_ext.h
 * stdio (namely printf variants) are in stdio_ext.h
 * math are in math_ext.h

These headers are no longer included by frame.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:09 +00:00
Dennis Schridde 728c68b81e Use format strings where required (script parser)
Should fix #178

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6597 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 02:53:52 +00:00
Giel van Schijndel 1538c2af41 * Don't use an yyerror implementation with printf-format parsing for parsers/lexers that don't use it
- This reduces the complexity of those functions ''significantly''
 * Mark yyerror functions with printf formatting with WZ_DECL_FORMAT(printf, ...)

(@trunk = the original intented target for r6430)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6432 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-04 12:58:42 +00:00
Buginator 6f3419da73 Modify scrOutputCallTrace() to dump the stack on script errors, and act normally whenever it is called normally.
(Normally, it dumps only when LOG_SCRIPT is defined, but we can't determine where the script errors are when LOG_SCRIPT isn't used)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6212 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 17:56:43 +00:00
Giel van Schijndel 64910221e7 Fix several warnings that occur on NDEBUG builds:
* Missing returns from function
 * Functions that are defined in both DEBUG and NDEBUG builds but only used in DEBUG builds

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6179 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 14:22:29 +00:00
Giel van Schijndel 71ddbdc5e4 Cleanup:
* Mark several parameters that aren't being used (but shouldn't be removed) with WZ_DECL_UNUSED
 * Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
 * Instead of "(X - Y) >= 0" use the logically equivalent and more readable "X >= Y"
 * Remove redundant function prototypes
 * Move variables into a more local scope where possible
 * Assign the result of an expression to a variable once so that the expression doesn't have to be duplicated several times
 * Move constant UNALLOCATED_OBJECT out of the header and into the only source file where it's ever used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6160 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 21:03:23 +00:00
Giel van Schijndel 1df1706440 * Fix several "comparison between signed and unsigned" warnings
* Const correctness
 * Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6158 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 20:42:20 +00:00
Giel van Schijndel 29d7c7abfd Fix the raw win32 makefile system which got broken in r6144 and r6145:
* The lexers depend on the parser's headers so make sure to compile the parsers first
 * Move a misplaced line-wrapping backslash in src/makefile.win32


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6153 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 18:28:21 +00:00
Giel van Schijndel 810fac209b * Wrap all file lists in the automake and win32 makefiles across lines such that there's only one file on each line
* Alphabetically sort the file lists

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6144 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-13 13:04:37 +00:00
Giel van Schijndel 906f766b8a * When using a va_list multiple times make sure to va_copy it first
* Make sure to call va_end on all instances of va_list when we're done with it

Similar to r5930 (which fixed ticket:50)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5931 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 20:10:47 +00:00
Per Inge Mathisen 9699a5080f Improve logging from assert when number of context variables don't match.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5748 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 20:54:45 +00:00
Giel van Schijndel 231866a510 Allow compiling with Flex < 2.5.9, r5679 and patch #1089 broke this
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5692 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 13:34:00 +00:00
Giel van Schijndel 5f496b5b33 Allow (warning-less) compilation with Flex 2.5.33
Patch #1089 by Bertrand Coconnier <bcoconni>

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5679 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 13:34:58 +00:00
Roman C a412bf4b17 An attempt to fix "interpRunScript: max instruction count exceeded - infinite loop ?" error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5669 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 11:28:54 +00:00
Giel van Schijndel 0340c2d9c3 Make it possible for the ST_GROUP loading code in function scrValDefLoad to accept higher savegame event data versions than 3
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5668 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 00:55:23 +00:00
Giel van Schijndel 7d42778f80 Don't #define DEBUG_GROUP0 in places where it cannot possibly be used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5629 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:52:33 +00:00
Giel van Schijndel 30cbbefcbd Mark the #include from src/ in chat_lexer.l with a FIXME
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5533 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 19:22:11 +00:00
Giel van Schijndel 5526f2c61a * Move type OBJECT_POSITION (and macro POSITION_OBJ to declare it) from structuredef.h to the new file positiondef.h
* Update build systems: autotools, raw win32 makefiles, Code::Blocks project and MSVC project
 * Rename _droid and _base_object forward declaration types to DROID and BASE_OBJECT respectively
 * Add two forward declarations for BASE_OBJECT and DROID to scriptfuncs.h so that it can declare pointers to these types
 * src/messagedef.h depends on lib/ivis_common/ivisdef.h and src/positiondef.h so #include those
 * Don't #include stuff from src/ in lib/script/chat_processing.h
 * Remove all unnecessary #inlucdes from src/ from lib/script/chat_lexer.l

NOTE: Build systems not mentioned above might need updating.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5531 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 18:15:03 +00:00
Dennis Schridde 022315eef0 Hardcode top_srcdir to make building from non-topdir possible, dont depend on the touch command, fix LDFLAGS to not depend on the removed TARGET variable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5476 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:10:16 +00:00
Dennis Schridde 302a557478 Rename "raw" Makefiles to "win32" Makefiles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5402 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:29:04 +00:00
Dennis Schridde ec5aeaf3c7 Make "SCRIPT" release function just indirectly point to scriptFreeCode, so the function types are strictly compatible.
Clean scriptFreeCode's formating and remove unnecessary checks for ptr!=NULL before freeing.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5400 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:02:46 +00:00
Giel van Schijndel a7ab3d9982 Merge lexer rules for the script_lexer that match different forms of the same token (e.g. upper/lower case variants)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5353 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-02 11:29:19 +00:00
Dennis Schridde 45f23a4926 Merge commit 'HEAD@{3}'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5347 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 22:32:44 +00:00
Dennis Schridde 050ec39c11 Use the (also new in this commit) relative variants of the directories almost everywhere.
Exception is when generating the .wz files, where we need the path to the build directory and building a reverse relative path to $(srcdir) will be messy.
Also silence submake.mk a great deal.
Bug #11883 should be fixed now for the most part.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5325 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 23:41:52 +00:00
Dennis Schridde fd2bfb0e0f Prepare for another fix for parts of bug #11883: Issues with the improved raw Makefiles
- Rename Makefile.raw to lowercase


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5321 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 22:48:45 +00:00
Dennis Schridde 73b35ab8d6 Rename top_srcdir/top_builddir to abs_top_srcdir/abs_top_builddir, to make this more obvious.
Their use is currently flawed, since it will not work in directories with spaces in them... (


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5319 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 20:19:54 +00:00
Dennis Schridde 9bd8b24921 Boost raw Makefiles
- Use PACKAGE, PACKAGE_VERSION, remove VERSION
- Allow out-of-source-dir builds (mkdir build && cd build && make -f ../Makefile.raw)
- Move config.mk from $(top_srcdir)/makerules/config.mk to $(top_builddir)/config.mk
   When keeping current behaviour (srcdir=builddir), this means: Move it from makerules into the main directory


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5308 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 13:54:47 +00:00
Per Inge Mathisen 0d706d02fd Forward port workaround for eventRemoveContext crash from 2.1. This will leak some memory.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5260 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-16 20:38:26 +00:00
Per Inge Mathisen 8419a7008b Use calloc instead of malloc+memset, and make sure we clear the right memory.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5181 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 15:40:56 +00:00
Giel van Schijndel 855ec725d4 Use sstrcpy|sstrcat instead of strlcpy|strlcat for manipulation of statically sized strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5176 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 13:46:49 +00:00
Per Inge Mathisen 8243c4b2fb Fix the infamous eventRemoveContext crash.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5167 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-24 13:58:26 +00:00
Roman C d89f43106d Make sure we print out script call stack when division by zero occurs.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5152 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-23 14:29:11 +00:00
Giel van Schijndel 2102ab0475 Fix warnings: remove unused variables
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5144 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-20 19:57:26 +00:00
Roman C ebaecc07f6 Fix memory leaks in script_paryer.y the correct way.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5142 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-19 13:53:04 +00:00
Giel van Schijndel d53aa02117 * Use the lexer_input framework instead of a custom YY_INPUT implementation for audp_lexer.l
* Get rid of lexer function parseGetErrorData and use audp_get_lineno() and audp_get_text() instead
 * Add a WZ_DECL_FORMAT declaration to audp_error to enable GCC's printf format checking
 * In audp_error allocate the buffer on the stack using alloca() instead of an auto 1kB text buffer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5094 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 20:29:13 +00:00
Giel van Schijndel 1c4bafaa2b Let the chat_lexer do some more of the work by returning only a single _T_YES token for "yes", "yea", "yeah" and "yep"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5063 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 12:48:31 +00:00
Per Inge Mathisen 07c9062105 Cosmetic update of static globals
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5061 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 12:39:16 +00:00
Giel van Schijndel 9640d3b0a6 * Make sure to set psPrev to NULL at the start of the deletion loop
* Also don't dereference it when it's NULL


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5060 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 12:33:38 +00:00
Giel van Schijndel 58176b97bc * Fix GPL headers for some files which where wrongly marked as being Copyright Eidos Interactive in r1014
* Update file-level comment for chat_lexer.l for the change in r899 (i.e. the flex option `-i` doesn't need to be specified anymore)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5059 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 12:16:46 +00:00