Commit eb38c52c2a6df76928c1a4760bc87d21b256e22a

Authored by blueswir1
1 parent 5bfd5521

Fix most warnings that would be caused by gcc flag -Wundef

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5173 c046a42c-6fe2-441c-8c8c-71466251a162
@@ -1123,6 +1123,7 @@ typedef struct elf64_note { @@ -1123,6 +1123,7 @@ typedef struct elf64_note {
1123 Elf64_Word n_type; /* Content type */ 1123 Elf64_Word n_type; /* Content type */
1124 } Elf64_Nhdr; 1124 } Elf64_Nhdr;
1125 1125
  1126 +#ifdef ELF_CLASS
1126 #if ELF_CLASS == ELFCLASS32 1127 #if ELF_CLASS == ELFCLASS32
1127 1128
1128 #define elfhdr elf32_hdr 1129 #define elfhdr elf32_hdr
@@ -1165,5 +1166,7 @@ typedef struct elf64_note { @@ -1165,5 +1166,7 @@ typedef struct elf64_note {
1165 # endif 1166 # endif
1166 #endif 1167 #endif
1167 1168
  1169 +#endif /* ELF_CLASS */
  1170 +
1168 1171
1169 #endif /* _QEMU_ELF_H */ 1172 #endif /* _QEMU_ELF_H */
@@ -2259,7 +2259,7 @@ static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr) @@ -2259,7 +2259,7 @@ static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr)
2259 #endif 2259 #endif
2260 #ifdef TARGET_SPARC 2260 #ifdef TARGET_SPARC
2261 do_unassigned_access(addr, 0, 0, 0); 2261 do_unassigned_access(addr, 0, 0, 0);
2262 -#elif TARGET_CRIS 2262 +#elif defined(TARGET_CRIS)
2263 do_unassigned_access(addr, 0, 0, 0); 2263 do_unassigned_access(addr, 0, 0, 0);
2264 #endif 2264 #endif
2265 return 0; 2265 return 0;
@@ -2272,7 +2272,7 @@ static void unassigned_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_ @@ -2272,7 +2272,7 @@ static void unassigned_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_
2272 #endif 2272 #endif
2273 #ifdef TARGET_SPARC 2273 #ifdef TARGET_SPARC
2274 do_unassigned_access(addr, 1, 0, 0); 2274 do_unassigned_access(addr, 1, 0, 0);
2275 -#elif TARGET_CRIS 2275 +#elif defined(TARGET_CRIS)
2276 do_unassigned_access(addr, 1, 0, 0); 2276 do_unassigned_access(addr, 1, 0, 0);
2277 #endif 2277 #endif
2278 } 2278 }
hw/omap1.c
@@ -3478,7 +3478,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3478,7 +3478,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3478 3478
3479 switch (offset) { 3479 switch (offset) {
3480 case 0x00: /* SECONDS_REG */ 3480 case 0x00: /* SECONDS_REG */
3481 -#if ALMDEBUG 3481 +#ifdef ALMDEBUG
3482 printf("RTC SEC_REG <-- %02x\n", value); 3482 printf("RTC SEC_REG <-- %02x\n", value);
3483 #endif 3483 #endif
3484 s->ti -= s->current_tm.tm_sec; 3484 s->ti -= s->current_tm.tm_sec;
@@ -3486,7 +3486,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3486,7 +3486,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3486 return; 3486 return;
3487 3487
3488 case 0x04: /* MINUTES_REG */ 3488 case 0x04: /* MINUTES_REG */
3489 -#if ALMDEBUG 3489 +#ifdef ALMDEBUG
3490 printf("RTC MIN_REG <-- %02x\n", value); 3490 printf("RTC MIN_REG <-- %02x\n", value);
3491 #endif 3491 #endif
3492 s->ti -= s->current_tm.tm_min * 60; 3492 s->ti -= s->current_tm.tm_min * 60;
@@ -3494,7 +3494,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3494,7 +3494,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3494 return; 3494 return;
3495 3495
3496 case 0x08: /* HOURS_REG */ 3496 case 0x08: /* HOURS_REG */
3497 -#if ALMDEBUG 3497 +#ifdef ALMDEBUG
3498 printf("RTC HRS_REG <-- %02x\n", value); 3498 printf("RTC HRS_REG <-- %02x\n", value);
3499 #endif 3499 #endif
3500 s->ti -= s->current_tm.tm_hour * 3600; 3500 s->ti -= s->current_tm.tm_hour * 3600;
@@ -3506,7 +3506,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3506,7 +3506,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3506 return; 3506 return;
3507 3507
3508 case 0x0c: /* DAYS_REG */ 3508 case 0x0c: /* DAYS_REG */
3509 -#if ALMDEBUG 3509 +#ifdef ALMDEBUG
3510 printf("RTC DAY_REG <-- %02x\n", value); 3510 printf("RTC DAY_REG <-- %02x\n", value);
3511 #endif 3511 #endif
3512 s->ti -= s->current_tm.tm_mday * 86400; 3512 s->ti -= s->current_tm.tm_mday * 86400;
@@ -3514,7 +3514,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3514,7 +3514,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3514 return; 3514 return;
3515 3515
3516 case 0x10: /* MONTHS_REG */ 3516 case 0x10: /* MONTHS_REG */
3517 -#if ALMDEBUG 3517 +#ifdef ALMDEBUG
3518 printf("RTC MTH_REG <-- %02x\n", value); 3518 printf("RTC MTH_REG <-- %02x\n", value);
3519 #endif 3519 #endif
3520 memcpy(&new_tm, &s->current_tm, sizeof(new_tm)); 3520 memcpy(&new_tm, &s->current_tm, sizeof(new_tm));
@@ -3533,7 +3533,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3533,7 +3533,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3533 return; 3533 return;
3534 3534
3535 case 0x14: /* YEARS_REG */ 3535 case 0x14: /* YEARS_REG */
3536 -#if ALMDEBUG 3536 +#ifdef ALMDEBUG
3537 printf("RTC YRS_REG <-- %02x\n", value); 3537 printf("RTC YRS_REG <-- %02x\n", value);
3538 #endif 3538 #endif
3539 memcpy(&new_tm, &s->current_tm, sizeof(new_tm)); 3539 memcpy(&new_tm, &s->current_tm, sizeof(new_tm));
@@ -3555,7 +3555,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3555,7 +3555,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3555 return; /* Ignored */ 3555 return; /* Ignored */
3556 3556
3557 case 0x20: /* ALARM_SECONDS_REG */ 3557 case 0x20: /* ALARM_SECONDS_REG */
3558 -#if ALMDEBUG 3558 +#ifdef ALMDEBUG
3559 printf("ALM SEC_REG <-- %02x\n", value); 3559 printf("ALM SEC_REG <-- %02x\n", value);
3560 #endif 3560 #endif
3561 s->alarm_tm.tm_sec = omap_rtc_bin(value); 3561 s->alarm_tm.tm_sec = omap_rtc_bin(value);
@@ -3563,7 +3563,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3563,7 +3563,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3563 return; 3563 return;
3564 3564
3565 case 0x24: /* ALARM_MINUTES_REG */ 3565 case 0x24: /* ALARM_MINUTES_REG */
3566 -#if ALMDEBUG 3566 +#ifdef ALMDEBUG
3567 printf("ALM MIN_REG <-- %02x\n", value); 3567 printf("ALM MIN_REG <-- %02x\n", value);
3568 #endif 3568 #endif
3569 s->alarm_tm.tm_min = omap_rtc_bin(value); 3569 s->alarm_tm.tm_min = omap_rtc_bin(value);
@@ -3571,7 +3571,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3571,7 +3571,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3571 return; 3571 return;
3572 3572
3573 case 0x28: /* ALARM_HOURS_REG */ 3573 case 0x28: /* ALARM_HOURS_REG */
3574 -#if ALMDEBUG 3574 +#ifdef ALMDEBUG
3575 printf("ALM HRS_REG <-- %02x\n", value); 3575 printf("ALM HRS_REG <-- %02x\n", value);
3576 #endif 3576 #endif
3577 if (s->pm_am) 3577 if (s->pm_am)
@@ -3584,7 +3584,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3584,7 +3584,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3584 return; 3584 return;
3585 3585
3586 case 0x2c: /* ALARM_DAYS_REG */ 3586 case 0x2c: /* ALARM_DAYS_REG */
3587 -#if ALMDEBUG 3587 +#ifdef ALMDEBUG
3588 printf("ALM DAY_REG <-- %02x\n", value); 3588 printf("ALM DAY_REG <-- %02x\n", value);
3589 #endif 3589 #endif
3590 s->alarm_tm.tm_mday = omap_rtc_bin(value); 3590 s->alarm_tm.tm_mday = omap_rtc_bin(value);
@@ -3592,7 +3592,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3592,7 +3592,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3592 return; 3592 return;
3593 3593
3594 case 0x30: /* ALARM_MONTHS_REG */ 3594 case 0x30: /* ALARM_MONTHS_REG */
3595 -#if ALMDEBUG 3595 +#ifdef ALMDEBUG
3596 printf("ALM MON_REG <-- %02x\n", value); 3596 printf("ALM MON_REG <-- %02x\n", value);
3597 #endif 3597 #endif
3598 s->alarm_tm.tm_mon = omap_rtc_bin(value); 3598 s->alarm_tm.tm_mon = omap_rtc_bin(value);
@@ -3600,7 +3600,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3600,7 +3600,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3600 return; 3600 return;
3601 3601
3602 case 0x34: /* ALARM_YEARS_REG */ 3602 case 0x34: /* ALARM_YEARS_REG */
3603 -#if ALMDEBUG 3603 +#ifdef ALMDEBUG
3604 printf("ALM YRS_REG <-- %02x\n", value); 3604 printf("ALM YRS_REG <-- %02x\n", value);
3605 #endif 3605 #endif
3606 s->alarm_tm.tm_year = omap_rtc_bin(value); 3606 s->alarm_tm.tm_year = omap_rtc_bin(value);
@@ -3608,7 +3608,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3608,7 +3608,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3608 return; 3608 return;
3609 3609
3610 case 0x40: /* RTC_CTRL_REG */ 3610 case 0x40: /* RTC_CTRL_REG */
3611 -#if ALMDEBUG 3611 +#ifdef ALMDEBUG
3612 printf("RTC CONTROL <-- %02x\n", value); 3612 printf("RTC CONTROL <-- %02x\n", value);
3613 #endif 3613 #endif
3614 s->pm_am = (value >> 3) & 1; 3614 s->pm_am = (value >> 3) & 1;
@@ -3620,7 +3620,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3620,7 +3620,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3620 return; 3620 return;
3621 3621
3622 case 0x44: /* RTC_STATUS_REG */ 3622 case 0x44: /* RTC_STATUS_REG */
3623 -#if ALMDEBUG 3623 +#ifdef ALMDEBUG
3624 printf("RTC STATUSL <-- %02x\n", value); 3624 printf("RTC STATUSL <-- %02x\n", value);
3625 #endif 3625 #endif
3626 s->status &= ~((value & 0xc0) ^ 0x80); 3626 s->status &= ~((value & 0xc0) ^ 0x80);
@@ -3628,14 +3628,14 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3628,14 +3628,14 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3628 return; 3628 return;
3629 3629
3630 case 0x48: /* RTC_INTERRUPTS_REG */ 3630 case 0x48: /* RTC_INTERRUPTS_REG */
3631 -#if ALMDEBUG 3631 +#ifdef ALMDEBUG
3632 printf("RTC INTRS <-- %02x\n", value); 3632 printf("RTC INTRS <-- %02x\n", value);
3633 #endif 3633 #endif
3634 s->interrupts = value; 3634 s->interrupts = value;
3635 return; 3635 return;
3636 3636
3637 case 0x4c: /* RTC_COMP_LSB_REG */ 3637 case 0x4c: /* RTC_COMP_LSB_REG */
3638 -#if ALMDEBUG 3638 +#ifdef ALMDEBUG
3639 printf("RTC COMPLSB <-- %02x\n", value); 3639 printf("RTC COMPLSB <-- %02x\n", value);
3640 #endif 3640 #endif
3641 s->comp_reg &= 0xff00; 3641 s->comp_reg &= 0xff00;
@@ -3643,7 +3643,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr, @@ -3643,7 +3643,7 @@ static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
3643 return; 3643 return;
3644 3644
3645 case 0x50: /* RTC_COMP_MSB_REG */ 3645 case 0x50: /* RTC_COMP_MSB_REG */
3646 -#if ALMDEBUG 3646 +#ifdef ALMDEBUG
3647 printf("RTC COMPMSB <-- %02x\n", value); 3647 printf("RTC COMPMSB <-- %02x\n", value);
3648 #endif 3648 #endif
3649 s->comp_reg &= 0x00ff; 3649 s->comp_reg &= 0x00ff;
@@ -76,7 +76,7 @@ uint64_t cpu_get_tsc(CPUX86State *env) @@ -76,7 +76,7 @@ uint64_t cpu_get_tsc(CPUX86State *env)
76 /* Note: when using kqemu, it is more logical to return the host TSC 76 /* Note: when using kqemu, it is more logical to return the host TSC
77 because kqemu does not trap the RDTSC instruction for 77 because kqemu does not trap the RDTSC instruction for
78 performance reasons */ 78 performance reasons */
79 -#if USE_KQEMU 79 +#ifdef USE_KQEMU
80 if (env->kqemu_enabled) { 80 if (env->kqemu_enabled) {
81 return cpu_get_real_ticks(); 81 return cpu_get_real_ticks();
82 } else 82 } else
hw/rtl8139.c
@@ -3356,7 +3356,7 @@ static inline int64_t rtl8139_get_next_tctr_time(RTL8139State *s, int64_t curren @@ -3356,7 +3356,7 @@ static inline int64_t rtl8139_get_next_tctr_time(RTL8139State *s, int64_t curren
3356 return next_time; 3356 return next_time;
3357 } 3357 }
3358 3358
3359 -#if RTL8139_ONBOARD_TIMER 3359 +#ifdef RTL8139_ONBOARD_TIMER
3360 static void rtl8139_timer(void *opaque) 3360 static void rtl8139_timer(void *opaque)
3361 { 3361 {
3362 RTL8139State *s = opaque; 3362 RTL8139State *s = opaque;
@@ -3456,7 +3456,7 @@ void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn) @@ -3456,7 +3456,7 @@ void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn)
3456 3456
3457 register_savevm("rtl8139", -1, 3, rtl8139_save, rtl8139_load, s); 3457 register_savevm("rtl8139", -1, 3, rtl8139_save, rtl8139_load, s);
3458 3458
3459 -#if RTL8139_ONBOARD_TIMER 3459 +#ifdef RTL8139_ONBOARD_TIMER
3460 s->timer = qemu_new_timer(vm_clock, rtl8139_timer, s); 3460 s->timer = qemu_new_timer(vm_clock, rtl8139_timer, s);
3461 3461
3462 qemu_mod_timer(s->timer, 3462 qemu_mod_timer(s->timer,
hw/usb-net.c
@@ -1069,7 +1069,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value, @@ -1069,7 +1069,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,
1069 case ClassInterfaceOutRequest | USB_CDC_SEND_ENCAPSULATED_COMMAND: 1069 case ClassInterfaceOutRequest | USB_CDC_SEND_ENCAPSULATED_COMMAND:
1070 if (!s->rndis || value || index != 0) 1070 if (!s->rndis || value || index != 0)
1071 goto fail; 1071 goto fail;
1072 -#if TRAFFIC_DEBUG 1072 +#ifdef TRAFFIC_DEBUG
1073 { 1073 {
1074 unsigned int i; 1074 unsigned int i;
1075 fprintf(stderr, "SEND_ENCAPSULATED_COMMAND:"); 1075 fprintf(stderr, "SEND_ENCAPSULATED_COMMAND:");
@@ -1092,7 +1092,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value, @@ -1092,7 +1092,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,
1092 data[0] = 0; 1092 data[0] = 0;
1093 ret = 1; 1093 ret = 1;
1094 } 1094 }
1095 -#if TRAFFIC_DEBUG 1095 +#ifdef TRAFFIC_DEBUG
1096 { 1096 {
1097 unsigned int i; 1097 unsigned int i;
1098 fprintf(stderr, "GET_ENCAPSULATED_RESPONSE:"); 1098 fprintf(stderr, "GET_ENCAPSULATED_RESPONSE:");
@@ -1219,7 +1219,7 @@ static int usb_net_handle_statusin(USBNetState *s, USBPacket *p) @@ -1219,7 +1219,7 @@ static int usb_net_handle_statusin(USBNetState *s, USBPacket *p)
1219 if (!s->rndis_resp.tqh_first) 1219 if (!s->rndis_resp.tqh_first)
1220 ret = USB_RET_NAK; 1220 ret = USB_RET_NAK;
1221 1221
1222 -#if DEBUG 1222 +#ifdef TRAFFIC_DEBUG
1223 fprintf(stderr, "usbnet: interrupt poll len %u return %d", p->len, ret); 1223 fprintf(stderr, "usbnet: interrupt poll len %u return %d", p->len, ret);
1224 { 1224 {
1225 int i; 1225 int i;
@@ -1260,7 +1260,7 @@ static int usb_net_handle_datain(USBNetState *s, USBPacket *p) @@ -1260,7 +1260,7 @@ static int usb_net_handle_datain(USBNetState *s, USBPacket *p)
1260 s->in_ptr = s->in_len = 0; 1260 s->in_ptr = s->in_len = 0;
1261 } 1261 }
1262 1262
1263 -#if TRAFFIC_DEBUG 1263 +#ifdef TRAFFIC_DEBUG
1264 fprintf(stderr, "usbnet: data in len %u return %d", p->len, ret); 1264 fprintf(stderr, "usbnet: data in len %u return %d", p->len, ret);
1265 { 1265 {
1266 int i; 1266 int i;
@@ -1285,7 +1285,7 @@ static int usb_net_handle_dataout(USBNetState *s, USBPacket *p) @@ -1285,7 +1285,7 @@ static int usb_net_handle_dataout(USBNetState *s, USBPacket *p)
1285 (struct rndis_packet_msg_type *) s->out_buf; 1285 (struct rndis_packet_msg_type *) s->out_buf;
1286 uint32_t len; 1286 uint32_t len;
1287 1287
1288 -#if TRAFFIC_DEBUG 1288 +#ifdef TRAFFIC_DEBUG
1289 fprintf(stderr, "usbnet: data out len %u\n", p->len); 1289 fprintf(stderr, "usbnet: data out len %u\n", p->len);
1290 { 1290 {
1291 int i; 1291 int i;
hw/usb-ohci.c
@@ -1598,7 +1598,7 @@ static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn, @@ -1598,7 +1598,7 @@ static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn,
1598 int i; 1598 int i;
1599 1599
1600 if (usb_frame_time == 0) { 1600 if (usb_frame_time == 0) {
1601 -#if OHCI_TIME_WARP 1601 +#ifdef OHCI_TIME_WARP
1602 usb_frame_time = ticks_per_sec; 1602 usb_frame_time = ticks_per_sec;
1603 usb_bit_time = muldiv64(1, ticks_per_sec, USB_HZ/1000); 1603 usb_bit_time = muldiv64(1, ticks_per_sec, USB_HZ/1000);
1604 #else 1604 #else
linux-user/arm/nwfpe/fpa11.c
@@ -54,7 +54,7 @@ void resetFPA11(void) @@ -54,7 +54,7 @@ void resetFPA11(void)
54 fpa11->fpsr = FP_EMULATOR | BIT_AC; 54 fpa11->fpsr = FP_EMULATOR | BIT_AC;
55 55
56 /* FPCR: set SB, AB and DA bits, clear all others */ 56 /* FPCR: set SB, AB and DA bits, clear all others */
57 -#if MAINTAIN_FPCR 57 +#ifdef MAINTAIN_FPCR
58 fpa11->fpcr = MASK_RESET; 58 fpa11->fpcr = MASK_RESET;
59 #endif 59 #endif
60 } 60 }
@@ -64,7 +64,7 @@ void SetRoundingMode(const unsigned int opcode) @@ -64,7 +64,7 @@ void SetRoundingMode(const unsigned int opcode)
64 int rounding_mode; 64 int rounding_mode;
65 FPA11 *fpa11 = GET_FPA11(); 65 FPA11 *fpa11 = GET_FPA11();
66 66
67 -#if MAINTAIN_FPCR 67 +#ifdef MAINTAIN_FPCR
68 fpa11->fpcr &= ~MASK_ROUNDING_MODE; 68 fpa11->fpcr &= ~MASK_ROUNDING_MODE;
69 #endif 69 #endif
70 switch (opcode & MASK_ROUNDING_MODE) 70 switch (opcode & MASK_ROUNDING_MODE)
@@ -72,28 +72,28 @@ void SetRoundingMode(const unsigned int opcode) @@ -72,28 +72,28 @@ void SetRoundingMode(const unsigned int opcode)
72 default: 72 default:
73 case ROUND_TO_NEAREST: 73 case ROUND_TO_NEAREST:
74 rounding_mode = float_round_nearest_even; 74 rounding_mode = float_round_nearest_even;
75 -#if MAINTAIN_FPCR 75 +#ifdef MAINTAIN_FPCR
76 fpa11->fpcr |= ROUND_TO_NEAREST; 76 fpa11->fpcr |= ROUND_TO_NEAREST;
77 #endif 77 #endif
78 break; 78 break;
79 79
80 case ROUND_TO_PLUS_INFINITY: 80 case ROUND_TO_PLUS_INFINITY:
81 rounding_mode = float_round_up; 81 rounding_mode = float_round_up;
82 -#if MAINTAIN_FPCR 82 +#ifdef MAINTAIN_FPCR
83 fpa11->fpcr |= ROUND_TO_PLUS_INFINITY; 83 fpa11->fpcr |= ROUND_TO_PLUS_INFINITY;
84 #endif 84 #endif
85 break; 85 break;
86 86
87 case ROUND_TO_MINUS_INFINITY: 87 case ROUND_TO_MINUS_INFINITY:
88 rounding_mode = float_round_down; 88 rounding_mode = float_round_down;
89 -#if MAINTAIN_FPCR 89 +#ifdef MAINTAIN_FPCR
90 fpa11->fpcr |= ROUND_TO_MINUS_INFINITY; 90 fpa11->fpcr |= ROUND_TO_MINUS_INFINITY;
91 #endif 91 #endif
92 break; 92 break;
93 93
94 case ROUND_TO_ZERO: 94 case ROUND_TO_ZERO:
95 rounding_mode = float_round_to_zero; 95 rounding_mode = float_round_to_zero;
96 -#if MAINTAIN_FPCR 96 +#ifdef MAINTAIN_FPCR
97 fpa11->fpcr |= ROUND_TO_ZERO; 97 fpa11->fpcr |= ROUND_TO_ZERO;
98 #endif 98 #endif
99 break; 99 break;
@@ -105,28 +105,28 @@ void SetRoundingPrecision(const unsigned int opcode) @@ -105,28 +105,28 @@ void SetRoundingPrecision(const unsigned int opcode)
105 { 105 {
106 int rounding_precision; 106 int rounding_precision;
107 FPA11 *fpa11 = GET_FPA11(); 107 FPA11 *fpa11 = GET_FPA11();
108 -#if MAINTAIN_FPCR 108 +#ifdef MAINTAIN_FPCR
109 fpa11->fpcr &= ~MASK_ROUNDING_PRECISION; 109 fpa11->fpcr &= ~MASK_ROUNDING_PRECISION;
110 #endif 110 #endif
111 switch (opcode & MASK_ROUNDING_PRECISION) 111 switch (opcode & MASK_ROUNDING_PRECISION)
112 { 112 {
113 case ROUND_SINGLE: 113 case ROUND_SINGLE:
114 rounding_precision = 32; 114 rounding_precision = 32;
115 -#if MAINTAIN_FPCR 115 +#ifdef MAINTAIN_FPCR
116 fpa11->fpcr |= ROUND_SINGLE; 116 fpa11->fpcr |= ROUND_SINGLE;
117 #endif 117 #endif
118 break; 118 break;
119 119
120 case ROUND_DOUBLE: 120 case ROUND_DOUBLE:
121 rounding_precision = 64; 121 rounding_precision = 64;
122 -#if MAINTAIN_FPCR 122 +#ifdef MAINTAIN_FPCR
123 fpa11->fpcr |= ROUND_DOUBLE; 123 fpa11->fpcr |= ROUND_DOUBLE;
124 #endif 124 #endif
125 break; 125 break;
126 126
127 case ROUND_EXTENDED: 127 case ROUND_EXTENDED:
128 rounding_precision = 80; 128 rounding_precision = 80;
129 -#if MAINTAIN_FPCR 129 +#ifdef MAINTAIN_FPCR
130 fpa11->fpcr |= ROUND_EXTENDED; 130 fpa11->fpcr |= ROUND_EXTENDED;
131 #endif 131 #endif
132 break; 132 break;
linux-user/main.c
@@ -282,7 +282,7 @@ static void write_dt(void *ptr, unsigned long addr, unsigned long limit, @@ -282,7 +282,7 @@ static void write_dt(void *ptr, unsigned long addr, unsigned long limit,
282 p[1] = tswap32(e2); 282 p[1] = tswap32(e2);
283 } 283 }
284 284
285 -#if TARGET_X86_64 285 +#ifdef TARGET_X86_64
286 uint64_t idt_table[512]; 286 uint64_t idt_table[512];
287 287
288 static void set_gate64(void *ptr, unsigned int type, unsigned int dpl, 288 static void set_gate64(void *ptr, unsigned int type, unsigned int dpl,
mips-dis.c
@@ -3302,7 +3302,7 @@ set_default_mips_dis_options (struct disassemble_info *info) @@ -3302,7 +3302,7 @@ set_default_mips_dis_options (struct disassemble_info *info)
3302 #endif 3302 #endif
3303 3303
3304 /* Set ISA, architecture, and cp0 register names as best we can. */ 3304 /* Set ISA, architecture, and cp0 register names as best we can. */
3305 -#if ! SYMTAB_AVAILABLE && 0 3305 +#if !defined(SYMTAB_AVAILABLE) && 0
3306 /* This is running out on a target machine, not in a host tool. 3306 /* This is running out on a target machine, not in a host tool.
3307 FIXME: Where does mips_target_info come from? */ 3307 FIXME: Where does mips_target_info come from? */
3308 target_processor = mips_target_info.processor; 3308 target_processor = mips_target_info.processor;
slirp/ip_icmp.c
@@ -228,7 +228,7 @@ icmp_error(msrc, type, code, minsize, message) @@ -228,7 +228,7 @@ icmp_error(msrc, type, code, minsize, message)
228 /* check msrc */ 228 /* check msrc */
229 if(!msrc) goto end_error; 229 if(!msrc) goto end_error;
230 ip = mtod(msrc, struct ip *); 230 ip = mtod(msrc, struct ip *);
231 -#if DEBUG 231 +#ifdef DEBUG
232 { char bufa[20], bufb[20]; 232 { char bufa[20], bufb[20];
233 strcpy(bufa, inet_ntoa(ip->ip_src)); 233 strcpy(bufa, inet_ntoa(ip->ip_src));
234 strcpy(bufb, inet_ntoa(ip->ip_dst)); 234 strcpy(bufb, inet_ntoa(ip->ip_dst));
@@ -285,7 +285,7 @@ icmp_error(msrc, type, code, minsize, message) @@ -285,7 +285,7 @@ icmp_error(msrc, type, code, minsize, message)
285 HTONS(icp->icmp_ip.ip_id); 285 HTONS(icp->icmp_ip.ip_id);
286 HTONS(icp->icmp_ip.ip_off); 286 HTONS(icp->icmp_ip.ip_off);
287 287
288 -#if DEBUG 288 +#ifdef DEBUG
289 if(message) { /* DEBUG : append message to ICMP packet */ 289 if(message) { /* DEBUG : append message to ICMP packet */
290 int message_len; 290 int message_len;
291 char *cpnt; 291 char *cpnt;
slirp/slirp.h
@@ -103,7 +103,7 @@ typedef unsigned char u_int8_t; @@ -103,7 +103,7 @@ typedef unsigned char u_int8_t;
103 # include <sys/time.h> 103 # include <sys/time.h>
104 # include <time.h> 104 # include <time.h>
105 #else 105 #else
106 -# if HAVE_SYS_TIME_H 106 +# ifdef HAVE_SYS_TIME_H
107 # include <sys/time.h> 107 # include <sys/time.h>
108 # else 108 # else
109 # include <time.h> 109 # include <time.h>
target-i386/op_helper.c
@@ -1217,7 +1217,7 @@ void do_interrupt(int intno, int is_int, int error_code, @@ -1217,7 +1217,7 @@ void do_interrupt(int intno, int is_int, int error_code,
1217 } 1217 }
1218 } 1218 }
1219 if (env->cr[0] & CR0_PE_MASK) { 1219 if (env->cr[0] & CR0_PE_MASK) {
1220 -#if TARGET_X86_64 1220 +#ifdef TARGET_X86_64
1221 if (env->hflags & HF_LMA_MASK) { 1221 if (env->hflags & HF_LMA_MASK) {
1222 do_interrupt64(intno, is_int, error_code, next_eip, is_hw); 1222 do_interrupt64(intno, is_int, error_code, next_eip, is_hw);
1223 } else 1223 } else
@@ -35,14 +35,14 @@ @@ -35,14 +35,14 @@
35 #include "keymaps.c" 35 #include "keymaps.c"
36 #include "d3des.h" 36 #include "d3des.h"
37 37
38 -#if CONFIG_VNC_TLS 38 +#ifdef CONFIG_VNC_TLS
39 #include <gnutls/gnutls.h> 39 #include <gnutls/gnutls.h>
40 #include <gnutls/x509.h> 40 #include <gnutls/x509.h>
41 #endif /* CONFIG_VNC_TLS */ 41 #endif /* CONFIG_VNC_TLS */
42 42
43 // #define _VNC_DEBUG 1 43 // #define _VNC_DEBUG 1
44 44
45 -#if _VNC_DEBUG 45 +#ifdef _VNC_DEBUG
46 #define VNC_DEBUG(fmt, ...) do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) 46 #define VNC_DEBUG(fmt, ...) do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
47 47
48 #if CONFIG_VNC_TLS && _VNC_DEBUG >= 2 48 #if CONFIG_VNC_TLS && _VNC_DEBUG >= 2
@@ -93,7 +93,7 @@ enum { @@ -93,7 +93,7 @@ enum {
93 VNC_AUTH_VENCRYPT = 19 93 VNC_AUTH_VENCRYPT = 19
94 }; 94 };
95 95
96 -#if CONFIG_VNC_TLS 96 +#ifdef CONFIG_VNC_TLS
97 enum { 97 enum {
98 VNC_WIREMODE_CLEAR, 98 VNC_WIREMODE_CLEAR,
99 VNC_WIREMODE_TLS, 99 VNC_WIREMODE_TLS,
@@ -141,7 +141,7 @@ struct VncState @@ -141,7 +141,7 @@ struct VncState
141 char *display; 141 char *display;
142 char *password; 142 char *password;
143 int auth; 143 int auth;
144 -#if CONFIG_VNC_TLS 144 +#ifdef CONFIG_VNC_TLS
145 int subauth; 145 int subauth;
146 int x509verify; 146 int x509verify;
147 147
@@ -152,7 +152,7 @@ struct VncState @@ -152,7 +152,7 @@ struct VncState
152 #endif 152 #endif
153 char challenge[VNC_AUTH_CHALLENGE_SIZE]; 153 char challenge[VNC_AUTH_CHALLENGE_SIZE];
154 154
155 -#if CONFIG_VNC_TLS 155 +#ifdef CONFIG_VNC_TLS
156 int wiremode; 156 int wiremode;
157 gnutls_session_t tls_session; 157 gnutls_session_t tls_session;
158 #endif 158 #endif
@@ -662,7 +662,7 @@ static int vnc_client_io_error(VncState *vs, int ret, int last_errno) @@ -662,7 +662,7 @@ static int vnc_client_io_error(VncState *vs, int ret, int last_errno)
662 buffer_reset(&vs->input); 662 buffer_reset(&vs->input);
663 buffer_reset(&vs->output); 663 buffer_reset(&vs->output);
664 vs->need_update = 0; 664 vs->need_update = 0;
665 -#if CONFIG_VNC_TLS 665 +#ifdef CONFIG_VNC_TLS
666 if (vs->tls_session) { 666 if (vs->tls_session) {
667 gnutls_deinit(vs->tls_session); 667 gnutls_deinit(vs->tls_session);
668 vs->tls_session = NULL; 668 vs->tls_session = NULL;
@@ -684,7 +684,7 @@ static void vnc_client_write(void *opaque) @@ -684,7 +684,7 @@ static void vnc_client_write(void *opaque)
684 long ret; 684 long ret;
685 VncState *vs = opaque; 685 VncState *vs = opaque;
686 686
687 -#if CONFIG_VNC_TLS 687 +#ifdef CONFIG_VNC_TLS
688 if (vs->tls_session) { 688 if (vs->tls_session) {
689 ret = gnutls_write(vs->tls_session, vs->output.buffer, vs->output.offset); 689 ret = gnutls_write(vs->tls_session, vs->output.buffer, vs->output.offset);
690 if (ret < 0) { 690 if (ret < 0) {
@@ -722,7 +722,7 @@ static void vnc_client_read(void *opaque) @@ -722,7 +722,7 @@ static void vnc_client_read(void *opaque)
722 722
723 buffer_reserve(&vs->input, 4096); 723 buffer_reserve(&vs->input, 4096);
724 724
725 -#if CONFIG_VNC_TLS 725 +#ifdef CONFIG_VNC_TLS
726 if (vs->tls_session) { 726 if (vs->tls_session) {
727 ret = gnutls_read(vs->tls_session, buffer_end(&vs->input), 4096); 727 ret = gnutls_read(vs->tls_session, buffer_end(&vs->input), 4096);
728 if (ret < 0) { 728 if (ret < 0) {
@@ -829,7 +829,7 @@ static uint32_t read_u32(uint8_t *data, size_t offset) @@ -829,7 +829,7 @@ static uint32_t read_u32(uint8_t *data, size_t offset)
829 (data[offset + 2] << 8) | data[offset + 3]); 829 (data[offset + 2] << 8) | data[offset + 3]);
830 } 830 }
831 831
832 -#if CONFIG_VNC_TLS 832 +#ifdef CONFIG_VNC_TLS
833 static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport, 833 static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport,
834 const void *data, 834 const void *data,
835 size_t len) { 835 size_t len) {
@@ -1439,7 +1439,7 @@ static int start_auth_vnc(VncState *vs) @@ -1439,7 +1439,7 @@ static int start_auth_vnc(VncState *vs)
1439 } 1439 }
1440 1440
1441 1441
1442 -#if CONFIG_VNC_TLS 1442 +#ifdef CONFIG_VNC_TLS
1443 #define DH_BITS 1024 1443 #define DH_BITS 1024
1444 static gnutls_dh_params_t dh_params; 1444 static gnutls_dh_params_t dh_params;
1445 1445
@@ -1877,7 +1877,7 @@ static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len) @@ -1877,7 +1877,7 @@ static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len)
1877 VNC_DEBUG("Start VNC auth\n"); 1877 VNC_DEBUG("Start VNC auth\n");
1878 return start_auth_vnc(vs); 1878 return start_auth_vnc(vs);
1879 1879
1880 -#if CONFIG_VNC_TLS 1880 +#ifdef CONFIG_VNC_TLS
1881 case VNC_AUTH_VENCRYPT: 1881 case VNC_AUTH_VENCRYPT:
1882 VNC_DEBUG("Accept VeNCrypt auth\n");; 1882 VNC_DEBUG("Accept VeNCrypt auth\n");;
1883 return start_auth_vencrypt(vs); 1883 return start_auth_vencrypt(vs);
@@ -2030,7 +2030,7 @@ void vnc_display_init(DisplayState *ds) @@ -2030,7 +2030,7 @@ void vnc_display_init(DisplayState *ds)
2030 vnc_dpy_resize(vs->ds, 640, 400); 2030 vnc_dpy_resize(vs->ds, 640, 400);
2031 } 2031 }
2032 2032
2033 -#if CONFIG_VNC_TLS 2033 +#ifdef CONFIG_VNC_TLS
2034 static int vnc_set_x509_credential(VncState *vs, 2034 static int vnc_set_x509_credential(VncState *vs,
2035 const char *certdir, 2035 const char *certdir,
2036 const char *filename, 2036 const char *filename,
@@ -2107,7 +2107,7 @@ void vnc_display_close(DisplayState *ds) @@ -2107,7 +2107,7 @@ void vnc_display_close(DisplayState *ds)
2107 buffer_reset(&vs->input); 2107 buffer_reset(&vs->input);
2108 buffer_reset(&vs->output); 2108 buffer_reset(&vs->output);
2109 vs->need_update = 0; 2109 vs->need_update = 0;
2110 -#if CONFIG_VNC_TLS 2110 +#ifdef CONFIG_VNC_TLS
2111 if (vs->tls_session) { 2111 if (vs->tls_session) {
2112 gnutls_deinit(vs->tls_session); 2112 gnutls_deinit(vs->tls_session);
2113 vs->tls_session = NULL; 2113 vs->tls_session = NULL;
@@ -2116,7 +2116,7 @@ void vnc_display_close(DisplayState *ds) @@ -2116,7 +2116,7 @@ void vnc_display_close(DisplayState *ds)
2116 #endif /* CONFIG_VNC_TLS */ 2116 #endif /* CONFIG_VNC_TLS */
2117 } 2117 }
2118 vs->auth = VNC_AUTH_INVALID; 2118 vs->auth = VNC_AUTH_INVALID;
2119 -#if CONFIG_VNC_TLS 2119 +#ifdef CONFIG_VNC_TLS
2120 vs->subauth = VNC_AUTH_INVALID; 2120 vs->subauth = VNC_AUTH_INVALID;
2121 vs->x509verify = 0; 2121 vs->x509verify = 0;
2122 #endif 2122 #endif
@@ -2152,7 +2152,7 @@ int vnc_display_open(DisplayState *ds, const char *display) @@ -2152,7 +2152,7 @@ int vnc_display_open(DisplayState *ds, const char *display)
2152 const char *options; 2152 const char *options;
2153 int password = 0; 2153 int password = 0;
2154 int reverse = 0; 2154 int reverse = 0;
2155 -#if CONFIG_VNC_TLS 2155 +#ifdef CONFIG_VNC_TLS
2156 int tls = 0, x509 = 0; 2156 int tls = 0, x509 = 0;
2157 #endif 2157 #endif
2158 2158
@@ -2170,7 +2170,7 @@ int vnc_display_open(DisplayState *ds, const char *display) @@ -2170,7 +2170,7 @@ int vnc_display_open(DisplayState *ds, const char *display)
2170 password = 1; /* Require password auth */ 2170 password = 1; /* Require password auth */
2171 } else if (strncmp(options, "reverse", 7) == 0) { 2171 } else if (strncmp(options, "reverse", 7) == 0) {
2172 reverse = 1; 2172 reverse = 1;
2173 -#if CONFIG_VNC_TLS 2173 +#ifdef CONFIG_VNC_TLS
2174 } else if (strncmp(options, "tls", 3) == 0) { 2174 } else if (strncmp(options, "tls", 3) == 0) {
2175 tls = 1; /* Require TLS */ 2175 tls = 1; /* Require TLS */
2176 } else if (strncmp(options, "x509", 4) == 0) { 2176 } else if (strncmp(options, "x509", 4) == 0) {
@@ -2208,7 +2208,7 @@ int vnc_display_open(DisplayState *ds, const char *display) @@ -2208,7 +2208,7 @@ int vnc_display_open(DisplayState *ds, const char *display)
2208 } 2208 }
2209 2209
2210 if (password) { 2210 if (password) {
2211 -#if CONFIG_VNC_TLS 2211 +#ifdef CONFIG_VNC_TLS
2212 if (tls) { 2212 if (tls) {
2213 vs->auth = VNC_AUTH_VENCRYPT; 2213 vs->auth = VNC_AUTH_VENCRYPT;
2214 if (x509) { 2214 if (x509) {
@@ -2222,12 +2222,12 @@ int vnc_display_open(DisplayState *ds, const char *display) @@ -2222,12 +2222,12 @@ int vnc_display_open(DisplayState *ds, const char *display)
2222 #endif 2222 #endif
2223 VNC_DEBUG("Initializing VNC server with password auth\n"); 2223 VNC_DEBUG("Initializing VNC server with password auth\n");
2224 vs->auth = VNC_AUTH_VNC; 2224 vs->auth = VNC_AUTH_VNC;
2225 -#if CONFIG_VNC_TLS 2225 +#ifdef CONFIG_VNC_TLS
2226 vs->subauth = VNC_AUTH_INVALID; 2226 vs->subauth = VNC_AUTH_INVALID;
2227 } 2227 }
2228 #endif 2228 #endif
2229 } else { 2229 } else {
2230 -#if CONFIG_VNC_TLS 2230 +#ifdef CONFIG_VNC_TLS
2231 if (tls) { 2231 if (tls) {
2232 vs->auth = VNC_AUTH_VENCRYPT; 2232 vs->auth = VNC_AUTH_VENCRYPT;
2233 if (x509) { 2233 if (x509) {
@@ -2241,7 +2241,7 @@ int vnc_display_open(DisplayState *ds, const char *display) @@ -2241,7 +2241,7 @@ int vnc_display_open(DisplayState *ds, const char *display)
2241 #endif 2241 #endif
2242 VNC_DEBUG("Initializing VNC server with no auth\n"); 2242 VNC_DEBUG("Initializing VNC server with no auth\n");
2243 vs->auth = VNC_AUTH_NONE; 2243 vs->auth = VNC_AUTH_NONE;
2244 -#if CONFIG_VNC_TLS 2244 +#ifdef CONFIG_VNC_TLS
2245 vs->subauth = VNC_AUTH_INVALID; 2245 vs->subauth = VNC_AUTH_INVALID;
2246 } 2246 }
2247 #endif 2247 #endif