Alignment issue in NE_InitResourceHandler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixed alignment issue in NE_InitResourceHandler.  The code was originally a 
PUT_UA_WORD, and was changed to memcpy, but this doesn't work in this case 
because the compiler optimizes out the memcpy call.

Gregg Mattinson
Co-op Developer
Sun Microsystems of Canada

*** wine-20020605/loader/ne/resource.c  Tue Jun 11 11:44:56 2002
--- wine/loader/ne/resource.c  Tue Jun 11 11:44:06 2002
***************
*** 274,280 ****
--- 274,287 ----
  
      while(pTypeInfo->type_id)
      {
+         // Due to a bug in the compiler that causes alignment issues,
+         //   memcpy can't be used here.
+ #ifdef ALLOW_UNALIGNED_ACCESS
          memcpy( &pTypeInfo->resloader, &DefResourceHandlerProc, sizeof(FARPROC16) );
+ #else
+         ((WORD*)&pTypeInfo->resloader)[0] = ((WORD*)&DefResourceHandlerProc)[0];
+         ((WORD*)&pTypeInfo->resloader)[1] = ((WORD*)&DefResourceHandlerProc)[1];
+ #endif
        pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
      }
      return TRUE;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux