diff options
author | dholland <dholland@pkgsrc.org> | 2012-05-31 23:37:57 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2012-05-31 23:37:57 +0000 |
commit | 93879b8b68816125307b7a94de49aa44d74fa1e6 (patch) | |
tree | 348fc24cc785d5e818fb1e982d35b442764462c5 | |
parent | 6426ed1474d42660ce348cece4f6dc5baf501547 (diff) | |
download | pkgsrc-93879b8b68816125307b7a94de49aa44d74fa1e6.tar.gz |
Pass -Wall; fix Solaris and Linux build by not trying to use ->d_namlen
in struct dirent. There's no need to.
-rw-r--r-- | lang/focal/distinfo | 10 | ||||
-rw-r--r-- | lang/focal/patches/patch-aa | 86 | ||||
-rw-r--r-- | lang/focal/patches/patch-ab | 17 | ||||
-rw-r--r-- | lang/focal/patches/patch-ac | 4 | ||||
-rw-r--r-- | lang/focal/patches/patch-focal1_c | 24 | ||||
-rw-r--r-- | lang/focal/patches/patch-focal3_c | 66 |
6 files changed, 198 insertions, 9 deletions
diff --git a/lang/focal/distinfo b/lang/focal/distinfo index 788687d4b3c..15d4dd04f7f 100644 --- a/lang/focal/distinfo +++ b/lang/focal/distinfo @@ -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 --git a/lang/focal/patches/patch-aa b/lang/focal/patches/patch-aa index 66f4c973e38..63257ca70da 100644 --- a/lang/focal/patches/patch-aa +++ b/lang/focal/patches/patch-aa @@ -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 @@ $NetBSD: patch-aa,v 1.2 2010/04/29 00:22:02 dholland Exp $ #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 @@ $NetBSD: patch-aa,v 1.2 2010/04/29 00:22:02 dholland Exp $ 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 --git a/lang/focal/patches/patch-ab b/lang/focal/patches/patch-ab index 18e2eeec29e..2b06579f476 100644 --- a/lang/focal/patches/patch-ab +++ b/lang/focal/patches/patch-ab @@ -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 @@ $NetBSD: patch-ab,v 1.2 2010/04/29 00:22:02 dholland Exp $ || 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 --git a/lang/focal/patches/patch-ac b/lang/focal/patches/patch-ac index 1b79e633cf0..5a0cdf4c7be 100644 --- a/lang/focal/patches/patch-ac +++ b/lang/focal/patches/patch-ac @@ -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 --git a/lang/focal/patches/patch-focal1_c b/lang/focal/patches/patch-focal1_c new file mode 100644 index 00000000000..8031d404db3 --- /dev/null +++ b/lang/focal/patches/patch-focal1_c @@ -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 --git a/lang/focal/patches/patch-focal3_c b/lang/focal/patches/patch-focal3_c new file mode 100644 index 00000000000..86118cbee81 --- /dev/null +++ b/lang/focal/patches/patch-focal3_c @@ -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 |