Browse Source

Fix some write-strings warnings

Declare const char* arguments to get proper string conversion. Some of
these warnings still remain, as it involves code from Source/ directory.

According to https://github.com/diasurgical/devilutionX/issues/279,
those fixes should not be made outside of SourceX/.
pull/401/head
Guillaume Roche 7 years ago committed by Anders Jenbo
parent
commit
1bfd062b3c
  1. 2
      SourceX/DiabloUI/diabloui.cpp
  2. 2
      SourceX/DiabloUI/diabloui.h
  3. 2
      SourceX/DiabloUI/fonts.cpp
  4. 9
      SourceX/DiabloUI/mainmenu.cpp

2
SourceX/DiabloUI/diabloui.cpp

@ -489,7 +489,7 @@ int GetCenterOffset(int w, int bw)
return (bw - w) / 2;
}
void LoadBackgroundArt(char *pszFile)
void LoadBackgroundArt(const char *pszFile)
{
PALETTEENTRY pPal[256];

2
SourceX/DiabloUI/diabloui.h

@ -45,7 +45,7 @@ bool UiItemMouseEvents(SDL_Event *event, UiItem *items, std::size_t size);
int GetCenterOffset(int w, int bw = 0);
void LoadPalInMem(const PALETTEENTRY *pPal);
void DrawMouse();
void LoadBackgroundArt(char *pszFile);
void LoadBackgroundArt(const char *pszFile);
void SetMenu(int MenuId);
void UiFocusNavigationSelect();
void UiFocusNavigationEsc();

2
SourceX/DiabloUI/fonts.cpp

@ -8,7 +8,7 @@ Art ArtFonts[4][2];
namespace {
void LoadArtFont(char *pszFile, int size, int color)
void LoadArtFont(const char *pszFile, int size, int color)
{
LoadMaskedArt(pszFile, &ArtFonts[size][color], 256, 32);
}

9
SourceX/DiabloUI/mainmenu.cpp

@ -43,10 +43,11 @@ void mainmenu_Load(char *name, void (*fnSound)(char *file))
MainMenuResult = 0;
char *pszFile = "ui_art\\mainmenu.pcx";
if (false) //DiabloUI_GetSpawned()
pszFile = "ui_art\\swmmenu.pcx";
LoadBackgroundArt(pszFile);
if (!gbSpawned) {
LoadBackgroundArt("ui_art\\mainmenu.pcx");
} else {
LoadBackgroundArt("ui_art\\swmmenu.pcx");
}
UiInitList(MAINMENU_SINGLE_PLAYER, MAINMENU_EXIT_DIABLO, NULL, UiMainMenuSelect, mainmenu_Esc, MAINMENU_DIALOG, size(MAINMENU_DIALOG), true);
}

Loading…
Cancel
Save