Mercurial > hg > xemacs-beta
comparison src/unexcw.c @ 1685:29c45c1b64f3
[xemacs-hg @ 2003-09-15 21:19:11 by james]
Quiet compiler warnings on Cygwin.
author | james |
---|---|
date | Mon, 15 Sep 2003 21:19:17 +0000 |
parents | c1e69bcf8d07 |
children | 04bc9d2f42c7 |
comparison
equal
deleted
inserted
replaced
1684:fba0799e2d79 | 1685:29c45c1b64f3 |
---|---|
82 int sections_reversed = 0; | 82 int sections_reversed = 0; |
83 FILHDR f_hdr; | 83 FILHDR f_hdr; |
84 PEAOUTHDR f_ohdr; | 84 PEAOUTHDR f_ohdr; |
85 SCNHDR f_data, f_bss, f_text, f_nextdata; | 85 SCNHDR f_data, f_bss, f_text, f_nextdata; |
86 | 86 |
87 #define CHECK_AOUT_POS(a) \ | 87 #define CHECK_AOUT_POS(a) \ |
88 do { \ | 88 do { \ |
89 if (lseek (a_out, 0, SEEK_CUR) != a) \ | 89 if (lseek (a_out, 0, SEEK_CUR) != a) \ |
90 { \ | 90 { \ |
91 printf ("we are at %lx, should be at %lx\n", \ | 91 printf ("we are at %lx, should be at %lx\n", \ |
92 lseek (a_out, 0, SEEK_CUR), a); \ | 92 (unsigned long) lseek (a_out, 0, SEEK_CUR), \ |
93 exit (-1); \ | 93 (unsigned long) (a)); \ |
94 } \ | 94 exit (-1); \ |
95 } \ | |
95 } while (0) | 96 } while (0) |
96 | 97 |
97 /* Dump out .data and .bss sections into a new executable. */ | 98 /* Dump out .data and .bss sections into a new executable. */ |
98 int | 99 int |
99 unexec (char *out_name, char *in_name, uintptr_t start_data, | 100 unexec (char *out_name, char *in_name, uintptr_t start_data, |
438 PERROR ("failed to write bss section"); | 439 PERROR ("failed to write bss section"); |
439 free (empty_space); | 440 free (empty_space); |
440 if (lseek (a_new, 0, SEEK_CUR) != (long) f_nextdata.s_scnptr) | 441 if (lseek (a_new, 0, SEEK_CUR) != (long) f_nextdata.s_scnptr) |
441 { | 442 { |
442 printf ("at %lx should be at %lx\n", | 443 printf ("at %lx should be at %lx\n", |
443 lseek (a_new, 0, SEEK_CUR), | 444 (unsigned long) lseek (a_new, 0, SEEK_CUR), |
444 f_nextdata.s_scnptr); | 445 (unsigned long) f_nextdata.s_scnptr); |
445 PERROR ("file positioning error\n"); | 446 PERROR ("file positioning error\n"); |
446 } | 447 } |
447 lseek (a_out, f_nextdata_s_scnptr, SEEK_SET); | 448 lseek (a_out, f_nextdata_s_scnptr, SEEK_SET); |
448 } | 449 } |
449 | 450 |