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
e7c3b035
Commit
e7c3b035
authored
May 21, 2013
by
Christian Costa
Committed by
Alexandre Julliard
May 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Cleanup separators handling and allow multi-semicolons + single comma separator.
parent
90e913c4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
34 deletions
+24
-34
parsing.c
dlls/d3dxof/parsing.c
+13
-23
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+11
-11
No files found.
dlls/d3dxof/parsing.c
View file @
e7c3b035
...
...
@@ -1141,6 +1141,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
{
ULONG
k
;
ULONG
nb_elems
=
1
;
BOOL
basic_type
=
TRUE
;
buf
->
pxo
->
members
[
i
].
name
=
pt
->
members
[
i
].
name
;
buf
->
pxo
->
members
[
i
].
start
=
buf
->
cur_pos_data
;
...
...
@@ -1157,26 +1158,12 @@ static BOOL parse_object_members_list(parse_buffer * buf)
for
(
k
=
0
;
k
<
nb_elems
;
k
++
)
{
if
(
buf
->
txt
&&
k
)
{
token
=
check_TOKEN
(
buf
);
if
(
token
==
TOKEN_COMMA
)
{
get_TOKEN
(
buf
);
}
else
{
/* Allow comma omission */
if
(
!
((
token
==
TOKEN_FLOAT
)
||
(
token
==
TOKEN_INTEGER
)))
return
FALSE
;
}
}
if
(
pt
->
members
[
i
].
type
==
TOKEN_NAME
)
{
ULONG
j
;
TRACE
(
"Found sub-object %s
\n
"
,
buf
->
pdxf
->
xtemplates
[
pt
->
members
[
i
].
idx_template
].
name
);
basic_type
=
FALSE
;
buf
->
level
++
;
/* To do template lookup */
for
(
j
=
0
;
j
<
buf
->
pdxf
->
nb_xtemplates
;
j
++
)
...
...
@@ -1275,18 +1262,21 @@ static BOOL parse_object_members_list(parse_buffer * buf)
return
FALSE
;
}
}
}
/* Empty arrays can have the semicolon at the end or not so remove it if any and skip next check */
if
(
!
nb_elems
&&
(
check_TOKEN
(
buf
)
==
TOKEN_SEMICOLON
))
get_TOKEN
(
buf
);
if
(
nb_elems
&&
buf
->
txt
&&
(
check_TOKEN
(
buf
)
!=
TOKEN_CBRACE
)
&&
(
check_TOKEN
(
buf
)
!=
TOKEN_NAME
))
if
(
basic_type
)
{
token
=
get_TOKEN
(
buf
);
if
((
token
!=
TOKEN_SEMICOLON
)
&&
(
token
!=
TOKEN_COMMA
))
/* Handle separator only for basic types */
token
=
check_TOKEN
(
buf
);
if
((
token
!=
TOKEN_COMMA
)
&&
(
token
!=
TOKEN_SEMICOLON
))
return
FALSE
;
/* Allow multi-semicolons + single comma separator */
while
(
check_TOKEN
(
buf
)
==
TOKEN_SEMICOLON
)
get_TOKEN
(
buf
);
if
(
check_TOKEN
(
buf
)
==
TOKEN_COMMA
)
get_TOKEN
(
buf
);
}
}
buf
->
pxo
->
members
[
i
].
size
=
buf
->
cur_pos_data
-
buf
->
pxo
->
members
[
i
].
start
;
}
...
...
dlls/d3dxof/tests/d3dxof.c
View file @
e7c3b035
...
...
@@ -865,24 +865,24 @@ static void test_syntax_semicolon_comma(void)
/* Test semicolon separators in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_semicolon_txt
,
sizeof
(
object_syntax_semicolon_txt
)
-
1
);
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test semicolon separators in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_semicolon_bin
,
sizeof
(
object_syntax_semicolon_bin
));
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test comma separators in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_comma_txt
,
sizeof
(
object_syntax_comma_txt
)
-
1
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test comma separators in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_comma_bin
,
sizeof
(
object_syntax_comma_bin
));
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test multi-semicolons separators in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_multi_semicolons_txt
,
sizeof
(
object_syntax_multi_semicolons_txt
)
-
1
);
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test multi-semicolons separators in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_multi_semicolons_bin
,
sizeof
(
object_syntax_multi_semicolons_bin
));
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test multi-commas separators in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_multi_commas_txt
,
sizeof
(
object_syntax_multi_semicolons_txt
)
-
1
);
...
...
@@ -893,10 +893,10 @@ static void test_syntax_semicolon_comma(void)
/* Test multi-semicolons + single comma separators in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_multi_semicolons_and_comma_txt
,
sizeof
(
object_syntax_multi_semicolons_and_comma_txt
)
-
1
);
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test multi-semicolons + single comma separators in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_multi_semicolons_and_comma_bin
,
sizeof
(
object_syntax_multi_semicolons_and_comma_bin
));
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test comma + semicolon separators in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_comma_and_semicolon_txt
,
sizeof
(
object_syntax_comma_and_semicolon_txt
)
-
1
);
...
...
@@ -907,14 +907,14 @@ static void test_syntax_semicolon_comma(void)
/* Test no ending separator in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_no_ending_separator_txt
,
sizeof
(
object_syntax_no_ending_separator_txt
)
-
1
);
todo_wine
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
/* Test no ending separator in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_no_ending_separator_bin
,
sizeof
(
object_syntax_no_ending_separator_bin
));
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
/* Test no array separator in text mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_array_no_separator_txt
,
sizeof
(
object_syntax_array_no_separator_txt
)
-
1
);
todo_wine
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
/* Test no array separator in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_array_no_separator_bin
,
sizeof
(
object_syntax_array_no_separator_bin
));
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
...
...
@@ -925,11 +925,11 @@ static void test_syntax_semicolon_comma(void)
/* Test object with mixed integer list and integers + single comma separators in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_mixed_integer_list_bin
,
sizeof
(
object_syntax_mixed_integer_list_bin
));
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
todo_wine
ok
(
ret
==
DXFILE_OK
,
"test_buffer_object failed with %#x
\n
"
,
ret
);
/* Test integer list followed by a semicolon in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_integer_list_semicolon_bin
,
sizeof
(
object_syntax_integer_list_semicolon_bin
));
todo_wine
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"test_buffer_object returned %#x, expected %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
/* Test integer list followed by a comma in binary mode */
ret
=
test_buffer_object
(
dxfile
,
object_syntax_integer_list_comma_bin
,
sizeof
(
object_syntax_integer_list_comma_bin
));
...
...
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