]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
const changes
authorToni Wilen <twilen@winuae.net>
Sat, 31 Oct 2020 11:05:26 +0000 (13:05 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 31 Oct 2020 11:05:26 +0000 (13:05 +0200)
15 files changed:
archivers/chd/chdglue.cpp
disk.cpp
epsonprinter.cpp
od-win32/debug_win32.cpp
od-win32/direct3d.cpp
od-win32/hardfile_win32.cpp
od-win32/screenshot.cpp
od-win32/win32.cpp
od-win32/win32gui.cpp
pcem/device.h
pcem/pcemglue.cpp
pcem/rom.h
pcem/x86.h
pcem/x86seg.cpp
x86.cpp

index 555da8588a18aba4765ca4ef9b7c7057680a0416..c02a592a1a2300bcab83f780f462023e25ac6339 100644 (file)
@@ -15,7 +15,7 @@ int core_fseek(core_file *file, INT64 offset, int whence)
 }
 file_error core_fopen(const TCHAR *filename, UINT32 openflags, core_file **file)
 {
-       TCHAR *mode;
+       const TCHAR *mode;
 
        if (openflags & OPEN_FLAG_CREATE)
                mode = _T("wb");
index cd7a517aa855fc38f07f44cc6544fd0918140a10..a706e0ae081d0c5422032b5f9580c02eb447c7a1 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -4431,7 +4431,7 @@ using namespace tinyxml2;
 
 static bool abr_loaded;
 static tinyxml2::XMLDocument abr_xml[2];
-static TCHAR* abr_files[] = { _T("brainfile.xml"), _T("catlist.xml"), NULL };
+static const TCHAR* abr_files[] = { _T("brainfile.xml"), _T("catlist.xml"), NULL };
 
 static void abrcheck(struct diskinfo *di)
 {
index 3bc8af9e8013bed7d29d4ee81916ed4ef25dfabc..c97b1d95603a81a69842a9d3908e1533c257ca16 100644 (file)
@@ -56,7 +56,7 @@ int pngprint = 0;
 static const TCHAR *epsonprintername;
 static HFONT curFont;
 static float curFontHorizPoints, curFontVertPoints;
-static TCHAR *curFontName;
+static const TCHAR *curFontName;
 static HDC memHDC;
 static LPOUTLINETEXTMETRIC otm;
 #else
@@ -473,7 +473,7 @@ static void selectCodepage(Bit16u cp)
 
 static int selectfont(Bit16u style)
 {
-       static TCHAR *thisFontName;
+       static const TCHAR *thisFontName;
        static float thisFontHorizPoints;
        static float thisFontVertPoints;
        static Bit16u thisStyle;
@@ -544,7 +544,7 @@ static void updateFont(void)
 {
        Real64 horizPoints = 10.5;
        Real64 vertPoints = 10.5;
-       TCHAR *fontName;
+       const TCHAR *fontName;
 
        if (curFont != NULL)
 #ifdef WINFONT
index a50d82f94d107972c55c212d8b8cf217663937dc..fa75530b907834bc7e69fff1e368ac46e3d94d19 100644 (file)
@@ -81,7 +81,7 @@ static struct debuggerpage dbgpage[MAXPAGES];
 static int currpage, pages;
 static int pagetype;
 
-TCHAR *pname[] = { _T("OUT1"), _T("OUT2"), _T("MEM1"), _T("MEM2"), _T("DASM1"), _T("DASM2"), _T("BRKPTS"), _T("MISC"), _T("CUSTOM") };
+const TCHAR *pname[] = { _T("OUT1"), _T("OUT2"), _T("MEM1"), _T("MEM2"), _T("DASM1"), _T("DASM2"), _T("BRKPTS"), _T("MISC"), _T("CUSTOM") };
 static int pstatuscolor[MAXPAGES];
 
 static int dbgwnd_minx = 800, dbgwnd_miny = 600;
index 60e316596060630e532f80185601ea776ed27be7..b730d99947c616970b6dfb8dff82422ccdbaaf2e 100644 (file)
@@ -42,7 +42,7 @@ int forcedframelatency = -1;
 
 #include "direct3d.h"
 
-static TCHAR *D3DHEAD = _T("-");
+static const TCHAR *D3DHEAD = _T("-");
 
 static bool showoverlay = true;
 static int slicecnt;
@@ -293,7 +293,7 @@ static int ddraw_fs_hack_init (struct d3dstruct *d3d)
        return 1;
 }
 
-static TCHAR *D3D_ErrorText (HRESULT error)
+static const TCHAR *D3D_ErrorText (HRESULT error)
 {
        return _T("");
 }
index f38206f5470b52d7467674d2f644f86355f787a6..6052514e51a87225b9b2170c9878f91754bbb8ce 100644 (file)
@@ -438,7 +438,7 @@ int isharddrive (const TCHAR *name)
        return -1;
 }
 
-static TCHAR *hdz[] = { _T("hdz"), _T("zip"), _T("rar"), _T("7z"), NULL };
+static const TCHAR *hdz[] = { _T("hdz"), _T("zip"), _T("rar"), _T("7z"), NULL };
 
 static int progressdialogreturn;
 static int progressdialogactive;
@@ -891,7 +891,7 @@ static bool hd_get_meta_hack_realtek(HWND hDlg, HANDLE h, uae_u8 *data, uae_u8 *
        int state = 0;
 
        memset(cmd, 0, 6); // TEST UNIT READY
-       TCHAR *infotxt;
+       const TCHAR *infotxt;
        if (do_scsi_in(h, cmd, 6, data, 0, true) < 0) {
                state = 1;
                infotxt = _T("Realtek hack, insert card.");
@@ -2558,7 +2558,7 @@ static int hdf_write_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset,
        poscheck (hfd, len);
        memcpy (hfd->cache, buffer, len);
        if (hfd->handle_valid == HDF_HANDLE_WIN32_NORMAL) {
-               TCHAR *name = hfd->emptyname == NULL ? _T("<unknown>") : hfd->emptyname;
+               const TCHAR *name = hfd->emptyname == NULL ? _T("<unknown>") : hfd->emptyname;
                if (offset == 0) {
                        if (!hfd->handle->firstwrite && (hfd->flags & HFD_FLAGS_REALDRIVE) && !(hfd->flags & HFD_FLAGS_REALDRIVEPARTITION)) {
                                hfd->handle->firstwrite = true;
@@ -3326,8 +3326,8 @@ TCHAR *hdf_getnameharddrive (int index, int flags, int *sectorsize, int *dangero
        TCHAR tmp[32];
        uae_u64 size = udi->size;
        int nomedia = udi->nomedia;
-       TCHAR *dang = _T("?");
-       TCHAR *rw = _T("RW");
+       const TCHAR *dang = _T("?");
+       const TCHAR *rw = _T("RW");
        bool noaccess = false;
 
        if (outflags) {
index dbbadb68ddbdc361840ef9ab0224f2b43f7db375..8df06841a84f4e528b3db2fd9be72eeba94a395f 100644 (file)
@@ -794,7 +794,7 @@ int screenshotf(int monid, const TCHAR *spath, int mode, int doprepare, int imag
        FILE *fp = NULL;
        int failed = 0;
        int screenshot_max = 1000; // limit 999 iterations / screenshots
-       TCHAR *format = _T("%s%s%s%03d.%s");
+       const TCHAR *format = _T("%s%s%s%03d.%s");
        bool alpha = usealpha();
 
        HBITMAP offscreen_bitmap = NULL; // bitmap that is converted to a DIB
index a18451690b2590d1dbe97a7c12530ce788d1e0ad..2eda4d42641dd7a07db34e9fa7e57f1adc740af4 100644 (file)
@@ -3262,7 +3262,7 @@ int WIN32_CleanupLibraries (void)
 /* HtmlHelp Initialization - optional component */
 int WIN32_InitHtmlHelp (void)
 {
-       TCHAR *chm = _T("WinUAE.chm");
+       const TCHAR *chm = _T("WinUAE.chm");
        int result = 0;
        _stprintf(help_file, _T("%s%s"), start_path_data, chm);
        if (!zfile_exists (help_file))
@@ -3348,7 +3348,7 @@ const struct winuae_lang langs[] =
        { 0x400, _T("guidll.dll") },
        { 0, NULL }
 };
-static TCHAR *getlanguagename(DWORD id)
+static const TCHAR *getlanguagename(DWORD id)
 {
        int i;
        for (i = 0; langs[i].name; i++) {
@@ -3383,7 +3383,7 @@ HMODULE language_load (WORD language)
 
 #if LANG_DLL > 0
        TCHAR dllbuf[MAX_DPATH];
-       TCHAR *dllname;
+       const TCHAR *dllname;
        dllname = getlanguagename (language);
        if (dllname) {
                DWORD  dwVersionHandle, dwFileVersionInfoSize;
@@ -3773,7 +3773,7 @@ uae_u8 *target_load_keyfile (struct uae_prefs *p, const TCHAR *path, int *sizep,
        HMODULE h;
        PFN_GetKey pfnGetKey;
        int size;
-       TCHAR *libname = _T("amigaforever.dll");
+       const TCHAR *libname = _T("amigaforever.dll");
 
        h = WIN32_LoadLibrary(libname);
        if (!h) {
@@ -5191,7 +5191,7 @@ static int shell_deassociate (const TCHAR *extension)
        return 1;
 }
 
-static int shell_associate_2 (const TCHAR *extension, TCHAR *shellcommand, TCHAR *command, struct contextcommand *cc, const TCHAR *perceivedtype,
+static int shell_associate_2 (const TCHAR *extension, const TCHAR *shellcommand, const TCHAR *command, struct contextcommand *cc, const TCHAR *perceivedtype,
        const TCHAR *description, const TCHAR *ext2, int icon)
 {
        TCHAR rpath1[MAX_DPATH], rpath2[MAX_DPATH], progid2[MAX_DPATH];
@@ -5292,7 +5292,7 @@ static int shell_associate_2 (const TCHAR *extension, TCHAR *shellcommand, TCHAR
        regclosetree (fkey);
        return 1;
 }
-static int shell_associate (const TCHAR *extension, TCHAR *command, struct contextcommand *cc, const TCHAR *perceivedtype, const TCHAR *description, const TCHAR *ext2, int icon)
+static int shell_associate (const TCHAR *extension, const TCHAR *command, struct contextcommand *cc, const TCHAR *perceivedtype, const TCHAR *description, const TCHAR *ext2, int icon)
 {
        int v = shell_associate_2 (extension, NULL, command, cc, perceivedtype, description, ext2, icon);
        if (!_tcscmp (extension, _T(".uae")))
@@ -5660,7 +5660,7 @@ static void WIN32_HandleRegistryStuff (void)
 }
 
 #if WINUAEPUBLICBETA > 0
-static TCHAR *BETAMESSAGE = {
+static const TCHAR *BETAMESSAGE = {
        _T("This is unstable beta software. Click cancel if you are not comfortable using software that is incomplete and can have serious programming errors.")
 };
 #endif
index 58515aaaed0dcdf11d3336ec1090214f923243cc..3398d92a2a9381b6392789ef566e9e83e484c9ab 100644 (file)
@@ -2826,7 +2826,8 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        TCHAR file_name[MAX_DPATH] = _T("");
        TCHAR init_path[MAX_DPATH] = _T("");
        BOOL result = FALSE;
-       TCHAR *amiga_path = NULL, *initialdir = NULL, *defext = NULL;
+       TCHAR* amiga_path = NULL, * initialdir = NULL;
+       const TCHAR *defext = NULL;
        TCHAR *p, *nextp;
        int all = 1;
        int next;
@@ -6509,8 +6510,8 @@ typedef struct url_info
 {
        int   id;
        BOOL  state;
-       TCHAR *display;
-       TCHAR *url;
+       const TCHAR *display;
+       const TCHAR *url;
 } urlinfo;
 
 static urlinfo urls[] =
@@ -6623,7 +6624,7 @@ static void setmultiautocomplete (HWND hDlg, int *ids)
                setautocomplete (hDlg, ids[i]);
 }
 
-static void wsetpath (HWND hDlg, TCHAR *name, DWORD d, TCHAR *def)
+static void wsetpath (HWND hDlg, const TCHAR *name, DWORD d, const TCHAR *def)
 {
        TCHAR tmp[MAX_DPATH];
 
@@ -8316,7 +8317,7 @@ static void init_resolution_combo (HWND hDlg)
 
 static void init_displays_combo (HWND hDlg, bool rtg)
 {
-       TCHAR *adapter = _T("");
+       const TCHAR *adapter = _T("");
        struct MultiDisplay *md = Displays;
        int cnt = 0, cnt2 = 0;
        int displaynum;
@@ -8349,7 +8350,7 @@ static bool get_displays_combo (HWND hDlg, bool rtg)
 {
        struct MultiDisplay *md = Displays;
        LRESULT posn;
-       TCHAR *adapter = _T("");
+       const TCHAR *adapter = _T("");
        int cnt = 0, cnt2 = 0;
        int displaynum;
        int id = rtg ? IDC_RTG_DISPLAYSELECT : IDC_DISPLAYSELECT;
@@ -12056,7 +12057,7 @@ static void enable_for_miscdlg (HWND hDlg)
 
 static void misc_kbled (HWND hDlg, int v, int nv)
 {
-       TCHAR *defname = v == IDC_KBLED1 ? _T("(NumLock)") : v == IDC_KBLED2 ? _T("(CapsLock)") : _T("(ScrollLock)");
+       const TCHAR *defname = v == IDC_KBLED1 ? _T("(NumLock)") : v == IDC_KBLED2 ? _T("(CapsLock)") : _T("(ScrollLock)");
        SendDlgItemMessage (hDlg, v, CB_RESETCONTENT, 0, 0L);
        SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)defname);
        SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("POWER"));
@@ -19276,7 +19277,7 @@ static void *filtervars2[] = {
 };
 
 struct filterpreset {
-       TCHAR *name;
+       const TCHAR *name;
        int conf[27];
 };
 static const struct filterpreset filterpresets[] =
index e8177154cb91ede69fc726a9cdbbda7b079d479f..e7152b38e172c4c239524e78dee63fd5c43ee274 100644 (file)
@@ -46,8 +46,8 @@ void device_add_status_info(char *s, int max_len);
 
 extern char *current_device_name;
 
-int device_get_config_int(char *name);
-char *device_get_config_string(char *name);
+int device_get_config_int(const char *name);
+char *device_get_config_string(const char *name);
 
 enum
 {
@@ -58,7 +58,7 @@ enum
         DEVICE_PS1 = 0x80       /*Device is only for IBM PS/1 Model 2011*/
 };
 
-int model_get_config_int(char *s);
-char *model_get_config_string(char *s);
+int model_get_config_int(const char *s);
+char *model_get_config_string(const char *s);
 
 #endif
index 8282396eda55305d9d11ec99572c76189105ad4c..2af395ed4af87b0bce443b3c6bf64ebc8f909a97 100644 (file)
@@ -340,7 +340,7 @@ MODEL models[] =
        { "[386SX] AMI 386SX clone", ROM_AMI386SX, "ami386", { { "386SX", cpus_i386SX }, { "386DX", cpus_i386DX }, { "486", cpus_i486 } }, MODEL_GFX_NONE | MODEL_AT | MODEL_HAS_IDE, 512, 16384, 128, model_init, NULL },
 };
 
-int rom_present(char *s)
+int rom_present(const char *s)
 {
        return 0;
 }
index 18e8cf8ec3394e61a15f09965322dc12c817d5bb..e7f746fad55cec1068376fa2bed480cb90cdae2f 100644 (file)
@@ -2,7 +2,7 @@
 #define _ROM_H_
 
 FILE *romfopen(char *fn, char *mode);
-int rom_present(char *fn);
+int rom_present(const char *fn);
 
 typedef struct rom_t
 {
index 5391e4fbb6fc96c41cc9b235ac58e3931be8ac4d..d761d69a2da3b1291aa4c14a56e4f06e4f977221 100644 (file)
@@ -273,7 +273,7 @@ extern uint8_t *pccache2;
 void x86illegal();
 
 void x86seg_reset();
-void x86gpf(char *s, uint16_t error);
+void x86gpf(const char *s, uint16_t error);
 
 void resetx86();
 void softresetx86();
index 766d0bc0add3b6e403f05c662eb20d9d93331f07..7c39a9cf132a0ce5e982a1efc38c9563101bc7f1 100644 (file)
@@ -170,25 +170,25 @@ void x86_doabrt(int x86_abrt)
                 }
         }
 }
-void x86gpf(char *s, uint16_t error)
+void x86gpf(const char *s, uint16_t error)
 {
 //        pclog("GPF %04X\n", error);
         cpu_state.abrt = ABRT_GPF;
         abrt_error = error;
 }
-void x86ss(char *s, uint16_t error)
+void x86ss(const char *s, uint16_t error)
 {
 //        pclog("SS %04X\n", error);
         cpu_state.abrt = ABRT_SS;
         abrt_error = error;
 }
-void x86ts(char *s, uint16_t error)
+void x86ts(const char *s, uint16_t error)
 {
 //        pclog("TS %04X\n", error);
         cpu_state.abrt = ABRT_TS;
         abrt_error = error;
 }
-void x86np(char *s, uint16_t error)
+void x86np(const char *s, uint16_t error)
 {
 //        pclog("NP %04X : %s\n", error, s);
         cpu_state.abrt = ABRT_NP;
diff --git a/x86.cpp b/x86.cpp
index 4627de8ab6a9e0ace7bfc2fe320b7ae44fda37d0..6c5cb0ab670dd2b7e22b08118d1a260c53e30a29 100644 (file)
--- a/x86.cpp
+++ b/x86.cpp
@@ -3292,7 +3292,7 @@ void *cms_init();
 
 static int x86_global_settings;
 
-int device_get_config_int(char *s)
+int device_get_config_int(const char *s)
 {
        if (!strcmp(s, "bilinear")) {
                return 1;