Commit Graph

42 Commits (2553ccfaafcc264ece076ce2046ee9285b580516)

Author SHA1 Message Date
Giel van Schijndel 613a38364e * Make resSetBaseDir const correct (char* -> const char*)
* Document the "fileName" parameter of makeLocaleFile in the Doxygen comment


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2639 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 16:12:00 +00:00
Giel van Schijndel bd37e62cb2 * Replace a lot of strncat(dst, src, sizeof(dst) - strlen(dst) - 1) calls with the less bloated strlcat(dst, src, sizeof(dst)) form
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2637 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 15:47:17 +00:00
Giel van Schijndel 6b4cba1700 * Rename pLevelName to aLevelName (hungarian notation is a pain. Especially when it's wrong!)
* Get rid of several magic numbers
 * Some const correctness
 * Replace a huge amount of strcpy(), strcat(), strncpy() and strncat() calls with a strlcpy() and strlcat() calls respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 14:35:35 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 21:11:29 +00:00
Giel van Schijndel e6827605e2 * Fix a rather large memory leak as reported in bug #10190
* In this bug-report calling free() twice (once on psRes->aID then on psRes) was proposed
   * Instead just ''over allocate'' the memory for psRes so that a single free() call on psRes will suffice

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2614 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 16:54:53 +00:00
Dennis Schridde c7b00fadaf More work on the ICC front:
- Less strict warnings in debug-mode (still unusable, because ICC warns about _a lot_)
- Explicit conversions
- Clarify parameter evaluation order


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-15 18:09:18 +00:00
Dennis Schridde fbd3a9c394 Use Unix PATH_MAX as default and thus move all "fixes" to Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2425 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:59:05 +00:00
Per Inge Mathisen 4b45e8e2e1 Some misc cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2306 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 15:04:16 +00:00
Dennis Schridde 2fbaec50c4 Fix unused function getLanguage.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2275 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-29 23:33:21 +00:00
Dennis Schridde 8939a96d21 Better debuging of not found data.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2270 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-29 17:17:38 +00:00
Dennis Schridde f612678624 Backport r2265,2266,2268 from branches/2.0
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2269 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-29 16:58:16 +00:00
Dennis Schridde ebb1d7a918 Translate3.patch by Martin Koller. Had to Wiggle names.txt, but it seems to have cleanly applied.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2241 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-28 11:35:26 +00:00
Dennis Schridde 6b8e636fc3 Revisit data loading (image/texture related) and remove unecessary fVertex pietype.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2195 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 22:37:48 +00:00
Dennis Schridde d9529e9d1c Localised data, patch by Martin Koller, slightly modified by me.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2123 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-16 17:19:47 +00:00
Dennis Schridde e80e0d4ca6 FILE_MAXCHAR -> MAX_PATH
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2058 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 17:17:16 +00:00
Dennis Schridde e40c830278 Remove more unused code. This includes iV_GetMouseFrame, which returned an undefined value before. scriptextern.c might want to be adapted.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1865 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:56:36 +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
Per Inge Mathisen 1b5cbb1c1e Remove flags from IMDShape since they were unused. Clean up IMD loader some
more. Remove unused GetLastHashName() and SetLastHashName().


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1544 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 10:36:21 +00:00
Giel van Schijndel d844dbab9c * Fix a segfault caused by dereferencing a NULL pointer when a resource has not been found
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1499 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 18:02:11 +00:00
Dennis Schridde ce16856887 FREE->free, MALLOC->malloc (sed+review)
This patch will create crashes where the code expects FREE to set the pointer to NULL! (Those problems should be fixed anyway.)
The only occassion where I saw this is when quiting a game, so it is not too much of an issue.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1459 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 10:43:05 +00:00
Giel van Schijndel 99153c743c * remove some dead code (resource preload callback stuff)
* turn a one-statement function into an inline (resDoResLoadCallback)
 * revive resource loading from file (the function pointer for this was removed in r1394, to actually use this pointer new code had to be written)
 * modify resDataInit to handle memory allocation as well as data initialization
 * modify struct RES_DATA to not have a fixed size char array to contain the filename (is now dynamically allocated together with the rest of the struct, see resDataInit)
 * modify some argument lists to take `const char*` instead of `char*`
 * change resLoadFile to use RES_TYPE.fileLoad if available, also remove an unused if statement (well actually the condition could never be false)
 * resource type "WAV" (see data.c) now directly loads from a file (rather than copying the file entirely into memory and then to operate on that)
 * fix sound_ConstructTrack (track.c) where I used the wrong source to copy the filename from
 * fix sound_LoadTrackFromBuffer (track.c) to *not* add the track to the tracklist because this breaks other code
 * modify sound_ReleaseTrack (track.c) to gracefully deal with NULL pointers
 * remove dataAudioRelease (data.c) and instead just use sound_ReleaseTrack

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1397 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 21:39:24 +00:00
Giel van Schijndel 10964ceca2 * remove unused function pointer fileLoad from struct RES_TYPE in lib/framework/frameresource.h (there is code that sets this member, but none that uses it)
* remove function resAddFileLoad from lib/framework/frameresource.[ch] which was used to set RES_TYPE.fileLoad
 * remove only call to resAddFileLoad from src/data.c, function dataInitLoadFuncs
 * remove now completely unused function dataSaveGameLoad from src/data.c
 * modify function dataInitLoadFuncs in src/data.c:
  * modify the struct definition for the list of resource types
  * modify the list accordingly
  * remove the NULL-item from the end of the list
  * modify list iteration code to use a start and end iterator (end being a pointer just past the last valid list-item, begin being the first valid one)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1394 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 17:15:56 +00:00
Giel van Schijndel 0af269415c * remove some linked list wrapping macro (to increase code readability)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1393 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 15:35:00 +00:00
Gerard Krol 6671fa934e 1. Removed the terrible memory leaks from the resource system. 2. Fixed the memory leaks for the terrain tiles. 3. Fixed a lot of uninitialised
variables. 4. Commented out some unused sound code.
I just love Valgrind :)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1390 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-07 13:23:14 +00:00
Gerard Krol 42ed587327 Per's removal of the memory heap system. Now MALLOC is just malloc, and not some wrapper around a wrapper that will allocate it from a specific pool.
The MSVC poject will need to be updated I guess, as some files were deleted.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1343 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 10:33:26 +00:00
Per Inge Mathisen 79b3875fc4 This commit fixes all warnings (on my system). -Werror added for
debug builds. Hopefully this will not cause too much pain, but
rather increase code quality for the future.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1144 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 14:10:44 +00:00
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Dennis Schridde 495824aea2 Patch by Christian Ohm:
018 - Warning fixes in lib-framework


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@885 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-02 13:06:56 +00:00
Stefan Huehner da14eaf2ad Add some more const to char* function parameters,
which aren't modified inside the called function.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@853 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-23 13:28:38 +00:00
Dennis Schridde d3cd44148d Patch by Gerard Krol: Replace STRING with char (STRING was confusingly defined to char)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@804 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-03 21:35:50 +00:00
Roman C 9aaae50baa Replaced 'Humans vs AIs' with 'Locked Teams' alliance mode.
Fixed difficulty slider applying settings to the wrong players.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@763 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-26 18:14:05 +00:00
Stefan Huehner 30f6dc392e mark some Strings an read-only by adding const.
On the way replace STRING with char



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@756 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-24 19:11:34 +00:00
Stefan Huehner 1395a7c69c Make some more functions static which aren't used outside their
declaring source files and which have no prototype.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@731 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-19 18:45:48 +00:00
Dennis Schridde 27b07a0ba1 Patch by Stefan Huehner: "code cleanup: const 2"
Patch marks several read-only function parameters and datastructures as such by adding const.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@709 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:16:17 +00:00
Dennis Schridde b9087ef4ca Patch by Stefan Huehner: "code cleanup: void 4"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@706 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:11:11 +00:00
Dennis Schridde 728b9a9913 - Commit patches "code cleanup: void" and "code cleanup: const" by Stefan Huehner
- Replace every occurence of VOID with void (and LPVOID with void*)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@703 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 09:09:05 +00:00
Dennis Schridde 0e288f45e7 - Replace all ASSERT(( )) with ASSERT( )
- Simplify definition of ASSERT(). Now is the same for GCC and MSVC.
  This may not work on versions older than MSVC 2005. If you experience this, please report it!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@613 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-23 12:58:48 +00:00
