Fix warnings

This commit is contained in:
Jaime Passos 2019-12-18 15:41:03 -03:00
parent 7c3cde4564
commit 94f2b8f970
3 changed files with 16 additions and 19 deletions

View file

@ -1140,7 +1140,6 @@ static void readgametype(MYFILE *f, char *gtname)
UINT8 newgtleftcolor = 0;
UINT8 newgtrightcolor = 0;
char gtdescription[441];
const char *gtnamestring;
do
{
@ -1254,9 +1253,7 @@ static void readgametype(MYFILE *f, char *gtname)
G_SetGametypeDescription(newgtidx, gtdescription, newgtleftcolor, newgtrightcolor);
// Write the new gametype name.
gtnamestring = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
memcpy((void *)gtnamestring, gtname, MAXLINELEN);
Gametype_Names[newgtidx] = gtnamestring;
Gametype_Names[newgtidx] = Z_StrDup((const char *)gtname);
// Update gametype_cons_t accordingly.
G_UpdateGametypeSelections();
@ -4506,23 +4503,23 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
// Get the gametype name from textline
// instead of word2, so that gametype names
// aren't allcaps
INT32 i;
for (i = 0; i < MAXLINELEN; i++)
INT32 c;
for (c = 0; c < MAXLINELEN; c++)
{
if (textline[i] == '\0')
if (textline[c] == '\0')
break;
if (textline[i] == ' ')
if (textline[c] == ' ')
{
char *gtname = (textline+i+1);
char *gtname = (textline+c+1);
if (gtname)
{
// remove funny characters
INT32 j;
for (j = 0; j < (MAXLINELEN - i); j++)
for (j = 0; j < (MAXLINELEN - c); j++)
{
if (gtname[j] == '\0')
break;
if (gtname[j] < 32 || gtname[j] > 127)
if (gtname[j] < 32)
gtname[j] = '\0';
}
readgametype(f, gtname);

View file

@ -3152,9 +3152,9 @@ void G_UpdateGametypeSelections(void)
// Set a description for the specified gametype.
// (Level platter)
//
void G_SetGametypeDescription(INT16 gtype, char *description, UINT8 leftcolor, UINT8 rightcolor)
void G_SetGametypeDescription(INT16 gtype, char *descriptiontext, UINT8 leftcolor, UINT8 rightcolor)
{
strncpy(gametypedesc[gtype].notes, description, 441);
strncpy(gametypedesc[gtype].notes, descriptiontext, 441);
gametypedesc[gtype].col[0] = leftcolor;
gametypedesc[gtype].col[1] = rightcolor;
}
@ -3194,9 +3194,9 @@ void G_AddTOL(UINT32 newtol, const char *tolname)
//
// Assigns a type of level to a gametype.
//
void G_AddGametypeTOL(INT16 gametype, UINT32 newtol)
void G_AddGametypeTOL(INT16 gtype, UINT32 newtol)
{
gametypetol[gametype] = newtol;
gametypetol[gtype] = newtol;
}
//
@ -3342,7 +3342,7 @@ INT16 G_TOLFlag(INT32 pgametype)
* has those flags.
* \author Graue <graue@oceanbase.org>
*/
static INT16 RandMap(INT16 tolflags, INT16 pprevmap)
static INT16 RandMap(UINT32 tolflags, INT16 pprevmap)
{
INT16 *okmaps = Z_Malloc(NUMMAPS * sizeof(INT16), PU_STATIC, NULL);
INT32 numokmaps = 0;

View file

@ -206,10 +206,10 @@ extern UINT32 gametypetol[NUMGAMETYPES];
void G_SetGametype(INT16 gametype);
INT16 G_AddGametype(UINT32 rules);
void G_UpdateGametypeSelections();
void G_UpdateGametypeSelections(void);
void G_AddTOL(UINT32 newtol, const char *tolname);
void G_AddGametypeTOL(INT16 gametype, UINT32 newtol);
void G_SetGametypeDescription(INT16 gtype, char *description, UINT8 leftcolor, UINT8 rightcolor);
void G_AddGametypeTOL(INT16 gtype, UINT32 newtol);
void G_SetGametypeDescription(INT16 gtype, char *descriptiontext, UINT8 leftcolor, UINT8 rightcolor);
INT32 G_GetGametypeByName(const char *gametypestr);
boolean G_IsSpecialStage(INT32 mapnum);