Author: Bernie Innocenti <bernie@codewiz.org>

Fix amiga-fdisk on 64bit systems

diff -up amiga-fdisk_0.04-12.64bit/amigastuff.c amiga-fdisk_0.04-12/amigastuff.c
--- amiga-fdisk_0.04-12.64bit/amigastuff.c	2009-03-29 18:07:21.166521465 +0200
+++ amiga-fdisk_0.04-12/amigastuff.c	2009-03-29 18:37:03.886391626 +0200
@@ -722,7 +722,7 @@ int rigiddisk_new(int first)
 			}
 			geo.cylinders=hdsize;
 			if (hdsize != geo.cylinders) {
-			  printf("Warning: %lli cylinders can not be stored in 16-bit value!\n", hdsize);
+			  printf("Warning: %lld cylinders can not be stored in 16-bit value!\n", (long long)hdsize);
 			}
 
 
@@ -999,22 +999,26 @@ int partition_show(void)
 	struct DosEnvec *de;
 	struct PartitionBlock *curr;
 
+	int padding=strlen(disk_device)+2-6;
+	if (padding<=0)
+		padding=0;
+
 	block=htonl(rdb->rdb_PartitionList);
 
-	printf ("   Device  Boot Mount   Begin      End     Size   Pri  BBlks    System\n");
+	printf ("Device%*s Boot Mount   Begin      End     Size   Pri  BBlks    System\n", padding, "");
 	for (i=0; i<parts; i++) {
 
 		curr=PART(get_block(block));
 		block=htonl(curr->pb_Next);
 
 		de=(struct DosEnvec *)curr->pb_Environment;
-		printf ("%s%-2d   ",disk_device,(i+1));
+		printf ("%s%-2d ",disk_device,(i+1));
 		printf ("%s    ", htonl(curr->pb_Flags)&PBFF_BOOTABLE?"*":" ");
 		printf ("%s    ", htonl(curr->pb_Flags)&PBFF_NOMOUNT?" ":"*");
 		printf ("%6ld   %6ld   ", (long int) htonl(de->de_LowCyl), (long int) htonl(de->de_HighCyl));
 		printf ("%6ld   ", (long int) (htonl(de->de_HighCyl)-htonl(de->de_LowCyl)+1)*
 				htonl(de->de_BlocksPerTrack)*htonl(de->de_Surfaces)/2);
-		printf ("%3ld    ",(long int) htonl(de->de_BootPri));
+		printf ("%3ld    ",(long int) (int32_t)htonl(de->de_BootPri));
 		printf ("%3ld  ",(long int) htonl(de->de_BootBlocks));
 		printf ("%s\n",DosType(htonl(de->de_DosType)));
 	}
diff -rup amiga-fdisk-0.04.debianorig/include/amiga/types.h amiga-fdisk_0.04-12/include/amiga/types.h
--- amiga-fdisk-0.04.debianorig/include/amiga/types.h	1998-11-03 03:18:45.000000000 +0100
+++ amiga-fdisk_0.04-12/include/amiga/types.h	2009-03-29 18:21:28.855486215 +0200
@@ -1,32 +1,24 @@
-#define VOID		void
+#include <stdint.h>
 
-#ifndef __alpha__
-typedef long		LONG;	    /* signed 32-bit quantity */
-typedef unsigned long	ULONG;	    /* unsigned 32-bit quantity */
-typedef unsigned long	LONGBITS;   /* 32 bits manipulated individually */
-#else
-typedef int		LONG;	    /* signed 32-bit quantity */
-typedef unsigned int	ULONG;	    /* unsigned 32-bit quantity */
-typedef unsigned int	LONGBITS;   /* 32 bits manipulated individually */
-#endif
+#define VOID		void
 
-typedef short		WORD;	    /* signed 16-bit quantity */
-typedef unsigned short	UWORD;	    /* unsigned 16-bit quantity */
-typedef unsigned short	WORDBITS;   /* 16 bits manipulated individually */
-#if __STDC__
-typedef signed char	BYTE;	    /* signed 8-bit quantity */
-#else
-typedef char		BYTE;	    /* signed 8-bit quantity */
-#endif
-typedef unsigned char	UBYTE;	    /* unsigned 8-bit quantity */
-typedef unsigned char	BYTEBITS;   /* 8 bits manipulated individually */
-typedef unsigned short	RPTR;	    /* signed relative pointer */
+typedef int32_t		LONG;	    /* signed 32-bit quantity */
+typedef uint32_t	ULONG;	    /* unsigned 32-bit quantity */
+typedef uint32_t	LONGBITS;   /* 32 bits manipulated individually */
+
+typedef int16_t		WORD;	    /* signed 16-bit quantity */
+typedef uint16_t	UWORD;	    /* unsigned 16-bit quantity */
+typedef uint16_t	WORDBITS;   /* 16 bits manipulated individually */
+typedef int8_t		BYTE;	    /* signed 8-bit quantity */
+typedef uint8_t		UBYTE;	    /* unsigned 8-bit quantity */
+typedef uint8_t		BYTEBITS;   /* 8 bits manipulated individually */
+typedef int16_t		RPTR;	    /* signed relative pointer */
 typedef unsigned char  *STRPTR;     /* string pointer (NULL terminated) */
 
 /* Types with specific semantics */
 typedef float		FLOAT;
 typedef double		DOUBLE;
-typedef short		BOOL;
+typedef int16_t		BOOL;
 typedef unsigned char	TEXT;
 
 #ifndef TRUE
