From 125da48747d2793c4e92e1d644b9da3a95998960 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Tue, 13 Aug 2002 07:12:00 +0000 Subject: [PATCH] fix warnings --- utility/hogcreate.c | 21 ++++++++++++--------- utility/hogextract.c | 9 ++++++--- utility/txb2txt.c | 6 ++++-- utility/txt2txb.c | 6 ++++-- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/utility/hogcreate.c b/utility/hogcreate.c index c0e9a840..6d004b5a 100644 --- a/utility/hogcreate.c +++ b/utility/hogcreate.c @@ -3,19 +3,20 @@ * I grant this program to public domain. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -void +int main(int argc, char *argv[]) { FILE *hogfile, *readfile; DIR *dp; struct dirent *ep; - int fp, len, fseekret = 0; char filename[13]; char *buf; struct stat statbuf; @@ -33,11 +34,11 @@ main(int argc, char *argv[]) free(buf); dp = opendir("./"); if (dp != NULL) { - while (ep = readdir(dp)) { + while ((ep = readdir(dp))) { strcpy(filename, ep->d_name); stat(filename, &statbuf); if(! S_ISDIR(statbuf.st_mode)) { - printf("Filename: %s \tLength: %i\n", filename, statbuf.st_size); + printf("Filename: %s \tLength: %i\n", filename, (int)statbuf.st_size); readfile = fopen(filename, "r"); buf = (char *)malloc(statbuf.st_size); if (buf == NULL) { @@ -55,4 +56,6 @@ main(int argc, char *argv[]) closedir(dp); } fclose(hogfile); + + return 0; } diff --git a/utility/hogextract.c b/utility/hogextract.c index bd033489..eeef59a0 100644 --- a/utility/hogextract.c +++ b/utility/hogextract.c @@ -4,15 +4,16 @@ */ #include +#include #include #include #include -void +int main(int argc, char *argv[]) { FILE *hogfile, *writefile; - int fp, len, fseekret=0; + int len; char filename[13]; char *buf; struct stat statbuf; @@ -24,7 +25,7 @@ main(int argc, char *argv[]) } hogfile = fopen(argv[1], "r"); stat(argv[1], &statbuf); - printf("%i\n", statbuf.st_size); + printf("%i\n", (int)statbuf.st_size); buf = (char *)malloc(3); fread(buf, 3, 1, hogfile); printf("Extracting from: %s\n", argv[1]); @@ -45,4 +46,6 @@ main(int argc, char *argv[]) } } fclose(hogfile); + + return 0; } diff --git a/utility/txb2txt.c b/utility/txb2txt.c index d4e26430..9463ccc2 100755 --- a/utility/txb2txt.c +++ b/utility/txb2txt.c @@ -1,10 +1,10 @@ #include -void +int main(int argc, char *argv[]) { FILE *file, *outfile; - char equals, ch; + char ch; int code; if (argc != 3) { @@ -39,4 +39,6 @@ main(int argc, char *argv[]) fclose(outfile); fclose(file); + + return 0; } diff --git a/utility/txt2txb.c b/utility/txt2txb.c index b5b71326..80c7dad1 100755 --- a/utility/txt2txb.c +++ b/utility/txt2txb.c @@ -1,10 +1,10 @@ #include -void +int main(int argc, char *argv[]) { FILE *file, *outfile; - char equals, ch; + char ch; int code; if (argc != 3) { @@ -43,4 +43,6 @@ main(int argc, char *argv[]) fclose(outfile); fclose(file); + + return 0; } -- 2.39.2