Further work towards use of win32 file HANDLEs
[sbcl.git] / src / runtime / coreparse.c
index 0cc32a9..fefa834 100644 (file)
  * files for more information.
  */
 
+#include "sbcl.h"
+
+#ifndef LISP_FEATURE_WIN32
+#ifdef LISP_FEATURE_LINUX
+/* For madvise */
+#define _BSD_SOURCE
+#include <sys/mman.h>
+#undef _BSD_SOURCE
+#else
+#include <sys/mman.h>
+#endif
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "sbcl.h"
-
-#ifndef LISP_FEATURE_WIN32
-#ifdef LISP_FEATURE_LINUX
-/* For madvise */
-# define _BSD_SOURCE
-#endif
-#include <sys/mman.h>
-#endif
-
 #include "os.h"
 #include "runtime.h"
 #include "globals.h"
@@ -511,7 +514,7 @@ load_core_file(char *file, os_vm_offset_t file_offset)
                      *
                      * The low bits of each word are allocation flags.
                      */
-                    if (word=data[i]) {
+                    if ((word=data[i])) {
                         page_table[offset].region_start_offset = word & ~0x03;
                         page_table[offset].allocated = word & 0x03;
                     }
@@ -529,7 +532,7 @@ load_core_file(char *file, os_vm_offset_t file_offset)
         }
 
         ptr += remaining_len;
-        FSHOW((stderr, "/new ptr=0x%"WORD_FTMX"\n", ptr));
+        FSHOW((stderr, "/new ptr=0x%"WORD_FMTX"\n", ptr));
     }
     SHOW("about to free(header)");
     free(header);