jer         15/05/02 11:14:31

  Modified:             big_pt.patch mac-fdisk-0.1-r6-ppc64.patch
                        mac-fdisk-0.1-headers.patch mac-fdisk-amd64.patch
                        largerthan2gb.patch
  Added:                mac-fdisk-0.1_p16-ppc64.patch
  Log:
  EAPI bump. Use bumped Debian patch level in PV. Clean up patches.
  
  (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 
A792A613)

Revision  Changes    Path
1.2                  sys-fs/mac-fdisk/files/big_pt.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/big_pt.patch?rev=1.2&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/big_pt.patch?rev=1.2&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/big_pt.patch?r1=1.1&r2=1.2

Index: big_pt.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-fs/mac-fdisk/files/big_pt.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- big_pt.patch        22 Jul 2009 15:18:55 -0000      1.1
+++ big_pt.patch        2 May 2015 11:14:31 -0000       1.2
@@ -1,5 +1,5 @@
---- partition_map.c    2009-07-22 15:06:58.739072858 +0000
-+++ /home/jjezak/partition_map.c       2009-07-22 15:10:01.069051603 +0000
+--- a/partition_map.c
++++ b/partition_map.c
 @@ -25,6 +25,11 @@
   * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
   */



1.2                  sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch?rev=1.2&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch?rev=1.2&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch?r1=1.1&r2=1.2

Index: mac-fdisk-0.1-r6-ppc64.patch
===================================================================
RCS file: 
/var/cvsroot/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mac-fdisk-0.1-r6-ppc64.patch        23 Sep 2006 22:30:41 -0000      1.1
+++ mac-fdisk-0.1-r6-ppc64.patch        2 May 2015 11:14:31 -0000       1.2
@@ -1,6 +1,5 @@
-diff -Nur mac-fdisk-0.1.orig/bitfield.c mac-fdisk-0.1/bitfield.c
---- mac-fdisk-0.1.orig/bitfield.c      1997-01-10 07:30:51.000000000 +0900
-+++ mac-fdisk-0.1/bitfield.c   2006-09-02 22:22:06.301788000 +0900
+--- a/bitfield.c
++++ b/bitfield.c
 @@ -67,13 +67,12 @@
  //
  // Routines
@@ -35,9 +34,8 @@
  
      // compute shift & mask
      // return the correct number of bits (shifted to low end)
-diff -Nur mac-fdisk-0.1.orig/bitfield.h mac-fdisk-0.1/bitfield.h
---- mac-fdisk-0.1.orig/bitfield.h      1996-12-18 09:44:16.000000000 +0900
-+++ mac-fdisk-0.1/bitfield.h   2006-09-02 22:22:06.301788000 +0900
+--- a/bitfield.h
++++ b/bitfield.h
 @@ -63,5 +63,5 @@
  //
  // Forward declarations
@@ -46,9 +44,8 @@
 -unsigned long bitfield_get(unsigned long bf, int base, int length);
 +unsigned int bitfield_set(unsigned int *bf, int base, int length, unsigned 
int value);
 +unsigned int bitfield_get(unsigned int bf, int base, int length);
-diff -Nur mac-fdisk-0.1.orig/dpme.h mac-fdisk-0.1/dpme.h
---- mac-fdisk-0.1.orig/dpme.h  2006-09-02 22:18:56.014216000 +0900
-+++ mac-fdisk-0.1/dpme.h       2006-09-02 22:22:06.305788000 +0900
+--- a/dpme.h
++++ b/dpme.h
 @@ -61,7 +61,7 @@
  //
  typedef       unsigned char   u8;
@@ -73,9 +70,8 @@
      u32     dpme_checksum           ;
      char    dpme_process_id[16]     ;
      u32     dpme_boot_args[32]      ;
-diff -Nur mac-fdisk-0.1.orig/dump.c mac-fdisk-0.1/dump.c
---- mac-fdisk-0.1.orig/dump.c  2006-09-02 22:18:56.138216000 +0900
-+++ mac-fdisk-0.1/dump.c       2006-09-02 22:22:06.305788000 +0900
+--- a/dump.c
++++ b/dump.c
 @@ -61,16 +61,16 @@
  // Global Constants
  //
@@ -185,9 +181,8 @@
  
        bp = (BZB *) (p->dpme_bzb);
        j = -1;
