diff -Nur lilo-24.1.orig/src/common.c lilo-24.1/src/common.c --- lilo-24.1.orig/src/common.c 2011-06-22 16:12:35.000000000 +0900 +++ lilo-24.1/src/common.c 2015-11-07 21:44:33.248019403 +0900 @@ -276,7 +276,7 @@ fprintf(stderr, "*****Fatal: INT != 4\n"); return 1; } - if (sizeof(long)>sizeof(int)) + if (sizeof(int32_t)>sizeof(int)) fprintf(stderr, "**Note: LONG is bigger than INT\n"); return 0; diff -Nur lilo-24.1.orig/src/common.h lilo-24.1/src/common.h --- lilo-24.1.orig/src/common.h 2011-06-22 16:13:27.000000000 +0900 +++ lilo-24.1/src/common.h 2015-11-07 22:13:51.448421174 +0900 @@ -19,6 +19,9 @@ #include #endif +#include +#define PTR_WIDTH ((int) (sizeof(intptr_t) * 2)) + #ifndef PAGE_SIZE # define PAGE_SIZE 4096U #endif diff -Nur lilo-24.1.orig/src/device.c lilo-24.1/src/device.c --- lilo-24.1.orig/src/device.c 2014-10-15 15:51:22.000000000 +0900 +++ lilo-24.1/src/device.c 2015-11-07 22:14:25.184730779 +0900 @@ -886,7 +886,7 @@ struct stat st; int duplicate = 0, invalid = 0, ret = 0, ntcaution = 0; int raidcaution = 0; - long codes = 0L; + int32_t codes = 0L; /* called from raid_setup & from geo_open */ /* allow only 1 call */ @@ -1167,7 +1167,7 @@ walk->next = disktab; vm[j].dt = disktab = walk; #if BETA_TEST - if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%08lx\n", vm[j].device, (long)walk); + if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%0*" PRIxPTR "\n", vm[j].device, , PTR_WIDTH, (intptr_t)walk); #endif } @@ -1281,7 +1281,7 @@ - if (verbose>=2) printf("device codes (user assigned pf) = %lX\n", codes); + if (verbose>=2) printf("device codes (user assigned pf) = %" PRIX32 "\n", codes); /* mark those BIOS codes that are already used in the disk=/bios= table */ @@ -1311,7 +1311,7 @@ } } - if (verbose>=2) printf("device codes (user assigned) = %lX\n", codes); + if (verbose>=2) printf("device codes (user assigned) = %" PRIX32 "\n", codes); for (i=0; i=2) printf("device codes (BIOS assigned) = %lX\n", codes); + if (verbose>=2) printf("device codes (BIOS assigned) = %" PRIX32 "\n", codes); for (bios=i=0; inext = disktab; vm[i].dt = disktab = walk; #if BETA_TEST - if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%08lx\n", vm[i].device, (long)walk); + if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%0*" PRIxPTR "\n", vm[i].device, PTR_WIDTH, (intptr_t)walk); #endif } j = vm[i].dt->bios = vm[i].bios.actual; @@ -1376,7 +1376,7 @@ inited = 1; } - if (verbose>=2) printf("device codes (canonical) = %lX\n", codes); + if (verbose>=2) printf("device codes (canonical) = %" PRIX32 "\n", codes); for (bios=8*sizeof(codes)-1; !(codes&(1L<=0; ) bios--; diff -Nur lilo-24.1.orig/src/edit.c lilo-24.1/src/edit.c --- lilo-24.1.orig/src/edit.c 2011-06-22 16:21:03.000000000 +0900 +++ lilo-24.1/src/edit.c 2015-11-07 21:44:33.254689196 +0900 @@ -193,7 +193,7 @@ } tm; static MENUTABLE *menu = &tm.mt; static BITMAPLILOHEADER *lh = (void*)(tm.buffer + - ((long)&tm.mt.row - (long)&tm.bmlh.row)); + ((intptr_t)&tm.mt.row - (intptr_t)&tm.bmlh.row)); /* a convenience definition */ #define mn tm.mt diff -Nur lilo-24.1.orig/src/geometry.c lilo-24.1/src/geometry.c --- lilo-24.1.orig/src/geometry.c 2014-10-17 07:45:05.000000000 +0900 +++ lilo-24.1/src/geometry.c 2015-11-07 22:15:02.170984433 +0900 @@ -55,7 +55,7 @@ #endif #ifndef REISERFS_IOC_UNPACK -#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) +#define REISERFS_IOC_UNPACK _IOW(0xCD,1,int32_t) #endif #ifndef REISER4_SUPER_MAGIC @@ -63,7 +63,7 @@ /* (*(__u32 *)"R4Sb"); */ #endif #ifndef REISER4_IOC_UNPACK -#define REISER4_IOC_UNPACK _IOW(0xCD,1,long) +#define REISER4_IOC_UNPACK _IOW(0xCD,1,int32_t) #endif #endif @@ -1268,7 +1268,7 @@ for (walk = disktab; walk; walk = walk->next) if (walk->device == (device & D_MASK(device))) break; #if BETA_TEST - if (verbose>=5) printf("walk=%08lx\n", (long)walk); + if (verbose>=5) printf("walk=%0*" PRIxPTR "\n", PTR_WIDTH, (intptr_t)walk); #endif #if 1 diff -Nur lilo-24.1.orig/src/geometry.h lilo-24.1/src/geometry.h --- lilo-24.1.orig/src/geometry.h 2011-06-22 16:23:40.000000000 +0900 +++ lilo-24.1/src/geometry.h 2015-11-07 21:44:33.258024092 +0900 @@ -22,7 +22,7 @@ unsigned char heads; unsigned char sectors; unsigned short cylinders; - unsigned long start; + uint32_t start; }; /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */ @@ -58,8 +58,8 @@ #define MAJOR(dev) (unsigned int)((((dev_t)(dev) >> 8) & 0xfff) | ((unsigned int) ((dev_t)(dev) >> 32) & ~0xfff)) #define MINOR(dev) (unsigned int)(((dev_t)(dev) & 0xff) | ((unsigned int) ((dev_t)(dev) >> 12) & ~0xff)) #define MKDEV(major,minor) (((minor & 0xff) | ((major & 0xfff) << 8) \ - | (((unsigned long long int) (minor & ~0xff)) << 12) \ - | (((unsigned long long int) (major & ~0xfff)) << 32))) + | (((uint64_t) (minor & ~0xff)) << 12) \ + | (((uint64_t) (major & ~0xfff)) << 32))) #else #include #ifdef major diff -Nur lilo-24.1.orig/src/lilo.c lilo-24.1/src/lilo.c --- lilo-24.1.orig/src/lilo.c 2014-10-17 09:06:46.000000000 +0900 +++ lilo-24.1/src/lilo.c 2015-11-07 21:44:33.261358988 +0900 @@ -193,11 +193,12 @@ "l=%d, ll=%d, f=%d, d=%d, ld=%d\n", MAX_IMAGES, (int)sizeof(char), (int)sizeof(short), (int)sizeof(int), - (int)sizeof(long), (int)sizeof( + (int)sizeof(int32_t), (int)sizeof( #if !__MSDOS__ - long + int64_t), +#else + int32_t), #endif /* !__MSDOS__ */ - long), (int)sizeof(float), (int)sizeof(double), (int)sizeof(long double) ); diff -Nur lilo-24.1.orig/src/lilo.h lilo-24.1/src/lilo.h --- lilo-24.1.orig/src/lilo.h 2014-10-15 17:07:20.000000000 +0900 +++ lilo-24.1/src/lilo.h 2015-11-07 21:44:33.264693884 +0900 @@ -19,7 +19,7 @@ #if !__MSDOS__ #define INT4 int #else -#define INT4 long +#define INT4 int32_t #endif /* !__MSDOS__ */ /* This is the stuff to check the configuration: diff -Nur lilo-24.1.orig/src/partition.c lilo-24.1/src/partition.c --- lilo-24.1.orig/src/partition.c 2014-10-17 06:53:29.000000000 +0900 +++ lilo-24.1/src/partition.c 2015-11-07 21:44:33.268028780 +0900 @@ -575,7 +575,7 @@ #if 1 int part_max, count, number, fd; struct partition pt [PART_MAX_MAX+1]; - long long daddr [PART_MAX_MAX+1]; + int64_t daddr [PART_MAX_MAX+1]; int modify=0; part_max = read_partitions(part, extended_pt ? PART_MAX_MAX : 0, @@ -740,7 +740,7 @@ /* partition table read */ int read_partitions(char *part, int max, int *volid, - struct partition *p, long long *where) + struct partition *p, int64_t *where) { int fd, i; unsigned int second, base; @@ -748,7 +748,7 @@ struct partition pt[PART_MAX]; BOOT_PARAMS_1 hdr; struct stat st; - long long daddr; + int64_t daddr; if ((fd=open(part,O_RDONLY))<0) die("Cannot open '%s'", part); if (fstat(fd,&st)<0) die("Cannot fstat '%s'", part); diff -Nur lilo-24.1.orig/src/partition.h lilo-24.1/src/partition.h --- lilo-24.1.orig/src/partition.h 2011-06-22 16:37:57.000000000 +0900 +++ lilo-24.1/src/partition.h 2015-11-07 21:44:33.268028780 +0900 @@ -26,10 +26,10 @@ PTW_mask=7, PTW_NTFS=8}; -#define LLSECTORSIZE ((long long)SECTOR_SIZE) +#define LLSECTORSIZE ((int64_t)SECTOR_SIZE) #if __GLIBC__ < 2 || __GLIBC_MINOR__ < 1 -typedef long long lloff_t; +typedef int64_t lloff_t; #ifdef _syscall5 lloff_t lseek64(unsigned int fd, lloff_t offs, unsigned int whence); @@ -80,7 +80,7 @@ /* Install a new MBR (Master Boot Record) */ int read_partitions(char *part, int max, int *volid, - struct partition *p, long long *where); + struct partition *p, int64_t *where); /* read all partitions & partition tables */ #endif diff -Nur lilo-24.1.orig/src/probe.c lilo-24.1/src/probe.c --- lilo-24.1.orig/src/probe.c 2013-06-07 22:08:44.000000000 +0900 +++ lilo-24.1/src/probe.c 2015-11-07 22:14:46.624494015 +0900 @@ -675,7 +675,7 @@ { 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 @@ } if (verbose>=5) { printf("\n"); - for (i=0; i= 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 diff -Nur lilo-24.1.orig/src/probe.h lilo-24.1/src/probe.h --- lilo-24.1.orig/src/probe.h 2011-06-22 16:39:55.000000000 +0900 +++ lilo-24.1/src/probe.h 2015-11-07 21:44:33.274698572 +0900 @@ -34,7 +34,7 @@ unsigned int n_cyl; unsigned int n_head; unsigned int n_sect; - long long n_sectors; + int64_t n_sectors; short n_byte; unsigned int edd_config_ptr; }; @@ -210,7 +210,7 @@ unsigned int cylinders; unsigned int heads; unsigned int sectors; - long long total_sectors; + int64_t total_sectors; unsigned short sector_size; unsigned short offset, diff -Nur lilo-24.1.orig/src/shs2.c lilo-24.1/src/shs2.c --- lilo-24.1.orig/src/shs2.c 2011-06-22 16:50:32.000000000 +0900 +++ lilo-24.1/src/shs2.c 2015-11-07 21:44:33.278033468 +0900 @@ -125,7 +125,7 @@ /* Step A. Copy the data buffer into the work buffer */ /* done */ #if SHS_DEBUG>=1 - for (i=0; i<16; i++) printf("W[%d] = %08lX\n", i, W[i]); + for (i=0; i<16; i++) printf("W[%d] = %08" PRIX32 "\n", i, W[i]); #endif /* Step B. Expand the 16 words into 64 temporary data words */