Christian Costa : d3dxof: Some fixes for template parsing in text mode.

Alexandre Julliard julliard at winehq.org
Tue Sep 2 08:33:03 CDT 2008


Module: wine
Branch: master
Commit: 23166f900eb12bbc86b62c70af6f0d6fb6b80f80
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=23166f900eb12bbc86b62c70af6f0d6fb6b80f80

Author: Christian Costa <titan.costa at wanadoo.fr>
Date:   Sat Aug 30 11:52:39 2008 +0200

d3dxof: Some fixes for template parsing in text mode.

Fix lockup when going to next template in text mode.
Keyword corresponding to TOKEN_LPSTR is STRING and not LPSTR.
Accept numerical characters in name.

---

 dlls/d3dxof/d3dxof.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index 30c8bdb..d1f580c 100644
--- a/dlls/d3dxof/d3dxof.c
+++ b/dlls/d3dxof/d3dxof.c
@@ -353,7 +353,7 @@ static WORD get_keyword_token(parse_buffer* buf)
     return TOKEN_SDWORD;
   if (is_keyword(buf, "VOID"))
     return TOKEN_VOID;
-  if (is_keyword(buf, "LPSTR"))
+  if (is_keyword(buf, "STRING"))
     return TOKEN_LPSTR;
   if (is_keyword(buf, "UNICODE"))
     return TOKEN_UNICODE;
@@ -423,7 +423,7 @@ static BOOL is_name(parse_buffer* buf)
   BOOL error = 0;
   while (!is_separator(c = *(buf->buffer+pos)))
   {
-    if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))))
+    if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9'))))
       error = 1;
     tmp[pos++] = c;
   }
@@ -597,7 +597,7 @@ static const char* get_primitive_string(WORD token)
     case TOKEN_VOID:
       return "VOID";
     case TOKEN_LPSTR:
-      return "LPSTR";
+      return "STRING";
     case TOKEN_UNICODE:
       return "UNICODE";
     case TOKEN_CSTRING:
@@ -927,13 +927,10 @@ static BOOL parse_template(parse_buffer * buf)
   if (buf->txt)
   {
     /* Go to the next template */
-    while (buf->rem_bytes)
+    while (buf->rem_bytes && is_space(*buf->buffer))
     {
-      if (is_space(*buf->buffer))
-      {
-        buf->buffer++;
-        buf->rem_bytes--;
-      }
+      buf->buffer++;
+      buf->rem_bytes--;
     }
   }
 
@@ -1021,7 +1018,8 @@ static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile* iface, LP
         i = This->nb_xtemplates - 1;
         clsid = &This->xtemplates[i].class_id;
 
-        DPRINTF("template %s {\n", This->xtemplates[i].name);
+        DPRINTF("template %s\n", This->xtemplates[i].name);
+        DPRINTF("{\n");
         DPRINTF(CLSIDFMT "\n", clsid->Data1, clsid->Data2, clsid->Data3, clsid->Data4[0],
           clsid->Data4[1], clsid->Data4[2], clsid->Data4[3], clsid->Data4[4], clsid->Data4[5], clsid->Data4[6], clsid->Data4[7]);
         for (j = 0; j < This->xtemplates[i].nb_members; j++)




More information about the wine-cvs mailing list