-diff -Nur mac-fdisk-0.1.orig/errors.c mac-fdisk-0.1/errors.c
---- mac-fdisk-0.1.orig/errors.c        2006-09-02 22:18:56.138216000 +0900
-+++ mac-fdisk-0.1/errors.c     2006-09-02 22:22:06.305788000 +0900
+--- a/errors.c
++++ b/errors.c
 @@ -30,6 +30,7 @@
  #include <string.h>
  #include <stdarg.h>
@@ -214,9 +209,8 @@
        fprintf(stderr, "  (%s)\n", strerror(value));
      } else {
        fprintf(stderr, "\n");
-diff -Nur mac-fdisk-0.1.orig/fdisk.c mac-fdisk-0.1/fdisk.c
---- mac-fdisk-0.1.orig/fdisk.c 2006-09-02 22:18:56.142216000 +0900
-+++ mac-fdisk-0.1/fdisk.c      2006-09-02 22:22:06.305788000 +0900
+--- a/fdisk.c
++++ b/fdisk.c
 @@ -71,12 +71,65 @@
  
  #include <sys/ioctl.h>
@@ -294,9 +288,8 @@
  {
        if (argc > 3)
                fatal(usage);
-diff -Nur mac-fdisk-0.1.orig/fdisklabel.c mac-fdisk-0.1/fdisklabel.c
---- mac-fdisk-0.1.orig/fdisklabel.c    2006-09-02 22:18:56.142216000 +0900
-+++ mac-fdisk-0.1/fdisklabel.c 2006-09-02 22:22:06.309788000 +0900
+--- a/fdisklabel.c
++++ b/fdisklabel.c
 @@ -35,6 +35,7 @@
     SUCH DAMAGE.
  */
@@ -410,9 +403,8 @@
  #endif
        if (pp->p_size % lp->d_secpercyl)
        putc('*', f);
-diff -Nur mac-fdisk-0.1.orig/io.c mac-fdisk-0.1/io.c
---- mac-fdisk-0.1.orig/io.c    2006-09-02 22:18:56.142216000 +0900
-+++ mac-fdisk-0.1/io.c 2006-09-02 22:22:06.309788000 +0900
+--- a/io.c
++++ b/io.c
 @@ -33,8 +33,10 @@
  #else
  #ifdef __GLIBC__
@@ -433,9 +425,8 @@
        return 0;
      }
  #ifndef __linux__
-diff -Nur mac-fdisk-0.1.orig/partition_map.c mac-fdisk-0.1/partition_map.c
---- mac-fdisk-0.1.orig/partition_map.c 2006-09-02 22:18:56.142216000 +0900
-+++ mac-fdisk-0.1/partition_map.c      2006-09-02 22:22:06.309788000 +0900
+--- a/partition_map.c
++++ b/partition_map.c
 @@ -105,7 +105,6 @@
      int fd;
      partition_map_header * map;
@@ -470,9 +461,8 @@
      map->media_size = number;
  
  #ifdef __linux__
-diff -Nur mac-fdisk-0.1.orig/pdisk.c mac-fdisk-0.1/pdisk.c
---- mac-fdisk-0.1.orig/pdisk.c 2006-09-02 22:18:56.142216000 +0900
-+++ mac-fdisk-0.1/pdisk.c      2006-09-02 22:22:06.309788000 +0900
+--- a/pdisk.c
++++ b/pdisk.c
 @@ -437,7 +437,6 @@
  {
      long base;



1.2                  sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch?rev=1.2&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch?rev=1.2&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch?r1=1.1&r2=1.2

Index: mac-fdisk-0.1-headers.patch
===================================================================
RCS file: 
/var/cvsroot/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mac-fdisk-0.1-headers.patch 19 Jul 2006 20:33:50 -0000      1.1
+++ mac-fdisk-0.1-headers.patch 2 May 2015 11:14:31 -0000       1.2
@@ -1,7 +1,7 @@
 Include a lot more headers and remove a bunch of braindead __linux__ checks
 
---- mac-fdisk-0.1/dump.c
-+++ mac-fdisk-0.1/dump.c
+--- a/dump.c
++++ b/dump.c
 @@ -30,10 +30,8 @@
   */
  
@@ -13,8 +13,8 @@
  #include <string.h>
  #include <errno.h>
  #include <fcntl.h>
---- mac-fdisk-0.1/errors.c
-+++ mac-fdisk-0.1/errors.c
+--- a/errors.c
++++ b/errors.c
 @@ -26,9 +26,7 @@
   */
  
@@ -47,8 +47,8 @@
      } else {
        fprintf(stderr, "\n");
      }
---- mac-fdisk-0.1/fdisk.c
-+++ mac-fdisk-0.1/fdisk.c
+--- a/fdisk.c
++++ b/fdisk.c
 @@ -62,6 +62,7 @@
  #include <unistd.h>
  #include <stdio.h>
@@ -57,8 +57,8 @@
  #include <fcntl.h>
  #include <ctype.h>
  #include <setjmp.h>
---- mac-fdisk-0.1/fdisklabel.c
-+++ mac-fdisk-0.1/fdisklabel.c
+--- a/fdisklabel.c
++++ b/fdisklabel.c
 @@ -38,6 +38,7 @@
  #include <unistd.h>
  #include <stdio.h>
@@ -67,8 +67,8 @@
  #include <fcntl.h>
  #include <ctype.h>
  #include <setjmp.h>
---- mac-fdisk-0.1/io.c
-+++ mac-fdisk-0.1/io.c
+--- a/io.c
++++ b/io.c
 @@ -26,9 +26,9 @@
   */
  
@@ -80,8 +80,8 @@
  #include <SCSI.h>
  #else
  #ifdef __GLIBC__
---- mac-fdisk-0.1/partition_map.c
-+++ mac-fdisk-0.1/partition_map.c
+--- a/partition_map.c
++++ b/partition_map.c
 @@ -26,10 +26,9 @@
   */
  
@@ -94,8 +94,8 @@
  #include <errno.h>
  
  #include <fcntl.h>
---- mac-fdisk-0.1/pdisk.c
-+++ mac-fdisk-0.1/pdisk.c
+--- a/pdisk.c
++++ b/pdisk.c
 @@ -32,10 +32,11 @@
  #include <getopt.h>
  #include <stddef.h>



1.2                  sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch?rev=1.2&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch?rev=1.2&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch?r1=1.1&r2=1.2

Index: mac-fdisk-amd64.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mac-fdisk-amd64.patch       7 Apr 2007 16:27:25 -0000       1.1
+++ mac-fdisk-amd64.patch       2 May 2015 11:14:31 -0000       1.2
@@ -1,6 +1,5 @@
-diff -Naur mac-fdisk-0.1.bak/fdisklabel.c mac-fdisk-0.1/fdisklabel.c
---- mac-fdisk-0.1.bak/fdisklabel.c     2007-03-16 10:56:26.000000000 -0400
-+++ mac-fdisk-0.1/fdisklabel.c 2007-03-16 10:56:13.000000000 -0400
+--- a/fdisklabel.c
++++ b/fdisklabel.c
 @@ -72,7 +72,7 @@
  static int bsd_readlabel  (struct partition *p, struct disklabel *d);
  static int bsd_writelabel (struct partition *p, struct disklabel *d);
@@ -161,9 +160,8 @@
  static int
  bsd_translate_fstype (int linux_type)
  {
-diff -Naur mac-fdisk-0.1.bak/fdisklabel.h mac-fdisk-0.1/fdisklabel.h
---- mac-fdisk-0.1.bak/fdisklabel.h     2007-03-16 10:56:26.000000000 -0400
-+++ mac-fdisk-0.1/fdisklabel.h 2007-03-16 10:56:13.000000000 -0400
+--- a/fdisklabel.h
++++ b/fdisklabel.h
 @@ -35,7 +35,7 @@
  #define       BSD_MAXPARTITIONS 8
  #define BSD_LINUX_BOOTDIR "/usr/ucb/mdec"
@@ -173,9 +171,8 @@
  #define BSD_LABELSECTOR   1
  #define BSD_LABELOFFSET   0
  #define       BSD_BBSIZE        8192          /* size of boot area, with 
label */
-diff -Naur mac-fdisk-0.1.bak/kernel-defs.h mac-fdisk-0.1/kernel-defs.h
---- mac-fdisk-0.1.bak/kernel-defs.h    2007-03-16 10:56:26.000000000 -0400
-+++ mac-fdisk-0.1/kernel-defs.h        2007-03-16 10:56:13.000000000 -0400
+--- a/kernel-defs.h
++++ b/kernel-defs.h
 @@ -15,8 +15,14 @@
  /* from asm/ioctl.h */
  #define _IOC_NRBITS   8



1.2                  sys-fs/mac-fdisk/files/largerthan2gb.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/largerthan2gb.patch?rev=1.2&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/largerthan2gb.patch?rev=1.2&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/largerthan2gb.patch?r1=1.1&r2=1.2

Index: largerthan2gb.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-fs/mac-fdisk/files/largerthan2gb.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- largerthan2gb.patch 5 Feb 2005 21:41:08 -0000       1.1
+++ largerthan2gb.patch 2 May 2015 11:14:31 -0000       1.2
@@ -1,5 +1,5 @@
---- fdisk.h-orig       1997-01-14 21:34:13.000000000 +0100
-+++ fdisk.h    2004-12-13 15:36:42.575004576 +0100
+--- a/fdisk.h
++++ b/fdisk.h
 @@ -2,6 +2,11 @@
     fdisk.h
  */



1.1                  sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc64.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc64.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc64.patch?rev=1.1&content-type=text/plain

Index: mac-fdisk-0.1_p16-ppc64.patch
===================================================================
--- a/bitfield.c
+++ b/bitfield.c
@@ -67,13 +67,12 @@
 //
 // Routines
 //
-unsigned long
-bitfield_set(unsigned long *bf, int base, int length, unsigned long value)
+unsigned int
+bitfield_set(unsigned int *bf, int base, int length, unsigned int value)
 {
-    unsigned long t;
-    unsigned long m;
+    unsigned int t;
+    unsigned int m;
     int s;
-    int i;
 
     // compute shift & mask, coerce value to correct number of bits,
     // zap the old bits and stuff the new value
@@ -86,12 +85,11 @@
 }
 
 
-unsigned long
-bitfield_get(unsigned long bf, int base, int length)
+unsigned int
+bitfield_get(unsigned int bf, int base, int length)
 {
-    unsigned long m;
+    unsigned int m;
     int s;
-    int i;
 
     // compute shift & mask
     // return the correct number of bits (shifted to low end)
--- a/bitfield.h
+++ b/bitfield.h
@@ -63,5 +63,5 @@
 //
 // Forward declarations
 //
-unsigned long bitfield_set(unsigned long *bf, int base, int length, unsigned 
long value);
-unsigned long bitfield_get(unsigned long bf, int base, int length);
+unsigned int bitfield_set(unsigned int *bf, int base, int length, unsigned int 
value);
+unsigned int bitfield_get(unsigned int bf, int base, int length);
--- a/dump.c
+++ b/dump.c
@@ -61,16 +61,16 @@
 // Global Constants
 //
 NAMES plist[] = {
-    "Drvr", "Apple_Driver",
-    "Dr43", "Apple_Driver43",
-    "Free", "Apple_Free",
-    " HFS", "Apple_HFS",
-    " MFS", "Apple_MFS",
-    "PDOS", "Apple_PRODOS",
-    "junk", "Apple_Scratch",
-    "unix", "Apple_UNIX_SVR2",
-    " map", "Apple_partition_map",
-    0, 0
+    {"Drvr"}, {"Apple_Driver"},
+    {"Dr43"}, {"Apple_Driver43"},
+    {"Free"}, {"Apple_Free"},
+    {" HFS"}, {"Apple_HFS"},
+    {" MFS"}, {"Apple_MFS"},
+    {"PDOS"}, {"Apple_PRODOS"},
+    {"junk"}, {"Apple_Scratch"},
+    {"unix"}, {"Apple_UNIX_SVR2"},
+    {" map"}, {"Apple_partition_map"},
+    {0},       {0}
 };
 
 const char * kStringEmpty      = "";
@@ -162,10 +162,10 @@
     }
 #ifdef __mc68000__
     printf("%*s  type name         "
-           "%*s   %-*s ( size )  system\n", strlen(map->name)+1, "#", j, 
"length", j, "base");
+           "%*s   %-*s ( size )  system\n", (int)strlen(map->name)+1, "#", j, 
"length", j, "base");
 #else
     printf("%*s                    type name               "
-           "%*s   %-*s ( size )  system\n", strlen(map->name)+1, "#", j, 
"length", j, "base");
+           "%*s   %-*s ( size )  system\n", (int)strlen(map->name)+1, "#", j, 
"length", j, "base");
 #endif
 
     /* Grok devfs names. (courtesy Colin Walters)*/
