Avoid warnings. Detabified.
committer: mfx <mfx> 1131593815 +0000
This commit is contained in:
@@ -105,8 +105,8 @@ static int do_reverse_endian;
|
|||||||
} else if (sizeof(X) == 8) { \
|
} else if (sizeof(X) == 8) { \
|
||||||
__res = bswap_64((X)); \
|
__res = bswap_64((X)); \
|
||||||
} else { \
|
} else { \
|
||||||
fprintf(stderr, "%s: %s: EGET failed for size %d\n", \
|
fprintf(stderr, "%s: %s: EGET failed for size %ld\n", \
|
||||||
progname, filename, sizeof(X)); \
|
progname, filename, (long) sizeof(X)); \
|
||||||
exit(EXIT_FAILURE); \
|
exit(EXIT_FAILURE); \
|
||||||
} \
|
} \
|
||||||
__res; \
|
__res; \
|
||||||
@@ -126,8 +126,8 @@ static int do_reverse_endian;
|
|||||||
} else if (sizeof(Y) == 8) { \
|
} else if (sizeof(Y) == 8) { \
|
||||||
Y = bswap_64((uint64_t)(X)); \
|
Y = bswap_64((uint64_t)(X)); \
|
||||||
} else { \
|
} else { \
|
||||||
fprintf(stderr, "%s: %s: ESET failed for size %d\n", \
|
fprintf(stderr, "%s: %s: ESET failed for size %ld\n", \
|
||||||
progname, filename, sizeof(Y)); \
|
progname, filename, (long) sizeof(Y)); \
|
||||||
exit(EXIT_FAILURE); \
|
exit(EXIT_FAILURE); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ static int do_reverse_endian;
|
|||||||
static int readelfheader ## CLASS (int fd, Elf ## CLASS ## _Ehdr *ehdr) \
|
static int readelfheader ## CLASS (int fd, Elf ## CLASS ## _Ehdr *ehdr) \
|
||||||
{ \
|
{ \
|
||||||
if (read(fd, ((char *)ehdr)+EI_NIDENT, sizeof(*ehdr) - EI_NIDENT) \
|
if (read(fd, ((char *)ehdr)+EI_NIDENT, sizeof(*ehdr) - EI_NIDENT) \
|
||||||
!= sizeof(*ehdr) - EI_NIDENT) \
|
!= (ssize_t)sizeof(*ehdr) - EI_NIDENT) \
|
||||||
return ferr("missing or incomplete ELF header."); \
|
return ferr("missing or incomplete ELF header."); \
|
||||||
\
|
\
|
||||||
/* Verify the sizes of the ELF header and the program segment \
|
/* Verify the sizes of the ELF header and the program segment \
|
||||||
@@ -199,7 +199,7 @@ static int getmemorysize ## CLASS (Elf ## CLASS ## _Ehdr const *ehdr, \
|
|||||||
{ \
|
{ \
|
||||||
Elf ## CLASS ## _Phdr const *phdr; \
|
Elf ## CLASS ## _Phdr const *phdr; \
|
||||||
unsigned long size, n; \
|
unsigned long size, n; \
|
||||||
int i; \
|
size_t i; \
|
||||||
\
|
\
|
||||||
/* Start by setting the size to include the ELF header and the \
|
/* Start by setting the size to include the ELF header and the \
|
||||||
* complete program segment header table. \
|
* complete program segment header table. \
|
||||||
@@ -232,7 +232,7 @@ static int modifyheaders ## CLASS (Elf ## CLASS ## _Ehdr *ehdr, \
|
|||||||
unsigned long newsize) \
|
unsigned long newsize) \
|
||||||
{ \
|
{ \
|
||||||
Elf ## CLASS ## _Phdr *phdr; \
|
Elf ## CLASS ## _Phdr *phdr; \
|
||||||
int i; \
|
size_t i; \
|
||||||
\
|
\
|
||||||
/* If the section header table is gone, then remove all references \
|
/* If the section header table is gone, then remove all references \
|
||||||
* to it in the ELF header. \
|
* to it in the ELF header. \
|
||||||
@@ -275,7 +275,7 @@ static int commitchanges ## CLASS (int fd, Elf ## CLASS ## _Ehdr const *ehdr, \
|
|||||||
if (lseek(fd, 0, SEEK_SET)) \
|
if (lseek(fd, 0, SEEK_SET)) \
|
||||||
return ferr("could not rewind file"); \
|
return ferr("could not rewind file"); \
|
||||||
errno = 0; \
|
errno = 0; \
|
||||||
if (write(fd, ehdr, sizeof *ehdr) != sizeof *ehdr) \
|
if (write(fd, ehdr, sizeof *ehdr) != (ssize_t)sizeof *ehdr) \
|
||||||
return err("could not modify file"); \
|
return err("could not modify file"); \
|
||||||
\
|
\
|
||||||
/* Save the changes to the program segment header table, if any. \
|
/* Save the changes to the program segment header table, if any. \
|
||||||
|
|||||||
Reference in New Issue
Block a user