winspool.drv: Write-strings warnings fix
Andrew Talbot
Andrew.Talbot at talbotville.com
Sat Jun 24 11:49:14 CDT 2006
Changelog:
winspool.drv: Write-strings warnings fix.
diff -urN a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
--- a/dlls/winspool.drv/info.c 2006-06-21 17:24:50.000000000 +0100
+++ b/dlls/winspool.drv/info.c 2006-06-24 17:28:23.000000000 +0100
@@ -376,17 +376,26 @@
RegDeleteValueW(hkeyPrinter, May_Delete_Value);
RegCloseKey(hkeyPrinter);
} else {
+ static CHAR dtype[] = "RAW",
+ processor[] = "WinPrint",
+ driver[] = "PS Driver",
+ comment[] = "WINEPS Printer using CUPS",
+ location[] = "<physical location of printer>",
+ params[] = "<parameters?>",
+ sharename[] = "<share name?>",
+ sepfile[] = "<sep file?>";
+
memset(&pinfo2a,0,sizeof(pinfo2a));
- pinfo2a.pPrinterName = dests[i].name;
- pinfo2a.pDatatype = "RAW";
- pinfo2a.pPrintProcessor = "WinPrint";
- pinfo2a.pDriverName = "PS Driver";
- pinfo2a.pComment = "WINEPS Printer using CUPS";
- pinfo2a.pLocation = "<physical location of printer>";
- pinfo2a.pPortName = port;
- pinfo2a.pParameters = "<parameters?>";
- pinfo2a.pShareName = "<share name?>";
- pinfo2a.pSepFile = "<sep file?>";
+ pinfo2a.pPrinterName = dests[i].name;
+ pinfo2a.pDatatype = dtype;
+ pinfo2a.pPrintProcessor = processor;
+ pinfo2a.pDriverName = driver;
+ pinfo2a.pComment = comment;
+ pinfo2a.pLocation = location;
+ pinfo2a.pPortName = port;
+ pinfo2a.pParameters = params;
+ pinfo2a.pShareName = sharename;
+ pinfo2a.pSepFile = sepfile;
if (!AddPrinterA(NULL,2,(LPBYTE)&pinfo2a)) {
if (GetLastError() != ERROR_PRINTER_ALREADY_EXISTS)
@@ -410,6 +419,7 @@
char *e,*s,*name,*prettyname,*devname;
BOOL ret = FALSE, set_default = FALSE;
char *port,*devline,*env_default;
+ static CHAR empty[] = "";
HKEY hkeyPrinter, hkeyPrinters, hkey;
while (isspace(*pent)) pent++;
@@ -421,7 +431,7 @@
*s=':';
pent = s;
} else
- pent = "";
+ pent = empty;
TRACE("name=%s entry=%s\n",name, pent);
@@ -490,17 +500,25 @@
RegDeleteValueW(hkeyPrinter, May_Delete_Value);
RegCloseKey(hkeyPrinter);
} else {
+ static CHAR dtype[] = "RAW",
+ processor[] = "WinPrint",
+ driver[] = "PS Driver",
+ comment[] = "WINEPS Printer using LPR",
+ params[] = "<parameters?>",
+ sharename[] = "<share name?>",
+ sepfile[] = "<sep file?>";
+
memset(&pinfo2a,0,sizeof(pinfo2a));
- pinfo2a.pPrinterName = devname;
- pinfo2a.pDatatype = "RAW";
- pinfo2a.pPrintProcessor = "WinPrint";
- pinfo2a.pDriverName = "PS Driver";
- pinfo2a.pComment = "WINEPS Printer using LPR";
- pinfo2a.pLocation = prettyname;
- pinfo2a.pPortName = port;
- pinfo2a.pParameters = "<parameters?>";
- pinfo2a.pShareName = "<share name?>";
- pinfo2a.pSepFile = "<sep file?>";
+ pinfo2a.pPrinterName = devname;
+ pinfo2a.pDatatype = dtype;
+ pinfo2a.pPrintProcessor = processor;
+ pinfo2a.pDriverName = driver;
+ pinfo2a.pComment = comment;
+ pinfo2a.pLocation = prettyname;
+ pinfo2a.pPortName = port;
+ pinfo2a.pParameters = params;
+ pinfo2a.pShareName = sharename;
+ pinfo2a.pSepFile = sepfile;
if (!AddPrinterA(NULL,2,(LPBYTE)&pinfo2a)) {
if (GetLastError()!=ERROR_PRINTER_ALREADY_EXISTS)
@@ -587,17 +605,25 @@
DWORD needed, num, i;
WCHAR PrinterName[256];
BOOL done = FALSE;
-
- di3a.cVersion = (GetVersion() & 0x80000000) ? 0 : 3; /* FIXME: add 1, 2 */
- di3a.pName = "PS Driver";
- di3a.pEnvironment = NULL; /* NULL means auto */
- di3a.pDriverPath = "wineps16";
- di3a.pDataFile = "<datafile?>";
- di3a.pConfigFile = "wineps16";
- di3a.pHelpFile = "<helpfile?>";
- di3a.pDependentFiles = "<dependend files?>";
- di3a.pMonitorName = "<monitor name?>";
- di3a.pDefaultDataType = "RAW";
+ static CHAR driver[] = "PS Driver",
+ path[] = "wineps16",
+ datafile[] = "<datafile?>",
+ configfile[] = "wineps16",
+ helpfile[] = "<helpfile?>",
+ depfiles[] = "<dependend files?>",
+ monitor[] = "<monitor name?>",
+ defdtype[] = "RAW";
+
+ di3a.cVersion = (GetVersion() & 0x80000000) ? 0 : 3; /* FIXME: add 1, 2 */
+ di3a.pName = driver;
+ di3a.pEnvironment = NULL; /* NULL means auto */
+ di3a.pDriverPath = path;
+ di3a.pDataFile = datafile;
+ di3a.pConfigFile = configfile;
+ di3a.pHelpFile = helpfile;
+ di3a.pDependentFiles = depfiles;
+ di3a.pMonitorName = monitor;
+ di3a.pDefaultDataType = defdtype;
if (!AddPrinterDriverA(NULL,3,(LPBYTE)&di3a)) {
ERR("Failed adding PS Driver (%ld)\n",GetLastError());
@@ -3935,6 +3961,8 @@
{
DRIVER_INFO_3A di3;
HKEY hkeyDrivers, hkeyName;
+ static CHAR empty[] = "",
+ nullnull[] = "\0";
TRACE("(%s,%ld,%p)\n",debugstr_a(pName),level,pDriverInfo);
@@ -3965,10 +3993,10 @@
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
- if(!di3.pDefaultDataType) di3.pDefaultDataType = "";
- if(!di3.pDependentFiles) di3.pDependentFiles = "\0";
- if(!di3.pHelpFile) di3.pHelpFile = "";
- if(!di3.pMonitorName) di3.pMonitorName = "";
+ if(!di3.pDefaultDataType) di3.pDefaultDataType = empty;
+ if(!di3.pDependentFiles) di3.pDependentFiles = nullnull;
+ if(!di3.pHelpFile) di3.pHelpFile = empty;
+ if(!di3.pMonitorName) di3.pMonitorName = empty;
hkeyDrivers = WINSPOOL_OpenDriverReg(di3.pEnvironment, FALSE);
More information about the wine-patches
mailing list