diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2002-03-30 17:10:20 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2002-03-30 17:10:20 +0000 |
commit | 99e772806a36ae098c6182c10930a22d0e294773 (patch) | |
tree | 1711f44fbf118a1272386226ffd60f4cc94cc20c /usr.bin/indent/io.c | |
parent | 02ab2c827dc5bab7d906f77bfdbb34f353f214aa (diff) | |
download | FreeBSD-src-99e772806a36ae098c6182c10930a22d0e294773.zip FreeBSD-src-99e772806a36ae098c6182c10930a22d0e294773.tar.gz |
1) Const enough things to avoid warnings.
2) Cast ifdef_level to a size_t before comparing it to a ratio of size_ts.
Ifdef_level should always be positive.
3) Complete prototype for chfont.
4) Cast some ptrdiff_ts to ints before using as a field width.
5) Avoid shadowing a local variable p with another local variable p.
Diffstat (limited to 'usr.bin/indent/io.c')
-rw-r--r-- | usr.bin/indent/io.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c index b8f7a56..ce8a9f5 100644 --- a/usr.bin/indent/io.c +++ b/usr.bin/indent/io.c @@ -126,9 +126,9 @@ dump_line(void) s++; if (s < e_lab) fprintf(output, s[0]=='/' && s[1]=='*' ? "\t%.*s" : "\t/* %.*s */", - e_lab - s, s); + (int)(e_lab - s), s); } - else fprintf(output, "%.*s", e_lab - s_lab, s_lab); + else fprintf(output, "%.*s", (int)(e_lab - s_lab), s_lab); cur_col = count_spaces(cur_col, s_lab); } else @@ -539,7 +539,7 @@ count_spaces(int current, char *buffer) int found_err; void -diag4(int level, char *msg, int a, int b) +diag4(int level, const char *msg, int a, int b) { if (level) found_err = 1; @@ -556,7 +556,7 @@ diag4(int level, char *msg, int a, int b) } void -diag3(int level, char *msg, int a) +diag3(int level, const char *msg, int a) { if (level) found_err = 1; @@ -573,7 +573,7 @@ diag3(int level, char *msg, int a) } void -diag2(int level, char *msg) +diag2(int level, const char *msg) { if (level) found_err = 1; @@ -627,9 +627,9 @@ chfont(struct fstate *of, struct fstate *nf, char *s) } void -parsefont(struct fstate *f, char *s0) +parsefont(struct fstate *f, const char *s0) { - register char *s = s0; + const char *s = s0; int sizedelta = 0; bzero(f, sizeof *f); |