[PATCH 2/4] d3dxof: Move list type and list nb elements into the parse context.
Christian Costa
titan.costa at gmail.com
Mon May 27 02:51:31 CDT 2013
---
dlls/d3dxof/d3dxof_private.h | 2 ++
dlls/d3dxof/parsing.c | 23 ++++++++++-------------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/dlls/d3dxof/d3dxof_private.h b/dlls/d3dxof/d3dxof_private.h
index 5bd3c71..7812fff 100644
--- a/dlls/d3dxof/d3dxof_private.h
+++ b/dlls/d3dxof/d3dxof_private.h
@@ -125,6 +125,8 @@ typedef struct {
WORD current_token;
BOOL token_present;
BOOL txt;
+ DWORD list_nb_elements;
+ BOOL list_type_float;
ULONG cur_pos_data;
LPBYTE cur_pstrings;
BYTE value[100];
diff --git a/dlls/d3dxof/parsing.c b/dlls/d3dxof/parsing.c
index bb8b586..3ec7908 100644
--- a/dlls/d3dxof/parsing.c
+++ b/dlls/d3dxof/parsing.c
@@ -717,10 +717,7 @@ static WORD parse_TOKEN(parse_buffer * buf)
}
else
{
- static int nb_elem;
- static int is_float;
-
- if (!nb_elem)
+ if (!buf->list_nb_elements)
{
if (!read_bytes(buf, &token, 2))
return TOKEN_NONE;
@@ -728,26 +725,26 @@ static WORD parse_TOKEN(parse_buffer * buf)
/* Convert integer and float list into separate elements */
if (token == TOKEN_INTEGER_LIST)
{
- if (!read_bytes(buf, &nb_elem, 4))
+ if (!read_bytes(buf, &buf->list_nb_elements, 4))
return TOKEN_ERROR;
token = TOKEN_INTEGER;
- is_float = FALSE;
- TRACE("Integer list (TOKEN_INTEGER_LIST) of size %d\n", nb_elem);
+ buf->list_type_float = FALSE;
+ TRACE("Integer list (TOKEN_INTEGER_LIST) of size %d\n", buf->list_nb_elements);
}
else if (token == TOKEN_FLOAT_LIST)
{
- if (!read_bytes(buf, &nb_elem, 4))
+ if (!read_bytes(buf, &buf->list_nb_elements, 4))
return TOKEN_ERROR;
token = TOKEN_FLOAT;
- is_float = TRUE;
- TRACE("Float list (TOKEN_FLOAT_LIST) of size %d\n", nb_elem);
+ buf->list_type_float = TRUE;
+ TRACE("Float list (TOKEN_FLOAT_LIST) of size %d\n", buf->list_nb_elements);
}
}
- if (nb_elem)
+ if (buf->list_nb_elements)
{
- token = is_float ? TOKEN_FLOAT : TOKEN_INTEGER;
- nb_elem--;
+ token = buf->list_type_float ? TOKEN_FLOAT : TOKEN_INTEGER;
+ buf->list_nb_elements--;
{
DWORD integer;
More information about the wine-patches
mailing list