Changeset 1705

Show
Ignore:
Timestamp:
11/10/08 23:54:40 (2 months ago)
Author:
common
Message:

libemu

  • rename the INT(bits) and UINT(bits) macros to INTOF(bits) and UINTOF(bits) as INT collides on windows
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libemu/trunk/include/emu/emu_cpu_data.h

    r1639 r1705  
    122122extern int64_t max_inttype_borders[][2][2]; 
    123123 
    124 #define INT(bits) int##bits##_t 
    125 #define UINT(bits) uint##bits##_t 
     124#define INTOF(bits) int##bits##_t 
     125#define UINTOF(bits) uint##bits##_t 
    126126 
    127127#if !defined(INSTR_CALC) 
    128128#if BYTE_ORDER == BIG_ENDIAN  
    129129#define INSTR_CALC(bits, a, b, c, operation)                    \ 
    130 UINT(bits) operand_a; \ 
    131 UINT(bits) operand_b; \ 
     130UINTOF(bits) operand_a; \ 
     131UINTOF(bits) operand_b; \ 
    132132bcopy(&(a), &operand_a, bits/8); \ 
    133133bcopy(&(b), &operand_b, bits/8); \ 
    134 UINT(bits) operation_result = operand_a operation operand_b;    \ 
     134UINTOF(bits) operation_result = operand_a operation operand_b;    \ 
    135135bcopy(&operation_result, &(c), bits/8);  
    136136#else // ENDIAN 
    137137#define INSTR_CALC(bits, a, b, c, operation)                    \ 
    138 UINT(bits) operand_a = a;                                                             \ 
    139 UINT(bits) operand_b = b;                                                             \ 
    140 UINT(bits) operation_result = operand_a operation operand_b;  \ 
     138UINTOF(bits) operand_a = a;                                                           \ 
     139UINTOF(bits) operand_b = b;                                                           \ 
     140UINTOF(bits) operation_result = operand_a operation operand_b;        \ 
    141141c = operation_result; 
    142142#endif // ENDIAN 
     
    182182#define INSTR_SET_FLAG_OF(cpu, operand, bits)                                                           \ 
    183183{                                                                                                                                                               \ 
    184         int64_t sx = (INT(bits))operand_a;                                   \ 
    185         int64_t sy = (INT(bits))operand_b;                                   \ 
     184        int64_t sx = (INTOF(bits))operand_a;                                   \ 
     185        int64_t sy = (INTOF(bits))operand_b;                                   \ 
    186186        int64_t sz = 0;                                                             \ 
    187187                                                                                                                                                                \ 
     
    189189                                                                                                                                                                \ 
    190190        if (sz < max_inttype_borders[sizeof(operation_result)][0][0] || sz > max_inttype_borders[sizeof(operation_result)][0][1] \ 
    191         || sz != (INT(bits))operation_result )                                                                            \ 
     191        || sz != (INTOF(bits))operation_result )                                                                          \ 
    192192        {                                                                           \ 
    193193                CPU_FLAG_SET(cpu, f_of);                                                 \ 
  • libemu/trunk/src/environment/win32/env_w32_dll_export_kernel32_hooks.c

    r1692 r1705  
    268268        memset(si, 0, sizeof(STARTUPINFO)); 
    269269 
    270         emu_memory_read_dword(m, p_startinfo + 15 * 4, (uint32_t *)&si->hStdInput); 
    271         emu_memory_read_dword(m, p_startinfo + 16 * 4, (uint32_t *)&si->hStdOutput); 
    272         emu_memory_read_dword(m, p_startinfo + 17 * 4, (uint32_t *)&si->hStdError); 
     270        emu_memory_read_dword(m, p_startinfo + 14 * 4, (uint32_t *)&si->hStdInput); 
     271        emu_memory_read_dword(m, p_startinfo + 15 * 4, (uint32_t *)&si->hStdOutput); 
     272        emu_memory_read_dword(m, p_startinfo + 16 * 4, (uint32_t *)&si->hStdError); 
    273273 
    274274 
     
    284284        pi->dwThreadId = 4712; 
    285285 
    286       emu_memory_write_block(m, p_procinfo, pi, sizeof(PROCESS_INFORMATION)); 
     286//    emu_memory_write_block(m, p_procinfo, pi, sizeof(PROCESS_INFORMATION)); 
    287287        emu_memory_write_dword(m, p_procinfo+0*4, pi->hProcess); 
    288288        emu_memory_write_dword(m, p_procinfo+1*4, pi->hThread); 
     
    310310        } 
    311311 
    312         emu_memory_write_block(m, p_procinfo, pi, sizeof(PROCESS_INFORMATION)); 
     312//      emu_memory_write_block(m, p_procinfo, pi, sizeof(PROCESS_INFORMATION)); 
     313        emu_memory_write_dword(m, p_procinfo+0*4, pi->hProcess); 
     314        emu_memory_write_dword(m, p_procinfo+1*4, pi->hThread); 
     315        emu_memory_write_dword(m, p_procinfo+2*4, pi->dwProcessId); 
     316        emu_memory_write_dword(m, p_procinfo+3*4, pi->dwThreadId); 
     317 
    313318 
    314319 
  • libemu/trunk/src/functions/adc.c

    r1639 r1705  
    3232#if BYTE_ORDER == BIG_ENDIAN  
    3333#define INSTR_CALC(bits, a, b, c, operation, cpu)                       \ 
    34 UINT(bits) operand_a; \ 
    35 UINT(bits) operand_b; \ 
     34UINTOF(bits) operand_a; \ 
     35UINTOF(bits) operand_b; \ 
    3636bcopy(&(a), &operand_a, bits/8); \ 
    3737bcopy(&(b), &operand_b, bits/8); \ 
    38 UINT(bits) operation_result = operand_a operation operand_b operation ((cpu->eflags & (1 << f_cf))?1:0);      \ 
     38UINTOF(bits) operation_result = operand_a operation operand_b operation ((cpu->eflags & (1 << f_cf))?1:0);    \ 
    3939bcopy(&operation_result, &(c), bits/8);  
    4040#else // ENDIAN 
    4141#define INSTR_CALC(bits, a, b, c, operation, cpu)                       \ 
    42 UINT(bits) operand_a = a;                                                             \ 
    43 UINT(bits) operand_b = b;                                                             \ 
    44 UINT(bits) operation_result = operand_a operation operand_b operation ((cpu->eflags & (1 << f_cf))?1:0);      \ 
     42UINTOF(bits) operand_a = a;                                                           \ 
     43UINTOF(bits) operand_b = b;                                                           \ 
     44UINTOF(bits) operation_result = operand_a operation operand_b operation ((cpu->eflags & (1 << f_cf))?1:0);    \ 
    4545c = operation_result; 
    4646#endif // ENDIAN 
     
    4949#define INSTR_SET_FLAG_OF(cpu, operand,bits)                                                                                    \ 
    5050{                                                                                                                                                               \ 
    51         int64_t sx = (INT(bits))operand_a;                                            \ 
    52         int64_t sy = (INT(bits))operand_b;                                            \ 
     51        int64_t sx = (INTOF(bits))operand_a;                                            \ 
     52        int64_t sy = (INTOF(bits))operand_b;                                            \ 
    5353        int64_t sz = 0;                                                             \ 
    5454                                                                                                                                                                \ 
     
    5757                                                                                                                                                        \ 
    5858        if (sz < max_inttype_borders[sizeof(operation_result)][0][0] || sz > max_inttype_borders[sizeof(operation_result)][0][1] \ 
    59         || sz != (INT(bits))operation_result )                                                                            \ 
     59        || sz != (INTOF(bits))operation_result )                                                                          \ 
    6060        {                                                                           \ 
    6161                CPU_FLAG_SET(cpu, f_of);                                                 \ 
  • libemu/trunk/src/functions/cmp.c

    r1656 r1705  
    3131#if BYTE_ORDER == BIG_ENDIAN  
    3232#define INSTR_CALC(bits, a, b, operation)                       \ 
    33 UINT(bits) operand_a; \ 
    34 UINT(bits) operand_b; \ 
     33UINTOF(bits) operand_a; \ 
     34UINTOF(bits) operand_b; \ 
    3535bcopy(&(a), &operand_a, bits/8); \ 
    3636bcopy(&(b), &operand_b, bits/8); \ 
    37 UINT(bits) operation_result = operand_a operation operand_b; 
     37UINTOF(bits) operation_result = operand_a operation operand_b; 
    3838#else // ENDIAN 
    3939#define INSTR_CALC(bits, a, b, operation)                       \ 
    40 UINT(bits) operand_a = a;                                                             \ 
    41 UINT(bits) operand_b = b;                                                             \ 
    42 UINT(bits) operation_result = operand_a operation operand_b;   
     40UINTOF(bits) operand_a = a;                                                           \ 
     41UINTOF(bits) operand_b = b;                                                           \ 
     42UINTOF(bits) operation_result = operand_a operation operand_b;         
    4343#endif // ENDIAN 
    4444 
  • libemu/trunk/src/functions/cmps.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b) \ 
    32 UINT(bits) operand_a = a; \ 
    33 UINT(bits) operand_b = b; \ 
    34 UINT(bits) operation_result = operand_a - operand_b;  
     32UINTOF(bits) operand_a = a; \ 
     33UINTOF(bits) operand_b = b; \ 
     34UINTOF(bits) operation_result = operand_a - operand_b;  
    3535//printf(" a %02x b %02x c %02x \n",operand_a, operand_b, operation_result); 
    3636 
  • libemu/trunk/src/functions/dec.c

    r1317 r1705  
    2929 
    3030#define INSTR_CALC(bits, a)                                             \ 
    31 UINT(bits) operand_a = a;                                                             \ 
    32 UINT(bits) operation_result = operand_a-1;                            \ 
     31UINTOF(bits) operand_a = a;                                                           \ 
     32UINTOF(bits) operation_result = operand_a-1;                          \ 
    3333a = operation_result; 
    3434 
     
    3737#define INSTR_SET_FLAG_OF(cpu, bits)                                                                    \ 
    3838{                                                                                                                                                               \ 
    39         int64_t sz = (INT(bits))operand_a;                                            \ 
     39        int64_t sz = (INTOF(bits))operand_a;                                            \ 
    4040                                                                                                                                                                \ 
    4141        sz--;                                                                                                                                   \ 
    4242                                                                                                                                                                \ 
    4343        if (sz < max_inttype_borders[sizeof(operation_result)][0][0] || sz > max_inttype_borders[sizeof(operation_result)][0][1] \ 
    44         || sz != (INT(bits))operation_result )                                                                            \ 
     44        || sz != (INTOF(bits))operation_result )                                                                          \ 
    4545        {                                                                           \ 
    4646                CPU_FLAG_SET(cpu, f_of);                                                \ 
  • libemu/trunk/src/functions/div.c

    r1317 r1705  
    3838                return -1; \ 
    3939        } \ 
    40         UINT(dbits) q_result = dividend / divisor; \ 
    41         UINT(dbits) r_result = dividend % divisor; \ 
     40        UINTOF(dbits) q_result = dividend / divisor; \ 
     41        UINTOF(dbits) r_result = dividend % divisor; \ 
    4242\ 
    4343        quotient = q_result; \ 
  • libemu/trunk/src/functions/idiv.c

    r1317 r1705  
    3737                return -1; \ 
    3838        } \ 
    39         INT(dbits) q_result = (INT(dbits))dividend / (INT(bits))divisor; \ 
    40         INT(dbits) r_result = (INT(dbits))dividend % (INT(bits))divisor; \ 
     39        INTOF(dbits) q_result = (INTOF(dbits))dividend / (INTOF(bits))divisor; \ 
     40        INTOF(dbits) r_result = (INTOF(dbits))dividend % (INTOF(bits))divisor; \ 
    4141\ 
    4242        quotient = q_result; \ 
  • libemu/trunk/src/functions/imul.c

    r1639 r1705  
    2929 
    3030#define INSTR_CALC(inbits, outbits, cpu, a, b) \ 
    31 INT(inbits) operand_a = (INT(inbits))a; \ 
    32 INT(inbits) operand_b = (INT(inbits))b; \ 
    33 INT(outbits) operation_result = operand_a * operand_b; \ 
     31INTOF(inbits) operand_a = (INTOF(inbits))a; \ 
     32INTOF(inbits) operand_b = (INTOF(inbits))b; \ 
     33INTOF(outbits) operation_result = operand_a * operand_b; \ 
    3434 
    3535 
  • libemu/trunk/src/functions/inc.c

    r1317 r1705  
    2929 
    3030#define INSTR_CALC(bits, a)                                             \ 
    31 UINT(bits) operand_a = a;                                                             \ 
    32 UINT(bits) operation_result = operand_a+1;                            \ 
     31UINTOF(bits) operand_a = a;                                                           \ 
     32UINTOF(bits) operation_result = operand_a+1;                          \ 
    3333a = operation_result; 
    3434 
     
    3737#define INSTR_SET_FLAG_OF(cpu, bits)                                                                    \ 
    3838{                                                                                                                                                               \ 
    39         int64_t sz = (INT(bits))operand_a;                                            \ 
     39        int64_t sz = (INTOF(bits))operand_a;                                            \ 
    4040                                                                                                                                                                \ 
    4141        sz++;                                                                                                                                   \ 
    4242                                                                                                                                                                \ 
    4343        if (sz < max_inttype_borders[sizeof(operation_result)][0][0] || sz > max_inttype_borders[sizeof(operation_result)][0][1] \ 
    44         || sz != (INT(bits))operation_result )                                                                            \ 
     44        || sz != (INTOF(bits))operation_result )                                                                          \ 
    4545        {                                                                           \ 
    4646                CPU_FLAG_SET(cpu, f_of);                                                \ 
  • libemu/trunk/src/functions/mul.c

    r1317 r1705  
    3131 
    3232#define INSTR_CALC(inbits, outbits, cpu, a, b) \ 
    33 UINT(inbits) operand_a = a; \ 
    34 UINT(inbits) operand_b = b; \ 
    35 UINT(outbits) operation_result = operand_a * operand_b; \ 
     33UINTOF(inbits) operand_a = a; \ 
     34UINTOF(inbits) operand_b = b; \ 
     35UINTOF(outbits) operation_result = operand_a * operand_b; \ 
    3636 
    3737#include "emu/emu.h" 
  • libemu/trunk/src/functions/neg.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, cpu) \ 
    32 UINT(bits) operand_a = a; \ 
    33 UINT(bits) operation_result = 0-operand_a;  
     32UINTOF(bits) operand_a = a; \ 
     33UINTOF(bits) operation_result = 0-operand_a;  
    3434 
    3535#define INSTR_SET_FLAG_OF(cpu, bits) \ 
    3636{ \ 
    37         int64_t sx = (INT(bits))operand_a; \ 
     37        int64_t sx = (INTOF(bits))operand_a; \ 
    3838        int64_t sz = 0; \ 
    3939 \ 
     
    4141 \ 
    4242        if (sz < max_inttype_borders[sizeof(operation_result)][0][0] || sz > max_inttype_borders[sizeof(operation_result)][0][1] \ 
    43         || sz != (INT(bits))operation_result )                                                                            \ 
     43        || sz != (INTOF(bits))operation_result )                                                                          \ 
    4444        {                                                                           \ 
    4545                CPU_FLAG_SET(cpu, f_of);                                                 \ 
  • libemu/trunk/src/functions/not.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, cpu) \ 
    32 UINT(bits) operand_a = a; \ 
    33 UINT(bits) operation_result = ~operand_a; \ 
     32UINTOF(bits) operand_a = a; \ 
     33UINTOF(bits) operation_result = ~operand_a; \ 
    3434a = operation_result;  
    3535 
  • libemu/trunk/src/functions/rcl.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b, cpu) \ 
    32 UINT(bits) operation_result = (a); \ 
     32UINTOF(bits) operation_result = (a); \ 
    3333uint8_t operand_b = (b); \ 
    3434{ \ 
  • libemu/trunk/src/functions/rcr.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b, cpu) \ 
    32 UINT(bits) operation_result = (a); \ 
     32UINTOF(bits) operation_result = (a); \ 
    3333uint8_t operand_b = (b); \ 
    3434{ \ 
  • libemu/trunk/src/functions/rol.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b, cpu) \ 
    32 UINT(bits) operation_result = (a); \ 
     32UINTOF(bits) operation_result = (a); \ 
    3333uint8_t operand_b = (b); \ 
    3434{ \ 
  • libemu/trunk/src/functions/ror.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b, cpu) \ 
    32 UINT(bits) operation_result = (a); \ 
     32UINTOF(bits) operation_result = (a); \ 
    3333uint8_t operand_b = (b); \ 
    3434{ \ 
  • libemu/trunk/src/functions/sal.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b, cpu) \ 
    32 UINT(bits) operation_result = (a); \ 
     32UINTOF(bits) operation_result = (a); \ 
    3333uint8_t operand_b = (b); \ 
    3434{ \ 
  • libemu/trunk/src/functions/sar.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b, cpu) \ 
    32 UINT(bits) operation_result = (a); \ 
     32UINTOF(bits) operation_result = (a); \ 
    3333uint8_t operand_b = (b); \ 
    3434{ \ 
     
    4040                        CPU_FLAG_SET(cpu, f_cf); \ 
    4141                } \ 
    42                 operation_result = (UINT(bits))((INT(bits))operation_result >> operand_b); \ 
     42                operation_result = (UINTOF(bits))((INTOF(bits))operation_result >> operand_b); \ 
    4343                if( operand_b == 1 ) \ 
    4444                { \ 
  • libemu/trunk/src/functions/sbb.c

    r1317 r1705  
    2929 
    3030#define INSTR_CALC(bits, a, b, c, operation, cpu)                       \ 
    31 UINT(bits) operand_a = a;                                                             \ 
    32 UINT(bits) operand_b = b;                                                             \ 
    33 UINT(bits) operation_result = operand_a operation operand_b operation ((cpu->eflags & (1 << f_cf))?1:0);      \ 
     31UINTOF(bits) operand_a = a;                                                           \ 
     32UINTOF(bits) operand_b = b;                                                           \ 
     33UINTOF(bits) operation_result = operand_a operation operand_b operation ((cpu->eflags & (1 << f_cf))?1:0);    \ 
    3434c = operation_result; 
    3535 
    3636#define INSTR_SET_FLAG_OF(cpu, operand,bits)                                                                                    \ 
    3737{                                                                                                                                                               \ 
    38         int64_t sx = (INT(bits))operand_a;                                            \ 
    39         int64_t sy = (INT(bits))operand_b;                                            \ 
     38        int64_t sx = (INTOF(bits))operand_a;                                            \ 
     39        int64_t sy = (INTOF(bits))operand_b;                                            \ 
    4040        int64_t sz = 0;                                                             \ 
    4141                                                                                                                                                                \ 
     
    4444                                                                                                                                                        \ 
    4545        if (sz < max_inttype_borders[sizeof(operation_result)][0][0] || sz > max_inttype_borders[sizeof(operation_result)][0][1] \ 
    46         || sz != (INT(bits))operation_result )                                                                            \ 
     46        || sz != (INTOF(bits))operation_result )                                                                          \ 
    4747        {                                                                           \ 
    4848                CPU_FLAG_SET(cpu, f_of);                                                 \ 
  • libemu/trunk/src/functions/scas.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b) \ 
    32 UINT(bits) operation_result = (a) - (b); \ 
    33 UINT(bits) operand_a = a; \ 
    34 UINT(bits) operand_b = b; 
     32UINTOF(bits) operation_result = (a) - (b); \ 
     33UINTOF(bits) operand_a = a; \ 
     34UINTOF(bits) operand_b = b; 
    3535 
    3636 
  • libemu/trunk/src/functions/shr.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b, cpu) \ 
    32 UINT(bits) operation_result = (a); \ 
     32UINTOF(bits) operation_result = (a); \ 
    3333uint8_t operand_b = (b); \ 
    3434{ \ 
  • libemu/trunk/src/functions/test.c

    r1317 r1705  
    3030 
    3131#define INSTR_CALC(bits, a, b) \ 
    32 UINT(bits) operand_a = a; \ 
    33 UINT(bits) operand_b = b; \ 
    34 UINT(bits) operation_result = operand_a & operand_b;   
     32UINTOF(bits) operand_a = a; \ 
     33UINTOF(bits) operand_b = b; \ 
     34UINTOF(bits) operation_result = operand_a & operand_b;         
    3535 
    3636