Merge pull request #400 from ccawley2011/write-strings

Fix all -Wwrite-strings warnings
This commit is contained in:
Arisotura 2019-05-05 04:16:22 +02:00 committed by GitHub
commit fdd20c48ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 18 deletions

View File

@ -30,7 +30,7 @@ typedef struct
int Type;
void* Value;
int DefaultInt;
char* DefaultStr;
const char* DefaultStr;
int StrLength; // should be set to actual array length minus one
} ConfigEntry;

View File

@ -129,7 +129,7 @@ void Reset()
fclose(f);
// take a backup
char* firmbkp = "firmware.bin.bak";
const char* firmbkp = "firmware.bin.bak";
f = fopen(firmbkp, "rb");
if (f) fclose(f);
else

View File

@ -47,9 +47,9 @@
* different minor means adjustments may have to be made
*/
Savestate::Savestate(char* filename, bool save)
Savestate::Savestate(const char* filename, bool save)
{
char* magic = "MELN";
const char* magic = "MELN";
Error = false;
@ -153,7 +153,7 @@ Savestate::~Savestate()
if (file) fclose(file);
}
void Savestate::Section(char* magic)
void Savestate::Section(const char* magic)
{
if (Error) return;

View File

@ -28,7 +28,7 @@
class Savestate
{
public:
Savestate(char* filename, bool save);
Savestate(const char* filename, bool save);
~Savestate();
bool Error;
@ -39,7 +39,7 @@ public:
u32 CurSection;
void Section(char* magic);
void Section(const char* magic);
void Var8(u8* var);
void Var16(u16* var);

View File

@ -32,7 +32,7 @@ static char *runSavePanel(NSWindow *parent, NSSavePanel *s)
return filename;
}
char *uiOpenFile(uiWindow *parent, char* filter, char* initpath)
char *uiOpenFile(uiWindow *parent, const char* filter, const char* initpath)
{
NSOpenPanel *o;
@ -46,7 +46,7 @@ char *uiOpenFile(uiWindow *parent, char* filter, char* initpath)
return runSavePanel(windowWindow(parent), o);
}
char *uiSaveFile(uiWindow *parent, char* filter, char* initpath)
char *uiSaveFile(uiWindow *parent, const char* filter, const char* initpath)
{
NSSavePanel *s;

View File

@ -283,8 +283,8 @@ _UI_EXTERN uiMenuItem *uiMenuAppendSubmenu(uiMenu *m, uiMenu* child);
_UI_EXTERN void uiMenuAppendSeparator(uiMenu *m);
_UI_EXTERN uiMenu *uiNewMenu(const char *name);
_UI_EXTERN char *uiOpenFile(uiWindow *parent, char* filter, char* initpath);
_UI_EXTERN char *uiSaveFile(uiWindow *parent, char* filter, char* initpath);
_UI_EXTERN char *uiOpenFile(uiWindow *parent, const char* filter, const char* initpath);
_UI_EXTERN char *uiSaveFile(uiWindow *parent, const char* filter, const char* initpath);
_UI_EXTERN void uiMsgBox(uiWindow *parent, const char *title, const char *description);
_UI_EXTERN void uiMsgBoxError(uiWindow *parent, const char *title, const char *description);

View File

@ -163,7 +163,7 @@ uiDrawBitmap* uiDrawNewBitmap(uiDrawContext* c, int width, int height)
void uiDrawBitmapUpdate(uiDrawBitmap* bmp, const void* data)
{
unsigned char* src = data;
const unsigned char* src = data;
unsigned char* dst = cairo_image_surface_get_data(bmp->bmp);
if (bmp->Stride == bmp->Width*4)

View File

@ -6,7 +6,7 @@
#define windowWindow(w) ((w)?(GTK_WINDOW(uiControlHandle(uiControl(w)))):NULL)
static char *filedialog(GtkWindow *parent, GtkFileChooserAction mode, const gchar *confirm, char* filter, char* initpath)
static char *filedialog(GtkWindow *parent, GtkFileChooserAction mode, const gchar *confirm, const char* filter, const char* initpath)
{
GtkWidget *fcd;
GtkFileChooser *fc;
@ -83,12 +83,12 @@ static char *filedialog(GtkWindow *parent, GtkFileChooserAction mode, const gcha
return filename;
}
char *uiOpenFile(uiWindow *parent, char* filter, char* initpath)
char *uiOpenFile(uiWindow *parent, const char* filter, const char* initpath)
{
return filedialog(windowWindow(parent), GTK_FILE_CHOOSER_ACTION_OPEN, "_Open", filter, initpath);
}
char *uiSaveFile(uiWindow *parent, char* filter, char* initpath)
char *uiSaveFile(uiWindow *parent, const char* filter, const char* initpath)
{
return filedialog(windowWindow(parent), GTK_FILE_CHOOSER_ACTION_SAVE, "_Save", filter, initpath);
}

View File

@ -16,7 +16,7 @@
#define windowHWND(w) (w ? (HWND) uiControlHandle(uiControl(w)) : NULL)
char *commonItemDialog(HWND parent, REFCLSID clsid, REFIID iid, char* filter, char* initpath, FILEOPENDIALOGOPTIONS optsadd)
char *commonItemDialog(HWND parent, REFCLSID clsid, REFIID iid, const char* filter, const char* initpath, FILEOPENDIALOGOPTIONS optsadd)
{
IFileDialog *d = NULL;
FILEOPENDIALOGOPTIONS opts;
@ -108,7 +108,7 @@ out:
return name;
}
char *uiOpenFile(uiWindow *parent, char* filter, char* initpath)
char *uiOpenFile(uiWindow *parent, const char* filter, const char* initpath)
{
char *res;
@ -121,7 +121,7 @@ char *uiOpenFile(uiWindow *parent, char* filter, char* initpath)
return res;
}
char *uiSaveFile(uiWindow *parent, char* filter, char* initpath)
char *uiSaveFile(uiWindow *parent, const char* filter, const char* initpath)
{
char *res;