Christian Costa : d3dxof: Use buffer start followed by offset when accessing data.

Alexandre Julliard julliard at winehq.org
Wed Jan 25 15:14:04 CST 2012


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

Author: Christian Costa <titan.costa at gmail.com>
Date:   Mon Jan 23 21:37:48 2012 +0100

d3dxof: Use buffer start followed by offset when accessing data.

---

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

diff --git a/dlls/d3dxof/parsing.c b/dlls/d3dxof/parsing.c
index 3d7a4d0..5b8b44b 100644
--- a/dlls/d3dxof/parsing.c
+++ b/dlls/d3dxof/parsing.c
@@ -1225,12 +1225,12 @@ static BOOL parse_object_members_list(parse_buffer * buf)
             return FALSE;
           if (pt->members[i].type == TOKEN_WORD)
           {
-            *(((WORD*)(buf->cur_pos_data + buf->pdata))) = (WORD)(*(DWORD*)buf->value);
+            *(((WORD*)(buf->pdata + buf->cur_pos_data))) = (WORD)(*(DWORD*)buf->value);
             buf->cur_pos_data += 2;
           }
           else if (pt->members[i].type == TOKEN_DWORD)
           {
-            *(((DWORD*)(buf->cur_pos_data + buf->pdata))) = (DWORD)(*(DWORD*)buf->value);
+            *(((DWORD*)(buf->pdata + buf->cur_pos_data))) = (DWORD)(*(DWORD*)buf->value);
             buf->cur_pos_data += 4;
           }
           else
@@ -1247,7 +1247,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
             return FALSE;
           if (pt->members[i].type == TOKEN_FLOAT)
           {
-            *(((float*)(buf->cur_pos_data + buf->pdata))) = (float)(*(float*)buf->value);
+            *(((float*)(buf->pdata + buf->cur_pos_data))) = (float)(*(float*)buf->value);
             buf->cur_pos_data += 4;
           }
           else
@@ -1271,7 +1271,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
               return FALSE;
             }
             strcpy((char*)buf->cur_pstrings, (char*)buf->value);
-            *(((LPCSTR*)(buf->cur_pos_data + buf->pdata))) = (char*)buf->cur_pstrings;
+            *(((LPCSTR*)(buf->pdata + buf->cur_pos_data))) = (char*)buf->cur_pstrings;
             buf->cur_pstrings += len;
             buf->cur_pos_data += sizeof(LPSTR);
           }




More information about the wine-cvs mailing list