@@ -199,7 +199,6 @@
     partition_map_header *map;
     int j;
     DPME *p;
-    BZB *bp;
     char *s;
 #ifdef __mc68000__
     int aflag = 1;
@@ -222,13 +221,13 @@
            }
        }
 #ifdef __mc68000__
-       printf("%s%-2d %.4s %-12.12s ", dev, entry->disk_address, s, 
p->dpme_name);
+       printf("%s%-2d %.4s %-12.12s ", dev, (int)entry->disk_address, s, 
p->dpme_name);
 #else
-       printf("%s%-4d  %.4s %-18.32s ", dev, entry->disk_address, s, 
p->dpme_name);
+       printf("%s%-4d  %.4s %-18.32s ", dev, (int)entry->disk_address, s, 
p->dpme_name);
 #endif
     } else {
        printf("%s%-4d %20.32s %-18.32s ", dev, 
-               entry->disk_address, p->dpme_type, p->dpme_name);
+               (int)entry->disk_address, p->dpme_type, p->dpme_name);
     }
 
     if (pflag) {
@@ -312,7 +311,6 @@
     int i;
     int fd;
     DPME * data;
-    long t;
 
     data = (DPME *) malloc(PBLOCK_SIZE);
     if (data == NULL) {
@@ -380,7 +378,7 @@
     printf("Header:\n");
     printf("fd=%d (%s)\n", map->fd, (map->regular_file)?"file":"device");
     printf("map %d blocks out of %d,  media %u blocks\n",
-           map->blocks_in_map, map->maximum_in_map, map->media_size);
+           map->blocks_in_map, map->maximum_in_map, (unsigned 
int)map->media_size);
     printf("Map is%s writeable", (map->writeable)?kStringEmpty:kStringNot);
     printf(", but%s changed\n", (map->changed)?kStringEmpty:kStringNot);
     printf("\n");
@@ -424,7 +422,7 @@
     for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
        p = entry->data;
        printf("%2d: %20.32s ",
-               entry->disk_address, p->dpme_type);
+               (int)entry->disk_address, p->dpme_type);
        printf("%7u @ %-7u ", p->dpme_pblocks, p->dpme_pblock_start);
        printf("%c%c%c%c%c%c%c%c%c%c ",
                (dpme_valid_get(p))?'V':'v',
@@ -447,7 +445,7 @@
            "goto_address checksum processor\n");
     for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
        p = entry->data;
