[PATCH] d3dxof: Turn some TRACEs into WARNs in case of parsing error

Christian Costa titan.costa at wanadoo.fr
Tue Mar 2 01:37:13 CST 2010


---

 dlls/d3dxof/d3dxof.c  |    8 ++++----
 dlls/wined3d/shader.c |   22 +++++++++++++++++++++-
 2 files changed, 25 insertions(+), 5 deletions(-)
-------------- next part --------------
diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index 88a9e52..b8c85e0 100644
--- a/dlls/d3dxof/d3dxof.c
+++ b/dlls/d3dxof/d3dxof.c
@@ -303,7 +303,7 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
   {
     if (!parse_template(&object->buf))
     {
-      TRACE("Template is not correct\n");
+      WARN("Template is not correct\n");
       hr = DXFILEERR_BADVALUE;
       goto error;
     }
@@ -418,7 +418,7 @@ static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile* iface, LP
   {
     if (!parse_template(&buf))
     {
-      TRACE("Template is not correct\n");
+      WARN("Template is not correct\n");
       return DXFILEERR_BADVALUE;
     }
     else
@@ -1051,7 +1051,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
   {
     if (!parse_template(&This->buf))
     {
-      TRACE("Template is not correct\n");
+      WARN("Template is not correct\n");
       hr = DXFILEERR_BADVALUE;
       goto error;
     }
@@ -1099,7 +1099,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
 
   if (!parse_object(&This->buf))
   {
-    TRACE("Object is not correct\n");
+    WARN("Object is not correct\n");
     hr = DXFILEERR_PARSEERROR;
     goto error;
   }
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 06c49ab..bb6f9f5 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -1231,7 +1231,27 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
         fe->shader_read_comment(&ptr, &comment, &comment_size);
         if (comment)
         {
-            TRACE("// %s\n", debugstr_an(comment, comment_size));
+            if (comment_size > 4 && *(const DWORD *)comment == WINEMAKEFOURCC('T', 'E', 'X', 'T'))
+            {
+                const char *end = comment + comment_size;
+                const char *ptr = comment + 4;
+                const char *line = ptr;
+
+                TRACE("// TEXT\n");
+                while (ptr != end)
+                {
+                    if (*ptr == '\n')
+                    {
+                        UINT len = ptr - line;
+                        if (len && *(ptr - 1) == '\r') --len;
+                        TRACE("// %s\n", debugstr_an(line, len));
+                        line = ++ptr;
+                    }
+                    else ++ptr;
+                }
+                if (line != ptr) TRACE("// %s\n", debugstr_an(line, ptr - line));
+            }
+            else TRACE("// %s\n", debugstr_an(comment, comment_size));
             continue;
         }
 


More information about the wine-patches mailing list