Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
8ba66c0c
Commit
8ba66c0c
authored
Apr 09, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhelp: Fix Win64 warnings.
parent
2c8476a0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
42 deletions
+42
-42
callback.c
programs/winhelp/callback.c
+4
-4
hlpfile.c
programs/winhelp/hlpfile.c
+13
-13
macro.lex.l
programs/winhelp/macro.lex.l
+1
-1
winhelp.c
programs/winhelp/winhelp.c
+24
-24
No files found.
programs/winhelp/callback.c
View file @
8ba66c0c
...
...
@@ -127,16 +127,16 @@ static void CALLBACK WHD_ErrorString(LPSTR err)
WINE_FIXME
(
"()
\n
"
);
}
static
LONG
CALLBACK
WHD_GetInfo
(
WORD
what
,
HWND
hnd
)
static
ULONG_PTR
CALLBACK
WHD_GetInfo
(
WORD
what
,
HWND
hnd
)
{
LONG
ret
=
0
;
ULONG_PTR
ret
=
0
;
WINE_TRACE
(
"(%x %p)
\n
"
,
what
,
hnd
);
switch
(
what
)
{
case
0
:
break
;
case
1
:
/* instance */
ret
=
(
LONG
)
Globals
.
hInstance
;
break
;
case
3
:
/* current window */
ret
=
(
LONG
)
Globals
.
active_win
->
hMainWnd
;
break
;
case
1
:
/* instance */
ret
=
(
ULONG_PTR
)
Globals
.
hInstance
;
break
;
case
3
:
/* current window */
ret
=
(
ULONG_PTR
)
Globals
.
active_win
->
hMainWnd
;
break
;
case
2
:
/* main window */
case
4
:
/* handle to opened file */
case
5
:
/* foreground color */
...
...
programs/winhelp/hlpfile.c
View file @
8ba66c0c
...
...
@@ -158,11 +158,11 @@ HLPFILE_PAGE *HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset)
static
int
comp_PageByHash
(
void
*
p
,
const
void
*
key
,
int
leaf
,
void
**
next
)
{
LONG
lKey
=
(
LONG
)
key
;
LONG
lTest
=
GET_UINT
(
p
,
0
);
ULONG_PTR
lKey
=
(
LONG_PTR
)
key
;
ULONG_PTR
lTest
=
GET_UINT
(
p
,
0
);
*
next
=
(
char
*
)
p
+
(
leaf
?
8
:
6
);
WINE_TRACE
(
"Comparing '%
u' with '%
u'
\n
"
,
lKey
,
lTest
);
WINE_TRACE
(
"Comparing '%
lu' with '%l
u'
\n
"
,
lKey
,
lTest
);
if
(
lTest
<
lKey
)
return
-
1
;
if
(
lTest
>
lKey
)
return
1
;
return
0
;
...
...
@@ -184,7 +184,7 @@ HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash)
if
(
hlpfile
->
version
<=
16
)
return
HLPFILE_PageByNumber
(
hlpfile
,
lHash
);
ptr
=
HLPFILE_BPTreeSearch
(
hlpfile
->
Context
,
(
void
*
)
lHash
,
comp_PageByHash
);
ptr
=
HLPFILE_BPTreeSearch
(
hlpfile
->
Context
,
ULongToPtr
(
lHash
)
,
comp_PageByHash
);
if
(
!
ptr
)
{
WINE_ERR
(
"Page of hash %x not found in file %s
\n
"
,
lHash
,
hlpfile
->
lpszPath
);
...
...
@@ -587,7 +587,7 @@ static BYTE* HLPFILE_DecompressGfx(BYTE* src, unsigned csz, unsigned sz, BYTE
if
(
!
dst
)
return
NULL
;
HLPFILE_UncompressRLE
(
src
,
src
+
csz
,
&
tmp
,
sz
);
if
(
tmp
-
dst
!=
sz
)
WINE_WARN
(
"Bogus gfx sizes (RunLen): %
u/%u
\n
"
,
tmp
-
dst
,
sz
);
WINE_WARN
(
"Bogus gfx sizes (RunLen): %
lu/%u
\n
"
,
(
SIZE_T
)(
tmp
-
dst
)
,
sz
);
break
;
case
2
:
/* LZ77 */
sz77
=
HLPFILE_UncompressedLZ77_Size
(
src
,
src
+
csz
);
...
...
@@ -610,7 +610,7 @@ static BYTE* HLPFILE_DecompressGfx(BYTE* src, unsigned csz, unsigned sz, BYTE
}
HLPFILE_UncompressRLE
(
tmp
,
tmp
+
sz77
,
&
tmp2
,
sz
);
if
(
tmp2
-
dst
!=
sz
)
WINE_WARN
(
"Bogus gfx sizes (LZ77+RunLen): %
u / %u
\n
"
,
tmp2
-
dst
,
sz
);
WINE_WARN
(
"Bogus gfx sizes (LZ77+RunLen): %
lu / %u
\n
"
,
(
SIZE_T
)(
tmp2
-
dst
)
,
sz
);
HeapFree
(
GetProcessHeap
(),
0
,
tmp
);
break
;
default:
...
...
@@ -729,8 +729,8 @@ static BOOL HLPFILE_LoadMetaFile(BYTE* beg, BYTE pack, HLPFILE_PARAGRAPH* pa
hsoff
=
GET_UINT
(
ptr
,
4
);
ptr
+=
8
;
WINE_TRACE
(
"sz=%lu csz=%lu (%d,%d) offs=%lu/%u,%lu
\n
"
,
size
,
csize
,
lpmfp
->
xExt
,
lpmfp
->
yExt
,
off
,
ptr
-
beg
,
hsoff
);
WINE_TRACE
(
"sz=%lu csz=%lu (%d,%d) offs=%lu/%
l
u,%lu
\n
"
,
size
,
csize
,
lpmfp
->
xExt
,
lpmfp
->
yExt
,
off
,
(
SIZE_T
)(
ptr
-
beg
)
,
hsoff
);
bits
=
HLPFILE_DecompressGfx
(
beg
+
off
,
csize
,
size
,
pack
);
if
(
!
bits
)
return
FALSE
;
...
...
@@ -944,7 +944,7 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigne
for
(
nc
=
0
;
nc
<
ncol
;
nc
++
)
{
WINE_TRACE
(
"looking for format at offset %
u for column %d
\n
"
,
format
-
(
buf
+
0x15
),
nc
);
WINE_TRACE
(
"looking for format at offset %
lu for column %d
\n
"
,
(
SIZE_T
)(
format
-
(
buf
+
0x15
)
),
nc
);
if
(
buf
[
0x14
]
==
0x23
)
format
+=
5
;
if
(
buf
[
0x14
]
==
0x01
)
...
...
@@ -1796,8 +1796,8 @@ static void HLPFILE_Uncompress2(const BYTE *ptr, const BYTE *end, BYTE *newptr,
if
(
newptr
+
(
phend
-
phptr
)
>
newend
)
{
WINE_FIXME
(
"buffer overflow %p > %p for %
d bytes
\n
"
,
newptr
,
newend
,
phend
-
phptr
);
WINE_FIXME
(
"buffer overflow %p > %p for %
lu bytes
\n
"
,
newptr
,
newend
,
(
SIZE_T
)(
phend
-
phptr
)
);
return
;
}
memcpy
(
newptr
,
phptr
,
phend
-
phptr
);
...
...
@@ -1902,8 +1902,8 @@ static void HLPFILE_UncompressRLE(const BYTE* src, const BYTE* end, BYTE** dst,
*
dst
+=
ch
;
}
if
(
*
dst
!=
sdst
)
WINE_WARN
(
"Buffer X-flow: d(%u) instead of d(%u)
\n
"
,
*
dst
-
(
sdst
-
dstsz
),
dstsz
);
WINE_WARN
(
"Buffer X-flow: d(%
l
u) instead of d(%u)
\n
"
,
(
SIZE_T
)(
*
dst
-
(
sdst
-
dstsz
)
),
dstsz
);
}
/**************************************************************************
...
...
programs/winhelp/macro.lex.l
View file @
8ba66c0c
...
...
@@ -175,7 +175,7 @@ static int MACRO_CheckArgs(void* pa[], unsigned max, const char* args)
case 'I':
if (t != INTEGER)
{WINE_WARN("missing U\n");return -1;}
pa[idx] =
(void*)yylval.integer;
pa[idx] =
LongToPtr(yylval.integer);
break;
case 'B':
if (t != BOOL_FUNCTION)
...
...
programs/winhelp/winhelp.c
View file @
8ba66c0c
...
...
@@ -466,10 +466,10 @@ static BOOL WINHELP_ReuseWindow(WINHELP_WINDOW* win, WINHELP_WINDOW* oldwin,
oldwin
->
hMainWnd
=
oldwin
->
hButtonBoxWnd
=
oldwin
->
hTextWnd
=
oldwin
->
hHistoryWnd
=
0
;
win
->
hBrush
=
CreateSolidBrush
(
win
->
info
->
sr_color
);
SetWindowLong
(
win
->
hMainWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
(
win
->
hButtonBoxWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
(
win
->
hTextWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
(
win
->
hHistoryWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
Ptr
(
win
->
hMainWnd
,
0
,
(
ULONG_PTR
)
win
);
SetWindowLong
Ptr
(
win
->
hButtonBoxWnd
,
0
,
(
ULONG_PTR
)
win
);
SetWindowLong
Ptr
(
win
->
hTextWnd
,
0
,
(
ULONG_PTR
)
win
);
SetWindowLong
Ptr
(
win
->
hHistoryWnd
,
0
,
(
ULONG_PTR
)
win
);
WINHELP_InitFonts
(
win
->
hMainWnd
);
...
...
@@ -701,12 +701,12 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
{
case
WM_NCCREATE
:
win
=
(
WINHELP_WINDOW
*
)
((
LPCREATESTRUCT
)
lParam
)
->
lpCreateParams
;
SetWindowLong
(
hWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
Ptr
(
hWnd
,
0
,
(
ULONG_PTR
)
win
);
win
->
hMainWnd
=
hWnd
;
break
;
case
WM_CREATE
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
/* Create button box and text Window */
CreateWindow
(
BUTTON_BOX_WIN_CLASS_NAME
,
""
,
WS_CHILD
|
WS_VISIBLE
,
...
...
@@ -718,7 +718,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
/* Fall through */
case
WM_USER
:
case
WM_WINDOWPOSCHANGED
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
GetClientRect
(
hWnd
,
&
rect
);
/* Update button box and text Window */
...
...
@@ -738,7 +738,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
WM_COMMAND
:
Globals
.
active_win
=
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
Globals
.
active_win
=
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
switch
(
wParam
)
{
/* Menu FILE */
...
...
@@ -790,7 +790,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
case
VK_PRIOR
:
case
VK_NEXT
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
curPos
=
GetScrollPos
(
win
->
hTextWnd
,
SB_VERT
);
GetScrollRange
(
win
->
hTextWnd
,
SB_VERT
,
&
min
,
&
max
);
...
...
@@ -841,13 +841,13 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa
{
case
WM_NCCREATE
:
win
=
(
WINHELP_WINDOW
*
)
((
LPCREATESTRUCT
)
lParam
)
->
lpCreateParams
;
SetWindowLong
(
hWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
Ptr
(
hWnd
,
0
,
(
ULONG_PTR
)
win
);
win
->
hButtonBoxWnd
=
hWnd
;
break
;
case
WM_WINDOWPOSCHANGING
:
winpos
=
(
WINDOWPOS
*
)
lParam
;
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
/* Update buttons */
button_size
.
cx
=
0
;
...
...
@@ -958,7 +958,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
{
case
WM_NCCREATE
:
win
=
(
WINHELP_WINDOW
*
)
((
LPCREATESTRUCT
)
lParam
)
->
lpCreateParams
;
SetWindowLong
(
hWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
Ptr
(
hWnd
,
0
,
(
ULONG_PTR
)
win
);
win
->
hTextWnd
=
hWnd
;
win
->
hBrush
=
CreateSolidBrush
(
win
->
info
->
sr_color
);
if
(
win
->
info
->
win_style
&
WS_POPUP
)
Globals
.
hPopupWnd
=
win
->
hMainWnd
=
hWnd
;
...
...
@@ -966,7 +966,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
WM_CREATE
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
/* Calculate vertical size and position of a popup window */
if
(
win
->
info
->
win_style
&
WS_POPUP
)
...
...
@@ -1090,7 +1090,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
case
WM_PAINT
:
hDc
=
BeginPaint
(
hWnd
,
&
ps
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
scroll_pos
=
GetScrollPos
(
hWnd
,
SB_VERT
);
/* No DPtoLP needed - MM_TEXT map mode */
...
...
@@ -1189,7 +1189,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
WM_MOUSEMOVE
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
if
(
WINHELP_IsOverLink
(
win
,
wParam
,
lParam
))
SetCursor
(
win
->
hHandCur
);
/* set to hand pointer cursor to indicate a link */
...
...
@@ -1199,7 +1199,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
WM_LBUTTONDOWN
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
hPopupWnd
=
Globals
.
hPopupWnd
;
Globals
.
hPopupWnd
=
0
;
...
...
@@ -1248,7 +1248,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
WM_NCDESTROY
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
if
(
hWnd
==
Globals
.
hPopupWnd
)
Globals
.
hPopupWnd
=
0
;
...
...
@@ -1284,11 +1284,11 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
{
case
WM_NCCREATE
:
win
=
(
WINHELP_WINDOW
*
)((
LPCREATESTRUCT
)
lParam
)
->
lpCreateParams
;
SetWindowLong
(
hWnd
,
0
,
(
LONG
)
win
);
SetWindowLong
Ptr
(
hWnd
,
0
,
(
ULONG_PTR
)
win
);
win
->
hHistoryWnd
=
hWnd
;
break
;
case
WM_CREATE
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
hDc
=
GetDC
(
hWnd
);
GetTextMetrics
(
hDc
,
&
tm
);
GetWindowRect
(
hWnd
,
&
r
);
...
...
@@ -1303,7 +1303,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
ReleaseDC
(
hWnd
,
hDc
);
break
;
case
WM_LBUTTONDOWN
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
hDc
=
GetDC
(
hWnd
);
GetTextMetrics
(
hDc
,
&
tm
);
i
=
HIWORD
(
lParam
)
/
tm
.
tmHeight
;
...
...
@@ -1313,7 +1313,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
break
;
case
WM_PAINT
:
hDc
=
BeginPaint
(
hWnd
,
&
ps
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
GetTextMetrics
(
hDc
,
&
tm
);
for
(
i
=
0
;
i
<
win
->
histIndex
;
i
++
)
...
...
@@ -1324,7 +1324,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
EndPaint
(
hWnd
,
&
ps
);
break
;
case
WM_DESTROY
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
if
(
hWnd
==
win
->
hHistoryWnd
)
win
->
hHistoryWnd
=
0
;
break
;
...
...
@@ -1532,7 +1532,7 @@ static WINHELP_LINE_PART* WINHELP_AppendGfxObject(WINHELP_LINE ***linep, WINHELP
*/
static
BOOL
WINHELP_SplitLines
(
HWND
hWnd
,
LPSIZE
newsize
)
{
WINHELP_WINDOW
*
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
WINHELP_WINDOW
*
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
HLPFILE_PARAGRAPH
*
p
;
WINHELP_LINE
**
line
=
&
win
->
first_line
;
WINHELP_LINE_PART
**
part
=
0
;
...
...
@@ -1854,7 +1854,7 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win)
*/
static
void
WINHELP_InitFonts
(
HWND
hWnd
)
{
WINHELP_WINDOW
*
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
WINHELP_WINDOW
*
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
Ptr
(
hWnd
,
0
);
LOGFONT
logfontlist
[]
=
{
{
-
10
,
0
,
0
,
0
,
400
,
0
,
0
,
0
,
DEFAULT_CHARSET
,
0
,
0
,
0
,
32
,
"Helv"
},
{
-
12
,
0
,
0
,
0
,
700
,
0
,
0
,
0
,
DEFAULT_CHARSET
,
0
,
0
,
0
,
32
,
"Helv"
},
...
...
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