Dennis Schridde 62ae49b0ce Replaced all occurences of DBMB, DBPRINTF and DBERROR with their former define.
( DBPRINTF(("Message")); becomes debug( LOG_NEVER, "Message" ); )



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@608 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-22 14:28:49 +00:00
Per Inge Mathisen 2149739999 Almost all strings and buffers are now of type char. This fixes
more than half the warnings on gcc4, and makes sure we do not
get signedness problems between platforms where char is defined
with different signedness. Also set line-ending properites for
some bison/flex files that did not have it set.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@563 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-12 16:52:37 +00:00
Dennis Schridde eb7ba7e41d - Again revised the modloading(restrictions were stupid) (src/levels.c,src/init.[ch],src/multiint.c,src/main.c)
- Fixed case problem with noVideo.rpl (lib/sequence/sequence_stub.c)
- Fixed some G++ 4.1 compile problems (mostly invalid conversions) (lib/script/script_parser.y,lib/framework/frame.h,lib/framework/frameresource.c,lib/framework/frameresource.h,lib/framework/input.c,lib/framework/configfile.c,lib/framework/frame.c)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@455 4a71c877-e1ca-e34f-864e-861f7616d084
2006-07-04 13:35:01 +00:00
Dennis Schridde 1e7edf9fa2 Fixes some minor memleaks and marks the source of the big one in pie_PNGLoadMem.
Also big amount of whitespace changes, sorry for the inconvenience...



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@400 4a71c877-e1ca-e34f-864e-861f7616d084
2006-02-18 18:54:37 +00:00
No Author 5ba7ddac6b Create final repository structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@362 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-28 17:47:08 +00:00