From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id q58AWfXc029616 for ; Fri, 8 Jun 2012 06:32:41 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id q58AWfEQ028827; Fri, 8 Jun 2012 06:32:41 -0400 (EDT) Date: Fri, 8 Jun 2012 06:32:41 -0400 (EDT) Message-Id: <201206081032.q58AWfEQ028827@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Use size_t in manpath instead of int. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 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