changeset 11868:711e584107af

switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support
author alex
date Thu, 29 Jan 2004 08:37:35 +0000
parents d12758db79aa
children c10bd91a4eb2
files loader/module.c
diffstat 1 files changed, 33 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/loader/module.c	Wed Jan 28 10:40:29 2004 +0000
+++ b/loader/module.c	Thu Jan 29 08:37:35 2004 +0000
@@ -20,7 +20,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/mman.h>
-#include <sys/types.h>
+#include <inttypes.h>
 
 #include "wine/windef.h"
 #include "wine/winerror.h"
@@ -40,8 +40,8 @@
 
 #ifdef EMU_QTX_API
 #include "wrapper.h"
-static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
-static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
+static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags);
+static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags);
 #endif
 
 //#undef TRACE
@@ -647,10 +647,10 @@
 
 #ifdef EMU_QTX_API
 
-static u_int32_t ret_array[4096];
+static uint32_t ret_array[4096];
 static int ret_i=0;
 
-static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
+static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags)
 {
 #ifdef DEBUG_QTX_API
   int i;
@@ -706,14 +706,14 @@
   printf("FUNC[%X/%s]: wrapper=%p  func=%p  len=%d\n",reg->eax,
       pname?pname:"???",pwrapper,pptr,plen);
 
-  printf("FUNC: caller=%p  ebx=%p\n",((u_int32_t *)stack_base)[0],reg->ebx);
+  printf("FUNC: caller=%p  ebx=%p\n",((uint32_t *)stack_base)[0],reg->ebx);
 
   if(pname)
       printf("%*sENTER(%d): %s(",ret_i*2,"",ret_i,pname);
   else
       printf("%*sENTER(%d): %X(",ret_i*2,"",ret_i,reg->eax);
   for (i=0;i<plen/4;i++){
-    unsigned int val=((u_int32_t *)stack_base)[1+i];
+    unsigned int val=((uint32_t *)stack_base)[1+i];
     unsigned char* fcc=&val;
     printf("%s0x%X", i?", ":"",val);
     if(fcc[0]>=0x20 && fcc[0]<128 &&
@@ -733,24 +733,24 @@
   // memory management:
   case 0x150011: //NewPtrClear
   case 0x150012: //NewPtrSysClear
-      reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
-      memset((void *)reg->eax,0,((u_int32_t *)stack_base)[1]);
+      reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
+      memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]);
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
 #endif
       return 1;
   case 0x15000F: //NewPtr
   case 0x150010: //NewPtrSys
-      reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
+      reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
 #endif
       return 1;
   case 0x15002f: //DisposePtr
-      if(((u_int32_t *)stack_base)[1]>=0x60000000)
+      if(((uint32_t *)stack_base)[1]>=0x60000000)
           printf("WARNING! Invalid Ptr handle!\n");
       else
-          free((void *)((u_int32_t *)stack_base)[1]);
+          free((void *)((uint32_t *)stack_base)[1]);
       reg->eax=0;
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
@@ -778,33 +778,33 @@
 #if 0
   switch(reg->eax){
 //  case 0x00010000:
-//      printf("FUNC: ImageCodecInitialize/ImageCodecGetCodecInfo(ci=%p,&icap=%p)\n",((u_int32_t *)stack_base)[1],((u_int32_t *)stack_base)[4]);
+//      printf("FUNC: ImageCodecInitialize/ImageCodecGetCodecInfo(ci=%p,&icap=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[4]);
 //      break;
   case 0x00010003:
-      printf("FUNC: CountComponents(&desc=%p)\n",((u_int32_t *)stack_base)[1]);
+      printf("FUNC: CountComponents(&desc=%p)\n",((uint32_t *)stack_base)[1]);
       break;
   case 0x00010004:
-      printf("FUNC: FindNextComponent(prev=%p,&desc=%p)\n",((u_int32_t *)stack_base)[1],((u_int32_t *)stack_base)[2]);
+      printf("FUNC: FindNextComponent(prev=%p,&desc=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[2]);
       break;
   case 0x00010007:
-      printf("FUNC: OpenComponent(prev=%p)\n",((u_int32_t *)stack_base)[1]);
+      printf("FUNC: OpenComponent(prev=%p)\n",((uint32_t *)stack_base)[1]);
       break;
   case 0x0003008b:
       printf("FUNC: QTNewGWorldFromPtr(&pts=%p,fourcc=%.4s,&rect=%p,x1=%p,x2=%p,x3=%p,plane=%p,stride=%d)\n",
-          ((u_int32_t *)stack_base)[1],
-          &(((u_int32_t *)stack_base)[2]),
-          ((u_int32_t *)stack_base)[3],
-          ((u_int32_t *)stack_base)[4],
-          ((u_int32_t *)stack_base)[5],
-          ((u_int32_t *)stack_base)[6],
-          ((u_int32_t *)stack_base)[7],
-          ((u_int32_t *)stack_base)[8]);
+          ((uint32_t *)stack_base)[1],
+          &(((uint32_t *)stack_base)[2]),
+          ((uint32_t *)stack_base)[3],
+          ((uint32_t *)stack_base)[4],
+          ((uint32_t *)stack_base)[5],
+          ((uint32_t *)stack_base)[6],
+          ((uint32_t *)stack_base)[7],
+          ((uint32_t *)stack_base)[8]);
       break;
   case 0x001c0018:
-      printf("FUNC: GetGWorldPixMap(gworld=%p)\n",((u_int32_t *)stack_base)[1]);
+      printf("FUNC: GetGWorldPixMap(gworld=%p)\n",((uint32_t *)stack_base)[1]);
       break;
   case 0x00110001:
-      printf("FUNC: Gestalt(fourcc=%.4s, &ret=%p)\n",&(((u_int32_t *)stack_base)[1]),((u_int32_t *)stack_base)[2]);
+      printf("FUNC: Gestalt(fourcc=%.4s, &ret=%p)\n",&(((uint32_t *)stack_base)[1]),((uint32_t *)stack_base)[2]);
       break;
   default: {
       int i;
@@ -829,34 +829,34 @@
 #endif
 
   // save ret addr:
-  ret_array[ret_i]=((u_int32_t *)stack_base)[0];
+  ret_array[ret_i]=((uint32_t *)stack_base)[0];
   ++ret_i;
 
 #if 0
   // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) 
   printf("stack[] = { ");
   for (i=0;i<7;i++) {
-    printf("%08x ", ((u_int32_t *)stack_base)[i]);
+    printf("%08x ", ((uint32_t *)stack_base)[i]);
   }
   printf("}\n\n");
 #endif
   
 //  // mess with function parameters 
-//  ((u_int32_t *)stack_base)[1] = 0x66554433;
+//  ((uint32_t *)stack_base)[1] = 0x66554433;
 
 //  // mess with return address...
 //  reg->eax = 0x11223344;
     return 0;
 }
 
-static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
+static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags)
 {
   int i;
   short err;
 
   // restore ret addr:
   --ret_i;
-  ((u_int32_t *)stack_base)[0]=ret_array[ret_i];
+  ((uint32_t *)stack_base)[0]=ret_array[ret_i];
 
 #ifdef DEBUG_QTX_API
 
@@ -882,7 +882,7 @@
   // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) 
   printf("stack[] = { ");
   for (i=0;i<7;i++) {
-    printf("%08x ", ((u_int32_t *)stack_base)[i]);
+    printf("%08x ", ((uint32_t *)stack_base)[i]);
   }
   printf("}\n\n");
 #endif
@@ -890,7 +890,7 @@
 #endif
   
 //  // mess with function parameters 
-//  ((u_int32_t *)stack_base)[1] = 0x66554433;
+//  ((uint32_t *)stack_base)[1] = 0x66554433;
 
 //  // mess with return address...
 //  reg->eax = 0x11223344;