Update Standards Version
[rrq/maintain_lilo.git] / src / probe.c
index 90a579dea14c1a44b4a0931fdf8274f584acd7ab..a4f1f313f0c8cd22ffe53248aac3cd409b62c0ae 100644 (file)
@@ -1,12 +1,12 @@
-/* probe.c -- BIOS probes */
-/*
-Copyright 1999-2006 John Coffman.
-All rights reserved.
-
-Licensed under the terms contained in the file 'COPYING' in the 
-source directory.
-
-*/
+/* probe.c  -  BIOS probe utility
+ * 
+ * Copyright 1999-2006 John Coffman
+ * Copyright 2009-2015 Joachim Wiedorn
+ * All rights reserved.
+ * 
+ * Licensed under the terms contained in the file 'COPYING'
+ * in the source directory.
+ */
 
 /*#define DEBUG_PROBE*/
 #define BITMAP 0       /* change to 1 when do_bitmap is filled in */
@@ -149,12 +149,12 @@ static struct partitions {
     { "DOS12", PART_DOS12, HIDDEN_OFF },
     { "DOS16_small", PART_DOS16_SMALL, HIDDEN_OFF },
     { "DOS16_big", PART_DOS16_BIG, HIDDEN_OFF },
-    { "NTFS or OS2_HPFS", PART_NTFS, HIDDEN_OFF },     /* same as HPFS; keep these two together */
+    { "NTFS", PART_NTFS, HIDDEN_OFF }, /* same as HPFS; keep these two together */
 /*  { "HPFS", PART_HPFS, HIDDEN_OFF }, */      /* same as NTFS */
     { "FAT32", PART_FAT32, HIDDEN_OFF },
     { "FAT32_lba", PART_FAT32_LBA, HIDDEN_OFF },
     { "FAT16_lba", PART_FAT16_LBA, HIDDEN_OFF },
-    { "OS/2 BootMgr", PART_OS2_BOOTMGR, 0 },
+/*  { "OS/2 BootMgr", PART_OS2_BOOTMGR, 0 }, */  /* obsolete system */
     { "DOS extended", PART_DOS_EXTD, 0 },
     { "WIN extended", PART_WIN_EXTD_LBA, 0 },
     { "Linux ext'd", PART_LINUX_EXTD, 0 },
@@ -204,10 +204,10 @@ int fetch(void)
        eq = (void*)&buf.b[buf.s5.equipment];
        v1 = (void*)&buf.b[buf.s5.video];
        if (buf.s5.vid > 1) {
-           v2 = (void*)v1 + sizeof(*v1);
-           v25 = (void*)v2 + sizeof(*v2);
+           v2 = (void*)(v1 + 1);
+           v25 = (void*)(v2 + 1);
        }
-       if (buf.s5.vid > 2) v3 = (void*)v25 + sizeof(*v25);
+       if (buf.s5.vid > 2) v3 = (void*)(v25 + 1);
     }
 #if BETA_TEST
        if (verbose>=5) printf("fetch: good return\n");
@@ -354,7 +354,7 @@ static int get_geom(unsigned int drive, struct disk_geom *geom)
 
 
     if (drive >= 0x80)
-        hdp[drive-0x80 + 1] = (void*)hd + sizeof(hard_t);              /* simplest increment, but may be wrong */
+        hdp[drive-0x80 + 1] = hd + 1;          /* simplest increment, but may be wrong */
     
     /* regs.eax = 0x1500;           check drive type */
     /* regs.edx = drive;                       */
@@ -405,7 +405,7 @@ static int get_geom(unsigned int drive, struct disk_geom *geom)
 #if 0
                                geom->pt = &pt_base[(drive&15)*4];
 #else
-       void *p = (void*)pt_base;
+       char *p = (char*)pt_base;
        int i = buf.s5.version >= 4 ? 8 : 0;
        
        p += (drive & 15) * (PART_TABLE_SIZE + i) + i;
@@ -439,7 +439,7 @@ static int get_geom(unsigned int drive, struct disk_geom *geom)
        fflush(stdout);
 #endif
     /* update the pointer to the next drive */
-      hdp[drive-0x80 + 1] = (void*)dp + sizeof(edd_t);
+      hdp[drive-0x80 + 1] = (void*)(dp + 1);
 
       /* regs.eax = 0x4800;            */
       /* regs.edx = drive;             */
@@ -675,7 +675,7 @@ static void do_table(char *part)
 {
     struct partition pt [PART_MAX_MAX+1];
     int volid;
-    long long where[PART_MAX_MAX+1];
+    int64_t where[PART_MAX_MAX+1];
     int i,j;
     int extd = (extended_pt || verbose>0);
     
@@ -693,7 +693,7 @@ static void do_table(char *part)
     }
     if (verbose>=5) {
        printf("\n");
-       for (i=0; i<j; i++) printf("%4d%20lld%12d\n", i+1, where[i], (int)(where[i]/SECTOR_SIZE));
+       for (i=0; i<j; i++) printf("%4d%20" PRId64 "%12d\n", i+1, where[i], (int)(where[i]/SECTOR_SIZE));
     }
 }
 
@@ -999,8 +999,8 @@ int bios_device(GEOMETRY *geo, int device)
     while (--bios >= 0x80) {
        get_geom(bios, &bdata);
        if (verbose>=5) {
-               printf("bios_dev: (0x%02X)  vol-ID=%08X  *PT=%08lX\n",
-                       bios, bdata.serial_no, (long)bdata.pt);
+               printf("bios_dev: (0x%02X)  vol-ID=%08X  *PT=%0*" PRIXPTR "\n",
+                       bios, bdata.serial_no, PTR_WIDTH, (intptr_t)bdata.pt);
 #ifdef DEBUG_PROBE
                dump_pt((void*)bdata.pt);
 #endif