Commit 6c41b2723f5cac6e62e68925e7a73f30b11a7a06

Authored by balrog
1 parent f610349f

Don't compare '\0' against pointers.

Add a note from Fabrice in slow_st template.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3669 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 9 additions and 7 deletions
softmmu_template.h
... ... @@ -282,6 +282,8 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr,
282 282 } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
283 283 do_unaligned_access:
284 284 /* XXX: not efficient, but simple */
  285 + /* Note: relies on the fact that tlb_fill() does not remove the
  286 + * previous page from the TLB cache. */
285 287 for(i = DATA_SIZE - 1; i >= 0; i--) {
286 288 #ifdef TARGET_WORDS_BIGENDIAN
287 289 glue(slow_stb, MMUSUFFIX)(addr + i, val >> (((DATA_SIZE - 1) * 8) - (i * 8)),
... ...
... ... @@ -8256,20 +8256,20 @@ int main(int argc, char **argv)
8256 8256 #endif
8257 8257 linux_boot = (kernel_filename != NULL);
8258 8258 net_boot = (boot_devices_bitmap >> ('n' - 'a')) && 0xF;
8259   -
  8259 +
8260 8260 /* XXX: this should not be: some embedded targets just have flash */
8261 8261 if (!linux_boot && net_boot == 0 &&
8262   - hd_filename[0] == '\0' &&
8263   - (cdrom_index >= 0 && hd_filename[cdrom_index] == '\0') &&
8264   - fd_filename[0] == '\0' &&
8265   - pflash_filename[0] == '\0')
  8262 + hd_filename[0] == NULL &&
  8263 + (cdrom_index >= 0 && hd_filename[cdrom_index] == NULL) &&
  8264 + fd_filename[0] == NULL &&
  8265 + pflash_filename[0] == NULL)
8266 8266 help(1);
8267 8267  
8268 8268 /* boot to floppy or the default cd if no hard disk defined yet */
8269 8269 if (!boot_devices[0]) {
8270   - if (hd_filename[0] != '\0')
  8270 + if (hd_filename[0] != NULL)
8271 8271 boot_devices = "c";
8272   - else if (fd_filename[0] != '\0')
  8272 + else if (fd_filename[0] != NULL)
8273 8273 boot_devices = "a";
8274 8274 else
8275 8275 boot_devices = "d";
... ...