diff options
Diffstat (limited to 'textproc/wordnet/files/patch-ah')
-rw-r--r-- | textproc/wordnet/files/patch-ah | 134 |
1 files changed, 123 insertions, 11 deletions
diff --git a/textproc/wordnet/files/patch-ah b/textproc/wordnet/files/patch-ah index 2484129a1df5..49db3aae93f3 100644 --- a/textproc/wordnet/files/patch-ah +++ b/textproc/wordnet/files/patch-ah @@ -1,12 +1,30 @@ ---- src/lib/morph.c Tue Jul 15 10:41:55 2003 -+++ src/lib/morph.c Tue Feb 17 15:50:51 2004 -@@ -45,27 +45,28 @@ +--- lib/morph.c Fri May 6 13:17:39 2005 ++++ lib/morph.c Tue Dec 20 23:21:44 2005 +@@ -19,7 +19,7 @@ + #endif + +-static char *Id = "$Id: morph.c,v 1.66 2005/03/18 18:14:24 wn Exp $"; ++__FBSDID("$Id: morph.c,v 1.66 2005/03/18 18:14:24 wn Exp $"); + +-static char *sufx[] ={ ++static const char *sufx[] ={ + /* Noun suffixes */ + "s", "ses", "xes", "zes", "ches", "shes", "men", "ies", +@@ -30,5 +30,5 @@ + }; + +-static char *addr[] ={ ++static const char *addr[] ={ + /* Noun endings */ + "", "s", "x", "z", "ch", "sh", "man", "y", +@@ -43,35 +43,36 @@ static char msgbuf[256]; -#define NUMPREPS 15 static struct { - char *str; +- char *str; ++ const char *str; int strlen; -} prepositions[NUMPREPS] = { - "to", 2, @@ -46,7 +64,41 @@ + static FILE *exc_fps[NUMPARTS + 1]; -@@ -207,5 +208,6 @@ +-static int do_init(); +-static int strend(char *, char *); +-static char *wordbase(char *, int); +-static int hasprep(char *, int); +-static char *exc_lookup(char *, int); +-static char *morphprep(char *); ++static int do_init(void); ++static int strend(const char *, const char *); ++static const char *wordbase(const char *, int); ++static int hasprep(const char *, unsigned int); ++static const char *exc_lookup(const char *, int); ++static const char *morphprep(const char *); + + /* Open exception list files */ +@@ -167,13 +168,15 @@ + with NULL argument return additional baseforms for original string. */ + +-char *morphstr(char *origstr, int pos) ++const char * ++morphstr(const char *origstr, int pos) + { + static char searchstr[WORDBUF], str[WORDBUF]; + static int svcnt, svprep; +- char word[WORDBUF], *tmp; ++ char word[WORDBUF]; ++ const char *tmp; + int cnt, st_idx = 0, end_idx; + int prep; +- char *end_idx1, *end_idx2; +- char *append; ++ const char *end_idx1, *end_idx2; ++ const char *append; + + if (pos == SATELLITE) +@@ -230,5 +233,6 @@ strncpy(word, str + st_idx, end_idx - st_idx); word[end_idx - st_idx] = '\0'; - if(tmp = morphword(word, pos)) @@ -54,7 +106,7 @@ + if(tmp) strcat(searchstr,tmp); else -@@ -215,5 +217,6 @@ +@@ -238,5 +242,6 @@ } - if(tmp = morphword(strcpy(word, str + st_idx), pos)) @@ -62,21 +114,81 @@ + if(tmp) strcat(searchstr,tmp); else -@@ -248,6 +251,5 @@ - char *tmp, tmpbuf[WORDBUF], *end; +@@ -264,13 +269,14 @@ + + /* Try to find baseform (lemma) of individual word in POS */ +-char *morphword(char *word, int pos) ++const char * ++morphword(const char *word, int pos) + { + int offset, cnt; + int i; + static char retval[WORDBUF]; +- char *tmp, tmpbuf[WORDBUF], *end; ++ char tmpbuf[WORDBUF]; ++ const char *tmp, *end; - sprintf(retval,""); - sprintf(tmpbuf, ""); + retval[0] = tmpbuf[0] = '\0'; end = ""; -@@ -343,5 +345,4 @@ +@@ -315,7 +321,7 @@ + } + +-static int strend(char *str1, char *str2) ++static int strend(const char *str1, const char *str2) + { +- char *pt1; ++ const char *pt1; + + if(strlen(str2) >= strlen(str1)) +@@ -329,5 +335,6 @@ + } + +-static char *wordbase(char *word, int ender) ++static const char * ++wordbase(const char *word, int ender) + { + char *pt1; +@@ -344,10 +351,10 @@ + } + +-static int hasprep(char *s, int wdcnt) ++static int hasprep(const char *s, unsigned int wdcnt) + { + /* Find a preposition in the verb string and return its + corresponding word number. */ + +- int i, wdnum; ++ unsigned int i, wdnum; + + for (wdnum = 2; wdnum <= wdcnt; wdnum++) { +@@ -362,9 +369,9 @@ + } + +-static char *exc_lookup(char *word, int pos) ++static const char * ++exc_lookup(const char *word, int pos) + { static char line[WORDBUF], *beglp, *endlp; - char *excline; +- char *excline; - int found = 0; ++ const char *excline; if (exc_fps[pos] == NULL) -@@ -385,5 +386,6 @@ +@@ -394,7 +401,8 @@ + } + +-static char *morphprep(char *s) ++static const char * ++morphprep(const char *s) + { +- char *rest, *exc_word, *lastwd = NULL, *last; ++ const char *rest, *exc_word, *lastwd = NULL, *last; + int i, offset, cnt; + char word[WORDBUF], end[WORDBUF]; +@@ -408,5 +416,6 @@ last = strrchr(s, '_'); if (rest != last) { /* more than 2 words */ - if (lastwd = morphword(last + 1, NOUN)) { |