From 193d52773664eca6c0008aac9fed528a538df2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Assailly?= Date: Fri, 28 Jan 2005 14:02:52 +0000 Subject: [PATCH] char -> const char fixes. --- dlls/commdlg/cdlg32.c | 2 +- dlls/kernel/tests/comm.c | 6 +++--- dlls/kernel/tests/console.c | 8 ++------ dlls/lzexpand/tests/lzexpand_main.c | 6 +++--- loader/preloader.c | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dlls/commdlg/cdlg32.c b/dlls/commdlg/cdlg32.c index fc94238c6f3..38cc88c42e2 100644 --- a/dlls/commdlg/cdlg32.c +++ b/dlls/commdlg/cdlg32.c @@ -63,7 +63,7 @@ BOOL (WINAPI *COMDLG32_SHGetFolderPathW)(HWND,int,HANDLE,DWORD,LPWSTR); * FALSE if sibling could not be loaded or instantiated twice, TRUE * otherwise. */ -static char * GPA_string = "Failed to get entry point %s for hinst = 0x%08x\n"; +static const char * GPA_string = "Failed to get entry point %s for hinst = 0x%08x\n"; #define GPA(dest, hinst, name) \ if(!(dest = (void*)GetProcAddress(hinst,name)))\ { \ diff --git a/dlls/kernel/tests/comm.c b/dlls/kernel/tests/comm.c index b17c26e4c59..5353661b0ef 100644 --- a/dlls/kernel/tests/comm.c +++ b/dlls/kernel/tests/comm.c @@ -409,7 +409,7 @@ static TEST test[] = pdcb->wReserved1 & 0xffff ); } */ -static void check_result(char *function, TEST *ptest, int initial_value, BOOL result) +static void check_result(const char *function, TEST *ptest, int initial_value, BOOL result) { DWORD LastError = GetLastError(); DWORD CorrectError = (ptest->result ? 0xdeadbeef : ERROR_INVALID_PARAMETER); @@ -421,7 +421,7 @@ static void check_result(char *function, TEST *ptest, int initial_value, BOOL re #define check_dcb_member(a,b) ok(pdcb1->a == pdcb2->a, "%s(\"%s\"), 0x%02x: "#a" is "b", should be "b"\n", function, ptest->string, initial_value, pdcb1->a, pdcb2->a) #define check_dcb_member2(a,c,b) if(pdcb2->a == c) { check_dcb_member(a,b); } else { ok(pdcb1->a == pdcb2->a || pdcb1->a == c, "%s(\"%s\"), 0x%02x: "#a" is "b", should be "b" or "b"\n", function, ptest->string, initial_value, pdcb1->a, pdcb2->a, c); } -static void check_dcb(char *function, TEST *ptest, int initial_value, DCB *pdcb1, DCB *pdcb2) +static void check_dcb(const char *function, TEST *ptest, int initial_value, DCB *pdcb1, DCB *pdcb2) { /* DCBlength is a special case since Win 9x sets it but NT does not. We will accept either as correct. */ @@ -493,7 +493,7 @@ static void check_dcb(char *function, TEST *ptest, int initial_value, DCB *pdcb1 #define check_timeouts_member(a) ok(ptimeouts1->a == ptimeouts2->a, "%s(\"%s\"), 0x%02x: "#a" is %lu, should be %lu\n", function, ptest->string, initial_value, ptimeouts1->a, ptimeouts2->a); -static void check_timeouts(char *function, TEST *ptest, int initial_value, COMMTIMEOUTS *ptimeouts1, COMMTIMEOUTS *ptimeouts2) +static void check_timeouts(const char *function, TEST *ptest, int initial_value, COMMTIMEOUTS *ptimeouts1, COMMTIMEOUTS *ptimeouts2) { check_timeouts_member(ReadIntervalTimeout); check_timeouts_member(ReadTotalTimeoutMultiplier); diff --git a/dlls/kernel/tests/console.c b/dlls/kernel/tests/console.c index 069796b6dcd..f195b9ab079 100644 --- a/dlls/kernel/tests/console.c +++ b/dlls/kernel/tests/console.c @@ -137,8 +137,8 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize) { COORD c; DWORD len, mode; - char* mytest; - int mylen; + const char* mytest = "123"; + const int mylen = strlen(mytest); int ret; int p; @@ -149,10 +149,6 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 3; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3\n"); - mytest = "123"; - - mylen = strlen(mytest); - ret = WriteConsole(hCon, mytest, mylen, &len, NULL); ok(ret != 0 && len == mylen, "Couldn't write, ret = %d, len = %ld\n", ret, len); c.Y = 0; diff --git a/dlls/lzexpand/tests/lzexpand_main.c b/dlls/lzexpand/tests/lzexpand_main.c index c3093f6a7d2..b8a9f4eeb1d 100644 --- a/dlls/lzexpand/tests/lzexpand_main.c +++ b/dlls/lzexpand/tests/lzexpand_main.c @@ -47,11 +47,11 @@ #include #include -static char* filename_ = "testfile.xx_"; +static char filename_[] = "testfile.xx_"; #if 0 -static char* filename = "testfile.xxx"; +static char filename[] = "testfile.xxx"; #endif -static char* filename2 = "testfile.yyy"; +static char filename2[] = "testfile.yyy"; /* This is the hex string representation of the file created by compressing a simple text file with the contents "This is a test file." diff --git a/loader/preloader.c b/loader/preloader.c index aebb6983052..74a10d8dc4a 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -725,7 +725,7 @@ static void map_so_lib( const char *name, struct wld_link_map *l) /* * Find a symbol in the symbol table of the executable loaded */ -static void *find_symbol( const ElfW(Phdr) *phdr, int num, char *var ) +static void *find_symbol( const ElfW(Phdr) *phdr, int num, const char *var ) { const ElfW(Dyn) *dyn = NULL; const ElfW(Phdr) *ph;