pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/focal Pass -Wall; fix Solaris and Linux build by ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8617984efd94
branches:  trunk
changeset: 604494:8617984efd94
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Thu May 31 23:37:57 2012 +0000

description:
Pass -Wall; fix Solaris and Linux build by not trying to use ->d_namlen
in struct dirent. There's no need to.

diffstat:

 lang/focal/distinfo               |  10 ++-
 lang/focal/patches/patch-aa       |  86 ++++++++++++++++++++++++++++++++++++++-
 lang/focal/patches/patch-ab       |  17 ++++++-
 lang/focal/patches/patch-ac       |   4 +-
 lang/focal/patches/patch-focal1_c |  24 ++++++++++
 lang/focal/patches/patch-focal3_c |  66 +++++++++++++++++++++++++++++
 6 files changed, 198 insertions(+), 9 deletions(-)

diffs (265 lines):

diff -r 950bd01078b1 -r 8617984efd94 lang/focal/distinfo
--- a/lang/focal/distinfo       Thu May 31 23:15:07 2012 +0000
+++ b/lang/focal/distinfo       Thu May 31 23:37:57 2012 +0000
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.4 2010/04/29 00:22:02 dholland Exp $
+$NetBSD: distinfo,v 1.5 2012/05/31 23:37:57 dholland Exp $
 
 SHA1 (focal.tar.gz) = 704d1411365085fb47ff25c1a77ae1f8e7fa601e
 RMD160 (focal.tar.gz) = 6b06cc08b2761035c315ae13b80d64a5e7a6004b
 Size (focal.tar.gz) = 12561 bytes
-SHA1 (patch-aa) = 632a2ff83f744865a154712ce31092e1435af6f2
-SHA1 (patch-ab) = b2795472241ef1d1cc554e7c13bf35dc4b39b330
-SHA1 (patch-ac) = 17d1d5e2895d45c76782dfa79b97f583efa5346d
+SHA1 (patch-aa) = 9e761e135665dad02b8cc700d80bf4eba69a0e7d
+SHA1 (patch-ab) = b4f0c53188dc67fa890da6093d5d5431df3b7efc
+SHA1 (patch-ac) = b56fe36efbcb15f6a5454943a40871683d0c1e0a
+SHA1 (patch-focal1_c) = 3957cde40ea86a218aea8411623d4bd033df9dbe
+SHA1 (patch-focal3_c) = 1624c53612707f71f628a74bf6bc186bfff0f96b
diff -r 950bd01078b1 -r 8617984efd94 lang/focal/patches/patch-aa
--- a/lang/focal/patches/patch-aa       Thu May 31 23:15:07 2012 +0000
+++ b/lang/focal/patches/patch-aa       Thu May 31 23:37:57 2012 +0000
@@ -1,4 +1,11 @@
-$NetBSD: patch-aa,v 1.2 2010/04/29 00:22:02 dholland Exp $
+$NetBSD: patch-aa,v 1.3 2012/05/31 23:37:57 dholland Exp $
+
+- place a big comment within a comment (just within a false ifdef is
+not sufficient)
+- do not use gets()
+- use ctype.h functions correctly
+- avoid symbol conflict with getline()
+- don't use implicit int
 
 --- focal0.c.orig      1995-04-17 13:03:43.000000000 +0000
 +++ focal0.c
@@ -18,7 +25,59 @@
  
  #include      "focal.h"
  #ifdef        vms
