diff --git a/src/Config.h b/src/Config.h index 25d1ee2c..88eb202a 100644 --- a/src/Config.h +++ b/src/Config.h @@ -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; diff --git a/src/SPI.cpp b/src/SPI.cpp index 6224338e..e550abd9 100644 --- a/src/SPI.cpp +++ b/src/SPI.cpp @@ -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 diff --git a/src/Savestate.cpp b/src/Savestate.cpp index b58d7acc..97fce93e 100644 --- a/src/Savestate.cpp +++ b/src/Savestate.cpp @@ -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; diff --git a/src/Savestate.h b/src/Savestate.h index 136b0cd0..bb12089b 100644 --- a/src/Savestate.h +++ b/src/Savestate.h @@ -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); diff --git a/src/libui_sdl/libui/darwin/stddialogs.m b/src/libui_sdl/libui/darwin/stddialogs.m index 42cb94c0..c8260351 100644 --- a/src/libui_sdl/libui/darwin/stddialogs.m +++ b/src/libui_sdl/libui/darwin/stddialogs.m @@ -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; diff --git a/src/libui_sdl/libui/ui.h b/src/libui_sdl/libui/ui.h index b100c084..5f40aff3 100644 --- a/src/libui_sdl/libui/ui.h +++ b/src/libui_sdl/libui/ui.h @@ -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); diff --git a/src/libui_sdl/libui/unix/draw.c b/src/libui_sdl/libui/unix/draw.c index 72d42029..e55397e6 100644 --- a/src/libui_sdl/libui/unix/draw.c +++ b/src/libui_sdl/libui/unix/draw.c @@ -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) diff --git a/src/libui_sdl/libui/unix/stddialogs.c b/src/libui_sdl/libui/unix/stddialogs.c index d2b89b97..3daeffac 100644 --- a/src/libui_sdl/libui/unix/stddialogs.c +++ b/src/libui_sdl/libui/unix/stddialogs.c @@ -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); } diff --git a/src/libui_sdl/libui/windows/stddialogs.cpp b/src/libui_sdl/libui/windows/stddialogs.cpp index eb535cbe..d0fd506a 100644 --- a/src/libui_sdl/libui/windows/stddialogs.cpp +++ b/src/libui_sdl/libui/windows/stddialogs.cpp @@ -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;