Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
865ee87b
Commit
865ee87b
authored
Nov 12, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps.drv: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
783d7136
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
18 deletions
+11
-18
driver.c
dlls/wineps.drv/driver.c
+4
-7
init.c
dlls/wineps.drv/init.c
+2
-2
type1afm.c
dlls/wineps.drv/type1afm.c
+5
-9
No files found.
dlls/wineps.drv/driver.c
View file @
865ee87b
...
...
@@ -227,8 +227,6 @@ typedef struct
static
INT_PTR
CALLBACK
PSDRV_PaperDlgProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
const
WCHAR
resW
[]
=
{
'%'
,
'd'
,
0
};
static
const
WCHAR
resxyW
[]
=
{
'%'
,
'd'
,
'x'
,
'%'
,
'd'
,
0
};
PSDRV_DLGINFO
*
di
;
int
i
,
Cursel
;
PAGESIZE
*
ps
;
...
...
@@ -280,7 +278,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
WCHAR
buf
[
256
];
res
=
di
->
pi
->
ppd
->
DefaultResolution
;
len
=
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
resW
,
res
);
len
=
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
L"%d"
,
res
);
buf
[
len
++
]
=
' '
;
LoadStringW
(
PSDRV_hInstance
,
IDS_DPI
,
buf
+
len
,
ARRAY_SIZE
(
buf
)
-
len
);
SendDlgItemMessageW
(
hwnd
,
IDD_QUALITY
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
buf
);
...
...
@@ -310,9 +308,9 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
DWORD
idx
;
if
(
res
->
resx
==
res
->
resy
)
len
=
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
resW
,
res
->
resx
);
len
=
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
L"%d"
,
res
->
resx
);
else
len
=
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
resxyW
,
res
->
resx
,
res
->
resy
);
len
=
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
L"%dx%d"
,
res
->
resx
,
res
->
resy
);
buf
[
len
++
]
=
' '
;
LoadStringW
(
PSDRV_hInstance
,
IDS_DPI
,
buf
+
len
,
ARRAY_SIZE
(
buf
)
-
len
);
idx
=
SendDlgItemMessageW
(
hwnd
,
IDD_QUALITY
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
buf
);
...
...
@@ -552,7 +550,6 @@ INT CDECL PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput
PSDRV_DLGINFO
di
;
PSDRV_DEVMODE
dlgdm
;
WCHAR
SetupW
[
64
];
static
const
WCHAR
PAPERW
[]
=
{
'P'
,
'A'
,
'P'
,
'E'
,
'R'
,
'\0'
};
LoadStringW
(
PSDRV_hInstance
,
IDS_SETUP
,
SetupW
,
ARRAY_SIZE
(
SetupW
));
hinstComctl32
=
LoadLibraryA
(
"comctl32.dll"
);
...
...
@@ -565,7 +562,7 @@ INT CDECL PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput
di
.
dlgdm
=
&
dlgdm
;
psp
.
dwSize
=
sizeof
(
psp
);
psp
.
hInstance
=
PSDRV_hInstance
;
psp
.
u
.
pszTemplate
=
PAPERW
;
psp
.
u
.
pszTemplate
=
L"PAPER"
;
psp
.
u2
.
pszIcon
=
NULL
;
psp
.
pfnDlgProc
=
PSDRV_PaperDlgProc
;
psp
.
lParam
=
(
LPARAM
)
&
di
;
...
...
dlls/wineps.drv/init.c
View file @
865ee87b
...
...
@@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
static
const
PSDRV_DEVMODE
DefaultDevmode
=
{
{
/* dmPublic */
/* dmDeviceName */
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'P'
,
'o'
,
's'
,
't'
,
'S'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
' '
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
}
,
/* dmDeviceName */
L"Wine PostScript Driver"
,
/* dmSpecVersion */
0x30a
,
/* dmDriverVersion */
0x001
,
/* dmSize */
sizeof
(
DEVMODEW
),
...
...
@@ -66,7 +66,7 @@ static const PSDRV_DEVMODE DefaultDevmode =
/* dmYResolution */
300
,
/* dmTTOption */
DMTT_SUBDEV
,
/* dmCollate */
DMCOLLATE_FALSE
,
/* dmFormName */
{
'L'
,
'e'
,
't'
,
't'
,
'e'
,
'r'
,
0
}
,
/* dmFormName */
L"Letter"
,
/* dmLogPixels */
0
,
/* dmBitsPerPel */
0
,
/* dmPelsWidth */
0
,
...
...
dlls/wineps.drv/type1afm.c
View file @
865ee87b
...
...
@@ -1093,13 +1093,12 @@ static BOOL BuildAFM(FILE *file)
*/
static
BOOL
ReadAFMFile
(
LPCWSTR
filename
)
{
static
const
WCHAR
rW
[]
=
{
'r'
,
0
};
FILE
*
f
;
BOOL
retval
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
filename
));
f
=
_wfopen
(
filename
,
rW
);
f
=
_wfopen
(
filename
,
L"r"
);
if
(
f
==
NULL
)
{
WARN
(
"%s: %s
\n
"
,
debugstr_w
(
filename
),
strerror
(
errno
));
...
...
@@ -1120,8 +1119,6 @@ static BOOL ReadAFMFile(LPCWSTR filename)
*/
static
BOOL
ReadAFMDir
(
LPCSTR
dirname
)
{
static
const
WCHAR
starW
[]
=
{
'*'
,
0
};
static
const
WCHAR
afmW
[]
=
{
'.'
,
'a'
,
'f'
,
'm'
,
0
};
WCHAR
*
path
=
wine_get_dos_file_name
(
dirname
);
struct
_wfinddata_t
data
;
intptr_t
handle
;
...
...
@@ -1138,7 +1135,7 @@ static BOOL ReadAFMDir(LPCSTR dirname)
HeapFree
(
GetProcessHeap
(),
0
,
path
);
p
=
filename
+
lstrlenW
(
filename
);
*
p
++
=
'\\'
;
lstrcpyW
(
p
,
starW
);
lstrcpyW
(
p
,
L"*"
);
handle
=
_wfindfirst
(
filename
,
&
data
);
if
(
handle
!=
-
1
)
...
...
@@ -1146,7 +1143,7 @@ static BOOL ReadAFMDir(LPCSTR dirname)
do
{
WCHAR
*
ext
=
wcschr
(
data
.
name
,
'.'
);
if
(
!
ext
||
wcsicmp
(
ext
,
afmW
))
continue
;
if
(
!
ext
||
wcsicmp
(
ext
,
L".afm"
))
continue
;
lstrcpyW
(
p
,
data
.
name
);
if
(
!
(
ret
=
ReadAFMFile
(
filename
)))
break
;
}
while
(
!
_wfindnext
(
handle
,
&
data
));
...
...
@@ -1170,7 +1167,6 @@ static BOOL ReadAFMDir(LPCSTR dirname)
*/
BOOL
PSDRV_GetType1Metrics
(
void
)
{
static
const
WCHAR
pathW
[]
=
{
'A'
,
'F'
,
'M'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
HKEY
hkey
;
DWORD
len
;
LPWSTR
valueW
;
...
...
@@ -1180,11 +1176,11 @@ BOOL PSDRV_GetType1Metrics(void)
if
(
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Fonts"
,
&
hkey
)
!=
ERROR_SUCCESS
)
return
TRUE
;
if
(
RegQueryValueExW
(
hkey
,
pathW
,
NULL
,
NULL
,
NULL
,
&
len
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueExW
(
hkey
,
L"AFMPath"
,
NULL
,
NULL
,
NULL
,
&
len
)
==
ERROR_SUCCESS
)
{
len
+=
sizeof
(
WCHAR
);
valueW
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
);
if
(
RegQueryValueExW
(
hkey
,
pathW
,
NULL
,
NULL
,
(
LPBYTE
)
valueW
,
&
len
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueExW
(
hkey
,
L"AFMPath"
,
NULL
,
NULL
,
(
BYTE
*
)
valueW
,
&
len
)
==
ERROR_SUCCESS
)
{
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
valueW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
valueA
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment