Commit Graph

767 Commits (850cc41653e3514b2558833b3efdd5ddb43578bc)

Author SHA1 Message Date
Freddie Witherden 55be99a19d Add sync-to-vblank support to Warzone; this closes ticket #38.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5871 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:01:49 +00:00
Giel van Schijndel 173ee31214 * Split ASSERT out into ASSERT_HELPER:
* ASSERT_HELPER can be used by debug functions that wish to alter the location information attached and printed with ASSERTs
 * Add some missing semi-colons (the previous ASSERT macro had a terminating semi-colon)
 * Change an ASSERT that checks calloc's return value into an if() block (we can also run out of memory on non-debug builds...)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5865 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 15:42:59 +00:00
Giel van Schijndel 5e593ad615 Add platform detection code for GNU/kFreeBSD (OS with FreeBSD kernel and GNU utilities and libraries) to allow compiling on this system
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5794 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 15:29:44 +00:00
Per Inge Mathisen 6f89f25b80 Attempt fix for bug #12118: Could not find string for ID. Has high risk for creating
more asserts - please report them to me.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5781 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-07 15:40:21 +00:00
Giel van Schijndel 3eabf084ad Get rid of the ID number cruft in the string resource system:
* At the only place where these ID numbers where used (scrValDefSave and scrValDefLoad), use the key-string instead (e.g. "ZNULLBODY" instead of 17)
 * Rename function strresGetStringByID to strresGetString
 * Increment event save file version to 4 (version of savegame.es files)
 * Reject loading of savegames that need to load non-NULL ST_TEXTSTRING variables from version < 4

NOTE: This may break current savegames of games that use scripts with variables of type TEXTSTRING in them (AFAIK currently only ''some'' campaign and tutorial savegames have these).

This closes ticket:19

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5685 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 23:58:49 +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
Giel van Schijndel f2bc3c056f Change the debug message about a string that couldn't be found from an error message into a warning message because it seems to occur quite often
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5667 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 22:14:47 +00:00
Giel van Schijndel b40e7a6a90 Further hardcode the treap management code to the string resource system:
* Don't maintain a secondary linked list of strings in strres.c
 * Add the string that's tracked and it's ID number to the TREAP_NODE structure
 * Let the treap code manage its own memory
 * Have the treap code perform reverse lookups using either the resource string (i.e. not the "key" string) or associated ID number

