[Wine-patches] [eter-2.1 5/5] wineps.drv: Don't cast away 'const' from DEVMODE provided as input. (eterbug #8330)

Dmitry Timoshkov dtimoshkov на etersoft.ru
Пт Янв 25 09:49:30 MSK 2013


(cherry picked from commit d7687bed6ad8abc37996706cc41c5e888a5274e0)
---
 dlls/wineps.drv/driver.c | 8 ++++----
 dlls/wineps.drv/init.c   | 4 ++--
 dlls/wineps.drv/psdrv.h  | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/wineps.drv/driver.c b/dlls/wineps.drv/driver.c
index eefc882..7d9a4b5 100644
--- a/dlls/wineps.drv/driver.c
+++ b/dlls/wineps.drv/driver.c
@@ -45,7 +45,7 @@ static inline int paper_size_from_points( float size )
     return size * 254 / 72;
 }
 
-INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm )
+INPUTSLOT *find_slot( PPD *ppd, const PSDRV_DEVMODE *dm )
 {
     INPUTSLOT *slot;
 
@@ -56,7 +56,7 @@ INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm )
     return NULL;
 }
 
-PAGESIZE *find_pagesize( PPD *ppd, PSDRV_DEVMODE *dm )
+PAGESIZE *find_pagesize( PPD *ppd, const PSDRV_DEVMODE *dm )
 {
     PAGESIZE *page;
 
@@ -67,7 +67,7 @@ PAGESIZE *find_pagesize( PPD *ppd, PSDRV_DEVMODE *dm )
     return NULL;
 }
 
-DUPLEX *find_duplex( PPD *ppd, PSDRV_DEVMODE *dm )
+DUPLEX *find_duplex( PPD *ppd, const PSDRV_DEVMODE *dm )
 {
     DUPLEX *duplex;
     WORD win_duplex = dm->dmPublic.dmFields & DM_DUPLEX ? dm->dmPublic.dmDuplex : 0;
@@ -88,7 +88,7 @@ DUPLEX *find_duplex( PPD *ppd, PSDRV_DEVMODE *dm )
  * Updates dm1 with some fields from dm2
  *
  */
-void PSDRV_MergeDevmodes( PSDRV_DEVMODE *dm1, PSDRV_DEVMODE *dm2, PRINTERINFO *pi )
+void PSDRV_MergeDevmodes( PSDRV_DEVMODE *dm1, const PSDRV_DEVMODE *dm2, PRINTERINFO *pi )
 {
     /* some sanity checks here on dm2 */
 
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index dfd64d2..300ab24 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -324,7 +324,7 @@ static BOOL PSDRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
     if (output && *output) physDev->job.output = strdupW( output );
 
     if(initData) {
-        PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODE *)initData, pi);
+        PSDRV_MergeDevmodes(physDev->Devmode, (const PSDRV_DEVMODE *)initData, pi);
         /* Eterbug #61: Scale must be changed only in PSDRV_ExtDeviceMode function*/
         physDev->Devmode->dmPublic.u1.s1.dmScale = 100;
     }
@@ -382,7 +382,7 @@ static HDC PSDRV_ResetDC( PHYSDEV dev, const DEVMODEW *lpInitData )
 
     if (lpInitData)
     {
-        PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODE *)lpInitData, physDev->pi);
+        PSDRV_MergeDevmodes(physDev->Devmode, (const PSDRV_DEVMODE *)lpInitData, physDev->pi);
         PSDRV_UpdateDevCaps(physDev);
     }
     return dev->hdc;
diff --git a/dlls/wineps.drv/psdrv.h b/dlls/wineps.drv/psdrv.h
index 12ce526..ffae328 100644
--- a/dlls/wineps.drv/psdrv.h
+++ b/dlls/wineps.drv/psdrv.h
@@ -409,9 +409,9 @@ extern HINSTANCE PSDRV_hInstance DECLSPEC_HIDDEN;
 extern HANDLE PSDRV_Heap DECLSPEC_HIDDEN;
 extern char *PSDRV_ANSIVector[256] DECLSPEC_HIDDEN;
 
-extern INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm );
-extern PAGESIZE *find_pagesize( PPD *ppd, PSDRV_DEVMODE *dm );
-extern DUPLEX *find_duplex( PPD *ppd, PSDRV_DEVMODE *dm );
+extern INPUTSLOT *find_slot( PPD *ppd, const PSDRV_DEVMODE *dm );
+extern PAGESIZE *find_pagesize( PPD *ppd, const PSDRV_DEVMODE *dm );
+extern DUPLEX *find_duplex( PPD *ppd, const PSDRV_DEVMODE *dm );
 
 /* GDI driver functions */
 extern BOOL PSDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
@@ -462,7 +462,7 @@ extern INT PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc ) DECLSPEC_HIDDEN;
 extern BOOL PSDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
 extern BOOL PSDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN;
 
-extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE *dm1, PSDRV_DEVMODE *dm2,
+extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE *dm1, const PSDRV_DEVMODE *dm2,
 			 PRINTERINFO *pi) DECLSPEC_HIDDEN;
 extern BOOL PSDRV_GetFontMetrics(void) DECLSPEC_HIDDEN;
 extern PPD *PSDRV_ParsePPD(char *fname, HANDLE printer) DECLSPEC_HIDDEN;
-- 
1.8.0.2



Подробная информация о списке рассылки Wine-patches