Browse Source

Fix a few compiler warnings

pull/1040/head
Anders Jenbo 5 years ago
parent
commit
0da09df7d6
  1. 12
      Source/diablo.cpp
  2. 8
      Source/objdat.cpp
  3. 8
      Source/objdat.h

12
Source/diablo.cpp

@ -1168,15 +1168,17 @@ static void PressChar(WPARAM vkey)
AutomapZoomOut();
}
return;
case 'v':
char *difficulties[3];
case 'v': {
char pszStr[120];
difficulties[0] = "Normal";
difficulties[1] = "Nightmare";
difficulties[2] = "Hell";
const char *difficulties[3] = {
"Normal",
"Nightmare",
"Hell",
};
sprintf(pszStr, "%s, mode = %s", gszProductName, difficulties[gnDifficulty]);
NetSendCmdString(1 << myplr, pszStr);
return;
}
case 'V':
NetSendCmdString(1 << myplr, gszVersionNumber);
return;

8
Source/objdat.cpp

@ -8,7 +8,7 @@
DEVILUTION_BEGIN_NAMESPACE
/** Maps from dun_object_id to object_id. */
int ObjTypeConv[] = {
const int ObjTypeConv[] = {
0,
OBJ_LEVER,
OBJ_CRUX1,
@ -151,7 +151,7 @@ int ObjTypeConv[] = {
};
/** Contains the data related to each object ID. */
ObjDataStruct AllObjects[] = {
const ObjDataStruct AllObjects[] = {
// clang-format off
// oload, ofindex, ominlvl, omaxlvl, olvltype, otheme, oquest, oAnimFlag, oAnimDelay, oAnimLen, oAnimWidth, oSolidFlag, oMissFlag, oLightFlag, oBreak, oSelFlag, oTrapFlag
{ 1, OFILE_L1BRAZ, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, -1, 1, 1, 26, 64, TRUE, TRUE, FALSE, 0, 0, FALSE },
@ -317,7 +317,7 @@ const char *const ObjMasterLoadList[] = {
"LzStand"
};
/** Maps from object_graphic_id to object CEL name (Hellfire Crypt overwrite). */
char *ObjCryptLoadList[] = {
const char *ObjCryptLoadList[] = {
"L1Braz",
"L5Door",
"L5Lever",
@ -376,7 +376,7 @@ char *ObjCryptLoadList[] = {
"LzStand",
};
/** Maps from object_graphic_id to object CEL name (Hellfire Hive overwrite). */
char *ObjHiveLoadList[] = {
const char *ObjHiveLoadList[] = {
"L1Braz",
"L1Doors",
"Lever",

8
Source/objdat.h

@ -12,11 +12,11 @@ DEVILUTION_BEGIN_NAMESPACE
extern "C" {
#endif
extern int ObjTypeConv[];
extern ObjDataStruct AllObjects[];
extern const int ObjTypeConv[];
extern const ObjDataStruct AllObjects[];
extern const char *const ObjMasterLoadList[];
extern char *ObjCryptLoadList[];
extern char *ObjHiveLoadList[];
extern const char *ObjCryptLoadList[];
extern const char *ObjHiveLoadList[];
#ifdef __cplusplus
}

Loading…
Cancel
Save