diff --git a/doomclassic/doom/d_items.cpp b/doomclassic/doom/d_items.cpp index bafcbe30..49741902 100644 --- a/doomclassic/doom/d_items.cpp +++ b/doomclassic/doom/d_items.cpp @@ -27,16 +27,17 @@ If you have questions concerning this license or the applicable additional terms */ #include "Precompiled.h" -#include "globaldata.h" - -// We are referring to sprite numbers. -#include "info.h" #ifdef __GNUG__ #pragma implementation "d_items.h" #endif #include "d_items.h" +#include "globaldata.h" + +// We are referring to sprite numbers. +#include "info.h" + // // PSPRITE ACTIONS for waepons. diff --git a/doomclassic/doom/d_main.cpp b/doomclassic/doom/d_main.cpp index d4c4c9bc..b872a20a 100644 --- a/doomclassic/doom/d_main.cpp +++ b/doomclassic/doom/d_main.cpp @@ -414,7 +414,7 @@ void D_DoAdvanceDemo (void) ::g->pagetic = 8 * TICRATE; ::g->gamestate = GS_DEMOSCREEN; - ::g->pagename = "INTERPIC"; + ::g->pagename = (char *)"INTERPIC"; if ( ::g->gamemode == commercial ) S_StartMusic(mus_dm2ttl); @@ -428,7 +428,7 @@ void D_DoAdvanceDemo (void) case 2: ::g->pagetic = 3 * TICRATE; ::g->gamestate = GS_DEMOSCREEN; - ::g->pagename = "INTERPIC"; + ::g->pagename = (char *)"INTERPIC"; break; case 3: G_DeferedPlayDemo ("demo2"); @@ -436,7 +436,7 @@ void D_DoAdvanceDemo (void) case 4: ::g->pagetic = 3 * TICRATE; ::g->gamestate = GS_DEMOSCREEN; - ::g->pagename = "INTERPIC"; + ::g->pagename = (char *)"INTERPIC"; break; case 5: G_DeferedPlayDemo ("demo3"); @@ -445,7 +445,7 @@ void D_DoAdvanceDemo (void) case 6: ::g->pagetic = 3 * TICRATE; ::g->gamestate = GS_DEMOSCREEN; - ::g->pagename = "INTERPIC"; + ::g->pagename = (char *)"INTERPIC"; break; case 7: G_DeferedPlayDemo ("demo4"); diff --git a/doomclassic/doom/doomdef.cpp b/doomclassic/doom/doomdef.cpp index 63d063e2..764cc5bf 100644 --- a/doomclassic/doom/doomdef.cpp +++ b/doomclassic/doom/doomdef.cpp @@ -27,14 +27,15 @@ If you have questions concerning this license or the applicable additional terms */ #include "Precompiled.h" -#include "globaldata.h" - #ifdef __GNUG__ #pragma implementation "doomdef.h" #endif #include "doomdef.h" +#include "globaldata.h" + + // Location for any defines turned variables. // None. diff --git a/doomclassic/doom/doominterface.cpp b/doomclassic/doom/doominterface.cpp index 104d6461..ab7c2c5a 100644 --- a/doomclassic/doom/doominterface.cpp +++ b/doomclassic/doom/doominterface.cpp @@ -41,7 +41,7 @@ extern void I_SetTime( int ); bool waitingForWipe; static const int dargc = 7; -static char* dargv[4][7] = +static const char* dargv[4][7] = { { "doomlauncher", "-net", "0", "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" }, { "doomlauncher", "-net", "1", "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" }, @@ -106,7 +106,7 @@ void DoomInterface::Startup( int playerscount, bool multiplayer ) printf( "\n" ); DoomLib::InitGame(mpArgc[i], mpArgVPtr[i] ); } else { - DoomLib::InitGame(localdargc, dargv[i] ); + DoomLib::InitGame(localdargc, (char **)dargv[i] ); } if( DoomLib::skipToLoad ) { diff --git a/doomclassic/doom/doomlib.cpp b/doomclassic/doom/doomlib.cpp index 9cbd8baf..44529c0a 100644 --- a/doomclassic/doom/doomlib.cpp +++ b/doomclassic/doom/doomlib.cpp @@ -498,7 +498,7 @@ int DoomLib::PlayerIndexToRemoteNode( int index ) { return indexMap[::g->consoleplayer][index]; } -void I_Error (char *error, ...); +void I_Error (const char *error, ...); extern bool useTech5Packets; void DoomLib::PollNetwork() { diff --git a/doomclassic/doom/dstrings.cpp b/doomclassic/doom/dstrings.cpp index 9c419697..761374ad 100644 --- a/doomclassic/doom/dstrings.cpp +++ b/doomclassic/doom/dstrings.cpp @@ -27,14 +27,13 @@ If you have questions concerning this license or the applicable additional terms */ #include "Precompiled.h" -#include "globaldata.h" - #ifdef __GNUG__ #pragma implementation "dstrings.h" #endif #include "dstrings.h" +#include "globaldata.h" const char* endmsg[NUM_QUITMESSAGES+1]= diff --git a/doomclassic/doom/f_finale.cpp b/doomclassic/doom/f_finale.cpp index 497f7eb6..79dafc9a 100644 --- a/doomclassic/doom/f_finale.cpp +++ b/doomclassic/doom/f_finale.cpp @@ -592,9 +592,9 @@ qboolean F_CastResponder (event_t* ev) } -void F_CastPrint (char* text) +void F_CastPrint (const char* text) { - char* ch; + const char* ch; int c; int cx; int w; diff --git a/doomclassic/doom/g_game.cpp b/doomclassic/doom/g_game.cpp index 55f35fed..a84d9c69 100644 --- a/doomclassic/doom/g_game.cpp +++ b/doomclassic/doom/g_game.cpp @@ -1844,9 +1844,9 @@ void G_BeginRecording (void) // // G_PlayDemo // -void G_DeferedPlayDemo (char* name) +void G_DeferedPlayDemo (const char* name) { - ::g->defdemoname = name; + ::g->defdemoname = (char *)name; ::g->gameaction = ga_playdemo; } @@ -1946,14 +1946,14 @@ void G_DoPlayDemo (void) // // G_TimeDemo // -void G_TimeDemo (char* name) +void G_TimeDemo (const char* name) { ::g->nodrawers = M_CheckParm ("-nodraw"); ::g->noblit = M_CheckParm ("-noblit"); ::g->timingdemo = true; ::g->singletics = true; - ::g->defdemoname = name; + ::g->defdemoname = (char *)name; ::g->gameaction = ga_playdemo; } diff --git a/doomclassic/doom/g_game.h b/doomclassic/doom/g_game.h index f7947ad1..38153d7e 100644 --- a/doomclassic/doom/g_game.h +++ b/doomclassic/doom/g_game.h @@ -46,7 +46,7 @@ void G_InitNew ( skill_t skill, int episode, int map ); // but a warp test can start elsewhere void G_DeferedInitNew (skill_t skill, int episode, int map); -void G_DeferedPlayDemo (char* demo); +void G_DeferedPlayDemo (const char* demo); // Can be called by the startup code or M_Responder, // calls P_SetupLevel or W_EnterWorld. @@ -63,7 +63,7 @@ void G_RecordDemo (char* name); void G_BeginRecording (void); void G_PlayDemo (char* name); -void G_TimeDemo (char* name); +void G_TimeDemo (const char* name); qboolean G_CheckDemoStatus (void); void G_ExitLevel (void); diff --git a/doomclassic/doom/globaldata.cpp b/doomclassic/doom/globaldata.cpp index 79632061..e8c57274 100644 --- a/doomclassic/doom/globaldata.cpp +++ b/doomclassic/doom/globaldata.cpp @@ -84,11 +84,11 @@ void M_SetupNextMenu(menu_t *menudef); void M_DrawThermo(int x,int y,int thermWidth,int thermDot); void M_DrawEmptyCell(menu_t *menu,int item); void M_DrawSelCell(menu_t *menu,int item); -void M_WriteText(int x, int y, char *string); -int M_StringWidth(char *string); -int M_StringHeight(char *string); +void M_WriteText(int x, int y, const char *string); +int M_StringWidth(const char *string); +int M_StringHeight(const char *string); void M_StartControlPanel(void); -void M_StartMessage(char *string,messageRoutine_t routine,qboolean input); +void M_StartMessage(const char *string,messageRoutine_t routine,qboolean input); void M_StopMessage(void); void M_ClearMenus (void); diff --git a/doomclassic/doom/i_net_win32.cpp b/doomclassic/doom/i_net_win32.cpp index fcea41d6..8ed589c0 100644 --- a/doomclassic/doom/i_net_win32.cpp +++ b/doomclassic/doom/i_net_win32.cpp @@ -97,16 +97,17 @@ void (*netsend) (void); // int UDPsocket (void) { - int s; + //int s; // allocate a socket //s = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if ( !IsValidSocket( s ) ) { - int err = GetLastSocketError(); - I_Error( "can't create socket, error %d", err ); - } + //if ( !IsValidSocket( s ) ) { + // int err = GetLastSocketError(); + // I_Error( "can't create socket, error %d", err ); + //} - return s; + //return s; + return 0; } // @@ -265,15 +266,15 @@ void I_ShutdownNetwork( void ) { void I_NetCmd (void) { - if (::g->doomcom.command == CMD_SEND) - { - netsend (); - } - else if (::g->doomcom.command == CMD_GET) - { - netget (); - } - else - I_Error ("Bad net cmd: %i\n",::g->doomcom.command); + //if (::g->doomcom.command == CMD_SEND) + //{ + // netsend (); + //} + //else if (::g->doomcom.command == CMD_GET) + //{ + // netget (); + //} + //else + // I_Error ("Bad net cmd: %i\n",::g->doomcom.command); } diff --git a/doomclassic/doom/i_sound_openal.cpp b/doomclassic/doom/i_sound_openal.cpp index dc213e3c..554ae2fc 100644 --- a/doomclassic/doom/i_sound_openal.cpp +++ b/doomclassic/doom/i_sound_openal.cpp @@ -149,7 +149,7 @@ getsfx // This function loads the sound data from the WAD lump, // for single sound. // -void* getsfx ( char* sfxname, int* len ) +void* getsfx ( const char* sfxname, int* len ) { unsigned char* sfx; unsigned char* sfxmem; diff --git a/doomclassic/doom/i_sound_win32.cpp b/doomclassic/doom/i_sound_win32.cpp index bd2d2e53..ec79ec60 100644 --- a/doomclassic/doom/i_sound_win32.cpp +++ b/doomclassic/doom/i_sound_win32.cpp @@ -158,7 +158,7 @@ getsfx // This function loads the sound data from the WAD lump, // for single sound. // -void* getsfx ( char* sfxname, int* len ) +void* getsfx ( const char* sfxname, int* len ) { unsigned char* sfx; unsigned char* sfxmem; diff --git a/doomclassic/doom/i_system.cpp b/doomclassic/doom/i_system.cpp index 2a3bb735..8a35e6bc 100644 --- a/doomclassic/doom/i_system.cpp +++ b/doomclassic/doom/i_system.cpp @@ -126,7 +126,7 @@ void I_EndRead(void) // I_Error // extern bool debugOutput; -void I_Printf(char* msg, ...) +void I_Printf(const char* msg, ...) { char pmsg[1024]; va_list argptr; @@ -143,7 +143,7 @@ void I_Printf(char* msg, ...) } -void I_PrintfE(char* msg, ...) +void I_PrintfE(const char* msg, ...) { char pmsg[1024]; va_list argptr; @@ -160,7 +160,7 @@ void I_PrintfE(char* msg, ...) } } -void I_Error(char *error, ...) +void I_Error(const char *error, ...) { const int ERROR_MSG_SIZE = 1024; char error_msg[ERROR_MSG_SIZE]; diff --git a/doomclassic/doom/i_system.h b/doomclassic/doom/i_system.h index 24a437fd..a159c05d 100644 --- a/doomclassic/doom/i_system.h +++ b/doomclassic/doom/i_system.h @@ -79,9 +79,9 @@ ticcmd_t* I_BaseTiccmd (void); void I_Quit (void); -void I_Error (char *error, ...); -void I_Printf(char *error, ...); -void I_PrintfE(char *error, ...); +void I_Error (const char *error, ...); +void I_Printf(const char *error, ...); +void I_PrintfE(const char *error, ...); #endif diff --git a/doomclassic/doom/info.cpp b/doomclassic/doom/info.cpp index c21552c6..861cbf4d 100644 --- a/doomclassic/doom/info.cpp +++ b/doomclassic/doom/info.cpp @@ -27,19 +27,21 @@ If you have questions concerning this license or the applicable additional terms */ #include "Precompiled.h" -#include "globaldata.h" - -// Data. -#include "sounds.h" -#include "m_fixed.h" #ifdef __GNUG__ #pragma implementation "info.h" #endif #include "info.h" +#include "globaldata.h" + +// Data. +#include "sounds.h" +#include "m_fixed.h" + #include "p_mobj.h" + // RB: sprnames must be NULL-terminated const char * const sprnames[NUMSPRITES + 1] = { "TROO","SHTG","PUNG","PISG","PISF","SHTF","SHT2","CHGG","CHGF","MISG", diff --git a/doomclassic/doom/m_argv.cpp b/doomclassic/doom/m_argv.cpp index 582befef..c1d8572d 100644 --- a/doomclassic/doom/m_argv.cpp +++ b/doomclassic/doom/m_argv.cpp @@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms // in the program's command line arguments. // Returns the argument number (1 to argc-1) // or 0 if not present -int M_CheckParm (char *check) +int M_CheckParm (const char *check) { int i; diff --git a/doomclassic/doom/m_argv.h b/doomclassic/doom/m_argv.h index b4d7630a..9962cba5 100644 --- a/doomclassic/doom/m_argv.h +++ b/doomclassic/doom/m_argv.h @@ -37,7 +37,7 @@ extern char** myargv; // Returns the position of the given parameter // in the arg list (0 if not found). -int M_CheckParm (char* check); +int M_CheckParm (const char* check); #endif diff --git a/doomclassic/doom/m_fixed.cpp b/doomclassic/doom/m_fixed.cpp index 4f72fd35..9b8b50b7 100644 --- a/doomclassic/doom/m_fixed.cpp +++ b/doomclassic/doom/m_fixed.cpp @@ -27,19 +27,18 @@ If you have questions concerning this license or the applicable additional terms */ #include "Precompiled.h" -#include "globaldata.h" - -#include "stdlib.h" - -#include "doomtype.h" -#include "i_system.h" #ifdef __GNUG__ #pragma implementation "m_fixed.h" #endif #include "m_fixed.h" +#include "globaldata.h" +#include "stdlib.h" + +#include "doomtype.h" +#include "i_system.h" // Fixme. __USE_C_FIXED__ or something. diff --git a/doomclassic/doom/m_menu.cpp b/doomclassic/doom/m_menu.cpp index 7719a46c..57b9366c 100644 --- a/doomclassic/doom/m_menu.cpp +++ b/doomclassic/doom/m_menu.cpp @@ -183,11 +183,11 @@ void M_SetupNextMenu(menu_t *menudef); void M_DrawThermo(int x,int y,int thermWidth,int thermDot); void M_DrawEmptyCell(menu_t *menu,int item); void M_DrawSelCell(menu_t *menu,int item); -void M_WriteText(int x, int y, char *string); -int M_StringWidth(char *string); -int M_StringHeight(char *string); +void M_WriteText(int x, int y, const char *string); +int M_StringWidth(const char *string); +int M_StringHeight(const char *string); void M_StartControlPanel(void); -void M_StartMessage(char *string,messageRoutine_t routine,qboolean input); +void M_StartMessage(const char *string,messageRoutine_t routine,qboolean input); void M_StopMessage(void); void M_ClearMenus (void); @@ -1051,13 +1051,13 @@ M_DrawSelCell void M_StartMessage -( char* string, +( const char* string, messageRoutine_t routine, qboolean input ) { ::g->messageLastMenuActive = ::g->menuactive; ::g->messageToPrint = 1; - ::g->messageString = string; + ::g->messageString = (char *)string; ::g->messageRoutine = (messageRoutine_t)routine; ::g->messageNeedsInput = input; ::g->menuactive = true; @@ -1077,7 +1077,7 @@ void M_StopMessage(void) // // Find string width from ::g->hu_font chars // -int M_StringWidth(char* string) +int M_StringWidth(const char* string) { unsigned int i; int w = 0; @@ -1100,7 +1100,7 @@ int M_StringWidth(char* string) // // Find string height from ::g->hu_font chars // -int M_StringHeight(char* string) +int M_StringHeight(const char* string) { unsigned int i; int h; @@ -1122,10 +1122,10 @@ void M_WriteText ( int x, int y, - char* string) + const char* string) { int w; - char* ch; + const char* ch; int c; int cx; int cy; diff --git a/doomclassic/doom/sounds.h b/doomclassic/doom/sounds.h index 8ff5825a..b06ef809 100644 --- a/doomclassic/doom/sounds.h +++ b/doomclassic/doom/sounds.h @@ -38,7 +38,7 @@ typedef struct sfxinfo_struct sfxinfo_t; struct sfxinfo_struct { // up to 6-character name - char* name; + const char* name; // Sfx singularity (only one at a time) int singularity; diff --git a/doomclassic/doom/structs.h b/doomclassic/doom/structs.h index 8b776441..04e40b82 100644 --- a/doomclassic/doom/structs.h +++ b/doomclassic/doom/structs.h @@ -53,7 +53,7 @@ typedef struct // f_finale.structs begin // typedef struct { - char *name; + const char *name; mobjtype_t type; } castinfo_t; // f_finale.structs end // @@ -212,7 +212,7 @@ typedef enum // m_misc.structs begin // struct default_t { - char* name; + const char* name; union { int * location; const char * * charLocation; @@ -232,13 +232,13 @@ struct default_t untranslated( 0 ) { } - default_t( char * name_, int * location_, int defaultvalue_ ) : + default_t( const char * name_, int * location_, int defaultvalue_ ) : name( name_ ), location( location_ ), defaultvalue( defaultvalue_ ) { } - default_t( char * name_, const char * * charLocation_, const char * charDefault_ ) : + default_t( const char * name_, const char * * charLocation_, const char * charDefault_ ) : name( name_ ), charLocation( charLocation_ ), charDefault( charDefault_ ) { diff --git a/doomclassic/doom/w_wad.cpp b/doomclassic/doom/w_wad.cpp index 4e827a92..9f609f1a 100644 --- a/doomclassic/doom/w_wad.cpp +++ b/doomclassic/doom/w_wad.cpp @@ -27,6 +27,12 @@ If you have questions concerning this license or the applicable additional terms */ #include "Precompiled.h" + +#ifdef __GNUG__ +#pragma implementation "w_wad.h" +#endif +#include "w_wad.h" + #include "globaldata.h" @@ -44,12 +50,6 @@ If you have questions concerning this license or the applicable additional terms #include "idlib/precompiled.h" -#ifdef __GNUG__ -#pragma implementation "w_wad.h" -#endif -#include "w_wad.h" - - // // GLOBALS diff --git a/neo/libs/timidity/config.h b/neo/libs/timidity/config.h index e1b365c7..a252c793 100644 --- a/neo/libs/timidity/config.h +++ b/neo/libs/timidity/config.h @@ -23,7 +23,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define __WIN32__ #endif +#ifndef LITTLE_ENDIAN #define LITTLE_ENDIAN +#endif #include diff --git a/neo/libs/timidity/controls.h b/neo/libs/timidity/controls.h index 95a911fd..fedbd04d 100644 --- a/neo/libs/timidity/controls.h +++ b/neo/libs/timidity/controls.h @@ -58,14 +58,14 @@ song if we're less than a second into this one. */ #define VERB_DEBUG_SILLY 4 typedef struct { - char *id_name, id_character; + const char *id_name, id_character; int verbosity, trace_playing, opened; int (*open)(int using_stdin, int using_stdout); void (*pass_playing_list)(int number_of_files, char *list_of_files[]); void (*close)(void); int (*read)(int *valp); - int (*cmsg)(int type, int verbosity_level, char *fmt, ...); + int (*cmsg)(int type, int verbosity_level, const char *fmt, ...); void (*refresh)(void); void (*reset)(void); diff --git a/neo/libs/timidity/instrum.cpp b/neo/libs/timidity/instrum.cpp index 25eb5b7f..16ddae09 100644 --- a/neo/libs/timidity/instrum.cpp +++ b/neo/libs/timidity/instrum.cpp @@ -194,10 +194,10 @@ static Instrument *load_instrument(char *name, int percussion, idFile * fp; uint8_t tmp[1024]; int i,j,noluck=0; - char *path; + const char *path; char filename[1024]; #ifdef PATCH_EXT_LIST - static char *patch_ext[] = PATCH_EXT_LIST; + static const char *patch_ext[] = PATCH_EXT_LIST; #endif if (!name) return 0; diff --git a/neo/libs/timidity/readmidi.cpp b/neo/libs/timidity/readmidi.cpp index 37b244b6..0ba46c22 100644 --- a/neo/libs/timidity/readmidi.cpp +++ b/neo/libs/timidity/readmidi.cpp @@ -113,7 +113,7 @@ static int32_t getvl(void) /* Print a string from the file, followed by a newline. Any non-ASCII or unprintable characters will be converted to periods. */ -static int dumpstring( int32_t len, char *label) +static int dumpstring( int32_t len, const char *label) { signed char *s=(signed char *)safe_malloc(len+1); if (len != (int32_t)read_local(s, 1, len)) @@ -171,7 +171,7 @@ static MidiEventList *read_midi_event(void) len=getvl(); if (type>0 && type<16) { - static char *label[]={ + static const char *label[]={ "Text event: ", "Text: ", "Copyright: ", "Track name: ", "Instrument: ", "Lyric: ", "Marker: ", "Cue point: "}; dumpstring(len, label[(type>7) ? 0 : type]); diff --git a/neo/libs/timidity/sdl_c.cpp b/neo/libs/timidity/sdl_c.cpp index 39741368..06ffe1b5 100644 --- a/neo/libs/timidity/sdl_c.cpp +++ b/neo/libs/timidity/sdl_c.cpp @@ -51,7 +51,7 @@ static void ctl_reset(void); static int ctl_open(int using_stdin, int using_stdout); static void ctl_close(void); static int ctl_read(int *valp); -static int cmsg(int type, int verbosity_level, char *fmt, ...); +static int cmsg(int type, int verbosity_level, const char *fmt, ...); #ifdef _DEBUG #define safeOutputDebug(x) printf( "%s", x ) @@ -92,7 +92,7 @@ static int ctl_read(int *valp) } extern void SendDebugMsg(const char*); extern bool debugOutput; -static int cmsg(int type, int verbosity_level, char *fmt, ...) +static int cmsg(int type, int verbosity_level, const char *fmt, ...) { #ifdef _DEBUG va_list ap; diff --git a/neo/libs/timidity/timidity.h b/neo/libs/timidity/timidity.h index 06a8a17c..619c43ed 100644 --- a/neo/libs/timidity/timidity.h +++ b/neo/libs/timidity/timidity.h @@ -54,9 +54,9 @@ extern void Real_Tim_Free( void *pt ); typedef struct { int rate, encoding; - char *id_name; + const char *id_name; FILE* fp; - char *file_name; + const char *file_name; int (*open_output)(void); /* 0=success, 1=warning, -1=fatal error */ void (*close_output)(void);