source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Some small lint checks in preconv.
Date: Thu, 26 May 2011 17:13:07 -0400 (EDT)	[thread overview]
Message-ID: <201105262113.p4QLD7mO021833@krisdoz.my.domain> (raw)

Log Message:
-----------
Some small lint checks in preconv.  Also add it to the default lint rule.

Modified Files:
--------------
    mdocml:
        Makefile
        preconv.c

Revision Data
-------------
Index: Makefile
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/Makefile,v
retrieving revision 1.347
retrieving revision 1.348
diff -LMakefile -LMakefile -u -p -r1.347 -r1.348
--- Makefile
+++ 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)
Index: preconv.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/preconv.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lpreconv.c -Lpreconv.c -u -p -r1.3 -r1.4
--- preconv.c
+++ preconv.c
@@ -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 *off
 
 		/* 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
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2011-05-26 21:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201105262113.p4QLD7mO021833@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).