wineps.drv: Cast-qual warnings fix (3 of 3)

Andrew Talbot Andrew.Talbot at talbotville.com
Sat Nov 18 12:34:20 CST 2006


This patch deconstifies certain variables but moves them to where they
are actually used.

-- Andy.
---
Changelog:
    wineps.drv: Cast-qual warnings fix.

diff -urN a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c
--- a/dlls/wineps.drv/ps.c	2006-10-13 11:27:20.000000000 +0100
+++ b/dlls/wineps.drv/ps.c	2006-11-18 17:58:49.000000000 +0000
@@ -43,41 +43,6 @@
 "%%%%Pages: (atend)\n"
 "%%%%EndComments\n";
 
-static const char psbeginprolog[] =
-"%%BeginProlog\n";
-
-static const char psendprolog[] =
-"%%EndProlog\n";
-
-static const char psprolog[] =
-"/tmpmtrx matrix def\n"
-"/hatch {\n"
-"  pathbbox\n"
-"  /b exch def /r exch def /t exch def /l exch def /gap 32 def\n"
-"  l cvi gap idiv gap mul\n"
-"  gap\n"
-"  r cvi gap idiv gap mul\n"
-"  {t moveto 0 b t sub rlineto}\n"
-"  for\n"
-"} bind def\n"
-"/B {pop pop pop pop} def\n"
-"/N {newpath} def\n"
-"/havetype42gdir {version cvi 2015 ge} bind def\n";
-
-static const char psbeginsetup[] =
-"%%BeginSetup\n";
-
-static const char psendsetup[] =
-"%%EndSetup\n";
-
-static const char psbeginfeature[] = /* feature, value */
-"mark {\n"
-"%%%%BeginFeature: %s %s\n";
-
-static const char psendfeature[] =
-"\n%%EndFeature\n"
-"} stopped cleartomark\n";
-
 static const char psnewpage[] = /* name, number, xres, yres, xtrans, ytrans, rot */
 "%%%%Page: %s %d\n"
 "%%%%BeginPageSetup\n"
@@ -88,10 +53,6 @@
 "%d rotate\n"
 "%%%%EndPageSetup\n";
 
-static const char psendpage[] =
-"pgsave restore\n"
-"showpage\n";
-
 static const char psfooter[] = /* pages */
 "%%%%Trailer\n"
 "%%%%Pages: %d\n"
@@ -197,11 +158,9 @@
 static const char psarraydef[] =
 "/%s %d array def\n";
 
-static const char psenddocument[] =
-"\n%%EndDocument\n";
-
 DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch)
 {
+    static char psenddocument[] = "\n%%EndDocument\n";
     int num, num_left = cch;
 
     if(physDev->job.quiet) {
@@ -210,7 +169,7 @@
     }
 
     if(physDev->job.in_passthrough) { /* Was in PASSTHROUGH mode */
-        WriteSpool16( physDev->job.hJob, (LPSTR)psenddocument, sizeof(psenddocument)-1 );
+        WriteSpool16( physDev->job.hJob, psenddocument, sizeof(psenddocument)-1 );
         physDev->job.in_passthrough = physDev->job.had_passthrough_rect = FALSE;
     }
 
@@ -233,17 +192,19 @@
 
 static INT PSDRV_WriteFeature(HANDLE16 hJob, LPCSTR feature, LPCSTR value, LPSTR invocation)
 {
-
+    static char psbeginfeature[] = "mark {\n"
+                                   "%%%%BeginFeature: %s %s\n";    /* feature, value */
+    static char psendfeature[]   = "\n%%EndFeature\n"
+                                   "} stopped cleartomark\n";
     char *buf = HeapAlloc( PSDRV_Heap, 0, sizeof(psbeginfeature) +
                            strlen(feature) + strlen(value));
 
-
     sprintf(buf, psbeginfeature, feature, value);
     WriteSpool16( hJob, buf, strlen(buf) );
 
     WriteSpool16( hJob, invocation, strlen(invocation) );
 
-    WriteSpool16( hJob, (LPSTR)psendfeature, strlen(psendfeature) );
+    WriteSpool16( hJob, psendfeature, strlen(psendfeature) );
 
     HeapFree( PSDRV_Heap, 0, buf );
     return 1;
@@ -313,6 +274,25 @@
     DUPLEX *duplex;
     int win_duplex;
     int llx, lly, urx, ury;
+    static char psbeginprolog[] = "%%BeginProlog\n";
+    static char psendprolog[]   = "%%EndProlog\n";
+    static char psprolog[] =
+            "/tmpmtrx matrix def\n"
+            "/hatch {\n"
+            "  pathbbox\n"
+            "  /b exch def /r exch def /t exch def /l exch def /gap 32 def\n"
+            "  l cvi gap idiv gap mul\n"
+            "  gap\n"
+            "  r cvi gap idiv gap mul\n"
+            "  {t moveto 0 b t sub rlineto}\n"
+            "  for\n"
+            "} bind def\n"
+            "/B {pop pop pop pop} def\n"
+            "/N {newpath} def\n"
+            "/havetype42gdir {version cvi 2015 ge} bind def\n";
+    static char psbeginsetup[] = "%%BeginSetup\n";
+    static char psendsetup[]   = "%%EndSetup\n";
+
 
     TRACE("'%s'\n", debugstr_a(title));
 
@@ -343,11 +323,11 @@
     }
     HeapFree( PSDRV_Heap, 0, buf );
 
-    WriteSpool16( physDev->job.hJob, (LPSTR)psbeginprolog, strlen(psbeginprolog) );
-    WriteSpool16( physDev->job.hJob, (LPSTR)psprolog, strlen(psprolog) );
-    WriteSpool16( physDev->job.hJob, (LPSTR)psendprolog, strlen(psendprolog) );
+    WriteSpool16( physDev->job.hJob, psbeginprolog, strlen(psbeginprolog) );
+    WriteSpool16( physDev->job.hJob, psprolog, strlen(psprolog) );
+    WriteSpool16( physDev->job.hJob, psendprolog, strlen(psendprolog) );
 
-    WriteSpool16( physDev->job.hJob, (LPSTR)psbeginsetup, strlen(psbeginsetup) );
+    WriteSpool16( physDev->job.hJob, psbeginsetup, strlen(psbeginsetup) );
 
     if(physDev->Devmode->dmPublic.dmCopies > 1) {
         char copies_buf[100];
@@ -387,7 +367,7 @@
 	}
     }
 
-    WriteSpool16( physDev->job.hJob, (LPSTR)psendsetup, strlen(psendsetup) );
+    WriteSpool16( physDev->job.hJob, psendsetup, strlen(psendsetup) );
 
 
     return 1;
@@ -420,8 +400,11 @@
 
 INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev )
 {
-    if( WriteSpool16( physDev->job.hJob, (LPSTR)psendpage, sizeof(psendpage)-1 ) !=
-	                                             sizeof(psendpage)-1 ) {
+    static char psendpage[] = "pgsave restore\n"
+                              "showpage\n";
+
+    if( WriteSpool16( physDev->job.hJob, psendpage, sizeof(psendpage)-1 ) !=
+        sizeof(psendpage)-1 ) {
         WARN("WriteSpool error\n");
 	return 0;
     }



More information about the wine-patches mailing list