summaryrefslogtreecommitdiff
path: root/src/hexen/sv_save.c
AgeCommit message (Collapse)Author
2015-05-05warnings: fix "value computed is not used" warningsFabian Greffrath
This fixes warnings that are caused by calling GET_LONG without using its return value, e.g.: sv_save.c: In function ‘StreamIn_player_t’: ../../src/i_swap.h:34:20: warning: value computed is not used [-Wunused-value] #define LONG(x) ((signed int) SDL_SwapLE32(x)) ^ sv_save.c:33:18: note: in expansion of macro ‘LONG’ #define GET_LONG LONG(*SavePtr.l++) ^ sv_save.c:349:5: note: in expansion of macro ‘GET_LONG’ GET_LONG; ^ Introducing a "long dummy" variable and calling "dummy = GET_LONG" does not help, because this provokes another warning, rightfully so: sv_save.c: In function ‘StreamIn_player_t’: sv_save.c:346:10: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] long dummy; Assigning the return value directly to the struct field results in: sv_save.c: In function ‘StreamIn_player_t’: sv_save.c:349:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion] str->mo = GET_LONG; Adding the cast to "(void *)" results in: sv_save.c: In function ‘StreamIn_player_t’: sv_save.c:349:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] str->mo = (void *) GET_LONG; Adding the intermediate cast to "(intptr_t)" finally silences the compiler. Phew!
2015-03-30Turn maxplayers into a global variableFabian Greffrath
... and decrease its value from MAXPLAYERS (i.e. 8) to 4 if (gamemode == shareware). It seems that it was hard-coded to this value until some time between the releases of the Demo and the Full version. Arrays are still declared with their full width of 8, though, they are just not iterated over the whole range anymore. This fixes playback of the IWAD demos.
2014-05-05Clean up file headers.Simon Howard
This change rewrites and simplifies the copyright headers at the top of all source files: * Remove "Emacs style mode select" line; this line was included in the headers for the originally released source files and appears to be to set the file type for old versions of Emacs. I'm not sure entirely why it was required but I don't think it is any more. * Remove "You should have received a copy of..." text from copyright header. This refers to the old 59 Temple Place address where the FSF headquarters used to be located and is no longer correct. Rather than change to the new address, just remove the paragraph as it is superfluous anyway. This fixes #311. * Remove ---- separator lines so that the file headers are barer and more simplified.
2014-04-01Replace all snprintf() calls with M_snprintf().Simon Howard
The Windows API has an _snprintf function that is not the same as Unix's snprintf(): if the string is truncated then no trailing NUL character is appended. This makes the function unsafe. Define a replacement/wrapper called M_snprintf that works the same but always appends a trailing NUL, for safety on Windows and other OSes that behave like this. Do the same thing for vsnprintf(), and update HACKING to list snprintf/vsnprintf as forbidden functions. This fixes #375; thanks to Quasar for pointing out the different behavior of these functions.
2014-03-30hexen: Eliminate use of sprintf().Simon Howard
Use snprintf() in place of sprintf(). This is part of fixing #371.
2014-03-29heretic: Eliminate use of unsafe string functions.Simon Howard
Eliminate use of strcpy, strcat, strncpy, and use the new safe alternatives.
2013-09-01Read/write thinker structures portably. Hexen savegames should now beSimon Howard
Vanilla compatible. Subversion-branch: /branches/v2-branch Subversion-revision: 2630
2013-08-25Read/write mobj_t structures to savegame files portably.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2626
2013-08-25First step towards portable Hexen savegames. Perform endiannessSimon Howard
conversions for ACS vars and add functions to read/write player_t structures. Subversion-branch: /branches/v2-branch Subversion-revision: 2625
2011-10-29Enable gcc warning to detect redundant declarations, and clean upSimon Howard
instances of this within the code (thanks Edward-san). Subversion-branch: /branches/v2-branch Subversion-revision: 2468
2011-09-25Fix special1/special2 values in Hexen code so that they can properlySimon Howard
hold pointer values. Subversion-branch: /branches/v2-branch Subversion-revision: 2407
2008-11-02Fix up raven-branch copyright notices.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1375
2008-10-08Switch configuration file code to common configuration file code, andSimon Howard
remove old code. Subversion-branch: /branches/raven-branch Subversion-revision: 1338
2008-10-01Use common versions of ticcmd_t and event_t for Hexen code. Remove oldSimon Howard
i_video definitions and use common i_video.c interface. Subversion-branch: /branches/raven-branch Subversion-revision: 1312
2008-10-01Merge Hexen fixed_t and angle definitions to common code, plus byteSimon Howard
swapping macros, bounding box checking, read/write file, screenshot and command line argument code. Update Heretic code to use ANG1_X rather than the new (correct) ANG1 definition. Subversion-branch: /branches/raven-branch Subversion-revision: 1311
2008-09-16Clean up some warnings in the Hexen code.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1232
2008-09-05Reformat (beautify) Raven sources and add GPL headers.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1197
2008-09-04Add GPLed Heretic/Hexen source.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1195