(more) fixes for -Wmissing-declarations and -Wwrite-strings warnings
Mike McCormack
mike at codeweavers.com
Fri Jun 3 09:50:54 CDT 2005
ChangeLog:
* fixes for -Wmissing-declarations and -Wwrite-strings warnings
-------------- next part --------------
? programs/wordpad
? programs/uninstaller/uninstaller.rc
? programs/winedbg/gdiobj.c
Index: programs/cmdlgtst/cmdlgtst.c
===================================================================
RCS file: /home/wine/wine/programs/cmdlgtst/cmdlgtst.c,v
retrieving revision 1.14
diff -u -p -r1.14 cmdlgtst.c
--- programs/cmdlgtst/cmdlgtst.c 2 Mar 2005 13:53:50 -0000 1.14
+++ programs/cmdlgtst/cmdlgtst.c 3 Jun 2005 14:49:30 -0000
@@ -101,13 +101,14 @@ static COLORREF txtColor = RGB(0, 0, 0);
/* Utility routines. */
-void nyi(HWND hWnd)
+static void nyi(HWND hWnd)
{
/* "Hi there! I'm not yet implemented!" */
MessageBox(hWnd, "Not yet implemented!", "NYI", MB_ICONEXCLAMATION | MB_OK);
}
-UINT CALLBACK dummyfnHook(HWND hWnd, UINT msg, UINT wParam, UINT lParam)
+#if 0
+static UINT CALLBACK dummyfnHook(HWND hWnd, UINT msg, UINT wParam, UINT lParam)
{
/*
* If the user specifies something that needs an awfully stupid hook function,
@@ -123,6 +124,7 @@ UINT CALLBACK dummyfnHook(HWND hWnd, UIN
return 0;
}
+#endif
/*
* Initialization code. This code simply shoves in predefined
@@ -131,7 +133,7 @@ UINT CALLBACK dummyfnHook(HWND hWnd, UIN
* if Microsoft decides to change the field ordering, I'd be screwed.
*/
-void mwi_Print(HWND hWnd)
+static void mwi_Print(HWND hWnd)
{
pd.lStructSize = sizeof(PRINTDLG);
pd.hwndOwner = hWnd;
@@ -151,7 +153,7 @@ void mwi_Print(HWND hWnd)
pd.hSetupTemplate = 0;
}
-void mwi_Color(HWND hWnd)
+static void mwi_Color(HWND hWnd)
{
int i;
@@ -171,7 +173,7 @@ void mwi_Color(HWND hWnd)
cc.lpTemplateName = 0;
}
-void mwi_Font(HWND hWnd)
+static void mwi_Font(HWND hWnd)
{
cf.lStructSize = sizeof(CHOOSEFONT);
cf.hwndOwner = hWnd;
@@ -191,7 +193,7 @@ void mwi_Font(HWND hWnd)
cf_lf.lfHeight = -18; /* this can be positive or negative, but negative is usually used. */
}
-void mwi_File(HWND hWnd)
+static void mwi_File(HWND hWnd)
{
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWnd;
@@ -217,7 +219,7 @@ void mwi_File(HWND hWnd)
ofn_result[0] = '\0';
}
-void mwi_FindReplace(HWND hWnd)
+static void mwi_FindReplace(HWND hWnd)
{
frS.lStructSize = sizeof(FINDREPLACE);
frS.hwndOwner = hWnd;
@@ -236,7 +238,7 @@ void mwi_FindReplace(HWND hWnd)
findMessageId = RegisterWindowMessage(FINDMSGSTRING);
}
-void mwi_InitAll(HWND hWnd)
+static void mwi_InitAll(HWND hWnd)
{
mwi_Print(hWnd);
mwi_Font(hWnd);
@@ -254,7 +256,7 @@ void mwi_InitAll(HWND hWnd)
* there might be a problem.
*/
-void paintMainWindow(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
+static void paintMainWindow(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
RECT rect;
@@ -322,7 +324,7 @@ void paintMainWindow(HWND hWnd, UINT iMe
* consult cderr.h to see what was returned.
*/
-void mw_checkError(HWND hWnd, BOOL explicitcancel)
+static void mw_checkError(HWND hWnd, BOOL explicitcancel)
{
DWORD errval = CommDlgExtendedError();
if(errval) {
@@ -343,7 +345,7 @@ void mw_checkError(HWND hWnd, BOOL expli
* various values specified in the dialog.
*/
-void mw_ColorSetup(HWND hWnd)
+static void mw_ColorSetup(HWND hWnd)
{
if(ChooseColor(&cc)) {
RECT rect;
@@ -355,7 +357,7 @@ void mw_ColorSetup(HWND hWnd)
else mw_checkError(hWnd, FALSE);
}
-void mw_FontSetup(HWND hWnd)
+static void mw_FontSetup(HWND hWnd)
{
if(ChooseFont(&cf)) {
RECT rect;
@@ -366,7 +368,7 @@ void mw_FontSetup(HWND hWnd)
else mw_checkError(hWnd, FALSE);
}
-void mw_FindSetup(HWND hWnd)
+static void mw_FindSetup(HWND hWnd)
{
if(findDialogBox == 0) {
findDialogBox = FindText(&frS);
@@ -374,7 +376,7 @@ void mw_FindSetup(HWND hWnd)
}
}
-void mw_ReplaceSetup(HWND hWnd)
+static void mw_ReplaceSetup(HWND hWnd)
{
if(findDialogBox == 0) {
findDialogBox = ReplaceText(&frS);
@@ -382,7 +384,7 @@ void mw_ReplaceSetup(HWND hWnd)
}
}
-void mw_OpenSetup(HWND hWnd)
+static void mw_OpenSetup(HWND hWnd)
{
if(GetOpenFileName(&ofn)) {
RECT rect;
@@ -392,7 +394,7 @@ void mw_OpenSetup(HWND hWnd)
else mw_checkError(hWnd,FALSE);
}
-void mw_SaveSetup(HWND hWnd)
+static void mw_SaveSetup(HWND hWnd)
{
if(GetSaveFileName(&ofn)) {
RECT rect;
@@ -407,12 +409,12 @@ void mw_SaveSetup(HWND hWnd)
* exist at all, or is it merely a subdialog of Print?
*/
-void mw_PSetupSetup(HWND hWnd)
+static void mw_PSetupSetup(HWND hWnd)
{
nyi(hWnd);
}
-void mw_PrintSetup(HWND hWnd)
+static void mw_PrintSetup(HWND hWnd)
{
if(PrintDlg(&pd)) {
/*
@@ -453,7 +455,7 @@ void mw_PrintSetup(HWND hWnd)
* In particular, we have to set things properly, and get the flags back.
*/
-void mwcd_SetFlags(HWND hWnd, struct FlagTableEntry *table, unsigned long flags)
+static void mwcd_SetFlags(HWND hWnd, struct FlagTableEntry *table, unsigned long flags)
{
int i;
@@ -463,7 +465,7 @@ void mwcd_SetFlags(HWND hWnd, struct Fla
}
}
-unsigned long mwcd_GetFlags(HWND hWnd, struct FlagTableEntry * table)
+static unsigned long mwcd_GetFlags(HWND hWnd, struct FlagTableEntry * table)
{
int i;
unsigned long l = 0;
@@ -484,7 +486,7 @@ unsigned long mwcd_GetFlags(HWND hWnd, s
* not the handlers. I'll fix that later; this works as of right now.
*/
-BOOL mwcd_Setup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
+static BOOL mwcd_Setup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
struct FlagTableEntry * table, unsigned long * flags)
{
(void) lParam;
@@ -523,7 +525,7 @@ BOOL mwcd_Setup(HWND hWnd, UINT uMsg, WP
}
}
-BOOL CALLBACK mwcd_ColorSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static BOOL CALLBACK mwcd_ColorSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static struct FlagTableEntry flagTable[] = {
{I_CC_RGBINIT, CC_RGBINIT},
@@ -539,7 +541,7 @@ BOOL CALLBACK mwcd_ColorSetup(HWND hWnd,
return mwcd_Setup(hWnd, uMsg, wParam, lParam, flagTable, &cc.Flags);
}
-BOOL CALLBACK mwcd_FontSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static BOOL CALLBACK mwcd_FontSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static struct FlagTableEntry flagTable[] = {
{I_CF_APPLY, CF_APPLY},
@@ -570,7 +572,7 @@ BOOL CALLBACK mwcd_FontSetup(HWND hWnd,
return mwcd_Setup(hWnd, uMsg, wParam, lParam, flagTable, &cf.Flags);
}
-BOOL CALLBACK mwcd_FindSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static BOOL CALLBACK mwcd_FindSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static struct FlagTableEntry flagTable[] = {
@@ -597,7 +599,7 @@ BOOL CALLBACK mwcd_FindSetup(HWND hWnd,
return mwcd_Setup(hWnd, uMsg, wParam, lParam, flagTable, &frS.Flags);
}
-BOOL CALLBACK mwcd_PrintSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static BOOL CALLBACK mwcd_PrintSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static struct FlagTableEntry flagTable[] = {
{I_PD_ALLPAGES, PD_ALLPAGES},
@@ -628,7 +630,7 @@ BOOL CALLBACK mwcd_PrintSetup(HWND hWnd,
return mwcd_Setup(hWnd, uMsg, wParam, lParam, flagTable, &pd.Flags);
}
-BOOL CALLBACK mwcd_FileSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static BOOL CALLBACK mwcd_FileSetup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static struct FlagTableEntry flagTable[] = {
{I_OFN_ALLOWMULTISELECT, OFN_ALLOWMULTISELECT},
@@ -654,7 +656,7 @@ BOOL CALLBACK mwcd_FileSetup(HWND hWnd,
return mwcd_Setup(hWnd, uMsg, wParam, lParam, flagTable, &ofn.Flags);
}
-BOOL CALLBACK mwcd_About(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static BOOL CALLBACK mwcd_About(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
(void) wParam;
(void) lParam;
@@ -673,31 +675,31 @@ BOOL CALLBACK mwcd_About(HWND hWnd, UINT
* the CommDlg structures initialized by the mwi_xxx() routines.
*/
-void mwc_ColorSetup(HWND hWnd)
+static void mwc_ColorSetup(HWND hWnd)
{
int r = DialogBox(g_hInstance, "Color_Flags_Dialog", hWnd, (DLGPROC) mwcd_ColorSetup);
if(r < 0) { MessageBox(hWnd, "Failure opening Color_Flags_Dialog box", "Error", MB_ICONASTERISK|MB_OK); }
}
-void mwc_FontSetup(HWND hWnd)
+static void mwc_FontSetup(HWND hWnd)
{
int r = DialogBox(g_hInstance, "Font_Flags_Dialog", hWnd, (DLGPROC) mwcd_FontSetup);
if(r < 0) { MessageBox(hWnd, "Failure opening Font_Flags_Dialog box", "Error", MB_ICONASTERISK|MB_OK); }
}
-void mwc_FindReplaceSetup(HWND hWnd)
+static void mwc_FindReplaceSetup(HWND hWnd)
{
int r = DialogBox(g_hInstance, "Find_Flags_Dialog", hWnd, (DLGPROC) mwcd_FindSetup);
if(r < 0) { MessageBox(hWnd, "Failure opening Find_Flags_Dialog box", "Error", MB_ICONASTERISK|MB_OK); }
}
-void mwc_PrintSetup(HWND hWnd)
+static void mwc_PrintSetup(HWND hWnd)
{
int r = DialogBox(g_hInstance, "Print_Flags_Dialog", hWnd, (DLGPROC) mwcd_PrintSetup);
if(r < 0) { MessageBox(hWnd, "Failure opening Print_Flags_Dialog box", "Error", MB_ICONASTERISK|MB_OK); }
}
-void mwc_FileSetup(HWND hWnd)
+static void mwc_FileSetup(HWND hWnd)
{
int r = DialogBox(g_hInstance, "File_Flags_Dialog", hWnd, (DLGPROC) mwcd_FileSetup);
if(r < 0) { MessageBox(hWnd, "Failure opening File_Flags_Dialog box", "Error", MB_ICONASTERISK|MB_OK); }
@@ -710,7 +712,7 @@ void mwc_FileSetup(HWND hWnd)
* dangling from Windows like a loose muffler. Sigh.
*/
-LRESULT CALLBACK EXPORT mainWindowDispatcher(
+static LRESULT CALLBACK EXPORT mainWindowDispatcher(
HWND hWnd,
UINT uMsg,
WPARAM wParam,
@@ -834,7 +836,7 @@ LRESULT CALLBACK EXPORT mainWindowDispat
/* Class registration. One might call this a Windowsism. */
-int registerMainWindowClass(HINSTANCE hInstance)
+static int registerMainWindowClass(HINSTANCE hInstance)
{
WNDCLASS wndClass;
@@ -862,7 +864,7 @@ int registerMainWindowClass(HINSTANCE hI
* can get messy; at least here we don't have to worry about that).
*/
-HWND createMainWindow(HINSTANCE hInstance, int show)
+static HWND createMainWindow(HINSTANCE hInstance, int show)
{
HWND hWnd;
@@ -888,7 +890,7 @@ HWND createMainWindow(HINSTANCE hInstanc
return hWnd;
}
-int messageLoop(HINSTANCE hInstance, HWND hWnd)
+static int messageLoop(HINSTANCE hInstance, HWND hWnd)
{
MSG msg;
Index: programs/regedit/edit.c
===================================================================
RCS file: /home/wine/wine/programs/regedit/edit.c,v
retrieving revision 1.17
diff -u -p -r1.17 edit.c
--- programs/regedit/edit.c 14 Apr 2005 11:30:31 -0000 1.17
+++ programs/regedit/edit.c 3 Jun 2005 14:49:30 -0000
@@ -46,7 +46,7 @@ struct edit_params
LONG cbData;
};
-INT vmessagebox(HWND hwnd, INT buttons, INT titleId, INT resId, va_list ap)
+static INT vmessagebox(HWND hwnd, INT buttons, INT titleId, INT resId, va_list ap)
{
TCHAR title[256];
TCHAR errfmt[1024];
@@ -63,7 +63,7 @@ INT vmessagebox(HWND hwnd, INT buttons,
return MessageBox(hwnd, errstr, title, buttons);
}
-INT messagebox(HWND hwnd, INT buttons, INT titleId, INT resId, ...)
+static INT messagebox(HWND hwnd, INT buttons, INT titleId, INT resId, ...)
{
va_list ap;
INT result;
@@ -75,7 +75,7 @@ INT messagebox(HWND hwnd, INT buttons, I
return result;
}
-void error(HWND hwnd, INT resId, ...)
+static void error(HWND hwnd, INT resId, ...)
{
va_list ap;
@@ -101,7 +101,7 @@ static void error_code_messagebox(HWND h
LocalFree(lpMsgBuf);
}
-BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
+static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
{
TCHAR buf[128];
DWORD val;
@@ -112,7 +112,7 @@ BOOL change_dword_base(HWND hwndDlg, BOO
return SetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf);
}
-INT_PTR CALLBACK modify_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK modify_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TCHAR* valueData;
HWND hwndValue;
Index: programs/regedit/framewnd.c
===================================================================
RCS file: /home/wine/wine/programs/regedit/framewnd.c,v
retrieving revision 1.19
diff -u -p -r1.19 framewnd.c
--- programs/regedit/framewnd.c 21 Mar 2005 11:23:40 -0000 1.19
+++ programs/regedit/framewnd.c 3 Jun 2005 14:49:30 -0000
@@ -61,7 +61,7 @@ static void resize_frame_rect(HWND hWnd,
MoveWindow(g_pChildWnd->hWnd, prect->left, prect->top, prect->right, prect->bottom, TRUE);
}
-void resize_frame_client(HWND hWnd)
+static void resize_frame_client(HWND hWnd)
{
RECT rect;
@@ -183,7 +183,7 @@ static BOOL CheckCommDlgError(HWND hWnd)
return TRUE;
}
-UINT_PTR CALLBACK ImportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
+static UINT_PTR CALLBACK ImportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
OPENFILENAME* pOpenFileName;
OFNOTIFY* pOfNotify;
@@ -319,7 +319,7 @@ static BOOL ExportRegistryFile(HWND hWnd
return TRUE;
}
-BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
+static BOOL PrintRegistryHive(HWND hWnd, LPCTSTR path)
{
#if 1
PRINTDLG pd;
@@ -384,7 +384,7 @@ BOOL PrintRegistryHive(HWND hWnd, LPTSTR
return TRUE;
}
-BOOL CopyKeyName(HWND hWnd, LPTSTR keyName)
+static 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.14
diff -u -p -r1.14 listview.c
--- programs/regedit/listview.c 11 Apr 2005 12:59:17 -0000 1.14
+++ programs/regedit/listview.c 3 Jun 2005 14:49:30 -0000
@@ -58,7 +58,7 @@ static HKEY g_currentRootKey;
static int default_column_widths[MAX_LIST_COLUMNS] = { 200, 175, 400 };
static int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT };
-LPTSTR get_item_text(HWND hwndLV, int item)
+static LPTSTR get_item_text(HWND hwndLV, int item)
{
LPTSTR newStr, curStr;
unsigned int maxLen = 128;
@@ -159,7 +159,7 @@ static void AddEntryToList(HWND hwndLV,
index = ListView_InsertItem(hwndLV, &item);
if (index != -1) {
/* LPTSTR pszText = NULL; */
- LPTSTR pszText = _T("(cannot display value)");
+ LPCTSTR pszText = _T("(cannot display value)");
switch (dwValType) {
case REG_SZ:
case REG_EXPAND_SZ:
Index: programs/regedit/main.c
===================================================================
RCS file: /home/wine/wine/programs/regedit/main.c,v
retrieving revision 1.14
diff -u -p -r1.14 main.c
--- programs/regedit/main.c 14 Apr 2005 11:30:31 -0000 1.14
+++ programs/regedit/main.c 3 Jun 2005 14:49:30 -0000
@@ -66,7 +66,7 @@ TCHAR szChildClass[MAX_LOADSTRING];
* create and display the main program window.
*/
-BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
+static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
WNDCLASSEX wcFrame = {
sizeof(WNDCLASSEX),
@@ -142,12 +142,12 @@ BOOL InitInstance(HINSTANCE hInstance, i
/******************************************************************************/
-void ExitInstance(void)
+static void ExitInstance(void)
{
DestroyMenu(hMenuFrame);
}
-BOOL TranslateChildTabMessage(MSG *msg)
+static BOOL TranslateChildTabMessage(MSG *msg)
{
if (msg->message != WM_KEYDOWN) return FALSE;
if (msg->wParam != VK_TAB) return FALSE;
Index: programs/regedit/regedit.c
===================================================================
RCS file: /home/wine/wine/programs/regedit/regedit.c,v
retrieving revision 1.10
diff -u -p -r1.10 regedit.c
--- programs/regedit/regedit.c 13 Jan 2004 05:07:07 -0000 1.10
+++ programs/regedit/regedit.c 3 Jun 2005 14:49:30 -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"
@@ -68,7 +68,7 @@ BOOL PerformRegAction(REGEDIT_ACTION act
* chu - the switch character in upper-case.
* s - the command line string where s points to the switch character.
*/
-void error_unknown_switch(char chu, char *s)
+static void error_unknown_switch(char chu, char *s)
{
if (isalpha(chu)) {
fprintf(stderr,"%s: Undefined switch /%c!\n", getAppName(), chu);
Index: programs/regedit/regproc.c
===================================================================
RCS file: /home/wine/wine/programs/regedit/regproc.c,v
retrieving revision 1.19
diff -u -p -r1.19 regproc.c
--- programs/regedit/regproc.c 30 Mar 2005 17:08:32 -0000 1.19
+++ programs/regedit/regproc.c 3 Jun 2005 14:49:31 -0000
@@ -43,9 +43,9 @@ static HKEY currentKeyClass = 0;
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", "HKEY_DYN_DATA"
};
@@ -343,7 +343,7 @@ LPSTR getArg( LPSTR arg)
/******************************************************************************
* Replaces escape sequences with the characters.
*/
-void REGPROC_unescape_string(LPSTR str)
+static void REGPROC_unescape_string(LPSTR str)
{
int str_idx = 0; /* current character under analysis */
int val_idx = 0; /* the last character of the unescaped string */
@@ -1044,7 +1044,7 @@ void doUnregisterDLL(LPSTR stdInput)
* Print the message for GetLastError
*/
-void REGPROC_print_error()
+static void REGPROC_print_error(void)
{
LPVOID lpMsgBuf;
DWORD error_code;
@@ -1073,7 +1073,7 @@ void REGPROC_print_error()
* required_len - length of the string to place to the buffer in characters.
* The length does not include the terminating null character.
*/
-void REGPROC_resize_char_buffer(CHAR **buffer, DWORD *len, DWORD required_len)
+static void REGPROC_resize_char_buffer(CHAR **buffer, DWORD *len, DWORD required_len)
{
required_len++;
if (required_len > *len) {
@@ -1089,7 +1089,7 @@ void REGPROC_resize_char_buffer(CHAR **b
/******************************************************************************
* Prints string str to file
*/
-void REGPROC_export_string(FILE *file, CHAR *str)
+static void REGPROC_export_string(FILE *file, CHAR *str)
{
size_t len = strlen(str);
size_t i;
@@ -1130,7 +1130,7 @@ void REGPROC_export_string(FILE *file, C
* Is resized if necessary.
* val_size - size of the buffer for storing values in bytes.
*/
-void export_hkey(FILE *file, HKEY key,
+static void export_hkey(FILE *file, HKEY key,
CHAR **reg_key_name_buf, DWORD *reg_key_name_len,
CHAR **val_name_buf, DWORD *val_name_len,
BYTE **val_buf, DWORD *val_size)
@@ -1214,7 +1214,7 @@ void export_hkey(FILE *file, HKEY key,
/* falls through */
case REG_BINARY: {
DWORD i1;
- CHAR *hex_prefix;
+ const CHAR *hex_prefix;
CHAR buf[20];
int cur_pos;
@@ -1284,7 +1284,7 @@ void export_hkey(FILE *file, HKEY key,
/******************************************************************************
* Open file for export.
*/
-FILE *REGPROC_open_export_file(CHAR *file_name)
+static FILE *REGPROC_open_export_file(CHAR *file_name)
{
FILE *file = fopen(file_name, "w");
if (!file) {
@@ -1405,7 +1405,7 @@ BOOL import_registry_file(LPTSTR filenam
/******************************************************************************
* Recursive function which removes the registry key with all subkeys.
*/
-void delete_branch(HKEY key,
+static void delete_branch(HKEY key,
CHAR **reg_key_name_buf, DWORD *reg_key_name_len)
{
HKEY branch_key;
@@ -1492,12 +1492,12 @@ void delete_registry_key(CHAR *reg_key_n
* 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(void)
{
return app_name;
}
Index: programs/regedit/regproc.h
===================================================================
RCS file: /home/wine/wine/programs/regedit/regproc.h,v
retrieving revision 1.4
diff -u -p -r1.4 regproc.h
--- programs/regedit/regproc.h 8 Dec 2003 22:48:07 -0000 1.4
+++ programs/regedit/regproc.h 3 Jun 2005 14:49:31 -0000
@@ -40,8 +40,8 @@ BOOL export_registry_key(CHAR *file_name
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);
@@ -71,3 +71,5 @@ HRESULT setValue(LPSTR val_name, LPSTR v
* api queryValue prototypes
*/
void processQueryValue(LPSTR cmdline);
+
+extern BOOL ProcessCmdLine(LPSTR lpCmdLine);
Index: programs/regedit/treeview.c
===================================================================
RCS file: /home/wine/wine/programs/regedit/treeview.c,v
retrieving revision 1.13
diff -u -p -r1.13 treeview.c
--- programs/regedit/treeview.c 11 Apr 2005 12:59:17 -0000 1.13
+++ programs/regedit/treeview.c 3 Jun 2005 14:49:31 -0000
@@ -112,7 +112,7 @@ BOOL DeleteNode(HWND hwndTV, HTREEITEM h
}
/* Add an entry to the tree. Only give hKey for root nodes (HKEY_ constants) */
-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)
{
TVITEM tvi;
TVINSERTSTRUCT tvins;
@@ -124,7 +124,7 @@ static HTREEITEM AddEntryToTree(HWND hwn
}
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
- tvi.pszText = label;
+ tvi.pszText = (LPTSTR) label;
tvi.cchTextMax = lstrlen(tvi.pszText);
tvi.iImage = Image_Closed;
tvi.iSelectedImage = Image_Open;
@@ -136,7 +136,7 @@ static HTREEITEM AddEntryToTree(HWND hwn
return TreeView_InsertItem(hwndTV, &tvins);
}
-BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
+static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
{
HKEY hRoot, hKey, hSubKey;
HTREEITEM childItem;
Index: programs/regsvr32/regsvr32.c
===================================================================
RCS file: /home/wine/wine/programs/regsvr32/regsvr32.c,v
retrieving revision 1.7
diff -u -p -r1.7 regsvr32.c
--- programs/regsvr32/regsvr32.c 7 Oct 2003 22:49:44 -0000 1.7
+++ programs/regsvr32/regsvr32.c 3 Jun 2005 14:49:31 -0000
@@ -58,7 +58,7 @@ typedef HRESULT (*DLLINSTALL)
int Silent = 0;
-int Usage()
+static int Usage(void)
{
printf("regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname ...\n");
printf("\t[/u] unregister server\n");
@@ -78,7 +78,7 @@ int Usage()
* 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)
+static VOID *LoadProc(const char* strDll, const char* procName, HMODULE* DllHandle)
{
VOID* (*proc)(void);
@@ -101,7 +101,7 @@ VOID *LoadProc(char* strDll, char* procN
return proc;
}
-int RegisterDll(char* strDll)
+static int RegisterDll(const char* strDll)
{
HRESULT hr;
DLLREGISTER pfRegister;
@@ -125,7 +125,7 @@ int RegisterDll(char* strDll)
return 0;
}
-int UnregisterDll(char* strDll)
+static int UnregisterDll(char* strDll)
{
HRESULT hr;
DLLUNREGISTER pfUnregister;
@@ -148,7 +148,7 @@ int UnregisterDll(char* strDll)
return 0;
}
-int InstallDll(BOOL install, char *strDll, WCHAR *command_line)
+static int InstallDll(BOOL install, char *strDll, WCHAR *command_line)
{
HRESULT hr;
DLLINSTALL pfInstall;
Index: programs/rpcss/rpcss_main.c
===================================================================
RCS file: /home/wine/wine/programs/rpcss/rpcss_main.c,v
retrieving revision 1.8
diff -u -p -r1.8 rpcss_main.c
--- programs/rpcss/rpcss_main.c 18 May 2005 15:33:20 -0000 1.8
+++ programs/rpcss/rpcss_main.c 3 Jun 2005 14:49:31 -0000
@@ -155,12 +155,12 @@ void RPCSS_SetLazyTimeRemaining(long sec
#undef ULARGEINT_TO_FILETIME
#undef TEN_MIL
-BOOL RPCSS_work(void)
+static BOOL RPCSS_work(void)
{
return RPCSS_NPDoWork();
}
-BOOL RPCSS_Empty(void)
+static BOOL RPCSS_Empty(void)
{
BOOL rslt = TRUE;
@@ -177,7 +177,7 @@ BOOL RPCSS_ReadyToDie(void)
return ( empty && (ltr <= 0) && (stc == 0) );
}
-BOOL RPCSS_Initialize(void)
+static BOOL RPCSS_Initialize(void)
{
WINE_TRACE("\n");
@@ -201,7 +201,7 @@ BOOL RPCSS_Initialize(void)
/* returns false if we discover at the last moment that we
aren't ready to terminate */
-BOOL RPCSS_Shutdown(void)
+static BOOL RPCSS_Shutdown(void)
{
if (!RPCSS_UnBecomePipeServer())
return FALSE;
@@ -214,7 +214,7 @@ BOOL RPCSS_Shutdown(void)
return TRUE;
}
-void RPCSS_MainLoop(void)
+static void RPCSS_MainLoop(void)
{
BOOL did_something_new;
@@ -234,7 +234,7 @@ void RPCSS_MainLoop(void)
}
}
-BOOL RPCSS_ProcessArgs( int argc, char **argv )
+static BOOL RPCSS_ProcessArgs( int argc, char **argv )
{
int i;
char *c,*c1;
@@ -280,7 +280,7 @@ BOOL RPCSS_ProcessArgs( int argc, char *
return TRUE;
}
-void RPCSS_Usage(void)
+static void RPCSS_Usage(void)
{
printf("\nWine RPCSS\n");
printf("\nsyntax: rpcss [-t timeout]\n\n");
Index: programs/taskmgr/dbgchnl.c
===================================================================
RCS file: /home/wine/wine/programs/taskmgr/dbgchnl.c,v
retrieving revision 1.6
diff -u -p -r1.6 dbgchnl.c
--- programs/taskmgr/dbgchnl.c 30 Nov 2004 21:38:57 -0000 1.6
+++ programs/taskmgr/dbgchnl.c 3 Jun 2005 14:49:31 -0000
@@ -157,7 +157,7 @@ static int change_channel_CB(HANDLE hPro
return 1;
}
-static void* get_symbol(HANDLE hProcess, char* name, char* lib)
+static void* get_symbol(HANDLE hProcess, const char* name, const char* lib)
{
char buffer[sizeof(IMAGEHLP_SYMBOL) + 256];
SYMBOL_INFO* si = (SYMBOL_INFO*)buffer;
@@ -171,8 +171,8 @@ static void* get_symbol(HANDLE hProcess,
{
si->SizeOfStruct = sizeof(*si);
si->MaxNameLen = sizeof(buffer) - sizeof(IMAGEHLP_SYMBOL);
- if (pSymLoadModule(hProcess, NULL, lib, NULL, 0, 0) &&
- pSymFromName(hProcess, name, si))
+ if (pSymLoadModule(hProcess, NULL, (PSTR)lib, NULL, 0, 0) &&
+ pSymFromName(hProcess, (PSTR)name, si))
ret = (void*)(ULONG_PTR)si->Address;
pSymCleanup(hProcess);
}
Index: programs/winedbg/be_cpu.h
===================================================================
RCS file: /home/wine/wine/programs/winedbg/be_cpu.h,v
retrieving revision 1.2
diff -u -p -r1.2 be_cpu.h
--- programs/winedbg/be_cpu.h 24 May 2005 11:46:25 -0000 1.2
+++ programs/winedbg/be_cpu.h 3 Jun 2005 14:49:31 -0000
@@ -114,3 +114,4 @@ extern struct backend_cpu* be_cpu;
void* be_cpu_linearize(HANDLE hThread, const ADDRESS*);
unsigned be_cpu_build_addr(HANDLE hThread, const CONTEXT* ctx, ADDRESS* addr,
unsigned seg, unsigned long offset);
+void be_i386_disasm_one_insn(ADDRESS *addr, int display);
Index: programs/winedbg/dbg.y
===================================================================
RCS file: /home/wine/wine/programs/winedbg/dbg.y,v
retrieving revision 1.25
diff -u -p -r1.25 dbg.y
--- programs/winedbg/dbg.y 23 May 2005 16:22:44 -0000 1.25
+++ programs/winedbg/dbg.y 3 Jun 2005 14:49:32 -0000
@@ -461,8 +461,11 @@ int input_fetch_entire_line(const c
size_t len;
if (arg_command) {
+ /* we only run one command before exiting */
+ const char q[] = "quit\n";
*line = arg_command;
- arg_command = "quit\n"; /* we only run one command before exiting */
+ arg_command = HeapAlloc(GetProcessHeap(), 0, sizeof q);
+ lstrcpyA(arg_command, q);
return 1;
}
Index: programs/winetest/main.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/main.c,v
retrieving revision 1.37
diff -u -p -r1.37 main.c
--- programs/winetest/main.c 27 May 2005 20:10:59 -0000 1.37
+++ programs/winetest/main.c 3 Jun 2005 14:49:32 -0000
@@ -60,7 +60,7 @@ static struct wine_test *wine_tests;
static struct rev_info *rev_infos = NULL;
static const char whitespace[] = " \t\r\n";
-static int running_under_wine ()
+static int running_under_wine (void)
{
HMODULE module = GetModuleHandleA("ntdll.dll");
@@ -68,7 +68,7 @@ static int running_under_wine ()
return (GetProcAddress(module, "wine_server_call") != NULL);
}
-static int running_on_visible_desktop ()
+static int running_on_visible_desktop (void)
{
HWND desktop;
HMODULE huser32 = GetModuleHandle("user32.dll");
@@ -92,7 +92,7 @@ static int running_on_visible_desktop ()
return IsWindowVisible(desktop);
}
-void print_version ()
+static void print_version (void)
{
OSVERSIONINFOEX ver;
BOOL ext;
@@ -125,7 +125,7 @@ static inline int is_dot_dir(const char*
return ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))));
}
-void remove_dir (const char *dir)
+static void remove_dir (const char *dir)
{
HANDLE hFind;
WIN32_FIND_DATA wfd;
@@ -156,7 +156,7 @@ void remove_dir (const char *dir)
dir, GetLastError ());
}
-const char* get_test_source_file(const char* test, const char* subtest)
+static const char* get_test_source_file(const char* test, const char* subtest)
{
static const char* special_dirs[][2] = {
{ "gdi32", "gdi"}, { "kernel32", "kernel" },
@@ -178,7 +178,7 @@ const char* get_test_source_file(const c
return buffer;
}
-const char* get_file_rev(const char* file)
+static const char* get_file_rev(const char* file)
{
const struct rev_info* rev;
@@ -189,7 +189,7 @@ const char* get_file_rev(const char* fil
return "-";
}
-void extract_rev_infos ()
+static void extract_rev_infos (void)
{
char revinfo[256], *p;
int size = 0, i;
@@ -215,7 +215,7 @@ void extract_rev_infos ()
}
}
-void* extract_rcdata (int id, int type, DWORD* size)
+static void* extract_rcdata (int id, int type, DWORD* size)
{
HRSRC rsrc;
HGLOBAL hdl;
@@ -230,7 +230,7 @@ void* extract_rcdata (int id, int type,
}
/* Fills in the name and exename fields */
-void
+static void
extract_test (struct wine_test *test, const char *dir, int id)
{
BYTE* code;
@@ -268,7 +268,7 @@ extract_test (struct wine_test *test, co
Return the exit status, -2 if can't create process or the return
value of WaitForSingleObject.
*/
-int
+static int
run_ex (char *cmd, const char *out, DWORD ms)
{
STARTUPINFO si;
@@ -345,7 +345,7 @@ run_ex (char *cmd, const char *out, DWOR
return status;
}
-void
+static void
get_subtests (const char *tempdir, struct wine_test *test, int id)
{
char *subname, *cmd;
@@ -410,7 +410,7 @@ get_subtests (const char *tempdir, struc
free (subname);
}
-void
+static void
run_test (struct wine_test* test, const char* subtest)
{
int status;
@@ -424,7 +424,7 @@ run_test (struct wine_test* test, const
xprintf ("%s:%s done (%d)\n", test->name, subtest, status);
}
-BOOL CALLBACK
+static BOOL CALLBACK
EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType,
LPTSTR lpszName, LONG_PTR lParam)
{
@@ -432,7 +432,7 @@ EnumTestFileProc (HMODULE hModule, LPCTS
return TRUE;
}
-char *
+static char *
run_tests (char *logname)
{
int nr_of_files = 0, nr_of_tests = 0, i;
@@ -542,8 +542,8 @@ run_tests (char *logname)
return logname;
}
-void
-usage ()
+static void
+usage (void)
{
fprintf (stderr, "\
Usage: winetest [OPTION]...\n\n\
Index: programs/winetest/send.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/send.c,v
retrieving revision 1.15
diff -u -p -r1.15 send.c
--- programs/winetest/send.c 5 Oct 2004 02:10:37 -0000 1.15
+++ programs/winetest/send.c 3 Jun 2005 14:49:32 -0000
@@ -24,7 +24,7 @@
#include "winetest.h"
-SOCKET
+static SOCKET
open_http (const char *server)
{
WSADATA wsad;
@@ -61,7 +61,7 @@ open_http (const char *server)
return INVALID_SOCKET;
}
-int
+static int
close_http (SOCKET s)
{
int ret;
@@ -70,7 +70,7 @@ close_http (SOCKET s)
return (WSACleanup () || ret);
}
-int
+static int
send_buf (SOCKET s, const char *buf, size_t length)
{
int sent;
@@ -84,7 +84,7 @@ send_buf (SOCKET s, const char *buf, siz
return 0;
}
-int
+static int
send_str (SOCKET s, ...)
{
va_list ap;
More information about the wine-patches
mailing list