NOTE: Searching a treap for anything else than the key is O(n), but that's no worse than a linked list, which is O(n) as well. Walking a treap has O(log n) as memory requirement, whereas walking a linked list has O(1) as memory requirement (stack size). So the only disadvantage is that searching the treap has a (highly remote!) possibility of stack overflows.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5666 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 20:27:54 +00:00
Giel van Schijndel e8e664f85a * Get rid of function strresGetIDString who's only purpose is to determine whether the given ID string has a string resource associated with it, and if so return a string that's equal (according to strcmp) to the passed in ID string
* Replace the only use of strresGetIDString with a call to function strresGetStringByID, which will also return NULL on failure to find the given ID string

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5663 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 21:12:43 +00:00
Giel van Schijndel 8a41fb89d3 Make function strresStoreString const correct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5662 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 21:12:39 +00:00
Giel van Schijndel a0e779ceb8 * Add a new function strresGetStringByID which combines the functionality of strresGetIDNum and strresGetString
* Get rid of function strresGetIDNum with its inconvenient API and use strresGetStringByID instead

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5661 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 20:10:16 +00:00
Giel van Schijndel 12e5120e69 Replace the linked list of arrays of string pointers (premature) optimisation with just a linked list of strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5660 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:57:09 +00:00
Giel van Schijndel 47d02a31da * Change strresGetString to return its string as const (to prevent potential double-free problems)
* Instead use strdup() where a non-const reference to these strings is used
  * NOTE: This may introduce memory leaks, but I'd rather have memory leaks than double-frees, of which I'm frankly surprised that they don't occur ''much'' more often
 * Change FindDroidTemplate to take its parameter as const
 * Don't multi-purpose the parameters of FindDroidTemplate as local variables
 * Store string variables in getName as const
 * scrvGetString:
  * Directly return the string it retrieved and use NULL to indicate failure
  * Return the string as `const'

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5658 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:18:07 +00:00
Giel van Schijndel da3c28efa2 * Move the allocation and initialisation of STR_ID structures to a function of its own: strresAllocIDStr
* Allocate STR_ID structures in such a way that a single free() call on it will suffice as cleanup

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5657 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:14 +00:00
Giel van Schijndel 8101f3bf5b * Change strresGetIDString to return its ID string const
* Change allocateName to do as the name suggests and actually ''allocate'' a string!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5656 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:08 +00:00
Giel van Schijndel e3a7f0cab8 Return the retrieved string from strresGetIDString and allocateName and use NULL to indicate failure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5655 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:03 +00:00
Giel van Schijndel e8efe132f8 * Get rid of global variable *psCurrRes, which is used by the strres_parser to operate on
* Instead pass the current STR_RES* pointer to work on to the parser function

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5654 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 14:16:27 +00:00
Giel van Schijndel 16e5fd8764 Get rid of the ID_ALLOC bitflag (marks strings allocated by the string resource system), as ''all'' strings are allocated by the string resource system anyway.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5652 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 13:59:16 +00:00
Giel van Schijndel 8eb2ed2827 Add some ASSERTs which I think should always hold true for the purpose of ''understanding'' the string resource code. As it's difficult to understand, due to it multi-purposing one variable to hold two semantically different values (at the same time!).
In any case I ''think'' these ASSERTs always hold true, (and for the testing I've done so far they do). But I'd like some more certainty and confirmation, hence why I'm committing this (before I make changes that rely on that assertion holding true), so other people get a chance to test this and prove my assertion wrong.

Thus, ''if'', these ASSERTs are triggered, please open a bugreport or otherwise notify me of it (e-mail, IRC, text message, postal mail, phone call, etc.)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5649 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-23 23:42:18 +00:00
Giel van Schijndel cf374ee5e1 * Move the definitions of the datatypes used by the string resource system from strres.h to strres.c
* Add a forward declaration for STR_RES to strres.h (so that we can still declare pointers to this type)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5645 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:36:23 +00:00
Giel van Schijndel d430c4b44d * Initialize global psStringRes to NULL
* Return the STR_RES* pointer from strresCreate and use NULL to indicate failure
 * Use size_t to store memory sizes in instead of UDWORD

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5644 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:33:10 +00:00
Giel van Schijndel 4f3c6d39a4 * Return the resulting STR_BLOCK* from strresAllocBlock and return NULL on failure
* Use calloc instead of a malloc followed by memset(0)
 * Check the return value from malloc&calloc for ''all'' invocations of it

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5643 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:14:48 +00:00
Giel van Schijndel 38f5b64c91 Add a new command line option: --flush-debug-stderr which causes the debug output to be flushed when used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5636 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:49:36 +00:00
Giel van Schijndel ef6fa22424 Fix a wrong call to calloc (parameter list was malloc style)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5631 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 01:00:37 +00:00
Giel van Schijndel f6a6179569 * Use calloc instead of malloc followed by memset(0)
* Use an unsigned int instead of UDWORD as we don't depend on the size guarantee
 * Move the definition of aUsage into #ifdef DEBUG_CHECK_FOR_UNUSED_STRINGS, because that's the only place where it's used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5630 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:57:32 +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 a3ecb8a325 Get rid of the custom TREAP* structure and instead use a pointer to a pointer to a TREAP_NODE** structure
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5628 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:43:33 +00:00
Giel van Schijndel 7c8789f108 * Don't associate line number and file information with calls to treapAdd, as it is only called once
* Replace use of the forwarding macro TREAP_ADD with a direct call to treapAdd
 * Remove treap debugging code (actually that's what the above changes effectively accomplished)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5627 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:30:55 +00:00
Giel van Schijndel b94c297371 * Don't associate line number and file information with calls to treapCreate, as it is only called once
* Replace use of the forwarding macro TREAP_CREATE with a direct call to treapCreate
 * Return the TREAP* pointer directly from treapCreate and use NULL as an indicator for failure

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5626 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:23:36 +00:00
Giel van Schijndel d22a2dcf82 Add table entries to the language tables in i18n.c for the newly added translations of r5596:5597
* Basque (eu)
 * Latvian (lv)
 * Norwegian Nynorsk (nn)
 * Slovenian (sl)
 * Swedish Sweden (se_SE)
 * Turkish (tr)
 * Uzbek Cyrillic (uz)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5599 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 22:23:06 +00:00
Giel van Schijndel 3814e5f511 * Update the locale lists for Windows and Unix: add all languages in po/ to them
* Change the Windows locale list to allow specifying sublanguages as well


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5598 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 22:01:20 +00:00
Giel van Schijndel 1b8a62deca Make the treap code specific for string resources
Because the treap management code is only used by the code for string resources, make it specific for these string resources and don't use casting back & forth from void* all over the place. This simplifies the interaction of string resource code with treap code.

This will allow an easier cleanup and eventually a removal of string resource code. As the string resource code can eventually be replaced with gettext code instead.

This closes #18

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5586 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 19:15:02 +00:00
Giel van Schijndel ed3f1508b8 * Remove the dumpLog function and associated code from debug.c
* Add a new function dbgDumpLog to dumpinfo.cpp for dumping the last debug messages
 * Add a debug output callback to dumpinfo.cpp which is used to fetch the debug messages and store them in a ring buffer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5581 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 01:08:07 +00:00
Giel van Schijndel 859196ed2c Move duplicated code, for printing to ''all'' debug output callbacks, to a function of its own.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5580 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 23:13:49 +00:00
Giel van Schijndel 9d77329842 * Add a new statically-sized string macro vssprintf, which allows printing to statically sized strings just like ssprintf, with as difference that this macro function operates similar to vsprintf rather than sprintf
* Replace uses of strncmp, snprintf and vsnprintf with sstrcmp, ssprintf and vssprintf respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5579 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 22:47:28 +00:00
Giel van Schijndel 0d670c0409 Don't bother checking whether bitflag ID_ALLOC is set before removing it, the end result is the same anyway: ID_ALLOC being absent from the bitmask/number
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5558 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-15 11:46:12 +00:00
Giel van Schijndel d7a0c2fa9b Don't bother checking whether bitflag ID_ALLOC is set before removing it, the end result is the same anyway: ID_ALLOC being absent from the bitmask/number
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5553 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 23:17:23 +00:00
Giel van Schijndel 0c4b256797 * Out with the (unnecessary! as the size guarantee isn't required) WORDs from treap.[ch]
* Restructure treapStringCmp to be __readable__

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5551 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 22:09:31 +00:00
Giel van Schijndel 8db7c031ff Fix some compile errors that occur when DEBUG_TREAP is #defined
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5550 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 22:09:15 +00:00
Giel van Schijndel 379a905c6c * Move the type definitions of TREAP_NODE and TREAP from treap.h to treap.c (use a forward declaration in the header instead)
* Don't strdup strings retrieved from __FILE__ directives; just store const char* the pointer instead (prevents a memory leak as well)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5549 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 20:41:22 +00:00
Giel van Schijndel 9e70aaf07c Get rid of macro TREAP_NODE_DEBUG and move its contents to the only location where it's used: struct TREAP_NODE
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5548 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 20:25:48 +00:00
Giel van Schijndel 077d4efefe * Remove unused functions treapReset, treapDisplayRec and treapDisplay
* Remove unused macro TREAP_DISPLAY
 * Directly use function treapGetSmallest, treapDel, treapFind and treapDestroy instead of macros TREAP_GETSMALLEST, TREAP_DEL, TREAP_FIND and TREAP_DESTROY respectively

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5547 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 20:22:19 +00:00
Giel van Schijndel 9f3371dc33 Remove macro TREAP_NODE_BASE and move its contents directly into TREAP_NODE as that's the only place where this macro is used.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5546 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 17:53:03 +00:00
Giel van Schijndel 6e9db52984 Get rid of the unused, default comparison function for the values in treap nodes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5545 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 17:49:10 +00:00
Giel van Schijndel 730188c081 * Get rid of treapint.h which declares prototypes for functions that are only used in treap.c.
* Declare these functions with static linkage instead.
 * Update autotools buildsystem, Code::Blocks project and MSVC project, raw win32 Makefiles don't need an update

NOTE: This may require updating of buildsystems not mentioned above

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5544 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 15:19:08 +00:00
Giel van Schijndel 514d96d72a * Don't #inlcude treap.h in frame.h as only a single file within Warzone depends on the treap code
* Use a forward declaration in strres.h to declare a pointer to a TREAP instead of importing the full treap.h declarations in strres.h and thus large portions of the codebase
 * Rename TREAP's forward declaration name from _treap to TREAP

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5543 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 15:09:00 +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 6b8aeb1aaa Add clipf() to clip float values
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5348 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-29 12:07:26 +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 452b737b64 Output gameTime for debug messages. Should make it easier to recognize relevant messages and their relation over time.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5317 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 18:07:45 +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
Giel van Schijndel 3b4df24942 Use WZ_DECL_UNUSED for the data parameter of debug_callback_win32debug to squelch the warning about it being unused
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5211 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-04 17:50:40 +00:00
Dennis Schridde 8836ce7a4b warning: converting of negative value `-0x000000001' to `UDWORD'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5206 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-31 23:17:27 +00:00
Giel van Schijndel 19b80a1a6b Make sure to parse `database` __before__ `file` (i.e. group it with other tokens starting with a `d`) to make sure that it gets recognised at all
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5198 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-28 20:55:49 +00:00
Giel van Schijndel c0296aa371 * Apparently the %destructor feature of Bison is implemented differently for 2.1 than it is for 2.3 (or it is broken in 2.1); so don't use it when compiling with Bison 2.1 (leak memory instead)
* Assume __all__ windows builds use Bison 2.1 (this isn't correct, but it's the best I can currently do, as Bison provides no version macros aside from a string macro)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5196 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-27 21:37:54 +00:00
Giel van Schijndel 1d739ce56b * Pass the table name as well from the .wrf resource file
* "table" will now attempt to load the given resource type from the given table (in the currently opened database)
 * Maintain the current database's name (for error message, etc.)
 * Pass the table name to the database loading functions and use it (in combination with sqlite3_mprintf) to produce the SQL statements


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5189 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 19:38:59 +00:00
Giel van Schijndel 452c167e9a * Add a new resource loading function type: RES_TABLELOAD
* Add two new keywords to the .wrf files: "database" and "table"
  * "database" will cause the given filename to be opened as a database file (using SQLite3)
  * "table" will attempt to load the given resource type from the currently opened database
 * Don't open the database in the file loading functions (src/data.c) anymore; turn them in table loading functions instead (which get the current database passed as a paramter)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5188 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 19:38:53 +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 4d845c8067 Fix debug log calls going off when they shouldn't
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5147 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-22 19:33:05 +00:00
Dennis Schridde f94ee4683d *cough*
rad2deg should not look like deg2rad...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5146 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-22 18:27:48 +00:00
Giel van Schijndel 0118573321 Work around Flex 2.5.33 implicitly defining yyget_extra() (rather than forward declaring it)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5130 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-17 10:49:33 +00:00
Dennis Schridde b77dfdadad Simplification and slight speedup for trigSin/trigCos. Make trigIntSqrt wrap sqrtf, since the old lookup implementation was probably slower than that.
Author: Björn Bredthauer <Bjoern.Bredthauer@gmx.de>
Date: Thu, 15 May 2008 01:28:55 +0200
Signed-off-by: Dennis Schridde <devurandom@gna.org>


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5122 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-15 00:19:47 +00:00
Dennis Schridde 2334f84c84 Remove unneccessary modulo
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5120 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-14 22:59:00 +00:00
Dennis Schridde be2b8a35ab clip() function for integers (Like CLIP macro) and some slightly altered comments/variable names.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5104 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-13 23:19:10 +00:00
Giel van Schijndel 7be6f76ba3 Remove our own custom definition of YYLMAX (give Flex the liberty of determining this itself)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5091 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 19:55:55 +00:00
Giel van Schijndel f8e4607093 Fix an error causing us to use the wrong names for yyget_extra(), yyset_extra(), yyget_lineno() and yyget_text()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5089 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 19:40:53 +00:00
Giel van Schijndel 10f021f279 Fix a syntax error introduced in r5086
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5087 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:58:41 +00:00
Giel van Schijndel 59a1c05037 Cleanup:
* Remove our own strcpy implementation: stringCpy
 * Don't use "d = malloc(strlen(s) + 1); strcpy(d, s);" to copy a string into fresh heap memory, use "d = strdup(s);" instead
 * Fix indentation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5086 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:56:42 +00:00
