X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Fcvtmail.c;h=7c689b8d311908964d11527b4279c195b4577ac9;hb=c8aa261a7bf3eb1389d2e018be1d715f73cacd66;hp=768bceecbc719e8726c7adc9886f8a0f9b4b0f1f;hpb=376658ea71d16dced8acff36c3e385ac3738d868;p=chise%2Fxemacs-chise.git- diff --git a/lib-src/cvtmail.c b/lib-src/cvtmail.c index 768bcee..7c689b8 100644 --- a/lib-src/cvtmail.c +++ b/lib-src/cvtmail.c @@ -35,19 +35,14 @@ Boston, MA 02111-1307, USA. */ */ -#include <../src/config.h> +#include #include #include +#include -#if __STDC__ || defined(STDC_HEADERS) -# include -#else -char *malloc (); -char *getenv (); -#endif -static void *xmalloc (unsigned int); -static void *xrealloc (char *ptr, unsigned int); +static void *xmalloc (size_t); +static void *xrealloc (void *, size_t); static void skip_to_lf (FILE *stream); static void fatal (CONST char *s1, CONST char *s2); static void error (CONST char *s1, CONST char *s2); @@ -68,7 +63,7 @@ main (int argc, char *argv[]) char name[14]; int c; - hd = (char *) getenv ("HOME"); + hd = getenv ("HOME"); md = (char *) xmalloc (strlen (hd) + 10); strcpy (md, hd); @@ -116,8 +111,7 @@ main (int argc, char *argv[]) } static void -skip_to_lf (stream) - FILE *stream; +skip_to_lf (FILE *stream) { register int c; while ((c = getc(stream)) != '\n') @@ -125,21 +119,18 @@ skip_to_lf (stream) } static void * -xmalloc (size) - unsigned size; +xmalloc (size_t size) { - char *result = (char *) malloc (size); + void *result = malloc (size); if (!result) fatal ("virtual memory exhausted", 0); return result; } static void * -xrealloc (ptr, size) - char *ptr; - unsigned size; +xrealloc (void *ptr, size_t size) { - char *result = (char *) realloc (ptr, size); + void *result = realloc (ptr, size); if (!result) fatal ("virtual memory exhausted", 0); return result;