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
a644bad2
Commit
a644bad2
authored
Nov 15, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Store handler pointers so casts to particular type are avoided.
parent
bd42c041
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
saxreader.c
dlls/msxml3/saxreader.c
+19
-9
No files found.
dlls/msxml3/saxreader.c
View file @
a644bad2
...
...
@@ -173,7 +173,7 @@ enum saxhandler_type
SAXHandler_Last
};
struct
saxhandler_iface
struct
sax
any
handler_iface
{
IUnknown
*
handler
;
IUnknown
*
vbhandler
;
...
...
@@ -197,6 +197,16 @@ struct saxlexicalhandler_iface
IVBSAXLexicalHandler
*
vbhandler
;
};
struct
saxhandler_iface
{
union
{
struct
saxcontenthandler_iface
content
;
struct
saxerrorhandler_iface
error
;
struct
saxlexicalhandler_iface
lexical
;
struct
saxanyhandler_iface
anyhandler
;
}
u
;
};
typedef
struct
{
DispatchEx
dispex
;
...
...
@@ -215,7 +225,7 @@ typedef struct
static
HRESULT
saxreader_put_handler
(
saxreader
*
reader
,
enum
saxhandler_type
type
,
void
*
ptr
,
BOOL
vb
)
{
struct
sax
handler_iface
*
iface
=
&
reader
->
saxhandlers
[
type
]
;
struct
sax
anyhandler_iface
*
iface
=
&
reader
->
saxhandlers
[
type
].
u
.
anyhandler
;
IUnknown
*
unk
=
(
IUnknown
*
)
ptr
;
if
(
unk
)
...
...
@@ -234,7 +244,7 @@ static HRESULT saxreader_put_handler(saxreader *reader, enum saxhandler_type typ
static
HRESULT
saxreader_get_handler
(
const
saxreader
*
reader
,
enum
saxhandler_type
type
,
BOOL
vb
,
void
**
ret
)
{
const
struct
sax
handler_iface
*
iface
=
&
reader
->
saxhandlers
[
type
]
;
const
struct
sax
anyhandler_iface
*
iface
=
&
reader
->
saxhandlers
[
type
].
u
.
anyhandler
;
if
(
!
ret
)
return
E_POINTER
;
...
...
@@ -253,17 +263,17 @@ static HRESULT saxreader_get_handler(const saxreader *reader, enum saxhandler_ty
static
struct
saxcontenthandler_iface
*
saxreader_get_contenthandler
(
saxreader
*
reader
)
{
return
(
struct
saxcontenthandler_iface
*
)
&
reader
->
saxhandlers
[
SAXContentHandler
]
;
return
&
reader
->
saxhandlers
[
SAXContentHandler
].
u
.
content
;
}
static
struct
saxerrorhandler_iface
*
saxreader_get_errorhandler
(
saxreader
*
reader
)
{
return
(
struct
saxerrorhandler_iface
*
)
&
reader
->
saxhandlers
[
SAXErrorHandler
]
;
return
&
reader
->
saxhandlers
[
SAXErrorHandler
].
u
.
error
;
}
static
struct
saxlexicalhandler_iface
*
saxreader_get_lexicalhandler
(
saxreader
*
reader
)
{
return
(
struct
saxlexicalhandler_iface
*
)
&
reader
->
saxhandlers
[
SAXLexicalHandler
]
;
return
&
reader
->
saxhandlers
[
SAXLexicalHandler
].
u
.
lexical
;
}
typedef
struct
...
...
@@ -327,8 +337,8 @@ static inline saxlocator *impl_from_ISAXAttributes( ISAXAttributes *iface )
static
inline
int
saxreader_has_handler
(
const
saxlocator
*
locator
,
enum
saxhandler_type
type
)
{
return
(
locator
->
vbInterface
&&
locator
->
saxreader
->
saxhandlers
[
type
].
vbhandler
)
||
(
!
locator
->
vbInterface
&&
locator
->
saxreader
->
saxhandlers
[
type
].
handler
);
struct
saxanyhandler_iface
*
iface
=
&
locator
->
saxreader
->
saxhandlers
[
type
].
u
.
anyhandler
;
return
(
locator
->
vbInterface
&&
iface
->
vbhandler
)
||
(
!
locator
->
vbInterface
&&
iface
->
handler
);
}
/* property names */
...
...
@@ -2734,7 +2744,7 @@ static ULONG WINAPI saxxmlreader_Release(
for
(
i
=
0
;
i
<
SAXHandler_Last
;
i
++
)
{
struct
sax
handler_iface
*
iface
=
&
This
->
saxhandlers
[
i
]
;
struct
sax
anyhandler_iface
*
iface
=
&
This
->
saxhandlers
[
i
].
u
.
anyhandler
;
if
(
iface
->
handler
)
IUnknown_Release
(
iface
->
handler
);
...
...
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