-       printf("%2d: ", entry->disk_address);
+       printf("%2d: ", (int)entry->disk_address);
        printf("%7u ", p->dpme_boot_block);
        printf("%7u ", p->dpme_boot_bytes);
        printf("%8x ", p->dpme_load_addr);
@@ -464,7 +462,7 @@
 */
     for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
        p = entry->data;
-       printf("%2d: ", entry->disk_address);
+       printf("%2d: ", (int)entry->disk_address);
 
        bp = (BZB *) (p->dpme_bzb);
        j = -1;
--- a/errors.c
+++ b/errors.c
@@ -30,6 +30,7 @@
 #include <string.h>
 #include <stdarg.h>
 
+#include <errno.h>
 #include "errors.h"
 #include "pdisk.h"
 
@@ -113,7 +114,7 @@
     va_end(ap);
 
 #ifdef __linux__
-    if (value > 0) {
+    if (value > 0 && value < errno) {
        fprintf(stderr, "  (%s)\n", strerror(value));
     } else {
        fprintf(stderr, "\n");
@@ -142,7 +143,7 @@
     va_end(ap);
 
 #ifdef __linux__
-    if (value > 0) {
+    if (value > 0 && value < errno) {
        fprintf(stderr, "  (%s)\n", strerror(value));
     } else {
        fprintf(stderr, "\n");
--- a/fdisk.c
+++ b/fdisk.c
@@ -71,12 +71,65 @@
 
 #include <sys/ioctl.h>
 
-typedef unsigned short kdev_t; /* BAD hack; kdev_t is not exported */
-
 #include "kernel-defs.h"
 
 #include "fdisk.h"
 
+/* ----------- */
+#define _PPC64_TYPES_H
+#define BITS_PER_LONG 64
+
+typedef __signed__ char __s8;
+typedef signed char s8;
+typedef unsigned char u8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef signed short s16;
+/*typedef unsigned short __u16;*/
+typedef unsigned short u16;
+
+typedef __signed__ int __s32;
+typedef signed int s32;
+/*typedef unsigned int __u32;*/
+typedef unsigned int u32;
+
+typedef __signed__ long __s64;
+typedef signed long s64;
+typedef unsigned long __u64;
+typedef unsigned long u64;
+
+typedef struct {
+        __u32 u[4];
+} __attribute((aligned(16))) __vector128;
+
+typedef __vector128 vector128;
+
+typedef u32 dma_addr_t;
+typedef u64 dma64_addr_t;
+
+typedef struct {
+        unsigned long entry;
+        unsigned long toc;
+        unsigned long env;
+} func_descr_t;
+
+typedef unsigned int umode_t;
+
+#define BITS_TO_LONGS(bits) \
+        (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
+#define DECLARE_BITMAP(name,bits) \
+        unsigned long name[BITS_TO_LONGS(bits)]
+#define CLEAR_BITMAP(name,bits) \
+        memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
+
+/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n 
*/
+#define HDIO_GETGEO             0x0301  /* get device geometry */
+
+#define BLKRRPART  _IO(0x12,95) /* re-read partition table */
+
+/* ---------- */
+
 #define hex_val(c)     ({ \
                                char _c = (c); \
                                isdigit(_c) ? _c - '0' : \
@@ -1416,7 +1469,7 @@
        }
 }
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
        if (argc > 3)
                fatal(usage);
--- a/fdisklabel.c
+++ b/fdisklabel.c
@@ -35,6 +35,7 @@
    SUCH DAMAGE.
 */
 
+#include <sys/types.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -47,6 +48,8 @@
 #include <sys/ioctl.h>
 #include <sys/param.h>
 
+#include <asm/types.h>
+
 #include "kernel-defs.h"
 
 #include "fdisk.h"
@@ -263,8 +266,8 @@
       fprintf(f, "type: %s\n", bsd_dktypenames[lp->d_type]);
     else
       fprintf(f, "type: %d\n", lp->d_type);
-    fprintf(f, "disk: %.*s\n", sizeof(lp->d_typename), lp->d_typename);
-    fprintf(f, "label: %.*s\n", sizeof(lp->d_packname), lp->d_packname);
+    fprintf(f, "disk: %.*s\n", (int)sizeof(lp->d_typename), lp->d_typename);
+    fprintf(f, "label: %.*s\n", (int)sizeof(lp->d_packname), lp->d_packname);
     fprintf(f, "flags:");
     if (lp->d_flags & BSD_D_REMOVABLE)
       fprintf(f, " removable");
@@ -273,17 +276,17 @@
     if (lp->d_flags & BSD_D_BADSECT)
       fprintf(f, " badsect");
     fprintf(f, "\n");
-    fprintf(f, "bytes/sector: %d\n", lp->d_secsize);
-    fprintf(f, "sectors/track: %d\n", lp->d_nsectors);
-    fprintf(f, "tracks/cylinder: %d\n", lp->d_ntracks);
-    fprintf(f, "sectors/cylinder: %d\n", lp->d_secpercyl);
-    fprintf(f, "cylinders: %d\n", lp->d_ncylinders);
+    fprintf(f, "bytes/sector: %d\n", (int)lp->d_secsize);
+    fprintf(f, "sectors/track: %d\n", (int)lp->d_nsectors);
+    fprintf(f, "tracks/cylinder: %d\n", (int)lp->d_ntracks);
+    fprintf(f, "sectors/cylinder: %d\n", (int)lp->d_secpercyl);
+    fprintf(f, "cylinders: %d\n", (int)lp->d_ncylinders);
     fprintf(f, "rpm: %d\n", lp->d_rpm);
     fprintf(f, "interleave: %d\n", lp->d_interleave);
     fprintf(f, "trackskew: %d\n", lp->d_trackskew);
     fprintf(f, "cylinderskew: %d\n", lp->d_cylskew);
-    fprintf(f, "headswitch: %d\t\t# milliseconds\n", lp->d_headswitch);
-    fprintf(f, "track-to-track seek: %d\t# milliseconds\n", lp->d_trkseek);
+    fprintf(f, "headswitch: %d\t\t# milliseconds\n", (int)lp->d_headswitch);
+    fprintf(f, "track-to-track seek: %d\t# milliseconds\n", 
(int)lp->d_trkseek);
     fprintf(f, "drivedata: ");
     for (i = NDDATA - 1; i >= 0; i--)
       if (lp->d_drivedata[i])
@@ -291,7 +294,7 @@
     if (i < 0)
       i = 0;
     for (j = 0; j <= i; j++)
-      fprintf(f, "%d ", lp->d_drivedata[j]);
+      fprintf(f, "%d ", (int)lp->d_drivedata[j]);
   }
   fprintf (f, "\n%d partitions:\n", lp->d_npartitions);
   fprintf (f, "#        size   offset    fstype   [fsize bsize   cpg]\n");
@@ -299,7 +302,7 @@
   for (i = 0; i < lp->d_npartitions; i++, pp++) {
     if (pp->p_size) {
       fprintf(f, "  %c: %8d %8d  ", 'a' + i,
-             pp->p_size, pp->p_offset);
+             (int)pp->p_size, (int)pp->p_offset);
       if ((unsigned) pp->p_fstype < BSD_FSMAXTYPES)
        fprintf(f, "%8.8s", bsd_fstypes[pp->p_fstype].name);
       else
@@ -308,12 +311,12 @@
       {
         case BSD_FS_UNUSED:
          fprintf(f, "    %5d %5d %5.5s ",
-                 pp->p_fsize, pp->p_fsize * pp->p_frag, "");
+                 (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag, "");
          break;
          
        case BSD_FS_BSDFFS:
          fprintf(f, "    %5d %5d %5d ",
-                 pp->p_fsize, pp->p_fsize * pp->p_frag,
+                 (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag,
                  pp->p_cpg);
          break;
          
@@ -323,21 +326,21 @@
       }
       fprintf(f, "\t# (Cyl. %4d",
 #if 0
-             pp->p_offset / lp->d_secpercyl); /* differs from Linux fdisk */
+             (int)(pp->p_offset / lp->d_secpercyl)); /* differs from Linux 
fdisk */
 #else
-             pp->p_offset / lp->d_secpercyl + 1);
+             (int)(pp->p_offset / lp->d_secpercyl + 1));
 #endif
       if (pp->p_offset % lp->d_secpercyl)
        putc('*', f);
       else
        putc(' ', f);
       fprintf(f, "- %d",
-             (pp->p_offset + 
+             (int)((pp->p_offset + 
               pp->p_size + lp->d_secpercyl - 1) /
 #if 0
-             lp->d_secpercyl - 1); /* differs from Linux fdisk */
+             lp->d_secpercyl - 1)); /* differs from Linux fdisk */
 #else
-             lp->d_secpercyl);
+             lp->d_secpercyl));
 #endif
       if (pp->p_size % lp->d_secpercyl)
        putc('*', f);
