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
30abce87
Commit
30abce87
authored
Jul 12, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Add support for double records in the writer.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bfa4a601
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
writer.c
dlls/webservices/writer.c
+70
-0
No files found.
dlls/webservices/writer.c
View file @
30abce87
...
...
@@ -704,6 +704,18 @@ static enum record_type get_attr_text_record_type( const WS_XML_TEXT *text )
if
(
text_uint64
->
value
<=
MAX_INT64
)
return
RECORD_INT64_TEXT
;
return
RECORD_UINT64_TEXT
;
}
case
WS_XML_TEXT_TYPE_DOUBLE
:
{
const
WS_XML_DOUBLE_TEXT
*
text_double
=
(
const
WS_XML_DOUBLE_TEXT
*
)
text
;
if
(
!
text_double
->
value
)
return
RECORD_ZERO_TEXT
;
if
(
text_double
->
value
==
1
)
return
RECORD_ONE_TEXT
;
if
(
isinf
(
text_double
->
value
)
||
(
INT64
)
text_double
->
value
!=
text_double
->
value
)
return
RECORD_DOUBLE_TEXT
;
if
(
text_double
->
value
<=
MAX_INT8
)
return
RECORD_INT8_TEXT
;
if
(
text_double
->
value
<=
MAX_INT16
)
return
RECORD_INT16_TEXT
;
if
(
text_double
->
value
<=
MAX_INT32
)
return
RECORD_INT32_TEXT
;
return
RECORD_INT64_TEXT
;
}
default:
FIXME
(
"unhandled text type %u
\n
"
,
text
->
textType
);
return
0
;
...
...
@@ -729,6 +741,11 @@ static INT64 get_text_value_int( const WS_XML_TEXT *text )
const
WS_XML_UINT64_TEXT
*
text_uint64
=
(
const
WS_XML_UINT64_TEXT
*
)
text
;
return
text_uint64
->
value
;
}
case
WS_XML_TEXT_TYPE_DOUBLE
:
{
const
WS_XML_DOUBLE_TEXT
*
text_double
=
(
const
WS_XML_DOUBLE_TEXT
*
)
text
;
return
text_double
->
value
;
}
default:
ERR
(
"unhandled text type %u
\n
"
,
text
->
textType
);
assert
(
0
);
...
...
@@ -827,6 +844,13 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_uint64
->
value
,
sizeof
(
text_uint64
->
value
)
);
return
S_OK
;
}
case
RECORD_DOUBLE_TEXT
:
{
WS_XML_DOUBLE_TEXT
*
text_double
=
(
WS_XML_DOUBLE_TEXT
*
)
text
;
if
((
hr
=
write_grow_buffer
(
writer
,
sizeof
(
text_double
->
value
)
))
!=
S_OK
)
return
hr
;
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_double
->
value
,
sizeof
(
text_double
->
value
)
);
return
S_OK
;
}
default:
ERR
(
"unhandled record type %02x
\n
"
,
type
);
return
E_NOTIMPL
;
...
...
@@ -2445,6 +2469,18 @@ static enum record_type get_text_record_type( const WS_XML_TEXT *text )
if
(
text_uint64
->
value
<=
MAX_INT64
)
return
RECORD_INT64_TEXT_WITH_ENDELEMENT
;
return
RECORD_UINT64_TEXT_WITH_ENDELEMENT
;
}
case
WS_XML_TEXT_TYPE_DOUBLE
:
{
const
WS_XML_DOUBLE_TEXT
*
text_double
=
(
const
WS_XML_DOUBLE_TEXT
*
)
text
;
if
(
!
text_double
->
value
)
return
RECORD_ZERO_TEXT_WITH_ENDELEMENT
;
if
(
text_double
->
value
==
1
)
return
RECORD_ONE_TEXT_WITH_ENDELEMENT
;
if
(
isinf
(
text_double
->
value
)
||
(
INT64
)
text_double
->
value
!=
text_double
->
value
)
return
RECORD_DOUBLE_TEXT_WITH_ENDELEMENT
;
if
(
text_double
->
value
<=
MAX_INT8
)
return
RECORD_INT8_TEXT_WITH_ENDELEMENT
;
if
(
text_double
->
value
<=
MAX_INT16
)
return
RECORD_INT16_TEXT_WITH_ENDELEMENT
;
if
(
text_double
->
value
<=
MAX_INT32
)
return
RECORD_INT32_TEXT_WITH_ENDELEMENT
;
return
RECORD_INT64_TEXT_WITH_ENDELEMENT
;
}
default:
FIXME
(
"unhandled text type %u
\n
"
,
text
->
textType
);
return
0
;
...
...
@@ -2577,6 +2613,14 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_uint64
->
value
,
sizeof
(
text_uint64
->
value
)
);
return
S_OK
;
}
case
RECORD_DOUBLE_TEXT_WITH_ENDELEMENT
:
{
WS_XML_DOUBLE_TEXT
*
text_double
=
(
WS_XML_DOUBLE_TEXT
*
)
text
;
if
((
hr
=
write_grow_buffer
(
writer
,
1
+
sizeof
(
text_double
->
value
)
))
!=
S_OK
)
return
hr
;
write_char
(
writer
,
type
);
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_double
->
value
,
sizeof
(
text_double
->
value
)
);
return
S_OK
;
}
default:
FIXME
(
"unhandled record type %02x
\n
"
,
type
);
return
E_NOTIMPL
;
...
...
@@ -3063,6 +3107,29 @@ static HRESULT write_type_uint64( struct writer *writer, WS_TYPE_MAPPING mapping
return
write_type_text
(
writer
,
mapping
,
&
text_uint64
.
text
);
}
static
HRESULT
write_type_double
(
struct
writer
*
writer
,
WS_TYPE_MAPPING
mapping
,
const
WS_DOUBLE_DESCRIPTION
*
desc
,
WS_WRITE_OPTION
option
,
const
void
*
value
,
ULONG
size
)
{
WS_XML_DOUBLE_TEXT
text_double
;
const
double
*
ptr
;
HRESULT
hr
;
if
(
desc
)
{
FIXME
(
"description not supported
\n
"
);
return
E_NOTIMPL
;
}
if
(
!
option
||
option
==
WS_WRITE_NILLABLE_VALUE
)
return
E_INVALIDARG
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
sizeof
(
double
),
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
if
(
option
==
WS_WRITE_NILLABLE_POINTER
&&
!
ptr
)
return
write_add_nil_attribute
(
writer
);
text_double
.
text
.
textType
=
WS_XML_TEXT_TYPE_DOUBLE
;
text_double
.
value
=
*
ptr
;
return
write_type_text
(
writer
,
mapping
,
&
text_double
.
text
);
}
static
HRESULT
write_type_datetime
(
struct
writer
*
writer
,
WS_TYPE_MAPPING
mapping
,
const
WS_DATETIME_DESCRIPTION
*
desc
,
WS_WRITE_OPTION
option
,
const
void
*
value
,
ULONG
size
)
...
...
@@ -3580,6 +3647,9 @@ static HRESULT write_type( struct writer *writer, WS_TYPE_MAPPING mapping, WS_TY
case
WS_UINT64_TYPE
:
return
write_type_uint64
(
writer
,
mapping
,
desc
,
option
,
value
,
size
);
case
WS_DOUBLE_TYPE
:
return
write_type_double
(
writer
,
mapping
,
desc
,
option
,
value
,
size
);
case
WS_DATETIME_TYPE
:
return
write_type_datetime
(
writer
,
mapping
,
desc
,
option
,
value
,
size
);
...
...
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