Giel van Schijndel 942350278b * Put textual tokens as found by strres_lexer.l in heap memory rather than some crazy stack-like static string buffer
* Make sure that this heap memory __will__ be released regardless of syntax errors during scanning
 * Reduce code duplication in strres_parser.y by reducing a single parsing rule with duplicated code up into two rules


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5085 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:47:25 +00:00
Giel van Schijndel dfaf3cea17 * Use yytext instead of strres_text
* Get rid of lexer function strresGetErrorData and use strres_get_lineno() and strres_get_text() instead
 * Don't call abort() in function strres_error as the parser will return an error anyway (causing strresLoad to return false)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5084 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:35:36 +00:00
Giel van Schijndel fdc48bfc94 * Use the lexer_input framework instead of a custom YY_INPUT implementation for strres_lexer.l
* Don't bother to check whether we're in a comment when reaching the end of a string resource file


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5083 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:22:05 +00:00
Giel van Schijndel fae3c7da53 Don't duplicate code that appears in both branches of an if-statement
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5082 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:16:30 +00:00
Giel van Schijndel 2f98b6e39a Minor cleanup and add Doxygen comments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5081 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:09:25 +00:00
Giel van Schijndel 251317bd9a Cleanup (behaviour should be unchanged)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5080 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:03:26 +00:00
Giel van Schijndel d73949e336 * Put textual tokens as found by resource_lexer.l in heap memory rather than some crazy stack-like static string buffer
* Make sure that this heap memory __will__ be released regardless of syntax errors during scanning


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5079 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:00:09 +00:00
Giel van Schijndel 636bce3996 From resource_parser.y: "No longer static ... lets use this area globally":
* Lets __not__ use very bad practices just because we can!!! Make it static again
 * Give strres_lexer.l such an array of its own (static as well)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5077 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:50:49 +00:00
