Merge pull request #117 from GravisZro/fix/warnings

More simple warning fixes
This commit is contained in:
Louis Gombert 2024-04-20 21:40:09 +00:00 committed by GitHub
commit 9e56f39ae6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 16 deletions

View File

@ -1573,20 +1573,20 @@ bool compute_dodge_dir(/* vector *dodge_dir, */ object *obj, object *dodge_obj);
// Inside walkers will suck resources // Inside walkers will suck resources
extern char *Ai_class_strings[MAX_AI_INIT_CLASSES] = {"Static", "Pure Path", "Fully AIS"}; const char *const Ai_class_strings[MAX_AI_INIT_CLASSES] = {"Static", "Pure Path", "Fully AIS"};
extern char *Ai_type_strings[MAX_AI_INIT_TYPES] = { const char *const Ai_type_strings[MAX_AI_INIT_TYPES] = {
"Fly Lander", "Stalker", "Evader 1", "Evader 2", "Stationary Turret", "AIS", "Melee1", "Bird Flock 1", "Herd 1"}; "Fly Lander", "Stalker", "Evader 1", "Evader 2", "Stationary Turret", "AIS", "Melee1", "Bird Flock 1", "Herd 1"};
extern char *Ai_movement_type_strings[MAX_AI_INIT_MOVEMENT_TYPES] = {"Standing", "Flying", "Rolling", "Walking"}; const char *const Ai_movement_type_strings[MAX_AI_INIT_MOVEMENT_TYPES] = {"Standing", "Flying", "Rolling", "Walking"};
// AI Movement flying types // AI Movement flying types
extern char *Ai_movement_subtype_flying_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES] = { const char *const Ai_movement_subtype_flying_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES] = {
"Normal", "Path", "Helicopter", "Hovercraft", "Jet", "Player", "Buddy"}; "Normal", "Path", "Helicopter", "Hovercraft", "Jet", "Player", "Buddy"};
// AI Movement walking types // AI Movement walking types
extern char *Ai_movement_subtype_walking_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES] = { const char *const Ai_movement_subtype_walking_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES] = {
"Restricted Flat", "Restricted Low-angle", "Restricted High_angle", "Non-restricted", "Water Only", "", ""}; "Restricted Flat", "Restricted Low-angle", "Restricted High_angle", "Non-restricted", "Water Only", "", ""};
#define AI_MAX_MELEE_RANGE 5.0f #define AI_MAX_MELEE_RANGE 5.0f

View File

@ -417,17 +417,17 @@ extern vector ai_lkplayer_velocity;
extern float ai_lkplayer_time; extern float ai_lkplayer_time;
#define MAX_AI_INIT_CLASSES 3 #define MAX_AI_INIT_CLASSES 3
extern char *Ai_class_strings[MAX_AI_INIT_CLASSES]; extern const char *const Ai_class_strings[MAX_AI_INIT_CLASSES];
#define MAX_AI_INIT_TYPES 9 #define MAX_AI_INIT_TYPES 9
extern char *Ai_type_strings[MAX_AI_INIT_TYPES]; extern const char *const Ai_type_strings[MAX_AI_INIT_TYPES];
#define MAX_AI_INIT_MOVEMENT_TYPES 4 #define MAX_AI_INIT_MOVEMENT_TYPES 4
extern char *Ai_movement_type_strings[MAX_AI_INIT_MOVEMENT_TYPES]; extern const char *const Ai_movement_type_strings[MAX_AI_INIT_MOVEMENT_TYPES];
#define MAX_AI_INIT_MOVEMENT_SUBTYPES 7 #define MAX_AI_INIT_MOVEMENT_SUBTYPES 7
extern char *Ai_movement_subtype_flying_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES]; extern const char *const Ai_movement_subtype_flying_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES];
extern char *Ai_movement_subtype_walking_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES]; extern const char *const Ai_movement_subtype_walking_strings[MAX_AI_INIT_MOVEMENT_SUBTYPES];
extern float AI_last_time_room_noise_alert_time[MAX_ROOMS + 8]; extern float AI_last_time_room_noise_alert_time[MAX_ROOMS + 8];
@ -879,4 +879,4 @@ extern ai_dynamic_path AIDynamicPath[MAX_DYNAMIC_PATHS];
extern int AIAltPath[MAX_ROOMS]; extern int AIAltPath[MAX_ROOMS];
extern int AIAltPathNumNodes; extern int AIAltPathNumNodes;
#endif #endif

View File

@ -527,7 +527,7 @@ int MainMultiplayerMenu() {
net_game_txt_items[k] = DLLCreateNewUITextItem(fmtline, GR_LIGHTGRAY); net_game_txt_items[k] = DLLCreateNewUITextItem(fmtline, GR_LIGHTGRAY);
} }
selgame[20] = NULL; selgame[20] = '\0';
if (strncmp(selgame, DLLNetwork_games[k].name, 19) == 0) { if (strncmp(selgame, DLLNetwork_games[k].name, 19) == 0) {
selti = net_game_txt_items[k]; selti = net_game_txt_items[k];
DLLmprintf((0, "Found previously selected game in list, reselecting...\n")); DLLmprintf((0, "Found previously selected game in list, reselecting...\n"));
@ -549,7 +549,7 @@ int MainMultiplayerMenu() {
if (selno >= 0) if (selno >= 0)
strcpy(selgame, DLLNetwork_games[selno].name); strcpy(selgame, DLLNetwork_games[selno].name);
else else
selgame[0] = NULL; selgame[0] = '\0';
} }
res = DLLPollUI(); res = DLLPollUI();
@ -615,7 +615,7 @@ int MainMultiplayerMenu() {
if (selno >= 0) if (selno >= 0)
strcpy(selgame, DLLNetwork_games[selno].name); strcpy(selgame, DLLNetwork_games[selno].name);
else else
selgame[0] = NULL; selgame[0] = '\0';
DLLSearchForLocalGamesTCP(0xffffffffl, htons(DEFAULT_GAME_PORT)); DLLSearchForLocalGamesTCP(0xffffffffl, htons(DEFAULT_GAME_PORT));
DLLListRemoveAll(main_list); DLLListRemoveAll(main_list);
@ -637,7 +637,7 @@ int MainMultiplayerMenu() {
char *pport = strchr(szdip, ':'); char *pport = strchr(szdip, ':');
if (pport) { if (pport) {
*pport = NULL; *pport = '\0';
pport++; pport++;
iport = atoi(pport); iport = atoi(pport);
} }

View File

@ -394,7 +394,7 @@ typedef int (*Obj_Create_fp)(ubyte type, ushort id, int roomnum, vector *pos, co
vector *initial_velocity); vector *initial_velocity);
OSIRISEXTERN Obj_Create_fp Obj_CreateFP; OSIRISEXTERN Obj_Create_fp Obj_CreateFP;
inline int Obj_Create(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL, inline int Obj_Create(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL,
int parent_handle = NULL, vector *initial_velocity = NULL) { int parent_handle = 0, vector *initial_velocity = NULL) {
return Obj_CreateFP(type, id, roomnum, pos, orient, parent_handle, initial_velocity); return Obj_CreateFP(type, id, roomnum, pos, orient, parent_handle, initial_velocity);
} }
// float Game_GetTime() (void) // float Game_GetTime() (void)