From: Alan Cox Date: Mon, 12 Jan 2015 22:12:06 +0000 (+0000) Subject: utils: some tweaks to keep cc65 happy. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d9be1a6b22fde6198046a7c2df4118bcea9ac98b;p=FUZIX.git utils: some tweaks to keep cc65 happy. --- diff --git a/Applications/util/fdisk.c b/Applications/util/fdisk.c index 4f384796..525b4f2b 100644 --- a/Applications/util/fdisk.c +++ b/Applications/util/fdisk.c @@ -316,9 +316,11 @@ void help(void) fflush(stdout); } +static unsigned char ptbl[512]; + void list_partition(char *devname) { - unsigned char ptbl[512],*partition; + unsigned char *partition; unsigned long seccnt; int i; diff --git a/Applications/util/sed.c b/Applications/util/sed.c index 2280b634..348f7475 100644 --- a/Applications/util/sed.c +++ b/Applications/util/sed.c @@ -245,7 +245,7 @@ static int bcount = 0; /* # tagged patterns in current RE */ static int eflag; /* -e option flag */ static int gflag; /* -g option flag */ -int main(int argc, char **argv); +int main(int argc, char *argv[]); static void compile(void); static int cmdcomp(char cchar); static char *rhscomp(char *rhsp, int delim); diff --git a/Applications/util/sort.c b/Applications/util/sort.c index fb1640e1..829bb324 100644 --- a/Applications/util/sort.c +++ b/Applications/util/sort.c @@ -681,10 +681,12 @@ void incr(int si, int ei) * puts it into the line1 and line2 arrays. It then calls the cmp () routine * with the field describing the arguments. */ + + int cmp_fields(char *el1, char *el2) { + static char line1[LINE_SIZE], line2[LINE_SIZE]; int i, ret; - char line1[LINE_SIZE], line2[LINE_SIZE]; for (i = 0; i < field_cnt; i++) { /* Setup line parts */ build_field(line1, &fields[i + 1], el1); @@ -1088,7 +1090,7 @@ MERGE *skip_lines(MERGE *smallest, int file_cnt) /* Uniq_lines () prints only the uniq lines out of the fd of the merg struct. */ void uniq_lines(MERGE *merg) { - char lastline[LINE_SIZE]; /* Buffer to hold last line */ + static char lastline[LINE_SIZE]; /* Buffer to hold last line */ for (;;) { put_line(merg->line); /* Print this line */ @@ -1110,7 +1112,7 @@ void uniq_lines(MERGE *merg) void check_file(int fd, char *file) { register MERGE *merg; /* 1 file only */ - char lastline[LINE_SIZE]; /* Save last line */ + static char lastline[LINE_SIZE]; /* Save last line */ register int ret; /* ret status of compare */ if (fd == 0) file = "stdin";