Commit d73dad66 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Fixes for -Wmissing-declarations and -Wwrite-strings warnings.

parent 2ea56681
......@@ -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, INT titleId, INT resId, va_list ap)
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, INT titleId, INT resId, ...)
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 hwnd, DWORD error_code)
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, BOOL toHex)
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;
......
......@@ -61,7 +61,7 @@ static void resize_frame_rect(HWND hWnd, PRECT prect)
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 path)
return TRUE;
}
BOOL CopyKeyName(HWND hWnd, LPTSTR keyName)
static BOOL CopyKeyName(HWND hWnd, LPCTSTR keyName)
{
BOOL result;
......
......@@ -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;
......
......@@ -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, int nCmdShow)
/******************************************************************************/
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;
......
......@@ -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 action, LPSTR s);
* 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);
......
......@@ -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 **buffer, DWORD *len, DWORD required_len)
/******************************************************************************
* 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, CHAR *str)
* 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 filename)
/******************************************************************************
* 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_name)
* 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;
}
......@@ -40,8 +40,8 @@ BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_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 val_data);
* api queryValue prototypes
*/
void processQueryValue(LPSTR cmdline);
extern BOOL ProcessCmdLine(LPSTR lpCmdLine);
......@@ -136,7 +136,7 @@ static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, HK
return TreeView_InsertItem(hwndTV, &tvins);
}
BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
{
HKEY hRoot, hKey, hSubKey;
HTREEITEM childItem;
......
......@@ -58,7 +58,7 @@ typedef HRESULT (*DLLINSTALL) (BOOL,LPCWSTR);
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* procName, HMODULE* DllHandle)
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;
......
......@@ -155,12 +155,12 @@ void RPCSS_SetLazyTimeRemaining(long seconds)
#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 **argv )
return TRUE;
}
void RPCSS_Usage(void)
static void RPCSS_Usage(void)
{
printf("\nWine RPCSS\n");
printf("\nsyntax: rpcss [-t timeout]\n\n");
......
......@@ -461,8 +461,11 @@ int input_fetch_entire_line(const char* pfx, char** line, size_t* alloc, BO
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;
}
......
......@@ -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* x)
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 char* test, const char* subtest)
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* file)
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, DWORD* size)
}
/* 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, const char *dir, int id)
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, DWORD ms)
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, struct wine_test *test, int id)
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 char* subtest)
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, LPCTSTR lpszType,
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\
......
......@@ -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, size_t length)
return 0;
}
int
static int
send_str (SOCKET s, ...)
{
va_list ap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment