Commit Graph

4537 Commits (f2bc3c056f2445ad9ba80889893dce82e01559e7)

Author SHA1 Message Date
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 dda033b53e Small refactoring and indentation fix to increase readability of gridIntersect
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5665 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 16:23:09 +00:00
Giel van Schijndel 88f428e37d * Make gridObjRange const correct
* Move commented out code into an #if 0 section (instead of /**/ comment)
 * Use function world_coord instead of manual multiplication by TILE_UNITS
 * Use the MAX macro to get the largest of two values (instead of manual comparison and selection of values)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5664 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 16:10:20 +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 032b630b22 * Make the ppTextMsg string arrays of VIEWDATA and SEQ_DISPLAY hold there strings as const references
* Don't use strdup() to assign the strings to ppTextMsg's message array
 * Make seq_AddTextForVideo const correct

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5659 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:42:45 +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
Freddie Witherden d9baa8d8b7 Break out of the droid sync loop early if there are no more droids to sync.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5653 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 14:11:14 +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 39d34b1880 Compiler warns about an uninitialized variable, `distanceExtensionFactor`, being used.
So initialize this variable with an "uninitialized marker" and assert that it doesn't occur in the places where this variable is used.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5651 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 13:59:07 +00:00
Freddie Witherden 6a94667dba Remove some dead #ifdef'ed code (#ifdef ARROWS).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5650 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 10:13:22 +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 0651625733 * Remove unused variable `line_num`
* win32 Makefile system:
  * Compile with debug symbols and all warnings enabled on both debug ''and'' non-debug builds
  * Only use -Werror-implicit-function-declaration when compiling C sources, as for C++ implicit function declarations are illegal anyway (and g++ thus doesn't like this compiler option)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5647 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-23 13:59:12 +00:00
Giel van Schijndel c1fb0af729 * -mwindows is a linker flag, so move it from CFLAGS and CXXFLAGS to LDFLAGS
* autorevision is a command line utility, not a GUI program, so strip the -mwindows flag from its linker flags

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5646 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-23 13:48:50 +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 7125ab811c Access OpenGL headers on Mac OSX through OpenGL/<header> instead of opengl/<header> (lower case)
This fixes a compile error reported by <ruud> on IRC

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5641 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 20:23:24 +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 de70b9ceb8 Add all translations in po/ to the NSIS installer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5633 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:29:49 +00:00
Giel van Schijndel cce9e1d768 Include the "Bold" face of DejaVu Sans Mono as well in the NSIS installer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5632 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:19:56 +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 410c511363 Don't duplicate $CFLAGS in $__BOTHFLAGS
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5624 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 23:22:36 +00:00
Giel van Schijndel 09f59a0200 Use some more options from the __BUILD_CONFIG.USER file in __BUILD_CONFIG
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5623 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 23:15:37 +00:00
Giel van Schijndel d71055a5e0 * Replace uses of strcpy, strcat and sprintf with sstrcpy, sstrcat and ssprintf where possible
* Merge a translation string into it's printf formatting string (i.e. make the format string the translated string)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5621 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:55 +00:00
Giel van Schijndel 1feee6ea95 Replace uses of "\n" and std::endl with uses of constant `endl`, which is defined to the platform's native line ending.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5620 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:50 +00:00
Giel van Schijndel d451b3f5a1 Remove the terminating newline ('\n') from ctime's output to allow different newline styles (e.g. "\r\n" on Windows)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5619 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:46 +00:00
Giel van Schijndel e029c11bb4 In the MinGW stack dumper, use dbgDumpHeader to dump a generic debug info header, instead of custom crafted (and duplicated) code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5618 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:26 +00:00
Giel van Schijndel 1311a3dc19 Don't define EXTDIR as a subdir of the devpackage, define it as the dir of the devpackage
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5613 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 16:18:34 +00:00
Giel van Schijndel 461c6f1002 Don't #include debug.h as we depend on dumpinfo.h instead (thus #include that file instead)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5612 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 15:27:17 +00:00
Giel van Schijndel 345bd3692d Allow UTF-8 strings in the sources when running xgettext over it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5610 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 13:50:48 +00:00
Steven Koenig 944ec2031b Checked every *.po for correct update of %u%% to %3.0f%% in "%s - Damage %u%%" to "%s - Damage %3.0f%%"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5605 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 07:07:00 +00:00
Steven Koenig a8fddd4c1a de.po:
* updated --> everything translated, 2 fuzzies left


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5604 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 05:32:16 +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 b26d8dd809 Add the most significant changes to the 2.1 branch to the 2.1_beta4 portion of the ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5593 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 20:25:49 +00:00
Giel van Schijndel 468320c140 Merge changelog changes of r5340 from the 2.1 branch into trunk
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5592 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 20:21:36 +00:00
Giel van Schijndel 8a4ccb21a7 Merge changelog changes of r5587 from the 2.1 branch into trunk
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5591 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 20:15:10 +00:00