-@@ -649,7 +651,7 @@ register int       c;
+@@ -66,6 +68,24 @@ int intflag;                        /* Interrupt flag */
+ 
+ struct        sym     *sym[N_HASH + 1];       /* Symbol table */
+ 
++static char *
++dogets(char *buf, size_t len)
++{
++      char *ret;
++
++      ret = fgets(buf, len, stdin);
++      if (ret != NULL) {
++              len = strlen(buf);
++              if (len > 0 && buf[len-1] == '\n') {
++                      buf[--len] = '\0';
++              }
++              if (len > 0 && buf[len-1] == '\r') {
++                      buf[--len] = '\0';
++              }
++      }
++      return ret;
++}
++
+ int main()
+ {
+       register int    c;
+@@ -86,7 +106,7 @@ int main()
+       catchcc();
+       for (;;) {
+               putchar('*');
+-              if (gets(cbuf) == NULL) {
++              if (dogets(cbuf, sizeof(cbuf)) == NULL) {
+                       putchar('\n');
+                       break;
+               }
+@@ -205,7 +225,7 @@ loop:
+                       popdo();
+               goto loop;
+       }
+-      while (isalpha(*ctp))
++      while (isalpha((unsigned char)*ctp))
+               ++ctp;
+       if (isupper(c))
+               c = tolower(c);
+@@ -427,7 +447,7 @@ void ask()
+               --ctp;
+               sp = getsym();
+               printf(": ");
+-              if (gets(abuf) == NULL) {
++              if (dogets(abuf, sizeof(abuf)) == NULL) {
+                       putchar('\n');
+                       diag("EOF in ask");
+               }
+@@ -649,11 +669,11 @@ register int     c;
  }
  
  
@@ -27,3 +86,26 @@
  register char *cp;
  register FILE *fp;
  {
+-      register c;
++      register int c;
+ 
+       while ((c=getc(fp))!=EOF && c!='\n')
+               *cp++ = c;
+@@ -667,7 +687,7 @@ register FILE *fp;
+ void type()
+ {
+       register char *fmt;
+-      register c;
++      register int c;
+ static        char fmtb[20];
+ static        int ifmtb = 1;
+       int x, y;
+@@ -724,7 +744,7 @@ FILE *fp;
+ {
+       struct lno lno;
+       register struct line *lp;
+-      register tgroup, lgroup;
++      register int tgroup, lgroup;
+ 
+       if (lnop == NULL) {
+               lno.ln_type = LN_ALL;
diff -r 950bd01078b1 -r 8617984efd94 lang/focal/patches/patch-ab
--- a/lang/focal/patches/patch-ab       Thu May 31 23:15:07 2012 +0000
+++ b/lang/focal/patches/patch-ab       Thu May 31 23:37:57 2012 +0000
@@ -1,7 +1,20 @@
-$NetBSD: patch-ab,v 1.2 2010/04/29 00:22:02 dholland Exp $
+$NetBSD: patch-ab,v 1.3 2012/05/31 23:37:57 dholland Exp $
+
+- use ctype.h functions correctly
+- avoid symbol name conflict with getline()
+- the name in struct dirent is null-terminated, don't try to bound it
 
 --- focal2.c.orig      1995-04-17 13:03:46.000000000 +0000
 +++ focal2.c
+@@ -49,7 +49,7 @@ void library()
+       c = getnb();
+       if (c!='c' && c!='s' && c!='l' && c!='d')
+               diag("Bad library command");
+-      while (isalpha(*ctp))
++      while (isalpha((unsigned char)*ctp))
+               ++ctp;
+       while ((d = *ctp)==' ' || d=='\t')
+               ++ctp;
 @@ -71,7 +71,7 @@ void library()
                }
                line = NULL;
@@ -16,7 +29,7 @@
                            ||  strcmp(de->d_name, "..") == 0)
                                continue;
 -                      printf("%.*s\n", de->d_reclen, de->d_name);
-+                      printf("%.*s\n", de->d_namlen, de->d_name);
++                      printf("%s\n", de->d_name);
                }
                closedir(dp);
  #else
diff -r 950bd01078b1 -r 8617984efd94 lang/focal/patches/patch-ac
--- a/lang/focal/patches/patch-ac       Thu May 31 23:15:07 2012 +0000
+++ b/lang/focal/patches/patch-ac       Thu May 31 23:37:57 2012 +0000
@@ -1,4 +1,6 @@
-$NetBSD: patch-ac,v 1.1 2010/04/29 00:22:02 dholland Exp $
+$NetBSD: patch-ac,v 1.2 2012/05/31 23:37:57 dholland Exp $
+
+- avoid symbol name conflict with getline()
 
 --- proto.h~   1995-04-17 13:03:41.000000000 +0000
 +++ proto.h
diff -r 950bd01078b1 -r 8617984efd94 lang/focal/patches/patch-focal1_c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/focal/patches/patch-focal1_c Thu May 31 23:37:57 2012 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-focal1_c,v 1.1 2012/05/31 23:37:57 dholland Exp $
+
+- don't use implicit int
+
+--- focal1.c~  1995-04-17 13:03:45.000000000 +0000
++++ focal1.c
+@@ -146,7 +146,7 @@ term()
+ struct        sym *
+ lookup(id, type, subs)
+ char *id;
+-register type;
++register int type;
+ int   subs;
+ {
+       register struct sym *sp;
+@@ -167,7 +167,7 @@ int        subs;
+ struct sym *
+ getsym()
+ {
+-      register c;
++      register int c;
+       char id[NID];
+       register char *cp;
+       register struct sym *sp;
diff -r 950bd01078b1 -r 8617984efd94 lang/focal/patches/patch-focal3_c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/focal/patches/patch-focal3_c Thu May 31 23:37:57 2012 +0000
@@ -0,0 +1,66 @@
+$NetBSD: patch-focal3_c,v 1.1 2012/05/31 23:37:57 dholland Exp $
+
+- don't use implicit int
+- use ctype.h functions correctly
+- fix accidental use of bitwise or in logical comparison
+- return characters 0..255 from getnb() to avoid incorrect calls to
+ctype.h functions elsewhere
+
+--- focal3.c~  1995-04-17 13:03:47.000000000 +0000
++++ focal3.c
+@@ -29,9 +29,9 @@ FILE *fp;
+  */
+ void getlno(lnop, c)
+ register struct lno *lnop;
+-register c;
++register int c;
+ {
+-      register gn, ln;
++      register int gn, ln;
+       static char badlno[] = "Bad line or group number";
+ 
+       if (c < 0)
+@@ -42,7 +42,7 @@ register c;
+               return;
+       }
+       if (c=='A' || c=='a') {
+-              while (isalpha(*ctp))
++              while (isalpha((unsigned char)*ctp))
+                       ++ctp;
+               lnop->ln_type = LN_ALL;
+               return;
+@@ -64,7 +64,7 @@ register c;
+               lnop->ln_type = LN_GRP;
+               return;
+       }
+-      if (ln<1 | ln>99)
++      if (ln<1 || ln>99)
+               diag(badlno);
+       lnop->ln_gno = gn;
+       lnop->ln_lno = ln;
+@@ -78,9 +78,9 @@ register c;
+  * Return the number read.
+  */
+ int getnum(c)
+-register c;
++register int c;
+ {
+-      register n;
++      register int n;
+ 
+       n = 0;
+       while (isdigit(c)) {
+@@ -152,11 +152,11 @@ char *s;
+  */
+ int getnb()
+ {
+-      register c;
++      register int c;
+ 
+       while ((c = *ctp++)==' ' || c=='\t')
+               ;
+-      return (c);
++      return ((int)(unsigned char)c);
+ }
+ /*
+  * drand48



Home | Main Index | Thread Index | Old Index