wined3d: Remove unneeded address-of operators from array names

Andrew Talbot andrew.talbot at talbotville.com
Fri Jul 11 15:58:34 CDT 2008


Changelog:
    wined3d: Remove unneeded address-of operators from array names.

diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c
index 57fbf62..3fcbc88 100644
--- a/dlls/wined3d/baseshader.c
+++ b/dlls/wined3d/baseshader.c
@@ -289,7 +289,7 @@ HRESULT shader_get_registers_used(
             local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant));
             if (!lconst) return E_OUTOFMEMORY;
             lconst->idx = *pToken & WINED3DSP_REGNUM_MASK;
-            memcpy(&lconst->value, pToken + 1, 4 * sizeof(DWORD));
+            memcpy(lconst->value, pToken + 1, 4 * sizeof(DWORD));
 
             /* In pixel shader 1.X shaders, the constants are clamped between [-1;1] */
             if(WINED3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) == 1 && pshader) {
@@ -312,7 +312,7 @@ HRESULT shader_get_registers_used(
             local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant));
             if (!lconst) return E_OUTOFMEMORY;
             lconst->idx = *pToken & WINED3DSP_REGNUM_MASK;
-            memcpy(&lconst->value, pToken + 1, 4 * sizeof(DWORD));
+            memcpy(lconst->value, pToken + 1, 4 * sizeof(DWORD));
             list_add_head(&This->baseShader.constantsI, &lconst->entry);
             pToken += curOpcode->num_params;
 
@@ -321,7 +321,7 @@ HRESULT shader_get_registers_used(
             local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant));
             if (!lconst) return E_OUTOFMEMORY;
             lconst->idx = *pToken & WINED3DSP_REGNUM_MASK;
-            memcpy(&lconst->value, pToken + 1, 1 * sizeof(DWORD));
+            memcpy(lconst->value, pToken + 1, 1 * sizeof(DWORD));
             list_add_head(&This->baseShader.constantsB, &lconst->entry);
             pToken += curOpcode->num_params;
 
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 9992ee2..e3fa599 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -697,7 +697,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) {
      * Initialize openGL extension related variables
      *  with Default values
      */
-    memset(&gl_info->supported, 0, sizeof(gl_info->supported));
+    memset(gl_info->supported, 0, sizeof(gl_info->supported));
     gl_info->max_buffers        = 1;
     gl_info->max_textures       = 1;
     gl_info->max_texture_stages = 1;
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index a7b20ee..e8ff6c1 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1046,10 +1046,10 @@ static HRESULT  WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
     This->blockType = WINED3DSBT_INIT;
 
     /* Set some of the defaults for lights, transforms etc */
-    memcpy(&This->transforms[WINED3DTS_PROJECTION], &identity, sizeof(identity));
-    memcpy(&This->transforms[WINED3DTS_VIEW], &identity, sizeof(identity));
+    memcpy(&This->transforms[WINED3DTS_PROJECTION], identity, sizeof(identity));
+    memcpy(&This->transforms[WINED3DTS_VIEW], identity, sizeof(identity));
     for (i = 0; i < 256; ++i) {
-      memcpy(&This->transforms[WINED3DTS_WORLDMATRIX(i)], &identity, sizeof(identity));
+      memcpy(&This->transforms[WINED3DTS_WORLDMATRIX(i)], identity, sizeof(identity));
     }
 
     TRACE("Render states\n");
@@ -1193,7 +1193,7 @@ static HRESULT  WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
     /* Texture Stage States - Put directly into state block, we will call function below */
     for (i = 0; i < MAX_TEXTURES; i++) {
         TRACE("Setting up default texture states for texture Stage %d\n", i);
-        memcpy(&This->transforms[WINED3DTS_TEXTURE0 + i], &identity, sizeof(identity));
+        memcpy(&This->transforms[WINED3DTS_TEXTURE0 + i], identity, sizeof(identity));
         This->textureState[i][WINED3DTSS_COLOROP               ] = (i==0)? WINED3DTOP_MODULATE :  WINED3DTOP_DISABLE;
         This->textureState[i][WINED3DTSS_COLORARG1             ] = WINED3DTA_TEXTURE;
         This->textureState[i][WINED3DTSS_COLORARG2             ] = WINED3DTA_CURRENT;
diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c
index 183cd2b..57809e1 100644
--- a/dlls/wined3d/surface_base.c
+++ b/dlls/wined3d/surface_base.c
@@ -544,7 +544,7 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) {
     b_info->bmiHeader.biClrImportant = 0;
 
     /* Get the bit masks */
-    masks = (DWORD *) &(b_info->bmiColors);
+    masks = (DWORD *)b_info->bmiColors;
     switch (This->resource.format) {
         case WINED3DFMT_R8G8B8:
             usage = DIB_RGB_COLORS;



More information about the wine-patches mailing list