From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Use size_t in manpath instead of int.
Date: Fri, 8 Jun 2012 06:32:41 -0400 (EDT) [thread overview]
Message-ID: <201206081032.q58AWfEQ028827@krisdoz.my.domain> (raw)
Log Message:
-----------
Use size_t in manpath instead of int.
Modified Files:
--------------
mdocml:
manpath.c
manpath.h
Revision Data
-------------
Index: manpath.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/manpath.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lmanpath.h -Lmanpath.h -u -p -r1.5 -r1.6
--- manpath.h
+++ manpath.h
@@ -23,7 +23,7 @@
* databases.
*/
struct manpaths {
- int sz;
+ size_t sz;
char **paths;
};
Index: manpath.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/manpath.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -Lmanpath.c -Lmanpath.c -u -p -r1.8 -r1.9
--- manpath.c
+++ manpath.c
@@ -74,7 +74,7 @@ manpath_parse(struct manpaths *dirs, con
do {
buf = mandoc_realloc(buf, bsz + 1024);
- sz = fread(buf + (int)bsz, 1, 1024, stream);
+ sz = fread(buf + bsz, 1, 1024, stream);
bsz += sz;
} while (sz > 0);
@@ -117,7 +117,7 @@ manpath_parse(struct manpaths *dirs, con
}
/* Append man.conf(5) to MANPATH. */
- if (':' == defp[(int)strlen(defp) - 1]) {
+ if (':' == defp[strlen(defp) - 1]) {
manpath_parseline(dirs, defp);
manpath_manconf(dirs, file);
return;
@@ -162,7 +162,7 @@ manpath_add(struct manpaths *dirs, const
{
char buf[PATH_MAX];
char *cp;
- int i;
+ size_t i;
if (NULL == (cp = realpath(dir, buf)))
return;
@@ -173,7 +173,7 @@ manpath_add(struct manpaths *dirs, const
dirs->paths = mandoc_realloc
(dirs->paths,
- ((size_t)dirs->sz + 1) * sizeof(char *));
+ (dirs->sz + 1) * sizeof(char *));
dirs->paths[dirs->sz++] = mandoc_strdup(cp);
}
@@ -181,7 +181,7 @@ manpath_add(struct manpaths *dirs, const
void
manpath_free(struct manpaths *p)
{
- int i;
+ size_t i;
for (i = 0; i < p->sz; i++)
free(p->paths[i]);
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2012-06-08 10:32 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=201206081032.q58AWfEQ028827@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).