--- a/io.c
+++ b/io.c
@@ -33,8 +33,10 @@
 #else
 #ifdef __GLIBC__
 #include <sys/types.h>
+#include <sys/stat.h>
 #endif
 #endif
+#include <linux/unistd.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdarg.h>
@@ -466,7 +468,7 @@
     long t;
 
     if (rflag) {
-       printf("Can't write block %u to file", num);
+       printf("Can't write block %u to file", (unsigned int)num);
        return 0;
     }
 #ifndef __linux__
--- a/partition_map.c
+++ b/partition_map.c
@@ -105,7 +105,6 @@
     int fd;
     partition_map_header * map;
     int writeable;
-    unsigned long length;
 #ifdef __linux__
     struct stat info;
 #endif
@@ -402,9 +401,7 @@
 {
     int fd;
     partition_map_header * map;
-    unsigned long length;
     DPME *data;
-    int ok;
     unsigned long number;
 #ifdef __linux__
     struct stat info;
@@ -433,13 +430,13 @@
     map->maximum_in_map = -1;
 
     number = compute_device_size(fd);
-    printf("size of 'device' is %u blocks: ", number);
+    printf("size of 'device' is %u blocks: ", (unsigned int)number);
     flush_to_newline(0);
     get_number_argument("what should be the size? ", (long *)&number, number);
     if (number < 4) {
        number = 4;
     }
-    printf("new size of 'device' is %u blocks\n", number);
+    printf("new size of 'device' is %u blocks\n", (unsigned int)number);
     map->media_size = number;
 
 #ifdef __linux__
--- a/pdisk.c
+++ b/pdisk.c
@@ -437,7 +437,6 @@
 {
     long base;
     long length;
-    long mult;
     char *name;
     char *type_name;
 
@@ -599,7 +598,6 @@
 void
 do_reorder(partition_map_header *map)
 {
-    partition_map * cur;
     long old_index;
     long index;
 




Reply via email to