Make our ascii strings static const.

Remove a couple string variables that were used only once and use the
string literal directly.
This commit is contained in:
Francois Gouget 2004-05-04 04:13:05 +00:00 committed by Alexandre Julliard
parent ff39b877a4
commit cfc3943c5f
36 changed files with 113 additions and 119 deletions

View File

@ -924,9 +924,8 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpItem->cxy = phdi->cxy; lpItem->cxy = phdi->cxy;
if (phdi->mask & HDI_TEXT) { if (phdi->mask & HDI_TEXT) {
static char empty[] = "";
if (!phdi->pszText) /* null pointer check */ if (!phdi->pszText) /* null pointer check */
phdi->pszText = empty; phdi->pszText = "";
if (phdi->pszText != LPSTR_TEXTCALLBACKA) { if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
len = MultiByteToWideChar(CP_ACP, 0, phdi->pszText, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, phdi->pszText, -1, NULL, 0);
lpItem->pszText = Alloc( len*sizeof(WCHAR) ); lpItem->pszText = Alloc( len*sizeof(WCHAR) );

View File

@ -54,10 +54,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(print); WINE_DEFAULT_DEBUG_CHANNEL(print);
static char PrinterModel[] = "Printer Model"; static const char PrinterModel[] = "Printer Model";
static char DefaultDevMode[] = "Default DevMode"; static const char DefaultDevMode[] = "Default DevMode";
static char PrinterDriverData[] = "PrinterDriverData"; static const char PrinterDriverData[] = "PrinterDriverData";
static char Printers[] = "System\\CurrentControlSet\\Control\\Print\\Printers\\"; static const char Printers[] = "System\\CurrentControlSet\\Control\\Print\\Printers\\";
/****************************************************************** /******************************************************************

View File

@ -162,7 +162,7 @@ DWORD getICMPStats(MIB_ICMP *stats)
/* get most of these stats from /proc/net/snmp, no error if can't */ /* get most of these stats from /proc/net/snmp, no error if can't */
fp = fopen("/proc/net/snmp", "r"); fp = fopen("/proc/net/snmp", "r");
if (fp) { if (fp) {
const char hdr[] = "Icmp:"; static const char hdr[] = "Icmp:";
char buf[512] = { 0 }, *ptr; char buf[512] = { 0 }, *ptr;
do { do {
@ -292,7 +292,7 @@ DWORD getIPStats(PMIB_IPSTATS stats)
/* get most of these stats from /proc/net/snmp, no error if can't */ /* get most of these stats from /proc/net/snmp, no error if can't */
fp = fopen("/proc/net/snmp", "r"); fp = fopen("/proc/net/snmp", "r");
if (fp) { if (fp) {
const char hdr[] = "Ip:"; static const char hdr[] = "Ip:";
char buf[512] = { 0 }, *ptr; char buf[512] = { 0 }, *ptr;
do { do {
@ -401,7 +401,7 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
/* get from /proc/net/snmp, no error if can't */ /* get from /proc/net/snmp, no error if can't */
fp = fopen("/proc/net/snmp", "r"); fp = fopen("/proc/net/snmp", "r");
if (fp) { if (fp) {
const char hdr[] = "Tcp:"; static const char hdr[] = "Tcp:";
char buf[512] = { 0 }, *ptr; char buf[512] = { 0 }, *ptr;
@ -491,7 +491,7 @@ DWORD getUDPStats(MIB_UDPSTATS *stats)
/* get from /proc/net/snmp, no error if can't */ /* get from /proc/net/snmp, no error if can't */
fp = fopen("/proc/net/snmp", "r"); fp = fopen("/proc/net/snmp", "r");
if (fp) { if (fp) {
const char hdr[] = "Udp:"; static const char hdr[] = "Udp:";
char buf[512] = { 0 }, *ptr; char buf[512] = { 0 }, *ptr;

View File

@ -35,9 +35,9 @@
#endif #endif
const char szmspath[] = "\\\\.\\mailslot\\wine_mailslot_test"; static const char szmspath[] = "\\\\.\\mailslot\\wine_mailslot_test";
int mailslot_test() static int mailslot_test()
{ {
HANDLE hSlot, hSlot2, hWriter, hWriter2; HANDLE hSlot, hSlot2, hWriter, hWriter2;
unsigned char buffer[16]; unsigned char buffer[16];

View File

@ -54,12 +54,12 @@
static HANDLE alarm_event; static HANDLE alarm_event;
void test_CreateNamedPipe(pipemode) static void test_CreateNamedPipe(pipemode)
{ {
HANDLE hnp; HANDLE hnp;
HANDLE hFile; HANDLE hFile;
const char obuf[] = "Bit Bucket"; static const char obuf[] = "Bit Bucket";
const char obuf2[] = "More bits"; static const char obuf2[] = "More bits";
char ibuf[32], *pbuf; char ibuf[32], *pbuf;
DWORD written; DWORD written;
DWORD readden; DWORD readden;
@ -617,7 +617,7 @@ static void exercizeServer(const char *pipename, HANDLE serverThread)
trace("exercizeServer starting\n"); trace("exercizeServer starting\n");
for (i = 0; i < NB_SERVER_LOOPS; i++) { for (i = 0; i < NB_SERVER_LOOPS; i++) {
HANDLE hFile=INVALID_HANDLE_VALUE; HANDLE hFile=INVALID_HANDLE_VALUE;
const char obuf[] = "Bit Bucket"; static const char obuf[] = "Bit Bucket";
char ibuf[32]; char ibuf[32];
DWORD written; DWORD written;
DWORD readden; DWORD readden;
@ -660,7 +660,7 @@ static void exercizeServer(const char *pipename, HANDLE serverThread)
trace("exercizeServer returning\n"); trace("exercizeServer returning\n");
} }
void test_NamedPipe_2(void) static void test_NamedPipe_2(void)
{ {
HANDLE serverThread; HANDLE serverThread;
DWORD serverThreadId; DWORD serverThreadId;
@ -700,11 +700,11 @@ void test_NamedPipe_2(void)
trace("test_NamedPipe_2 returning\n"); trace("test_NamedPipe_2 returning\n");
} }
void test_DisconnectNamedPipe(void) static void test_DisconnectNamedPipe(void)
{ {
HANDLE hnp; HANDLE hnp;
HANDLE hFile; HANDLE hFile;
const char obuf[] = "Bit Bucket"; static const char obuf[] = "Bit Bucket";
char ibuf[32]; char ibuf[32];
DWORD written; DWORD written;
DWORD readden; DWORD readden;

View File

@ -31,7 +31,8 @@
static void test_fdopen( void ) static void test_fdopen( void )
{ {
static char buffer[] = {0,1,2,3,4,5,6,7,8,9}; static const char buffer[] = {0,1,2,3,4,5,6,7,8,9};
char ibuf[10];
int fd; int fd;
FILE *file; FILE *file;
@ -42,15 +43,15 @@ static void test_fdopen( void )
fd = open ("fdopen.tst", O_RDONLY | O_BINARY); fd = open ("fdopen.tst", O_RDONLY | O_BINARY);
lseek (fd, 5, SEEK_SET); lseek (fd, 5, SEEK_SET);
file = fdopen (fd, "rb"); file = fdopen (fd, "rb");
ok (fread (buffer, 1, sizeof (buffer), file) == 5, "read wrong byte count\n"); ok (fread (ibuf, 1, sizeof (buffer), file) == 5, "read wrong byte count\n");
ok (memcmp (buffer, buffer + 5, 5) == 0, "read wrong bytes\n"); ok (memcmp (ibuf, buffer + 5, 5) == 0, "read wrong bytes\n");
fclose (file); fclose (file);
unlink ("fdopen.tst"); unlink ("fdopen.tst");
} }
static void test_fileops( void ) static void test_fileops( void )
{ {
static char outbuffer[] = "0,1,2,3,4,5,6,7,8,9"; static const char outbuffer[] = "0,1,2,3,4,5,6,7,8,9";
char buffer[256]; char buffer[256];
WCHAR wbuffer[256]; WCHAR wbuffer[256];
int fd; int fd;
@ -102,7 +103,7 @@ static void test_fgetwc( void )
char* tempf; char* tempf;
FILE *tempfh; FILE *tempfh;
const char mytext[]= "This is test_fgetwc\n"; static const char mytext[]= "This is test_fgetwc\n";
WCHAR wtextW[LLEN+1]; WCHAR wtextW[LLEN+1];
WCHAR *mytextW = NULL, *aptr, *wptr; WCHAR *mytextW = NULL, *aptr, *wptr;
BOOL diff_found = FALSE; BOOL diff_found = FALSE;
@ -132,8 +133,8 @@ static void test_file_put_get( void )
{ {
char* tempf; char* tempf;
FILE *tempfh; FILE *tempfh;
const char mytext[]= "This is a test_file_put_get\n"; static const char mytext[]= "This is a test_file_put_get\n";
const char dostext[]= "This is a test_file_put_get\r\n"; static const char dostext[]= "This is a test_file_put_get\r\n";
char btext[LLEN]; char btext[LLEN];
WCHAR wtextW[LLEN+1]; WCHAR wtextW[LLEN+1];
WCHAR *mytextW = NULL, *aptr, *wptr; WCHAR *mytextW = NULL, *aptr, *wptr;
@ -176,12 +177,13 @@ static void test_file_put_get( void )
fclose(tempfh); fclose(tempfh);
unlink(tempf); unlink(tempf);
} }
static void test_file_write_read( void ) static void test_file_write_read( void )
{ {
char* tempf; char* tempf;
int tempfd; int tempfd;
const char mytext[]= "This is test_file_write_read\nsecond line\n"; static const char mytext[]= "This is test_file_write_read\nsecond line\n";
const char dostext[]= "This is test_file_write_read\r\nsecond line\r\n"; static const char dostext[]= "This is test_file_write_read\r\nsecond line\r\n";
char btext[LLEN]; char btext[LLEN];
tempf=_tempnam(".","wne"); tempf=_tempnam(".","wne");

View File

@ -28,7 +28,7 @@ static void test_sscanf( void )
char format[20]; char format[20];
int result, ret; int result, ret;
float res1= -82.6267f, res2= 27.76f, res11, res12; float res1= -82.6267f, res2= 27.76f, res11, res12;
char pname[]=" St. Petersburg, Florida\n"; static const char pname[]=" St. Petersburg, Florida\n";
int hour=21,min=59,sec=20; int hour=21,min=59,sec=20;
int number,number_so_far; int number,number_so_far;

View File

@ -33,7 +33,7 @@ static int* (*pmemcmp)(void *, const void *, size_t n);
START_TEST(string) START_TEST(string)
{ {
void *mem; void *mem;
char xilstring[]="c:/xilinx"; static const char xilstring[]="c:/xilinx";
int nLen=strlen(xilstring); int nLen=strlen(xilstring);
HMODULE hMsvcrt = LoadLibraryA("msvcrt.dll"); HMODULE hMsvcrt = LoadLibraryA("msvcrt.dll");
ok(hMsvcrt != 0, "LoadLibraryA failed\n"); ok(hMsvcrt != 0, "LoadLibraryA failed\n");

View File

@ -7235,7 +7235,7 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
{ {
LARGE_INTEGER iSeekPos; LARGE_INTEGER iSeekPos;
METAFILEPICT16 MetaFilePict; METAFILEPICT16 MetaFilePict;
char strMetafilePictName[] = "METAFILEPICT"; static const char strMetafilePictName[] = "METAFILEPICT";
/* Set the TypeID for a Metafile */ /* Set the TypeID for a Metafile */
pOleStreamData[1].dwTypeID = 5; pOleStreamData[1].dwTypeID = 5;

View File

@ -1047,7 +1047,7 @@ DWORD WINAPI SHSetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue,
{ {
DWORD dwRet = ERROR_SUCCESS, dwDummy; DWORD dwRet = ERROR_SUCCESS, dwDummy;
HKEY hSubKey; HKEY hSubKey;
char szEmpty[] = ""; static const char szEmpty[] = { '\0' };
TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_a(lpszSubKey), TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_a(lpszSubKey),
debugstr_a(lpszValue), dwType, pvData, cbData); debugstr_a(lpszValue), dwType, pvData, cbData);

View File

@ -1312,7 +1312,7 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller,
URL_COMPONENTSW url; URL_COMPONENTSW url;
WCHAR host[0x80], path[0x100]; WCHAR host[0x80], path[0x100];
HANDLE hfile; HANDLE hfile;
WCHAR wszAppName[]={'u','r','l','m','o','n','.','d','l','l',0}; static const WCHAR wszAppName[]={'u','r','l','m','o','n','.','d','l','l',0};
/* Note: all error codes would need to be checked agains real Windows behaviour... */ /* Note: all error codes would need to be checked agains real Windows behaviour... */
TRACE("(%p,%s,%s,%08lx,%p) stub!\n", pCaller, debugstr_w(szURL), debugstr_w(szFileName), dwReserved, lpfnCB); TRACE("(%p,%s,%s,%08lx,%p) stub!\n", pCaller, debugstr_w(szURL), debugstr_w(szFileName), dwReserved, lpfnCB);

View File

@ -26,7 +26,7 @@ void
test_LoadStringA (void) test_LoadStringA (void)
{ {
HINSTANCE hInst = GetModuleHandle (NULL); HINSTANCE hInst = GetModuleHandle (NULL);
const char str[] = "String resource"; /* same in resource.rc */ static const char str[] = "String resource"; /* same in resource.rc */
char buf[128]; char buf[128];
struct string_test { struct string_test {
int bufsiz; int bufsiz;

View File

@ -268,7 +268,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs,
BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef) BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef)
{ {
DOWNLOAD *pdl, *old; DOWNLOAD *pdl, *old;
char undef[] = "/%s findfont 40 scalefont setfont /%s undefinefont\n"; static const char undef[] = "/%s findfont 40 scalefont setfont /%s undefinefont\n";
char buf[sizeof(undef) + 200]; char buf[sizeof(undef) + 200];
char *default_font = physDev->pi->ppd->DefaultFont ? char *default_font = physDev->pi->ppd->DefaultFont ?
physDev->pi->ppd->DefaultFont : "Courier"; physDev->pi->ppd->DefaultFont : "Courier";

View File

@ -28,11 +28,11 @@
WINE_DEFAULT_DEBUG_CHANNEL(psdrv); WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
static char PEN_dash[] = "50 30"; /* ----- ----- ----- */ static const char PEN_dash[] = "50 30"; /* ----- ----- ----- */
static char PEN_dot[] = "20"; /* -- -- -- -- -- -- */ static const char PEN_dot[] = "20"; /* -- -- -- -- -- -- */
static char PEN_dashdot[] = "40 30 20 30"; /* ---- -- ---- -- */ static const char PEN_dashdot[] = "40 30 20 30"; /* ---- -- ---- -- */
static char PEN_dashdotdot[] = "40 20 20 20 20 20"; /* ---- -- -- ---- */ static const char PEN_dashdotdot[] = "40 20 20 20 20 20"; /* ---- -- -- ---- */
static char PEN_alternate[] = "1"; static const char PEN_alternate[] = "1";
/*********************************************************************** /***********************************************************************
* SelectPen (WINEPS.@) * SelectPen (WINEPS.@)

View File

@ -617,7 +617,7 @@ BOOL PSDRV_WriteIndexColorSpaceBegin(PSDRV_PDEVICE *physDev, int size)
BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev) BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev)
{ {
char buf[] = ">\n] setcolorspace\n"; static const char buf[] = ">\n] setcolorspace\n";
return PSDRV_WriteSpool(physDev, buf, sizeof(buf) - 1); return PSDRV_WriteSpool(physDev, buf, sizeof(buf) - 1);
} }
@ -643,17 +643,17 @@ BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst
INT widthDst, INT heightDst, INT widthSrc, INT widthDst, INT heightDst, INT widthSrc,
INT heightSrc, char *bits, BOOL mask) INT heightSrc, char *bits, BOOL mask)
{ {
const char start[] = "%d %d translate\n%d %d scale\n<<\n" static const char start[] = "%d %d translate\n%d %d scale\n<<\n"
" /ImageType 1\n /Width %d\n /Height %d\n /BitsPerComponent %d\n" " /ImageType 1\n /Width %d\n /Height %d\n /BitsPerComponent %d\n"
" /ImageMatrix [%d 0 0 %d 0 %d]\n"; " /ImageMatrix [%d 0 0 %d 0 %d]\n";
const char decode1[] = " /Decode [0 %d]\n"; static const char decode1[] = " /Decode [0 %d]\n";
const char decode3[] = " /Decode [0 1 0 1 0 1]\n"; static const char decode3[] = " /Decode [0 1 0 1 0 1]\n";
const char end[] = " /DataSource currentfile /ASCII85Decode filter /RunLengthDecode filter\n>> image\n"; static const char end[] = " /DataSource currentfile /ASCII85Decode filter /RunLengthDecode filter\n>> image\n";
const char endmask[] = " /DataSource currentfile /ASCII85Decode filter /RunLengthDecode filter\n>> imagemask\n"; static const char endmask[] = " /DataSource currentfile /ASCII85Decode filter /RunLengthDecode filter\n>> imagemask\n";
const char endbits[] = " /DataSource <%s>\n>> image\n"; static const char endbits[] = " /DataSource <%s>\n>> image\n";
char *buf = HeapAlloc(PSDRV_Heap, 0, 1000); char *buf = HeapAlloc(PSDRV_Heap, 0, 1000);
@ -775,10 +775,10 @@ BOOL PSDRV_WriteRectClip2(PSDRV_PDEVICE *physDev, CHAR *pszArrayName)
BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits) BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits)
{ {
const char start[] = "<<\n /PaintType 1\n /PatternType 1\n /TilingType 1\n " static const char start[] = "<<\n /PaintType 1\n /PatternType 1\n /TilingType 1\n "
"/BBox [0 0 %d %d]\n /XStep %d\n /YStep %d\n /PaintProc {\n begin\n"; "/BBox [0 0 %d %d]\n /XStep %d\n /YStep %d\n /PaintProc {\n begin\n";
const char end[] = " end\n }\n>>\n matrix makepattern setpattern\n"; static const char end[] = " end\n }\n>>\n matrix makepattern setpattern\n";
char *buf, *ptr; char *buf, *ptr;
INT w, h, x, y; INT w, h, x, y;
COLORREF map[2]; COLORREF map[2];
@ -809,10 +809,10 @@ BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits)
BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage) BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage)
{ {
const char start[] = "<<\n /PaintType 1\n /PatternType 1\n /TilingType 1\n " static const char start[] = "<<\n /PaintType 1\n /PatternType 1\n /TilingType 1\n "
"/BBox [0 0 %d %d]\n /XStep %d\n /YStep %d\n /PaintProc {\n begin\n"; "/BBox [0 0 %d %d]\n /XStep %d\n /YStep %d\n /PaintProc {\n begin\n";
const char end[] = " end\n }\n>>\n matrix makepattern setpattern\n"; static const char end[] = " end\n }\n>>\n matrix makepattern setpattern\n";
char *buf, *ptr; char *buf, *ptr;
BYTE *bits; BYTE *bits;
INT w, h, x, y, colours; INT w, h, x, y, colours;

View File

@ -308,7 +308,7 @@ typedef struct {
typedef struct { typedef struct {
INT style; INT style;
INT width; INT width;
char *dash; const char* dash;
PSCOLOR color; PSCOLOR color;
BOOL set; BOOL set;
} PSPEN; } PSPEN;

View File

@ -142,7 +142,7 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
WORD num_of_tables = sizeof(tables_templ) / sizeof(tables_templ[0]) - 1; WORD num_of_tables = sizeof(tables_templ) / sizeof(tables_templ[0]) - 1;
char *buf; char *buf;
TYPE42 *t42; TYPE42 *t42;
const char start[] = /* name, fontbbox */ static const char start[] = /* name, fontbbox */
"25 dict begin\n" "25 dict begin\n"
" /FontName /%s def\n" " /FontName /%s def\n"
" /Encoding 256 array 0 1 255{1 index exch /.notdef put} for\n" " /Encoding 256 array 0 1 255{1 index exch /.notdef put} for\n"
@ -155,10 +155,10 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
" /.notdef 0 def\n" " /.notdef 0 def\n"
" currentdict end def\n" " currentdict end def\n"
" /sfnts [\n"; " /sfnts [\n";
const char TT_offset_table[] = "<00010000%04x%04x%04x%04x\n"; static const char TT_offset_table[] = "<00010000%04x%04x%04x%04x\n";
const char TT_table_dir_entry[] = "%08lx%08lx%08lx%08lx\n"; static const char TT_table_dir_entry[] = "%08lx%08lx%08lx%08lx\n";
const char storage[] ="]\nhavetype42gdir{pop}{{string} forall}ifelse\n"; static const char storage[] ="]\nhavetype42gdir{pop}{{string} forall}ifelse\n";
const char end[] = "] def\n" static const char end[] = "] def\n"
"havetype42gdir{/GlyphDirectory 256 dict def\n" "havetype42gdir{/GlyphDirectory 256 dict def\n"
" sfnts 0 get dup %ld (locx) putinterval %ld (glfx) putinterval}if\n" " sfnts 0 get dup %ld (locx) putinterval %ld (glfx) putinterval}if\n"
"currentdict end dup /FontName get exch definefont pop\n"; "currentdict end dup /FontName get exch definefont pop\n";

View File

@ -151,10 +151,10 @@ static char *progname; /* name this program was invoked by */
static Window g_win = 0; /* the hidden clipboard server window */ static Window g_win = 0; /* the hidden clipboard server window */
static GC g_gc = 0; static GC g_gc = 0;
static char *g_szOutOfMemory = "Insufficient memory!\n"; static const char g_szOutOfMemory[] = "Insufficient memory!\n";
/* X selection context info */ /* X selection context info */
static char _CLIPBOARD[] = "CLIPBOARD"; /* CLIPBOARD atom name */ static const char _CLIPBOARD[] = "CLIPBOARD"; /* CLIPBOARD atom name */
static int g_selectionToAcquire = 0; /* Masks for the selection to be acquired */ static int g_selectionToAcquire = 0; /* Masks for the selection to be acquired */
static int g_selectionAcquired = 0; /* Contains the current selection masks */ static int g_selectionAcquired = 0; /* Contains the current selection masks */
static int g_clearAllSelections = 0; /* If TRUE *all* selections are lost on SelectionClear */ static int g_clearAllSelections = 0; /* If TRUE *all* selections are lost on SelectionClear */

View File

@ -634,7 +634,7 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
TRACE(output); TRACE(output);
} }
} else { } else {
char blks[] = " .:;!o*#"; static const char blks[] = " .:;!o*#";
char str[2]; char str[2];
str[1] = '\0'; str[1] = '\0';

View File

@ -385,8 +385,8 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
MSG msg; MSG msg;
WNDCLASS class; WNDCLASS class;
char szClassName[] = "CLClass"; /* To make sure className >= 0x10000 */ static const char szClassName[] = "CLClass"; /* To make sure className >= 0x10000 */
char szWinName[] = "Clock"; static const char szWinName[] = "Clock";
/* Setup Globals */ /* Setup Globals */
memset(&Globals.hFont, 0, sizeof (Globals.hFont)); memset(&Globals.hFont, 0, sizeof (Globals.hFont));

View File

@ -58,9 +58,9 @@ struct FlagTableEntry {
#define EXPORT #define EXPORT
static char menuName[] = "CmdlgtstMenu"; static const char menuName[] = "CmdlgtstMenu";
static char className[] = "CmdlgtstClass"; static const char className[] = "CmdlgtstClass";
static char windowName[] = "Cmdlgtst Window"; static const char windowName[] = "Cmdlgtst Window";
/* /*
* global hInstance variable. This makes the code non-threadable, * global hInstance variable. This makes the code non-threadable,
@ -80,7 +80,7 @@ static COLORREF cc_cr[16];
static CHOOSECOLOR cc; static CHOOSECOLOR cc;
static LOGFONT cf_lf; static LOGFONT cf_lf;
static CHOOSEFONT cf; static CHOOSEFONT cf;
static char ofn_filepat[] = "All Files (*.*)\0*.*\0Only Text Files (*.txt)\0*.txt\0"; static const char ofn_filepat[] = "All Files (*.*)\0*.*\0Only Text Files (*.txt)\0*.txt\0";
static char ofn_result[1024]; static char ofn_result[1024];
static char ofn_titleresult[128]; static char ofn_titleresult[128];
static OPENFILENAME ofn; static OPENFILENAME ofn;
@ -196,7 +196,7 @@ void mwi_File(HWND hWnd)
ofn.lStructSize = sizeof(OPENFILENAME); ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWnd; ofn.hwndOwner = hWnd;
ofn.hInstance = g_hInstance; ofn.hInstance = g_hInstance;
ofn.lpstrFilter = (LPSTR) ofn_filepat; ofn.lpstrFilter = ofn_filepat;
ofn.lpstrCustomFilter = 0; ofn.lpstrCustomFilter = 0;
ofn.nMaxCustFilter = 0; ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 0; ofn.nFilterIndex = 0;

View File

@ -22,9 +22,6 @@
void WCMD_batch_command (char *line); void WCMD_batch_command (char *line);
extern char nyi[];
extern char newline[];
extern char version_string[];
extern int echo_mode; extern int echo_mode;
extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH]; extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH];
extern BATCH_CONTEXT *context; extern BATCH_CONTEXT *context;

View File

@ -46,10 +46,6 @@ struct env_stack *saved_environment;
extern HINSTANCE hinst; extern HINSTANCE hinst;
extern char *inbuilt[]; extern char *inbuilt[];
extern char nyi[];
extern char newline[];
extern char version_string[];
extern char anykey[];
extern int echo_mode, verify_mode; extern int echo_mode, verify_mode;
extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH]; extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH];
extern BATCH_CONTEXT *context; extern BATCH_CONTEXT *context;
@ -1027,7 +1023,6 @@ int WCMD_volume (int mode, char *path) {
DWORD count, serial; DWORD count, serial;
char string[MAX_PATH], label[MAX_PATH], curdir[MAX_PATH]; char string[MAX_PATH], label[MAX_PATH], curdir[MAX_PATH];
BOOL status; BOOL status;
static char syntax[] = "Syntax Error\n\n";
if (lstrlen(path) == 0) { if (lstrlen(path) == 0) {
status = GetCurrentDirectory (sizeof(curdir), curdir); status = GetCurrentDirectory (sizeof(curdir), curdir);
@ -1040,7 +1035,7 @@ static char syntax[] = "Syntax Error\n\n";
} }
else { else {
if ((path[1] != ':') || (lstrlen(path) != 2)) { if ((path[1] != ':') || (lstrlen(path) != 2)) {
WCMD_output_asis(syntax); WCMD_output_asis("Syntax Error\n\n");
return 0; return 0;
} }
wsprintf (curdir, "%s\\", path); wsprintf (curdir, "%s\\", path);

View File

@ -35,10 +35,6 @@ char * WCMD_filesize64 (ULONGLONG free);
char * WCMD_strrev (char *buff); char * WCMD_strrev (char *buff);
extern char nyi[];
extern char newline[];
extern char version_string[];
extern char anykey[];
extern int echo_mode; extern int echo_mode;
extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH]; extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH];
extern DWORD errorlevel; extern DWORD errorlevel;
@ -131,7 +127,6 @@ CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
void WCMD_list_directory (char *search_path, int level) { void WCMD_list_directory (char *search_path, int level) {
char string[1024], datestring[32], timestring[32]; char string[1024], datestring[32], timestring[32];
char mem_err[] = "Memory Allocation Error";
char *p; char *p;
char real_path[MAX_PATH]; char real_path[MAX_PATH];
WIN32_FIND_DATA *fd; WIN32_FIND_DATA *fd;
@ -193,7 +188,7 @@ ULARGE_INTEGER byte_count, file_size;
fd = realloc (fd, (entry_count+1)*sizeof(WIN32_FIND_DATA)); fd = realloc (fd, (entry_count+1)*sizeof(WIN32_FIND_DATA));
if (fd == NULL) { if (fd == NULL) {
FindClose (hff); FindClose (hff);
WCMD_output (mem_err); WCMD_output ("Memory Allocation Error");
return; return;
} }
} while (FindNextFile(hff, (fd+entry_count)) != 0); } while (FindNextFile(hff, (fd+entry_count)) != 0);

View File

@ -137,3 +137,9 @@ typedef struct {
/* Must be last in list */ /* Must be last in list */
#define WCMD_EXIT 38 #define WCMD_EXIT 38
/* Some standard messages */
extern const char nyi[];
extern const char newline[];
extern const char version_string[];
extern const char anykey[];

View File

@ -37,10 +37,10 @@ const char *inbuilt[] = {"ATTRIB", "CALL", "CD", "CHDIR", "CLS", "COPY", "CTTY",
HINSTANCE hinst; HINSTANCE hinst;
DWORD errorlevel; DWORD errorlevel;
int echo_mode = 1, verify_mode = 0; int echo_mode = 1, verify_mode = 0;
char nyi[] = "Not Yet Implemented\n\n"; const char nyi[] = "Not Yet Implemented\n\n";
char newline[] = "\n"; const char newline[] = "\n";
char version_string[] = "WCMD Version 0.17\n\n"; const char version_string[] = "WCMD Version 0.17\n\n";
char anykey[] = "Press Return key to continue: "; const char anykey[] = "Press Return key to continue: ";
char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH]; char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH];
BATCH_CONTEXT *context = NULL; BATCH_CONTEXT *context = NULL;

View File

@ -321,7 +321,8 @@ get_subtests (const char *tempdir, struct wine_test *test, int id)
FILE *subfile; FILE *subfile;
size_t total; size_t total;
char buffer[8192], *index; char buffer[8192], *index;
const char header[] = "Valid test names:", seps[] = " \r\n"; static const char header[] = "Valid test names:";
static const char seps[] = " \r\n";
int allocated; int allocated;
test->subtest_count = 0; test->subtest_count = 0;

View File

@ -113,15 +113,15 @@ send_file (const char *name)
/* RFC 2068 */ /* RFC 2068 */
#define SEP "-" #define SEP "-"
const char head[] = "POST /submit HTTP/1.0\r\n" static const char head[] = "POST /submit HTTP/1.0\r\n"
"Host: test.winehq.org\r\n" "Host: test.winehq.org\r\n"
"User-Agent: Winetest Shell\r\n" "User-Agent: Winetest Shell\r\n"
"Content-Type: multipart/form-data; boundary=" SEP "\r\n" "Content-Type: multipart/form-data; boundary=" SEP "\r\n"
"Content-Length: %u\r\n\r\n"; "Content-Length: %u\r\n\r\n";
const char body1[] = "--" SEP "\r\n" static const char body1[] = "--" SEP "\r\n"
"Content-Disposition: form-data; name=reportfile; filename=\"%s\"\r\n" "Content-Disposition: form-data; name=reportfile; filename=\"%s\"\r\n"
"Content-Type: application/octet-stream\r\n\r\n"; "Content-Type: application/octet-stream\r\n\r\n";
const char body2[] = "\r\n--" SEP "\r\n" static const char body2[] = "\r\n--" SEP "\r\n"
"Content-Disposition: form-data; name=submit\r\n\r\n" "Content-Disposition: form-data; name=submit\r\n\r\n"
"Upload File\r\n" "Upload File\r\n"
"--" SEP "--\r\n"; "--" SEP "--\r\n";

View File

@ -20,15 +20,15 @@
/* Class names */ /* Class names */
char MAIN_WIN_CLASS_NAME[] = "MS_WINHELP"; const char MAIN_WIN_CLASS_NAME[] = "MS_WINHELP";
char BUTTON_BOX_WIN_CLASS_NAME[] = "WHButtonBox"; const char BUTTON_BOX_WIN_CLASS_NAME[] = "WHButtonBox";
char TEXT_WIN_CLASS_NAME[] = "WHText"; const char TEXT_WIN_CLASS_NAME[] = "WHText";
char SHADOW_WIN_CLASS_NAME[] = "WHShadow"; const char SHADOW_WIN_CLASS_NAME[] = "WHShadow";
char HISTORY_WIN_CLASS_NAME[] = "WHHistory"; const char HISTORY_WIN_CLASS_NAME[] = "WHHistory";
char STRING_BUTTON[] = "BUTTON"; const char STRING_BUTTON[] = "BUTTON";
/* Resource names */ /* Resource names */
char STRING_DIALOG_TEST[] = "DIALOG_TEST"; const char STRING_DIALOG_TEST[] = "DIALOG_TEST";
/* Local Variables: */ /* Local Variables: */
/* c-file-style: "GNU" */ /* c-file-style: "GNU" */

View File

@ -142,14 +142,14 @@ INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name); HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
extern char MAIN_WIN_CLASS_NAME[]; extern const char MAIN_WIN_CLASS_NAME[];
extern char BUTTON_BOX_WIN_CLASS_NAME[]; extern const char BUTTON_BOX_WIN_CLASS_NAME[];
extern char TEXT_WIN_CLASS_NAME[]; extern const char TEXT_WIN_CLASS_NAME[];
extern char SHADOW_WIN_CLASS_NAME[]; extern const char SHADOW_WIN_CLASS_NAME[];
extern char HISTORY_WIN_CLASS_NAME[]; extern const char HISTORY_WIN_CLASS_NAME[];
extern char STRING_BUTTON[]; extern const char STRING_BUTTON[];
extern char STRING_MENU_Xx[]; extern const char STRING_MENU_Xx[];
extern char STRING_DIALOG_TEST[]; extern const char STRING_DIALOG_TEST[];
#endif #endif
/* Buttons */ /* Buttons */

View File

@ -77,7 +77,7 @@ static char usage[] =
" * 0x20 Preprocessor yacc trace\n" " * 0x20 Preprocessor yacc trace\n"
; ;
char version_string[] = "Wine IDL Compiler Version " WIDL_FULLVERSION "\n" static const char version_string[] = "Wine IDL Compiler Version " WIDL_FULLVERSION "\n"
"Copyright 2002 Ove Kaaven\n"; "Copyright 2002 Ove Kaaven\n";
int win32 = 1; int win32 = 1;

View File

@ -182,7 +182,7 @@ static char *xlatebuffer = NULL;
static int fill_inputbuffer(void) static int fill_inputbuffer(void)
{ {
int n; int n;
static char err_fatalread[] = "Fatal: reading input failed"; static const char err_fatalread[] = "Fatal: reading input failed";
static int endian = -1; static int endian = -1;
if(!inputbuffer) if(!inputbuffer)

View File

@ -519,7 +519,7 @@ static void test_id(int id)
static int check_languages(node_t *head) static int check_languages(node_t *head)
{ {
static char err_missing[] = "Missing definition for language 0x%x; MessageID %d, facility 0x%x, severity 0x%x"; static const char err_missing[] = "Missing definition for language 0x%x; MessageID %d, facility 0x%x, severity 0x%x";
node_t *ndp; node_t *ndp;
int nm = 0; int nm = 0;
msg_t *msg = NULL; msg_t *msg = NULL;

View File

@ -211,7 +211,7 @@ int unistricmp(const WCHAR *s1, const WCHAR *s2)
{ {
int i; int i;
int once = 0; int once = 0;
static char warn[] = "Don't know the uppercase equivalent of non acsii characters;" static const char warn[] = "Don't know the uppercase equivalent of non acsii characters;"
"comparison might yield wrong results"; "comparison might yield wrong results";
while(*s1 && *s2) while(*s1 && *s2)
{ {
@ -252,4 +252,3 @@ int unistrcmp(const WCHAR *s1, const WCHAR *s2)
return *s1 - *s2; return *s1 - *s2;
} }

View File

@ -152,7 +152,7 @@ enum res_e res_type_from_id(const name_id_t *nid)
static resource_t *read_res32(FILE *fp) static resource_t *read_res32(FILE *fp)
{ {
static char wrong_format[] = "Wrong resfile format (32bit)"; static const char wrong_format[] = "Wrong resfile format (32bit)";
DWORD ressize; DWORD ressize;
DWORD hdrsize; DWORD hdrsize;
DWORD totsize; DWORD totsize;

View File

@ -103,7 +103,7 @@ static char usage[] =
"with -o, then the output is written to \"wrc.tab.res\"\n" "with -o, then the output is written to \"wrc.tab.res\"\n"
; ;
char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n" static const char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n"
"Copyright 1998-2000 Bertho A. Stultiens\n" "Copyright 1998-2000 Bertho A. Stultiens\n"
" 1994 Martin von Loewis\n"; " 1994 Martin von Loewis\n";