aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-26 21:13:07 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-26 21:13:07 +0000
commita19043c1d1a89dde89d3b31c9c330d4a3b0c9328 (patch)
treec3aec97f23a4bf02f80deb298447facac9c83ea7
parentf1dd272735279442dc54ebddfd0371d3f7ca67b9 (diff)
downloadmandoc-a19043c1d1a89dde89d3b31c9c330d4a3b0c9328.tar.gz
mandoc-a19043c1d1a89dde89d3b31c9c330d4a3b0c9328.tar.zst
mandoc-a19043c1d1a89dde89d3b31c9c330d4a3b0c9328.zip
Some small lint checks in preconv. Also add it to the default lint rule.
-rw-r--r--Makefile2
-rw-r--r--preconv.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index d9c824e1..400ef44a 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,7 @@ INDEX_OBJS = $(INDEX_MANS) \
www: index.html
-lint: llib-llibmandoc.ln llib-lmandoc.ln
+lint: llib-llibmandoc.ln llib-lmandoc.ln llib-lpreconv.ln
clean:
rm -f libmandoc.a $(LIBMANDOC_OBJS)
diff --git a/preconv.c b/preconv.c
index 59c34349..a53504ec 100644
--- a/preconv.c
+++ b/preconv.c
@@ -1,4 +1,4 @@
-/* $Id: preconv.c,v 1.3 2011/05/26 14:43:07 kristaps Exp $ */
+/* $Id: preconv.c,v 1.4 2011/05/26 21:13:07 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -137,7 +137,7 @@ conv_utf_8(const struct buf *b)
/* Quick test for big-endian value. */
- if ( ! (*((char *)(&one))))
+ if ( ! (*((const char *)(&one))))
be = 1;
for (i = b->offs; i < b->sz; i++) {
@@ -376,7 +376,7 @@ cue_enc(const struct buf *b, size_t *offs, enum enc *enc)
/* Check us against known encodings. */
- for (i = 0; i < ENC__MAX; i++) {
+ for (i = 0; i < (int)ENC__MAX; i++) {
nsz = strlen(encs[i].name);
if (phsz < nsz)
continue;
@@ -403,7 +403,7 @@ main(int argc, char *argv[])
struct buf b;
const char *fn;
enum enc enc, def;
- const char bom[3] = { 0xEF, 0xBB, 0xBF };
+ unsigned char bom[3] = { 0xEF, 0xBB, 0xBF };
size_t offs;
extern int optind;
extern char *optarg;
@@ -427,12 +427,12 @@ main(int argc, char *argv[])
case ('D'):
/* FALLTHROUGH */
case ('e'):
- for (i = 0; i < ENC__MAX; i++) {
+ for (i = 0; i < (int)ENC__MAX; i++) {
if (strcasecmp(optarg, encs[i].name))
continue;
break;
}
- if (i < ENC__MAX) {
+ if (i < (int)ENC__MAX) {
if ('D' == ch)
def = (enum enc)i;
else