Giel van Schijndel 7caf01c08f Use yytext instead of res_text
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5075 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:41:00 +00:00
Giel van Schijndel 1aed007c3e Attempt to match an empty string __before__ a non-empty one (otherwise we won't ever match it at all)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5074 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:38:45 +00:00
Giel van Schijndel 6bb4f86529 * Get rid of lexer function resGetErrorData and use res_get_lineno() and res_get_text() instead
* Don't call abort() in function res_error as the parser will return an error anyway (causing resLoad to return false)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5073 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:34:56 +00:00
Giel van Schijndel f7419596e2 * Use the lexer_input framework instead of a custom YY_INPUT implementation for resource_lexer.l
* Don't add the function name to the debug message in openLoadFile as debug() does that itself already


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5072 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:23:33 +00:00
Giel van Schijndel 78f93d3055 Reduce code duplication that occurs in both branches of an if-statement
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5071 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:13:11 +00:00
Giel van Schijndel 6bd36ba163 Don't bother to check whether we're in a comment when reaching the end of a WRF file
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5070 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:04:32 +00:00
Per Inge Mathisen 36e2ff2517 Update changelog in trunk as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5056 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 22:11:28 +00:00
Roman C fcfae543ba Revert r5043 because of compilation problems on non-MSVC systems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5049 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 15:25:43 +00:00
Per Inge Mathisen 91727f270b objTrace() no longer requires a debug part parameter, and always outputs the ID
of the traced droid.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5047 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 14:58:20 +00:00
Roman C da83c65c9c Output script call stack on ASSERT.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5043 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 11:51:23 +00:00
Roman C b40f5dd5a3 Get rid of some more compiler warnings on MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5032 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 10:17:49 +00:00
Giel van Schijndel 701f65469c * Provide an abstraction of YY_INPUT so that we have a single definition which we can use in multiple lexers which can read from both in-memory buffers as well as PhysicsFS files
* Utilise this new version of YY_INPUT in script_parser and script_lexer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5008 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-10 00:35:24 +00:00
Giel van Schijndel b58d508ce6 Doxygenize the parameterlist of frameInitialise
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4943 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-05 23:17:35 +00:00
Giel van Schijndel 01958db9a0 We don't #define HAVE_STRLCPY or HAVE_STRLCAT in the configure script anymore
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4939 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-05 15:12:32 +00:00
Roman C 2c7d52d0c8 Fix MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:55:05 +00:00
Per Inge Mathisen 221a2cb4ee Remove MSVC support for WZ_DECL_CONST since it didn't work.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4913 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:34:20 +00:00
Per Inge Mathisen 6e9732a86a WZ_DECL_CONST now implies WZ_DECL_WARN_UNUSED_RESULT and also works on MSVC.
WZ_DECL_RESTRICT now works on MSVC as well.
WZ_DECL_THREAD added, declares variables thread local, support for it made mandatory.
WZ_ASSERT_STATIC_STRING (gcc only) to assert that a string is static added.
The sstr functions now support pointer-length strings again.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4908 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:43:28 +00:00
Giel van Schijndel 31fda8026b Don't call function pointers when they're NULL (fixes a segfault bug that occurs when a resource type without release function couldn't be loaded)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4896 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 10:24:36 +00:00
Giel van Schijndel 03bc81c0fb #include "frame.h" in strlfuncs.h; to hopefully fix bug #11609
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4889 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:59:35 +00:00
Giel van Schijndel 5154d575da Assert that the pointers to strlcpy & strlcat are not NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4878 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:38:44 +00:00
Giel van Schijndel b9857f9bf9 Detect whether the OS already supplies strlcpy and strlcat and don't define our own if it does:
* Add m4 macros AC_STRLCPY_CHECK and AC_STRLCAT_CHECK for use in the autoconf script
 * Don't define our implementation when HAVE_STRLCPY or HAVE_STRLCAT is defined

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4876 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:04:20 +00:00
Per Inge Mathisen 5034cedfd4 Rename astrlcpy and astrlcat to sstrcpy and sstrcat. Add ssprintf and sstrcmp also.
Renaming due to name conflict with a gnu extension. Added debug versions of all the
above, that assert if a char* pointer is passed in. This means they cannot be used
with strings shorter than the shortest expected length of void*.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4865 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-30 17:26:38 +00:00
Roman C c3ace2ec9f Redefine __STDC__ to 1, this fixes MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4855 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 15:05:08 +00:00
Giel van Schijndel b047f2c1ef Work around MSVC not #defining __STDC__ (all ISO C89 compliant compiles _should_ #define that macro)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4854 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 14:32:14 +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
Per Inge Mathisen 914cf90fb4 Add macros astrlcpy and astrlcat that work like strlcpy and strlcat
but with automatic length detection for fixed size arrays.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4777 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 12:08:30 +00:00
Giel van Schijndel 73fcb5eb6a Enable NLS for our parsers when it's enabled for us (using --enable-nls)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4700 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 16:38:27 +00:00
Per Inge Mathisen f0226edf93 Add new debug level for messages and new log calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4685 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-19 21:41:18 +00:00
Per Inge Mathisen 28669696a4 Clean up debug log. We now print the function name first automatically - no need to
put that into the debug call. Rename some categories to make them line up correctly in log.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4684 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-19 14:52:35 +00:00
Per Inge Mathisen 69a4b6a380 Fix bug #11520: crash when saving the game in campaign mission alpha 4, reported
by Jan Dittberner. If a tagfile group had only default values, it would consume
the group end tag and the rest of the file would be read corrupt.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4681 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-18 20:43:07 +00:00
Giel van Schijndel 1585b7d55a Add a workaround for the X11 headers #defining Status (i.e. #undef it), to prevent problems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4672 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-17 20:55:46 +00:00
Giel van Schijndel c6a0ad011e restrict is not a keyword to C++, so don't use it when compiling as C++
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4615 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-14 21:39:14 +00:00
Giel van Schijndel ff663196a3 * Forward declare debug_callback_win32debug when compiling for Windows
* Don't define windowsExceptionHandler when compiling with MinGW (as we don't use it on MinGW)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4587 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-13 22:54:58 +00:00
Per Inge Mathisen f64e3a8033 Fix bug in tagfile where we would not skip boolean values properly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4542 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-07 20:01:56 +00:00
Roman C ab1629285b Fix MSVC compilation. Patch by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4533 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 16:07:36 +00:00
Per Inge Mathisen 0edf5f08e5 Fix erronous handling of skipped group separators in the tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4527 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 13:14:12 +00:00
Per Inge Mathisen 8dca456c24 Fix bug in tagfile code. We would not properly skip groups that we did not intend to read.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4526 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 12:13:41 +00:00
Ari Johnson 685948940e Fixed cursors16.c to work again
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4525 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 03:20:27 +00:00
Giel van Schijndel 678edfead2 Provide an alternative `dumpLog` implementation:
* one that works with the POSIX write() syscall on an integer file descriptor
 * and one that works with WinAPI's WriteFile() function on a HANDLE

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4513 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 23:37:46 +00:00
Per Inge Mathisen 3dafc4e62a Fix some warnings generated by -Wextra
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4492 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 16:22:05 +00:00
Per Inge Mathisen 274ae7c9a4 Enforce strict function prototypes for autoconf builds, and fix function prototype problems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4487 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 15:34:55 +00:00
Giel van Schijndel 665e57dc12 Move the exceptionhandler to a directory of its own
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4484 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 15:11:43 +00:00
Per Inge Mathisen b41b7358b7 Add safer, proven versions of strlcpy and strlcat from OpenBSD.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4483 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 11:45:29 +00:00
Roman C 0ee1e1b965 Fixed warnings on MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4469 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-02 17:39:42 +00:00
Roman C 4f0e59e488 Remove ENABLE_NLS, since it breaks compilation on MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4467 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 20:00:47 +00:00
Dennis Schridde b2d8cd5187 ENABLE_NLS for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4464 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 17:14:17 +00:00
Freddie Witherden 59f951b0bc Update the arrayMin[F] functions so that they now return the min value and set the index. Also add arrayMax[F] versions.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4461 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 11:26:53 +00:00
Freddie Witherden 4e0c1dbafd arrayMinIndex: now in float form\!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4460 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-31 23:16:01 +00:00
Freddie Witherden 0587cf8674 A the helper arrayMinIndex, which will return the lowest item in an array of ints.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4459 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-31 22:58:34 +00:00
Per Inge Mathisen 3ee8a3ed7f Add beginnings of a game self-test. Start with --selftest command line option.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4433 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-30 14:36:11 +00:00
Giel van Schijndel 9002fb5953 * Rename frameSetCursorFromRes to frameSetCursor
* Make frameSetCursor take a CURSOR (an enum) parameter instead of SWORD


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4432 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-30 14:11:33 +00:00
Giel van Schijndel 39b6c60501 * Change and clean up the cursors API
* Get rid of resource.h which duplicated code and as such was a maintenance hell/burden


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4422 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-30 13:23:11 +00:00
Giel van Schijndel c7b40d8566 Revert r4416
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4417 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-29 18:46:37 +00:00
Giel van Schijndel ad68743327 Temporarily disable -Wmissing-declarations for lib/framework
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4416 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-29 18:33:05 +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
Giel van Schijndel db7f049617 Const correctness
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4401 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 22:21:37 +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 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 65b9f9b204 r4351: Port memleak fixes from 2.1
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4353 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 12:49:51 +00:00
Dennis Schridde c7a9f0f166 Give the bool2string function back...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4337 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-25 23:54:28 +00:00
Dennis Schridde dddbb92429 Move bool2string() conversion function from tagfile.c to frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4331 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-25 14:41:04 +00:00
Dennis Schridde 927c82aed0 C89 requires NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4315 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 17:19:47 +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
Dennis Schridde 9b94b011bb Better definition of a NULL pointer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4310 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:44:59 +00:00
Giel van Schijndel ad67fb8533 Revert the disabling of the exceptionhandler in r4304
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4305 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 15:41:34 +00:00
Giel van Schijndel dcc1536f58 Backport r4221 from the 2.1 branch to trunk:
* Fix warning regarding array bounds


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4304 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 15:40:13 +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
Dennis Schridde 1e26e33fc4 Make it look *exactly* how it looked before my commit... Maybe that finally fixes MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4274 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 20:16:13 +00:00
Dennis Schridde 5beaf745bf Fix missing identifier LC_MESSAGES for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4269 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 19:29:41 +00:00
Dennis Schridde f8b62a6e77 Simplify i18n handling by moving all system dependend stuff into lowlevel functions.
Support changing the language via the menu on Windows.
Don't save the language name to the config file. Use the ISO639 style identifier instead.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4268 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 19:22:09 +00:00
Giel van Schijndel 535e12a5ef When failing to load a resource (WRF), generate a debug message about what file failed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4252 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 15:55:36 +00:00
Per Inge Mathisen f698bf5fa7 Set LANG environment variable when changing languages. Attempt to fix
the i18n menu option for Windows users.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4246 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 14:18:23 +00:00
Dennis Schridde 2ba55d14a8 Record the time of compilation, too.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4233 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 00:05:41 +00:00
Dennis Schridde 6e89ffe22b Forgot to include physfs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4231 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 19:11:29 +00:00
Per Inge Mathisen 6185741b66 patch #1018: Experimental language selection menu option.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4230 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 18:30:08 +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
Giel van Schijndel 57389641e7 Remove the last content of deliverance.h (#define MAX_STR_LENGTH 256) to wzglobal.h and remove it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4219 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-21 23:02:22 +00:00
Dennis Schridde 9ca4445189 We always only have either config.h or config-macosx.h, but not both.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4207 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-21 16:38:57 +00:00
Dennis Schridde 0c5ecc0efb Fix bug #11277: Strings containing non-ascii characters missing
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4118 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-17 07:23:48 +00:00
Christian Ohm 3dbd10b277 Add newlines to two files to shut up gcc.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4109 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 14:23:44 +00:00
Dennis Schridde 81f54bdbfd We should add those files we #include...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4108 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 12:56:45 +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 a3d8cdbdb2 New include order in frame.h. This should fix msvc problems hopefully.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4096 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 03:10:05 +00:00
Dennis Schridde 9e38b3c9f0 Port r4093 and r4094 from 2.1: Cleanup frame.c headers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4095 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 02:46:03 +00:00
Giel van Schijndel cc0c897d47 Add i18n.[ch] to the raw makefile system and the Code::Blocks projectfile
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4084 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 00:20:35 +00:00
Dennis Schridde fe1a470ca1 Actually add the i18n.[ch] files...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4073 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 17:53:10 +00:00
Dennis Schridde a5643b359c Move i18n stuff into i18n.[ch] and cleanup headers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4068 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 17:36:50 +00:00
Dennis Schridde 9f5168e9dd Some generic cleanup-style things
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4066 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 17:05:15 +00:00
Dennis Schridde 74bb1a185b Revert r4061 (accidential commit)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4062 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 15:04:27 +00:00
Dennis Schridde 7e93a664b8 Move packaging -> pkg
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4061 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 14:57:35 +00:00
Dennis Schridde e32e928c38 Remove missing ftol() and add some docs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4055 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 11:40:35 +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
Dennis Schridde 303895e5fb Mark all BASE_OBJECT "derived" types as WZ_DECL_MAY_ALIAS (they may alias with any type).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4011 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-11 15:53:45 +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
Per Inge Mathisen 916435094f Add message to MSVC users about disabled warnings. Patch #995 from Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3967 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-09 10:06:05 +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 056147b16d Oh my beauty...
Please don't clutter the detection code with platform specific fixes... That's what the /* ---- Platform specific setup ---- */ section is for...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3948 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 21:51:53 +00:00
Per Inge Mathisen dfad738d65 Fix most MSVC warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3947 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 19:26:19 +00:00
Dennis Schridde 0c79f4b551 Simplify roundf() guards
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3946 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 18:45:56 +00:00
Per Inge Mathisen d8787a14e9 Allow for non-GNU C99 compilers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3945 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 18:37:59 +00:00
Per Inge Mathisen 51ca960ed5 Add -Wmissing-field-initializers, fix missing field initializers, and make source
compile even if GCC is not C99 compatible.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3944 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 18:27:43 +00:00
Dennis Schridde da462b4511 More float specialisation and generic cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3937 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 12:42:42 +00:00
Dennis Schridde 8fc819377a Move generic math functions from trig.h to math-help.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3935 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 12:17:11 +00:00
This file is free software, distributed under the terms of the GNU 90f0c23fc9 Port r3878 and r3879 from trunk/
Update gettext.h to 0.17. This changes its license from LGPL2+ to GPL2+ !

Update gettext files to versions found in 0.17

Deleted:
m4/ulonglong.m4 - Superceeded by longlong.m4
m4/signed.m4 - Had no users
m4/isc-posix.m4 - Superceeded by autoconf-2.53
m4/inttypes.m4 - Had no users
m4/longdouble.m4 - Also unneeded

m4/intmax.m4, m4/lib-prefix.m4, m4/lib-link.m4, m4/printf-posix.m4, m4/xsize.m4, m4/lib-ld.m4, m4/lcmessage.m4, m4/wint_t.m4, m4/inttypes-pri.m4, m4/progtest.m4, m4/uintmax_t.m4, m4/stdint_h.m4, m4/intdiv0.m4, m4/iconv.m4, m4/po.m4, m4/longlong.m4, m4/size_max.m4, m4/glibc21.m4, m4/inttypes_h.m4, m4/codeset.m4, m4/wchar_t.m4, m4/nls.m4
change in license from:
 This file is free software, distributed under the terms of the GNU
 General Public License.  As a special exception to the GNU General
 Public License, this file may be distributed as part of a program
 that contains a configuration script generated by Autoconf, under
 the same distribution terms as the rest of that program.
to:
 This file is free software; the Free Software Foundation
 gives unlimited permission to copy and/or distribute it,
 with or without modifications, as long as this notice is preserved.

This removes any GPL licensed files from m4/

po/Makefile.in.in recieved my MSGMERGE_OPTIONS again after update.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3882 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-01 13:04:16 +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
Giel van Schijndel 23230caf2a * Revert r3804 (replaces usage of strnlen with strnlen with the unsafe strlen)"
* Finish r3795 where I nicely #included the correct files but forgot to replace strnlen with strnlen1 - 1


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3805 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 17:57:43 +00:00
Ari Johnson 66f662e16a Removed usage of GNU extension strnlen()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3804 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 17:48:13 +00:00
Per Inge Mathisen ce473ed9fe Add some more doxygen comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3796 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 13:05:34 +00:00
Giel van Schijndel 33759c07c4 Don't use `strnlen` in debug.c as it's a GNU extension (and as such isn't always available), instead use `strnlen1 - 1`
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3795 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 11:53:25 +00:00
Giel van Schijndel 22844d16a6 Undo the (accidental) exceptionhandler disabling of r3784
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-15 19:44:40 +00:00
Giel van Schijndel 2322fe0920 Undo my "fix" in r3782, as it wasn't a fix but a breakage
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3784 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-15 19:43:53 +00:00
Per Inge Mathisen b92c8c5a33 Dumpt the last two log message calls into the exception handler report.
This way we get to see the message given by asserts in the dump file.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3781 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-14 22:07:53 +00:00
Per Inge Mathisen 79d13e4d14 Fix typo in exceptionhandler giving noise (at best) in exception output.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3778 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-14 20:50:39 +00:00
Per Inge Mathisen 917187ca7d Clean out some excess global defines.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3753 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 16:23:20 +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
Giel van Schijndel 6e74be4df9 Use C linkage for frameresource.h and debug.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3629 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-01 21:26:37 +00:00
Giel van Schijndel 07359499ab Don't define our own custom implementation when compiling with g++ either
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3628 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-01 21:01:23 +00:00