Fixed warnings with gcc option "-Wwrite-strings".
Index: programs/osversioncheck/osversioncheck.c =================================================================== RCS file: /home/wine/wine/programs/osversioncheck/osversioncheck.c,v retrieving revision 1.4 diff -u -r1.4 osversioncheck.c --- programs/osversioncheck/osversioncheck.c 10 Mar 2002 00:21:19 -0000 1.4 +++ programs/osversioncheck/osversioncheck.c 18 Oct 2003 17:36:49 -0000 @@ -71,7 +71,7 @@ show_last_error(); } else { - char * platforms[] = { + const char * platforms[] = { "Win32s on Windows 3.1", "Win32 on Windows 95 or Windows 98", "Win32 on Windows NT/Windows 2000", Index: programs/regedit/framewnd.c =================================================================== RCS file: /home/wine/wine/programs/regedit/framewnd.c,v retrieving revision 1.1 diff -u -r1.1 framewnd.c --- programs/regedit/framewnd.c 7 Aug 2003 03:10:13 -0000 1.1 +++ programs/regedit/framewnd.c 18 Oct 2003 17:36:50 -0000 @@ -320,7 +320,7 @@ return TRUE; } -BOOL PrintRegistryHive(HWND hWnd, LPTSTR path) +BOOL PrintRegistryHive(HWND hWnd, LPCTSTR path) { #if 1 PRINTDLG pd; @@ -385,7 +385,7 @@ return TRUE; } -BOOL CopyKeyName(HWND hWnd, LPTSTR keyName) +BOOL CopyKeyName(HWND hWnd, LPCTSTR keyName) { BOOL result; Index: programs/regedit/listview.c =================================================================== RCS file: /home/wine/wine/programs/regedit/listview.c,v retrieving revision 1.1 diff -u -r1.1 listview.c --- programs/regedit/listview.c 7 Aug 2003 03:10:13 -0000 1.1 +++ programs/regedit/listview.c 18 Oct 2003 17:36:51 -0000 @@ -69,7 +69,7 @@ index = ListView_InsertItem(hwndLV, &item); if (index != -1) { /* LPTSTR pszText = NULL; */ - LPTSTR pszText = _T("value"); + LPTSTR pszText = FAKE_LPTSTR(_T("value")); switch (dwValType) { case REG_SZ: case REG_EXPAND_SZ: @@ -137,39 +137,39 @@ switch (plvdi->item.iSubItem) { case 0: - plvdi->item.pszText = _T("(Default)"); + plvdi->item.pszText = FAKE_LPTSTR(_T("(Default)")); break; case 1: switch (plvdi->item.lParam) { case REG_SZ: - plvdi->item.pszText = _T("REG_SZ"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_SZ")); break; case REG_EXPAND_SZ: - plvdi->item.pszText = _T("REG_EXPAND_SZ"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_EXPAND_SZ")); break; case REG_BINARY: - plvdi->item.pszText = _T("REG_BINARY"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_BINARY")); break; case REG_DWORD: - plvdi->item.pszText = _T("REG_DWORD"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_DWORD")); break; /* case REG_DWORD_LITTLE_ENDIAN: */ -/* plvdi->item.pszText = _T("REG_DWORD_LITTLE_ENDIAN"); */ +/* plvdi->item.pszText = FAKE_LPTSTR(_T("REG_DWORD_LITTLE_ENDIAN")); */ /* break; */ case REG_DWORD_BIG_ENDIAN: - plvdi->item.pszText = _T("REG_DWORD_BIG_ENDIAN"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_DWORD_BIG_ENDIAN")); break; case REG_MULTI_SZ: - plvdi->item.pszText = _T("REG_MULTI_SZ"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_MULTI_SZ")); break; case REG_LINK: - plvdi->item.pszText = _T("REG_LINK"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_LINK")); break; case REG_RESOURCE_LIST: - plvdi->item.pszText = _T("REG_RESOURCE_LIST"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_RESOURCE_LIST")); break; case REG_NONE: - plvdi->item.pszText = _T("REG_NONE"); + plvdi->item.pszText = FAKE_LPTSTR(_T("REG_NONE")); break; default: wsprintf(buffer, _T("unknown(%d)"), plvdi->item.lParam); @@ -178,10 +178,10 @@ } break; case 2: - plvdi->item.pszText = _T("(value not set)"); + plvdi->item.pszText = FAKE_LPTSTR(_T("(value not set)")); break; case 3: - plvdi->item.pszText = _T(""); + plvdi->item.pszText = FAKE_LPTSTR(_T("")); break; } } Index: programs/regedit/main.h =================================================================== RCS file: /home/wine/wine/programs/regedit/main.h,v retrieving revision 1.3 diff -u -r1.3 main.h --- programs/regedit/main.h 7 Sep 2003 05:08:14 -0000 1.3 +++ programs/regedit/main.h 18 Oct 2003 17:36:51 -0000 @@ -37,6 +37,8 @@ #define SPLIT_WIDTH 5 #define MAX_NAME_LEN 500 +#define FAKE_LPTSTR(s) ((LPTSTR)(unsigned long)(s)) + /******************************************************************************/ Index: programs/regedit/regedit.c =================================================================== RCS file: /home/wine/wine/programs/regedit/regedit.c,v retrieving revision 1.7 diff -u -r1.7 regedit.c --- programs/regedit/regedit.c 15 Aug 2003 03:47:04 -0000 1.7 +++ programs/regedit/regedit.c 18 Oct 2003 17:36:51 -0000 @@ -23,7 +23,7 @@ #include <windows.h> #include "regproc.h" -static char *usage = +static const char *usage = "Usage:\n" " regedit filename\n" " regedit /E filename [regpath]\n" Index: programs/regedit/regproc.c =================================================================== RCS file: /home/wine/wine/programs/regedit/regproc.c,v retrieving revision 1.8 diff -u -r1.8 regproc.c --- programs/regedit/regproc.c 7 Aug 2003 03:10:13 -0000 1.8 +++ programs/regedit/regproc.c 18 Oct 2003 17:36:53 -0000 @@ -43,9 +43,9 @@ static HKEY currentKeyHandle = 0; static BOOL bTheKeyIsOpen = FALSE; -static CHAR *app_name = "UNKNOWN"; +static const CHAR *app_name = "UNKNOWN"; -static CHAR *reg_class_names[] = { +static const CHAR *reg_class_names[] = { "HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_CLASSES_ROOT", "HKEY_CURRENT_CONFIG", "HKEY_CURRENT_USER" }; @@ -1276,7 +1276,7 @@ case REG_BINARY: { DWORD i1; - CHAR *hex_prefix; + const CHAR *hex_prefix; CHAR buf[20]; int cur_pos; @@ -1577,12 +1577,12 @@ * Sets the application name. Then application name is used in the error * reporting. */ -void setAppName(CHAR *name) +void setAppName(const CHAR *name) { app_name = name; } -CHAR *getAppName() +const CHAR *getAppName() { return app_name; } Index: programs/regedit/regproc.h =================================================================== RCS file: /home/wine/wine/programs/regedit/regproc.h,v retrieving revision 1.3 diff -u -r1.3 regproc.h --- programs/regedit/regproc.h 7 Aug 2003 03:10:13 -0000 1.3 +++ programs/regedit/regproc.h 18 Oct 2003 17:36:53 -0000 @@ -40,8 +40,8 @@ BOOL import_registry_file(LPTSTR filename); void delete_registry_key(CHAR *reg_key_name); -void setAppName(CHAR *name); -CHAR *getAppName(); +void setAppName(const CHAR *name); +const CHAR *getAppName(); void processRegLines(FILE *in, CommandAPI command); Index: programs/regedit/treeview.c =================================================================== RCS file: /home/wine/wine/programs/regedit/treeview.c,v retrieving revision 1.2 diff -u -r1.2 treeview.c --- programs/regedit/treeview.c 8 Aug 2003 21:03:39 -0000 1.2 +++ programs/regedit/treeview.c 18 Oct 2003 17:36:53 -0000 @@ -80,14 +80,14 @@ return hKey; } -static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, HKEY hKey, DWORD dwChildren) +static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPCTSTR label, HKEY hKey, DWORD dwChildren) { HTREEITEM hItem = 0; TVITEM tvi; TVINSERTSTRUCT tvins; tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM; - tvi.pszText = label; + tvi.pszText = FAKE_LPTSTR(label); tvi.cchTextMax = lstrlen(tvi.pszText); tvi.iImage = Image_Closed; tvi.iSelectedImage = Image_Open; Index: programs/regsvr32/regsvr32.c =================================================================== RCS file: /home/wine/wine/programs/regsvr32/regsvr32.c,v retrieving revision 1.7 diff -u -r1.7 regsvr32.c --- programs/regsvr32/regsvr32.c 7 Oct 2003 22:49:44 -0000 1.7 +++ programs/regsvr32/regsvr32.c 18 Oct 2003 17:36:54 -0000 @@ -78,7 +78,7 @@ * procName - name of the procedure to load from dll * pDllHanlde - output variable receives handle of the loaded dll. */ -VOID *LoadProc(char* strDll, char* procName, HMODULE* DllHandle) +VOID *LoadProc(char* strDll, const char* procName, HMODULE* DllHandle) { VOID* (*proc)(void); Index: programs/rundll32/rundll32.c =================================================================== RCS file: /home/wine/wine/programs/rundll32/rundll32.c,v retrieving revision 1.6 diff -u -r1.6 rundll32.c --- programs/rundll32/rundll32.c 8 Sep 2003 19:38:45 -0000 1.6 +++ programs/rundll32/rundll32.c 18 Oct 2003 17:36:54 -0000 @@ -51,8 +51,8 @@ * Control_RunDLL needs to have a window. So lets make us a very * simple window class. */ -static TCHAR *szTitle = "rundll32"; -static TCHAR *szWindowClass = "class_rundll32"; +static LPCTSTR szTitle = "rundll32"; +static LPCTSTR szWindowClass = "class_rundll32"; static ATOM MyRegisterClass(HINSTANCE hInstance) { Index: programs/winefile/winefile.c =================================================================== RCS file: /home/wine/wine/programs/winefile/winefile.c,v retrieving revision 1.13 diff -u -r1.13 winefile.c --- programs/winefile/winefile.c 28 Aug 2003 19:40:51 -0000 1.13 +++ programs/winefile/winefile.c 18 Oct 2003 17:36:58 -0000 @@ -64,6 +64,8 @@ #define DEFAULT_SPLIT_POS 200; #endif +#define FAKE_LPTSTR(s) ((LPTSTR)(unsigned long)(s)) + WINEFILE_GLOBALS Globals; @@ -1880,7 +1882,7 @@ } -static const LPTSTR g_pos_names[COLUMNS] = { +static const LPCTSTR g_pos_names[COLUMNS] = { TEXT(""), /* symbol */ TEXT("Name"), TEXT("Size"), @@ -1967,7 +1969,7 @@ hdi.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT; for(idx=0; idx<COLUMNS; idx++) { - hdi.pszText = g_pos_names[idx]; + hdi.pszText = FAKE_LPTSTR(g_pos_names[idx]); hdi.fmt = HDF_STRING | g_pos_align[idx]; hdi.cxy = pane->widths[idx]; Header_InsertItem(hwnd, idx, &hdi); Index: programs/winemenubuilder/winemenubuilder.c =================================================================== RCS file: /home/wine/wine/programs/winemenubuilder/winemenubuilder.c,v retrieving revision 1.7 diff -u -r1.7 winemenubuilder.c --- programs/winemenubuilder/winemenubuilder.c 15 Oct 2003 03:35:54 -0000 1.7 +++ programs/winemenubuilder/winemenubuilder.c 18 Oct 2003 17:36:59 -0000 @@ -575,7 +575,7 @@ static int fork_and_wait( char *linker, char *link_name, char *path, int desktop, char *args, char *icon_name, - char *workdir, char *description ) + const char *workdir, char *description ) { int pos = 0; const char *argv[20]; Index: programs/winepath/winepath.c =================================================================== RCS file: /home/wine/wine/programs/winepath/winepath.c,v retrieving revision 1.3 diff -u -r1.3 winepath.c --- programs/winepath/winepath.c 11 May 2003 02:47:28 -0000 1.3 +++ programs/winepath/winepath.c 18 Oct 2003 17:37:00 -0000 @@ -87,7 +87,7 @@ { int outputformats = 0; int done = 0; - char *longopts[] = { "long", "short", "unix", "help", "version", "" }; + const char *longopts[] = { "long", "short", "unix", "help", "version", "" }; int i, j; for (i = 1; argv[i] && !done; ) Index: programs/winhelp/macro.c =================================================================== RCS file: /home/wine/wine/programs/winhelp/macro.c,v retrieving revision 1.19 diff -u -r1.19 macro.c --- programs/winhelp/macro.c 16 Oct 2003 19:12:49 -0000 1.19 +++ programs/winhelp/macro.c 18 Oct 2003 17:37:00 -0000 @@ -33,10 +33,10 @@ /* Macro table */ /**************************************************/ struct MacroDesc { - char* name; - char* alias; + const char* name; + const char* alias; BOOL isBool; - char* arguments; + const char* arguments; void (*fn)(); };