diff --git a/2dlib/memsurf.cpp b/2dlib/memsurf.cpp index cab2d97d..e27063e4 100644 --- a/2dlib/memsurf.cpp +++ b/2dlib/memsurf.cpp @@ -140,8 +140,6 @@ bool grMemorySurface::init(int w, int h, int bpp, char *data, int rowsize, unsig // internal functions // --------------------------------------------------------------------------- -static mem_bitmap grMemSurf_object; - bool gr_bm_mem_Blt16(ddgr_surface *dsf, int dx, int dy, ddgr_surface *ssf, int sx, int sy, int sw, int sh); bool gr_bm_mem_Blt16ck(ddgr_surface *dsf, int dx, int dy, ddgr_surface *ssf, int sx, int sy, int sw, int sh); diff --git a/2dlib/pentext.cpp b/2dlib/pentext.cpp index 6d93fbc9..5c64ecb0 100644 --- a/2dlib/pentext.cpp +++ b/2dlib/pentext.cpp @@ -96,7 +96,6 @@ #define STR_BUF_SIZE 512 static char Str_buf[STR_BUF_SIZE]; // String buffer for variable arguments -static char Draw_str_buf[STR_BUF_SIZE]; // used to buffer words in a string // --------------------------------------------------------------------------- // Viewport font and text funcitons diff --git a/bitmap/bitmain.cpp b/bitmap/bitmain.cpp index bcaffd36..38586bf1 100644 --- a/bitmap/bitmain.cpp +++ b/bitmap/bitmain.cpp @@ -575,8 +575,6 @@ int bm_AllocNoMemBitmap(int w, int h) { // Searches thru all bitmaps for a specific name, returns -1 if not found // or index of bitmap with name int bm_FindBitmapName(const char *name) { - int num_counted = 0; - bms_bitmap fbmp; strcpy(fbmp.name, name); bm_Node *fnode = bm_findNode(&fbmp); @@ -641,8 +639,6 @@ int bm_TestName(const char *src) { strncpy(namedest, filename, limit); namedest[limit] = 0; - int cur_len = strlen(namedest); - // Now, make sure there are no other bitmaps with this name strcat(namedest, ".ogf"); if ((i = bm_FindBitmapName(namedest)) == -1) @@ -652,7 +648,6 @@ int bm_TestName(const char *src) { // gets the filename from a path, plus appends our .ogf extension void bm_ChangeEndName(const char *src, char *dest) { uint32_t i, limit; - int last = -1; int curnum = -1; char namedest[256 + 16]; char path[256], ext[256], filename[256]; diff --git a/bitmap/iff.cpp b/bitmap/iff.cpp index de93cb28..acc87570 100644 --- a/bitmap/iff.cpp +++ b/bitmap/iff.cpp @@ -382,7 +382,7 @@ int bm_iff_parse_file(CFILE *ifile, iff_bitmap_header *bmheader, iff_bitmap_head switch (sig) { case IFF_SIG_FORM: { - int newsig = bm_iff_get_sig(ifile); + bm_iff_get_sig(ifile); bmheader->type = TYPE_PBM; break; } diff --git a/grtext/grtext.cpp b/grtext/grtext.cpp index c17af497..af90f252 100644 --- a/grtext/grtext.cpp +++ b/grtext/grtext.cpp @@ -760,7 +760,6 @@ int grtext_GetTextLineWidth(const char *str) { int line_width = 0, max_width = 0; int rgb_define_mode = 0; int strsize = strlen(str); - int line_idx = 0; for (int i = 0; i < strsize; i++) { int width; diff --git a/libmve/mveplay.cpp b/libmve/mveplay.cpp index 9df8560c..cd2267e4 100644 --- a/libmve/mveplay.cpp +++ b/libmve/mveplay.cpp @@ -174,7 +174,7 @@ static int create_audiobuf_handler(unsigned char major, unsigned char minor, uns int flags = get_ushort(data + 2); int sample_rate = get_ushort(data + 4); - int desired_buffer = get_int(data + 6); + // int desired_buffer = get_int(data + 6); int channels = (flags & MVE_AUDIO_FLAGS_STEREO) ? 2 : 1; int sample_size = (flags & MVE_AUDIO_FLAGS_16BIT) ? 2 : 1; @@ -338,12 +338,12 @@ static int video_codemap_handler(unsigned char major, unsigned char minor, unsig static int video_data_handler(unsigned char major, unsigned char minor, unsigned char *data, int len, void *context) { unsigned char *temp; - short nFrameHot = get_short(data); - short nFrameCold = get_short(data + 2); - short nXoffset = get_short(data + 4); - short nYoffset = get_short(data + 6); - short nXsize = get_short(data + 8); - short nYsize = get_short(data + 10); + // short nFrameHot = get_short(data); + // short nFrameCold = get_short(data + 2); + // short nXoffset = get_short(data + 4); + // short nYoffset = get_short(data + 6); + // short nXsize = get_short(data + 8); + // short nYsize = get_short(data + 10); unsigned short nFlags = get_ushort(data + 12); if (nFlags & 1) { diff --git a/manage/gamefilepage.cpp b/manage/gamefilepage.cpp index 1c03e3e7..b3d4bcf4 100644 --- a/manage/gamefilepage.cpp +++ b/manage/gamefilepage.cpp @@ -76,7 +76,7 @@ int mng_ReadNewGamefilePage(CFILE *infile, mngs_gamefile_page *gamefilepage) { ASSERT(infile != NULL); memset(gamefilepage, 0, sizeof(mngs_gamefile_page)); - int version = cf_ReadShort(infile); + /* int version = */ cf_ReadShort(infile); cf_ReadString(gamefilepage->gamefile_struct.name, PAGENAME_LEN, infile); cf_ReadString(gamefilepage->gamefile_struct.dir_name, PAGENAME_LEN, infile); diff --git a/manage/manage.cpp b/manage/manage.cpp index 97736b03..bf9d4b53 100644 --- a/manage/manage.cpp +++ b/manage/manage.cpp @@ -1480,7 +1480,7 @@ void mng_TransferPages() { continue; } pagetype = cf_ReadByte(infile); - int len = cf_ReadInt(infile); + /* int len = */ cf_ReadInt(infile); switch (pagetype) { case PAGETYPE_TEXTURE: mng_ReadNewTexturePage(infile, &texpage); @@ -2208,7 +2208,7 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype // If local is 1, deletes from the local table file int mng_DeletePage(char *name, int dest_pagetype, int local) { CFILE *infile, *outfile; - uint8_t pagetype, replaced = 0; + uint8_t pagetype; int done = 0; int deleted = 0; diff --git a/manage/megapage.cpp b/manage/megapage.cpp index abde9a3d..e0d03407 100644 --- a/manage/megapage.cpp +++ b/manage/megapage.cpp @@ -176,7 +176,7 @@ int mng_ReadNewMegacellPage(CFILE *infile, mngs_megacell_page *megacellpage) { int i; ASSERT(infile != NULL); memset(megacellpage, 0, sizeof(mngs_megacell_page)); - int version = cf_ReadShort(infile); + /* int version = */ cf_ReadShort(infile); cf_ReadString(megacellpage->megacell_struct.name, PAGENAME_LEN, infile); diff --git a/manage/pagelock.cpp b/manage/pagelock.cpp index c5ca7152..74c21be6 100644 --- a/manage/pagelock.cpp +++ b/manage/pagelock.cpp @@ -225,7 +225,6 @@ void mng_InitPagelocks() { // Returns pointer to locker's name, or NULL if the file is unlocked char *mng_CheckIfLockerPresent() { CFILE *infile; - int i = 0; static char lockname[200]; ASSERT(Network_up); @@ -380,7 +379,6 @@ int mng_CheckIfPageLocked(mngs_Pagelock *pl) { r = 2; } else { if (!stricmp(pl->name, testlock.name)) { - int test = 0; if (pl->pagetype == testlock.pagetype) { if (!stricmp(testlock.holder, "UNLOCKED")) r = 0; @@ -602,7 +600,7 @@ int mng_DeletePagelock(char *name, int pagetype) { // Given a list of names and a pagetype, deletes the ones already inside the lock file int mng_DeletePagelockSeries(char *names[], int num, int pagetype) { CFILE *infile, *outfile; - int done = 0, deleted = 0; + int done = 0; mngs_Pagelock temp_pl; infile = (CFILE *)cfopen(TableLockFilename, "rb"); @@ -656,7 +654,7 @@ int mng_DeletePagelockSeries(char *names[], int num, int pagetype) { // Goes through the pagelock table and deletes all duplicate entries int mng_DeleteDuplicatePagelocks() { CFILE *infile; //,*outfile; - int done = 0, deleted = 0; + int done = 0; mngs_Pagelock temp_pl; mngs_Pagelock *already_read; int num = 0, duplicates = 0, i; @@ -727,7 +725,7 @@ int mng_UnlockPagelockSeries(const char *names[], int *pagetypes, int num) { memset(already_done, 0, 500); CFILE *infile, *outfile; - int done = 0, deleted = 0; + int done = 0; mngs_Pagelock temp_pl; int total = 0; diff --git a/manage/soundpage.cpp b/manage/soundpage.cpp index bab72d60..883631a5 100644 --- a/manage/soundpage.cpp +++ b/manage/soundpage.cpp @@ -221,7 +221,7 @@ void mng_WriteNewSoundPage(CFILE *outfile, mngs_sound_page *soundpage) { // Reads a sound page from an open file. Returns 0 on error. int mng_ReadNewSoundPage(CFILE *infile, mngs_sound_page *soundpage) { ASSERT(infile != NULL); - int version = cf_ReadShort(infile); + /* int version = */ cf_ReadShort(infile); // read in name,rawfile name cf_ReadString(soundpage->sound_struct.name, PAGENAME_LEN, infile); cf_ReadString(soundpage->raw_name, PAGENAME_LEN, infile); diff --git a/manage/texpage.cpp b/manage/texpage.cpp index 53b4ae3c..581b53fa 100644 --- a/manage/texpage.cpp +++ b/manage/texpage.cpp @@ -762,9 +762,8 @@ int mng_ReadNewTexturePage(CFILE *infile, mngs_texture_page *texpage) { // If local is 1, deletes from the local table file int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) { CFILE *infile, *outfile; - uint8_t pagetype, replaced = 0; + uint8_t pagetype; int done = 0; - int deleted = 0; memset(&texpage1, 0, sizeof(mngs_texture_page)); if (local) @@ -796,7 +795,7 @@ int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) { continue; } pagetype = cf_ReadByte(infile); - int len = cf_ReadInt(infile); + /* int len = */ cf_ReadInt(infile); // If not a texture page, just read it in and write it right back out if (pagetype != PAGETYPE_TEXTURE) { diff --git a/model/newstyle.cpp b/model/newstyle.cpp index cf7d3940..aec00dee 100644 --- a/model/newstyle.cpp +++ b/model/newstyle.cpp @@ -510,7 +510,6 @@ inline void RenderSubmodelLightmapFace(poly_model *pm, bsp_info *sm, int facenum inline void RenderSubmodelFaceFogged(poly_model *pm, bsp_info *sm, int facenum) { g3Point *pointlist[100]; polyface *fp = &sm->faces[facenum]; - int modelnum = sm - pm->submodel; int t; for (t = 0; t < fp->nverts; t++) { @@ -561,7 +560,6 @@ inline void RenderSubmodelFaceFogged(poly_model *pm, bsp_info *sm, int facenum) inline void RenderSubmodelFaceSpecular(poly_model *pm, bsp_info *sm, int facenum) { g3Point *pointlist[100]; polyface *fp = &sm->faces[facenum]; - int modelnum = sm - pm->submodel; int t; bool smooth = 0; @@ -623,7 +621,6 @@ inline void RenderSubmodelFaceSpecular(poly_model *pm, bsp_info *sm, int facenum // Draws a glowing cone of light that represents thrusters void DrawThrusterEffect(vector *pos, float r, float g, float b, vector *norm, float size, float length) { vector cur_pos = *pos; - float cur_length = 0; vector glow_pos[MAX_PARTS]; float glow_size[MAX_PARTS]; int total_parts = 0; @@ -702,7 +699,6 @@ void RenderSubmodelFacesSorted(poly_model *pm, bsp_info *sm) { int rcount; int model_render_order[MAX_POLYGON_VECS]; - int modelnum = sm - pm->submodel; ASSERT(sm->nverts < MAX_POLYGON_VECS); diff --git a/model/polymodel.cpp b/model/polymodel.cpp index 1bec6b1b..da3615a7 100644 --- a/model/polymodel.cpp +++ b/model/polymodel.cpp @@ -2441,8 +2441,6 @@ void SetModelAngles(poly_model *po, const float *normalized_angles) { // Now do a parametric adjustment on the angles - int cur_angle = 0; - // If we're already at the high point of the interpolation then just // stuff some values if (cur_state == po->num_key_angles - 1) { @@ -2555,7 +2553,6 @@ void SetModelInterpPos(poly_model *po, const float *normalized_pos) { // Now do a parametric adjustment on the positions - vector total_delta_pos = {0, 0, 0}; vector subpos; vector final_pos; @@ -3122,7 +3119,6 @@ int CountFacesInPolymodel(poly_model *pm) { // of that point void GetPolyModelPointInWorld(vector *dest, poly_model *pm, vector *wpos, matrix *orient, int subnum, vector *pos, vector *norm) { - bsp_info *sm = &pm->submodel[subnum]; float normalized_time[MAX_SUBOBJECTS]; int i; @@ -3174,8 +3170,6 @@ void GetPolyModelPointInWorld(vector *dest, poly_model *pm, vector *wpos, matrix void GetPolyModelPointInWorld(vector *dest, poly_model *pm, vector *wpos, matrix *orient, int subnum, float *normalized_time, vector *pos, vector *norm) { - bsp_info *sm = &pm->submodel[subnum]; - ASSERT(!(pm->flags & PMF_NOT_RESIDENT)); if (!pm->new_style) diff --git a/module/module.cpp b/module/module.cpp index 121b6907..8dd72560 100644 --- a/module/module.cpp +++ b/module/module.cpp @@ -233,7 +233,6 @@ bool mod_FreeModule(module *handle) { // mod_GetLastError to see if there was an error symstr is the name of the function you want to get the symbol for (Do // NOT give any pre/suffix to this name) parmbytes is the size (in bytes) of the parameter list the function should have MODPROCADDRESS mod_GetSymbol(module *handle, const char *symstr, uint8_t parmbytes) { - char buffer[256]; MODPROCADDRESS sym; if (!handle) { ModLastError = MODERR_INVALIDHANDLE; @@ -248,6 +247,7 @@ MODPROCADDRESS mod_GetSymbol(module *handle, const char *symstr, uint8_t parmbyt return nullptr; } #if defined(WIN32) + char buffer[256]; // We need to first form the correct symbol name (for Windows) if (parmbytes == 255) sprintf(buffer, "%s", symstr); diff --git a/netcon/descent3onlineclient/odtclient.cpp b/netcon/descent3onlineclient/odtclient.cpp index 195eb899..39529875 100644 --- a/netcon/descent3onlineclient/odtclient.cpp +++ b/netcon/descent3onlineclient/odtclient.cpp @@ -440,7 +440,7 @@ int MainMultiplayerMenu() { // void HotSpotCreate(int item,int parentitem, int id, int key, int txtitemoff, int txtitemon, int x, int y, int w, // int h, int flags,int winnum) - void *exit_hs = DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0); + /* void *exit_hs = */ DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0); void *priv_hs = DLLHotSpotCreate(main_wnd, 6, 0, priv_msg_off_text, priv_msg_on_text, 328, 403, 170, 15, 0); @@ -1188,7 +1188,7 @@ int SearchMasterTrackerGameMenu() { // Menu loop while (!exit_menu) { if (ChatStarted) - const char *p = GetChatText(); + GetChatText(); DLLDescentDefer(); diff --git a/netcon/inetfile/CFtp.cpp b/netcon/inetfile/CFtp.cpp index dfeef42b..6fe9f500 100644 --- a/netcon/inetfile/CFtp.cpp +++ b/netcon/inetfile/CFtp.cpp @@ -134,7 +134,6 @@ CFtpGet::CFtpGet(char *URL, char *localfile, char *Username, char *Password) { } m_ListenSock = socket(AF_INET, SOCK_STREAM, 0); if (INVALID_SOCKET == m_ListenSock) { - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_SOCKET_ERROR; return; } else { @@ -145,7 +144,6 @@ CFtpGet::CFtpGet(char *URL, char *localfile, char *Username, char *Password) { // Bind the listen socket if (bind(m_ListenSock, (SOCKADDR *)&listensockaddr, sizeof(SOCKADDR))) { // Couldn't bind the socket - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_SOCKET_ERROR; return; } @@ -153,7 +151,6 @@ CFtpGet::CFtpGet(char *URL, char *localfile, char *Username, char *Password) { // Listen for the server connection if (listen(m_ListenSock, 1)) { // Couldn't listen on the socket - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_SOCKET_ERROR; return; } @@ -339,7 +336,6 @@ uint32_t CFtpGet::GetFile() { close(m_ListenSock); #endif if (m_DataSock == INVALID_SOCKET) { - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_SOCKET_ERROR; return 0; } @@ -363,7 +359,6 @@ uint32_t CFtpGet::IssuePort() { // Get the address for the hListenSocket iLength = sizeof(listenaddr); if (getsockname(m_ListenSock, (SOCKADDR *)&listenaddr, &iLength) == SOCKET_ERROR) { - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_SOCKET_ERROR; return 0; } @@ -374,7 +369,6 @@ uint32_t CFtpGet::IssuePort() { // Now, reuse the socket address structure to // get the IP address from the control socket. if (getsockname(m_ControlSock, (SOCKADDR *)&listenaddr, &iLength) == SOCKET_ERROR) { - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_SOCKET_ERROR; return 0; } @@ -411,7 +405,6 @@ uint32_t CFtpGet::IssuePort() { if (nReplyCode != 250 || (ReadFTPServerReply() != 200)) // ummmmmmmm #endif { - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_SOCKET_ERROR; return 0; } @@ -445,7 +438,6 @@ int CFtpGet::ConnectControlSocket() { return 0; // Now we will connect to the host if (connect(m_ControlSock, (SOCKADDR *)&hostaddr, sizeof(SOCKADDR))) { - int iWinsockErr = WSAGetLastError(); m_State = FTP_STATE_CANT_CONNECT; return 0; } @@ -479,7 +471,6 @@ uint32_t CFtpGet::SendFTPCommand(char *command) { FlushControlChannel(); // Send the FTP command if (SOCKET_ERROR == (send(m_ControlSock, command, strlen(command), 0))) { - int iWinsockErr = WSAGetLastError(); // Return 999 to indicate an error has occurred return (999); } @@ -579,7 +570,6 @@ uint32_t CFtpGet::ReadDataChannel() { void CFtpGet::FlushControlChannel() { fd_set read_fds; TIMEVAL timeout; - int bytesin = 0; char flushbuff[3]; timeout.tv_sec = 0; diff --git a/netcon/mtclient/mt_net.cpp b/netcon/mtclient/mt_net.cpp index ba3122f8..d8c669e2 100644 --- a/netcon/mtclient/mt_net.cpp +++ b/netcon/mtclient/mt_net.cpp @@ -182,7 +182,6 @@ void InitMTSockets() { } { - static HOSTENT lhe; memset(&sockaddr, 0, sizeof(SOCKADDR_IN)); gtrackaddr.sin_family = AF_INET; gtrackaddr.sin_addr.s_addr = INADDR_ANY; diff --git a/netcon/mtclient/mtclient.cpp b/netcon/mtclient/mtclient.cpp index bb30d5d7..31476caf 100644 --- a/netcon/mtclient/mtclient.cpp +++ b/netcon/mtclient/mtclient.cpp @@ -1094,7 +1094,7 @@ int MainMultiplayerMenu() { // void HotSpotCreate(int item,int parentitem, int id, int key, int txtitemoff, int txtitemon, int x, int y, int w, // int h, int flags,int winnum) - void *exit_hs = DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0); + /* void *exit_hs = */ DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0); void *priv_hs = DLLHotSpotCreate(main_wnd, 6, 0, priv_msg_off_text, priv_msg_on_text, 328, 403, 170, 15, 0); @@ -1371,7 +1371,6 @@ int MainMultiplayerMenu() { memset(fmtchan, 0, 500); - int textx = 0; int charpos = 0; int endpos; #define LIST_ROW1 90 @@ -1737,7 +1736,6 @@ int SearchMasterTrackerGameMenu() { int i = 0; float last_req_time; char selgame[200]; - void *selti = nullptr; void *return_text_on = DLLCreateNewUITextItem(TXT_PXO_RETURNTOCHAT, UICOL_HOTSPOT_HI); void *return_text_off = DLLCreateNewUITextItem(TXT_PXO_RETURNTOCHAT, UICOL_HOTSPOT_LO); void *game_head_text = DLLCreateNewUITextItem(TXT_PXO_GAMELISTHDR, UICOL_TEXT_NORMAL); @@ -1844,7 +1842,6 @@ int SearchMasterTrackerGameMenu() { DLLNewUIWindowLoadBackgroundImage(main_wnd, "pxogame.ogf"); DLLNewUIWindowOpen(main_wnd); *DLLNum_network_games_known = 0; - int lastgamesfound = 0; int itemp; last_req_time = DLLtimer_GetTime(); RequestGameList(); @@ -1854,7 +1851,7 @@ int SearchMasterTrackerGameMenu() { // Menu loop while (!exit_menu) { if (ChatStarted) - const char *p = GetChatText(); + GetChatText(); DLLDescentDefer(); IdleGameTracker(); diff --git a/netgames/anarchy/anarchy.cpp b/netgames/anarchy/anarchy.cpp index 8c093415..54f9a00a 100644 --- a/netgames/anarchy/anarchy.cpp +++ b/netgames/anarchy/anarchy.cpp @@ -822,7 +822,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); - int x = 520; ddgr_color color = 0; int rank = 1; diff --git a/netgames/ctf/ctf.cpp b/netgames/ctf/ctf.cpp index ce558f9b..c3b1779c 100644 --- a/netgames/ctf/ctf.cpp +++ b/netgames/ctf/ctf.cpp @@ -859,7 +859,6 @@ void OnClientCollide(uint8_t *data) { int pnum = me_obj->id; // player number int pteam = DMFCBase->GetPlayerTeam(pnum); // player's team int i; - bool play_return_home_msg = false; for (i = 0; i < CTFNumOfTeams; i++) { if (it_obj->id == FlagIDs[i]) @@ -876,7 +875,6 @@ void OnClientCollide(uint8_t *data) { // Did player collide with his own team's flag? if (fteam == pteam) { - int16_t flag_count = 0; vector fpos; int groom; int flagcount; @@ -963,7 +961,6 @@ void OnClientCollide(uint8_t *data) { TeamScores[pteam] += score; OverallTeamScores[pteam] += score; - int newscore = TeamScores[pteam]; switch (flagcount) { case 1: { @@ -1121,7 +1118,6 @@ void OnClientLevelEnd(void) { DMFCBase->OnClientLevelEnd(); } void OnPlayerChangeTeam(int player_num, int newteam, bool announce, bool spew_onrespawn) { DMFCBase->OnPlayerChangeTeam(player_num, newteam, announce, spew_onrespawn); - player_record *pr = DMFCBase->GetPlayerRecordByPnum(player_num); } // OnClientPlayerKilled @@ -2183,8 +2179,6 @@ bool AddFlagToPlayer(int pnum, int team, int flagobjnum) { // RemoveFlagFromPlayer // removes a flag from a player bool RemoveFlagFromPlayer(int pnum, int team) { - int flagobjnum = -1; - if (DMFCBase->GetLocalRole() == LR_SERVER) { if (ChildFlags[team] == OBJECT_HANDLE_NONE) diff --git a/netgames/dmfc/dmfcinputcommand.cpp b/netgames/dmfc/dmfcinputcommand.cpp index 6be7eb62..a5d351f4 100644 --- a/netgames/dmfc/dmfcinputcommand.cpp +++ b/netgames/dmfc/dmfcinputcommand.cpp @@ -921,7 +921,6 @@ void DMFCInputCommand_Piggyback(const char *input_string) { } char s[20]; - bool turn_on = true; object *pobj; int pnum = basethis->GetPlayerNum(); pobj = &basethis->Objects[basethis->Players[pnum].objnum]; diff --git a/netgames/entropy/EntropyBase.cpp b/netgames/entropy/EntropyBase.cpp index f03c6125..db53a01b 100644 --- a/netgames/entropy/EntropyBase.cpp +++ b/netgames/entropy/EntropyBase.cpp @@ -1738,7 +1738,6 @@ void DisplayWelcomeMessage(int player_num) { } void OnLabSpewTimer(void) { - int max_rooms = DMFCBase->GetHighestRoomIndex() + 1; int objnum; int index; int virus_count; diff --git a/netgames/hoard/hoard.cpp b/netgames/hoard/hoard.cpp index 9dc343f1..2149f715 100644 --- a/netgames/hoard/hoard.cpp +++ b/netgames/hoard/hoard.cpp @@ -74,7 +74,6 @@ IDMFC *DMFCBase = NULL; static IDmfcStats *dstat = NULL; -static IMenuItem *OSMenuSave = NULL; static object *dObjects = NULL; static player *dPlayers = NULL; @@ -1268,7 +1267,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) { if (DisplayScoreScreen) return; - int x = 520; int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); diff --git a/netgames/hyperanarchy/hyperanarchy.cpp b/netgames/hyperanarchy/hyperanarchy.cpp index 7830b472..11dac65e 100644 --- a/netgames/hyperanarchy/hyperanarchy.cpp +++ b/netgames/hyperanarchy/hyperanarchy.cpp @@ -1149,7 +1149,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); - int x = 510; int rank = 1; ddgr_color color = 0; bool hasorb; diff --git a/netgames/monsterball/monsterball.cpp b/netgames/monsterball/monsterball.cpp index eb333184..5a28bae4 100644 --- a/netgames/monsterball/monsterball.cpp +++ b/netgames/monsterball/monsterball.cpp @@ -262,7 +262,6 @@ static int Highlight_bmp; static int LastHitPnum = -1; static bool players_sorted = false; // the Sorted*[] have been sorted -static bool DisplayPowerBBlink = true; static bool DisplayScoreBlink = true; static bool DisplayScoreScreen = false; static bool display_my_welcome = false; @@ -1696,8 +1695,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int score_width = DLLgrtext_GetTextLineWidth("888"); int name_x = DMFCBase->GetGameWindowW() - name_width - score_width - 10; int score_x = DMFCBase->GetGameWindowW() - score_width - 5; - int icon_size = height - 3; - int icon_x = name_x - icon_size - 3; DLLgrtext_SetAlpha(alpha); char name[256]; @@ -1921,9 +1918,6 @@ void HandleMonsterballCollideWithWeapon(object *ball, weapon_collide_info *winfo void bump_object(object *object0, vector *rotvel, vector *velocity, vector *pos, matrix *orient, float mass, float size, vector *collision_point, vector *collision_normal, float rot_scalar, float vel_scalar) { - object *t = NULL; - object *other = NULL; - ASSERT(std::isfinite(rotvel->x)); ASSERT(std::isfinite(rotvel->y)); ASSERT(std::isfinite(rotvel->z)); diff --git a/netgames/roboanarchy/roboanarchy.cpp b/netgames/roboanarchy/roboanarchy.cpp index 678c3fbc..e49f1b07 100644 --- a/netgames/roboanarchy/roboanarchy.cpp +++ b/netgames/roboanarchy/roboanarchy.cpp @@ -817,7 +817,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); - int x = 520; ddgr_color color; int rank = 1; diff --git a/networking/networking.cpp b/networking/networking.cpp index 20338821..04f4d12e 100644 --- a/networking/networking.cpp +++ b/networking/networking.cpp @@ -408,9 +408,6 @@ static int16_t Packet_free_list[MAX_PACKET_BUFFERS]; // contains i static int Num_packet_buffers; static int Largest_packet_index = 0; -static int Uncompressed_outgoing_data_len = 0; -static int Compressed_outgoing_data_len = 0; - int Next_packet_id; int Last_packet_id; @@ -466,8 +463,6 @@ struct reliable_net_rcvbuffer { uint8_t buffer[NETBUFFERSIZE]; }; -static SOCKET Reliable_UDP_socket = INVALID_SOCKET; - static float first_sent_iamhere = 0; static float last_sent_iamhere = 0; @@ -577,14 +572,7 @@ void nw_InitNetworking(int iReadBufSizeOverride) { WORD ver = MAKEWORD(1, 1); #endif - static char exewithpath[_MAX_PATH * 2]; - static char exefile[_MAX_PATH * 2]; - static char ourargs[_MAX_PATH * 2]; - static char exedir[_MAX_PATH * 2]; - static char exeext[_MAX_PATH]; - static char *fixdir; static char szconntype[100]; - int parmlen; int len = 99; Database->read("NetworkConnection", szconntype, &len); if (stricmp(szconntype, "DIALUP") == 0) { @@ -612,10 +600,17 @@ void nw_InitNetworking(int iReadBufSizeOverride) { } #ifdef WIN32 if (!dp_DidLobbyLaunchGame()) { + static char exewithpath[_MAX_PATH * 2]; + static char exefile[_MAX_PATH * 2]; + static char ourargs[_MAX_PATH * 2]; + static char exedir[_MAX_PATH * 2]; + static char exeext[_MAX_PATH]; + static char *fixdir; + // Tell direct play about this game char *p = GetCommandLine(); LOG_DEBUG.printf("Command line: %s", p); - parmlen = strlen(p); + int parmlen = strlen(p); int a; for (a = 0; a < parmlen; ++a) { @@ -851,7 +846,6 @@ void nw_GetNumbersFromHostAddress(network_address *address, char *str) { // returns the ip address of this computer uint32_t nw_GetThisIP() { SOCKADDR_IN local_address; - int address_size = sizeof(SOCKADDR); if (Net_fixed_ip != INADDR_NONE) { return Net_fixed_ip; @@ -1078,7 +1072,6 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { int use_buffer = -1; reliable_socket *rsocket; reliable_header send_header; - int send_this_packet = 1; if (length == 0) { LOG_ERROR << "Attempting to send 0 byte network packet in nw_SendReliable()"; @@ -1252,12 +1245,9 @@ void nw_DoNetworkIdle(void) { void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { int i; - int rcode = -1; int16_t max_len = NETBUFFERSIZE; static reliable_header rcv_buff; static SOCKADDR rcv_addr; - int bytesin = 0; - int addrlen = sizeof(SOCKADDR); uint32_t rcvid; // The id of who we actually received a packet from, as opposed to socketid parm if (NP_TCP == naddr->connection_type) { @@ -2505,11 +2495,6 @@ int nw_DoReceiveCallbacks(void) { void nw_ReliableResend(void) { int i, j; int rcode = -1; - int16_t max_len = NETBUFFERSIZE; - static reliable_header rcv_buff; - static SOCKADDR rcv_addr; - int bytesin = 0; - int addrlen = sizeof(SOCKADDR); reliable_socket *rsocket = NULL; // Go through each reliable socket that is connected and do any needed work. for (j = 0; j < MAXRELIABLESOCKETS; j++) { diff --git a/physics/collide.cpp b/physics/collide.cpp index ec059dc7..77c52fd2 100644 --- a/physics/collide.cpp +++ b/physics/collide.cpp @@ -1573,7 +1573,6 @@ void ConvertAxisAmountToEuler(vector *n, float *w, vector *e) { float t; float scale = *w / .0001f; - float w_n = .0001f; vector s_result; if (*w == 0.0f) { @@ -2159,7 +2158,6 @@ void collide_generic_and_weapon(object *robotobj, object *weapon, vector *collis float damage_to_apply; uint8_t electrical = (Weapons[weapon->id].flags & WF_ELECTRICAL) ? 1 : 0; bool f_stick = ((weapon->mtype.phys_info.flags & PF_STICK) != 0); - bool f_energy = ((Weapons[weapon->id].flags & WF_MATTER_WEAPON) == 0); int damage_type; // Check for lava & volatile surfaces on an object diff --git a/physics/findintersection.cpp b/physics/findintersection.cpp index bedcd077..d52cde6d 100644 --- a/physics/findintersection.cpp +++ b/physics/findintersection.cpp @@ -2123,7 +2123,6 @@ int fvi_QuickDistObjectList(vector *pos, int init_room_index, float rad, int16_t fvi_wall_max_xyz = fvi_max_xyz; if (ROOMNUM_OUTSIDE(init_room_index)) { - int num_cells = 0; int next_y_delta; int xstart, xend, ystart, yend; int check_x, check_y; @@ -3326,7 +3325,6 @@ void check_hit_obj(int objnum) { vector hit_point; float cur_dist; const object *obj = &Objects[objnum]; - bool f_x = false; int collision_type; int m_obj_index = fvi_query_ptr->thisobjnum; object *m_obj = &Objects[m_obj_index]; @@ -4461,7 +4459,6 @@ int fvi_room(int room_index, int from_portal, int room_obj) { int portal_num; // vector col_point[32]; // vector col_normal[32]; - int num_cols = 0; object *this_obj; uint8_t msector = 0; diff --git a/physics/physics.cpp b/physics/physics.cpp index 31badcd1..e2c23b41 100644 --- a/physics/physics.cpp +++ b/physics/physics.cpp @@ -1948,7 +1948,6 @@ void do_walking_sim(object *obj) { vector total_force = Zero_vector; // Constant force acting on an object bool f_continue_sim; // Should we run another simulation loop - bool f_start_fvi_record = true; // Records the rooms that are passed thru poly_model *pm = &Poly_models[obj->rtype.pobj_info.model_num]; @@ -1974,8 +1973,6 @@ void do_walking_sim(object *obj) { obj->flags &= (~OF_STOPPED_THIS_FRAME); // Do rotation velocity/accel stuff - bool f_rotated = false; - if (!(fabs(pi->velocity.x) > .000001 || fabs(pi->velocity.y) > .000001 || fabs(pi->velocity.z) > .000001 || fabs(pi->thrust.x) > .000001 || fabs(pi->thrust.y) > .000001 || fabs(pi->thrust.z) > .000001 || fabs(pi->rotvel.x) > .000001 || fabs(pi->rotvel.y) > .000001 || fabs(pi->rotvel.z) > .000001 || diff --git a/ui/UIListBox.cpp b/ui/UIListBox.cpp index 6db8e369..5882ec6f 100644 --- a/ui/UIListBox.cpp +++ b/ui/UIListBox.cpp @@ -696,8 +696,6 @@ void UIListBox::OnDraw() { // behavior when key is pressed. void UIListBox::OnKeyDown(int key) { - UIGadget *gadget = this; - if (key == KEY_UP) { if (m_SelectedIndex > 0) { if (m_SelectedIndex == m_Index) @@ -837,7 +835,6 @@ void UIListBox::OnUserProcess() { // check if x and y selection hits a selected item. bool UIListBox::MseCheckSelect(int x, int y) { int i, ty; - bool use_scroll = !(m_Flags & UILB_NOSCROLL); if (!m_NumItems) return false; diff --git a/ui/UISystem.cpp b/ui/UISystem.cpp index 6fe0b005..00ed5cd3 100644 --- a/ui/UISystem.cpp +++ b/ui/UISystem.cpp @@ -539,8 +539,6 @@ bool ui_HideCursor() { } // set user interface screen resolution void ui_SetScreenMode(int w, int h) { - int old_w = UI_screen_width; - int old_h = UI_screen_height; UI_screen_width = w; UI_screen_height = h; UI_aspect_x = (float)w / (float)FIXED_SCREEN_WIDTH;