Commit Graph

1359 Commits (b2b33bbed4e5625e77de5aed6622781c9b89f02e)

Author SHA1 Message Date
Giel van Schijndel b2b33bbed4 * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
* modify createDroid, createFeature and createStruct to use a NULL pointer as failure notification rather than FALSE
 * get rid of createStructFunc and removeStructFunc which where nothing more than fancy malloc and free wrappers

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1864 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:50:18 +00:00
Ari Johnson 74ab4f8787 Warning linting for MacOS X
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1863 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:17:57 +00:00
Ari Johnson b254cea724 Updated Xcode project
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1862 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:17:36 +00:00
Giel van Schijndel 7a4309c41c * update POTFILES.in for r1859
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1861 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:05:31 +00:00
Giel van Schijndel 66746c4078 * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
* Fix a syntax error (missing brace)
 * Code cleanup: put curly braces on their own line
 * remove a copy&pasted switch statement, and merged it into the switch directly above (all case labels and break statements where _exactly_ the same, only the statements executed where different)
 * Use #if 0;#endif for commenting out code instead of /*;*/
 * move some vars in the most local scope where they're used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1860 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:59:04 +00:00
Per Inge Mathisen 5c23008ee0 Remove the unused 2D map editing code. We are never going there... Notice
that files are removed, so rerun your build systems!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1859 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:49:55 +00:00
Per Inge Mathisen 42ea71702d Add two new check macros, CHECK_OBJECT and CHECK_PROJECTILE, and sprinkle them over the code.
This will cause many new asserts, but easier to track down bugs. To find if a bug is caused
by too early object destruction, use "--debug memory" and compare with pointers such as 
"psObj-psDest" (one frequent offender in projectiles).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1858 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 20:27:10 +00:00
Per Inge Mathisen 9c820a0435 Cleanup of object memory system. Remove unused morgue code, and use unused list
checking function in debug mode. Factorise duplicated code. Remove unused defines.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1857 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 19:49:19 +00:00
Giel van Schijndel ea325b35ce oops forgot to commit this along with r1855:
* modify accessing a global var to using a set function instead

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1856 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 19:41:43 +00:00
Giel van Schijndel 05156439fd * Task #5192: Audit some files for failure to set global pointers to NULL after having called free(global pointer)
* Mark some global pointers/vars for static linkage (the less global, and more local they are, the better!)
 * Add include guards to some files
 * Some code cleanup: braces on their own line
 * loadFile2 now doesn't free memory it didn't allocate itself anymore
 * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
 * Don't assert(pointed_to_data != 0xdddddddd) since that method of detecting usage of dangling pointers only works with MSVC, while MSVC's free() probably (i.e. if it is sane) implementation does this check itself already

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1855 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 19:21:52 +00:00
Dennis Schridde 6a43986828 Remove POSIX deprecation warnings for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1854 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 19:03:43 +00:00
Giel van Schijndel 91adc1ba44 * Task #5192: Audit some files for failure to set global pointers to NULL after having called free(global pointer)
* Mark some global pointers/vars for static linkage (the less global, and more local they are, the better!)
 * Some code cleanup: 4 spaces -> TAB, braces on their own line
 * Don't `if (pointer != NULL) free(pointer);` since free(NULL) is very much legal as well (and more readable IMO)
 * move some vars in the most local scope where they're used
 * make ResearchRelease return void rather than BOOL, since all calling functions ignored its result; plus the function itself never returned anything else than TRUE

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1853 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 18:22:57 +00:00
Per Inge Mathisen 1edba5809f More globals free() auditing
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1852 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 18:58:14 +00:00
Per Inge Mathisen 9567ce6391 Add hack to make ./configure --enable-debug=yes work on 64bit CPUs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1851 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 18:02:56 +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
Per Inge Mathisen 6b9e5043be Audit some files for failures to set global pointers to NULL after calls
to free()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1849 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 17:18:56 +00:00
Per Inge Mathisen 80026d553c Tiny cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1848 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 17:16:26 +00:00
Per Inge Mathisen 8a84301e9a Fix bug #9262 where the game would fail when loading savegames because I
expected that an oil derrick would always be placed on top of an oil feature.
This is not the case when loading games, however. In this case, the oil is gone.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1847 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 16:22:50 +00:00
Per Inge Mathisen a06b1f8b53 Add recovery fallback for non-debug builds for bug #9262. It will
still assert, though. We need to figure out why it sometimes wants
to build derricks on tiles that do not have oil.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1846 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-11 20:31:36 +00:00
Giel van Schijndel b28d8bbdf6 * Fix array out of bounds access
patch by vs2k5

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1845 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-11 01:04:39 +00:00
Ari Johnson 15a89809d2 Improvement to how Xcode project invokes gcc with --std=gnu99
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1844 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-09 22:53:26 +00:00
Giel van Schijndel 239ea11701 Fix MSVC compilability:
* Declare vars at the beginning of the block

Hinted at the problem by vs2k5

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1843 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-09 21:54:15 +00:00
Per Inge Mathisen f537ad65fb Add a bunch of default m4 macros to ease compilation under some distributions.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1842 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-09 16:20:46 +00:00
Gerard Krol c1afb761f1 PIE import and export scripts. The import script is adapted from Rodzilla. Place these in your ~/.blender/scripts folder and enjoy. Supported:
connectors, team colors (using a second UV layer). Not supported: animations of any kind.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1840 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-08 18:05:16 +00:00
Dennis Schridde d11f659b71 Debian-ChangeLog update. Thanks Jocke.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1839 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-08 00:43:43 +00:00
Dennis Schridde e305f2a566 Move icons and desktop into /icons/. Autotools work, Debian buildscripts may need further adjustments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1838 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-07 22:51:52 +00:00
Giel van Schijndel c5f107c36b * 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@1837 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-07 18:31:42 +00:00
Giel van Schijndel 0378115e2b * Change variable names to more meaningfull names
* Add explaining comments
 * Remove some pieces of commented out code that only help us stand a better chance at winning the "Obfuscated C" contest
 * Get rid of some copy&pasted code which only has minor differences, and use a more general of the two copies instead
 * Remove armourDamage (held damage dealt to an object's armor) since it wasn't ever used

Cleanup part of patch #745 by Freddie Witherden <EvilGuru>
Plus additional modifications by myself

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1836 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-07 17:01:21 +00:00
Giel van Schijndel 7ede8f9fa1 * Add an assertion to check for NULL pointers (this seems to happen a lot when loading games lately)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1835 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 22:47:22 +00:00
Giel van Schijndel b6744218fb Cleanup:
* Remove some commented out lines
 * One of these commented out pieces described lowering armor as a result of being shot; this however would result in high ROF weapons being overpowered (not to mention the code was so old it probably wouldn't compile)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1834 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 21:16:44 +00:00
Giel van Schijndel dd337e40eb Some more 64bit safety:
* Use "%zu" as format specifier to print out size_t types


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1833 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 18:49:57 +00:00
Giel van Schijndel 98e6c05da1 * Allow compilation without sound; when used this eliminates the compile & link time requirement of libvorbisfile, libvorbis, libogg and libopenal
* This conditional compilation is controlled by WZ_NOSOUND (which replaces WZ_NOOGG)
 * Remove an unneed inclusion from oggvorbis.h (track.h)

NOTE: This is currently integrated in none of the build systems

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1832 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 17:09:23 +00:00
Giel van Schijndel 2adc6e3515 * Add a check for the special case of a commander playing in multiplayer (it needs less kills to achieve ranks then); I missed this when replaceing the specialized version of getDroidLevel for commanders
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1831 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 13:44:52 +00:00
Giel van Schijndel cc5de7ec37 * Refactor HashString and HashStringIgnoreCase to be a (very tiny) bit more readable
* Create a dedicated function for conversion of ASCII characters into upper case: upcaseASCII
 * Make HashStringIgnoreCase use upcaseASCII instead of an ugly bitmask hack which won't even work as expected on all strings!!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1830 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 13:22:21 +00:00
Giel van Schijndel 00b8c344ad Made a type in last commit; this fixes it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1829 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 10:37:48 +00:00
Giel van Schijndel abe777fd7a * Only assert that the build location of a droid is on the map if we're not playing single player since we can be on an away mission
This fixes one assert of bug #9280

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1828 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 10:32:47 +00:00
Giel van Schijndel a9a5b965ab * remove specialization of getDroidLevel: cmdDroidGetLevel
* modify getDroidLevel to provide the functionality of cmdDroidLevel for command and sensor droids

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1827 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 23:22:44 +00:00
Giel van Schijndel 6d2e839bf4 * Fix incorrect XML caused by (wrong) update to MSVC project file for deletion of lib/framework/heap.[ch]
(I simply should have enabled my VIM XML validation script, doh!)

Patch by vs2k5

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1826 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 22:09:02 +00:00
Dennis Schridde 8c49cf5a91 Remove unused file streamer.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1825 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 18:41:19 +00:00
Dennis Schridde 60cb577b1b Wrong number, reported by Kreuvf. (Shouldn't this function instead retrieve its numbers from some file?)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1824 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 18:29:26 +00:00
Ari Johnson d2d77144c9 Updated Xcode project
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1823 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 17:01:09 +00:00
Giel van Schijndel c0bddbb0e1 Add some translations to Dutch translation file
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1822 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 12:46:50 +00:00
Giel van Schijndel 12f21d0b0c * Replace usage of uint8_t with char for C-strings; while (u)int8_t works perfectly nice for numbers it isn't nice for text (char-array)
* To make sure we still have the guarantee that a char is 8bit I've inserted a static assertion for this (CHAR_BIT == 8)
 * Use exact length types for lobbyserver

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1821 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 12:01:59 +00:00
Giel van Schijndel ed73e62898 Leave the memory management up to the memory management functions!
That is:
 * Don't use a custom memory heap implementation anymore
 * Remove all usages of HEAP code and replace it with malloc/free

NOTE: MacOSX projectfile probably requires an update

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1820 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 11:46:00 +00:00
Giel van Schijndel 5af0c2c1a3 Some more heap abolishing:
* Replace use of heaps psDroidHeap, psStructHeap, psFeatureHeap and psGrpHeap with malloc/free
 * 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@1819 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 10:59:08 +00:00
Giel van Schijndel 72e28131de Some more heap abolishing:
* Replace use of heaps psStructFuncHeap and psFlagPosHeap with malloc/free

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1818 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 10:25:39 +00:00
Giel van Schijndel 9e9a17e58f Some more heap abolishing:
* Replace use of heap psTemplateHeap with malloc/free

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1817 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 10:15:33 +00:00
Giel van Schijndel 7ae1b1bee7 Some more heap abolishing:
* Replace a lot of heap usage with malloc/free usage

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1816 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 22:02:05 +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 5839fb21ea Revert r1810 since it somehow results in undefined behaviour (can't find the cause right now, so this revert is to leave the trunk in a stable state while I work on finding the cause)
PS: "Dang! That GUI code really is borked stuff!"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1814 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 19:52:07 +00:00