|
| 1 | +diff --git a/include/wn.h b/include/wn.h |
| 2 | +index d3ffa08..8452377 100644 |
| 3 | +--- a/include/wn.h |
| 4 | ++++ b/include/wn.h |
| 5 | +@@ -151,14 +151,6 @@ |
| 6 | + #define PREDICATIVE PADJ |
| 7 | + #define IMMED_POSTNOMINAL IPADJ |
| 8 | + |
| 9 | +-extern char *wnrelease; /* WordNet release/version number */ |
| 10 | +- |
| 11 | +-extern char *lexfiles[]; /* names of lexicographer files */ |
| 12 | +-extern char *ptrtyp[]; /* pointer characters */ |
| 13 | +-extern char *partnames[]; /* POS strings */ |
| 14 | +-extern char partchars[]; /* single chars for each POS */ |
| 15 | +-extern char *adjclass[]; /* adjective class strings */ |
| 16 | +-extern char *frametext[]; /* text of verb frames */ |
| 17 | + |
| 18 | + /* Data structures used by search code functions. */ |
| 19 | + |
| 20 | +@@ -236,6 +228,21 @@ typedef struct { |
| 21 | + |
| 22 | + typedef SearchResults *SearchResultsPtr; |
| 23 | + |
| 24 | ++/* Make all the functions compatible with c++ files */ |
| 25 | ++#ifdef __cplusplus |
| 26 | ++extern "C" { |
| 27 | ++#endif |
| 28 | ++ |
| 29 | ++extern char* wnrelease; /* WordNet release/version number */ |
| 30 | ++ |
| 31 | ++extern char* lexfiles[]; /* names of lexicographer files */ |
| 32 | ++extern char* ptrtyp[]; /* pointer characters */ |
| 33 | ++extern char* partnames[]; /* POS strings */ |
| 34 | ++extern char partchars[]; /* single chars for each POS */ |
| 35 | ++extern char* adjclass[]; /* adjective class strings */ |
| 36 | ++extern char* frametext[]; /* text of verb frames */ |
| 37 | ++ |
| 38 | ++ |
| 39 | + /* Global variables and flags */ |
| 40 | + |
| 41 | + extern SearchResults wnresults; /* structure containing results of search */ |
| 42 | +@@ -271,11 +278,6 @@ extern int default_display_message(char *); |
| 43 | + extern int (*display_message)(char *); |
| 44 | + |
| 45 | + |
| 46 | +-/* Make all the functions compatible with c++ files */ |
| 47 | +-#ifdef __cplusplus |
| 48 | +-extern "C" { |
| 49 | +-#endif |
| 50 | +- |
| 51 | + /* External library function prototypes */ |
| 52 | + |
| 53 | + /*** Search and database functions (search.c) ***/ |
| 54 | +diff --git a/lib/search.c b/lib/search.c |
| 55 | +index 1cdedc3..72c4bb5 100644 |
| 56 | +--- a/lib/search.c |
| 57 | ++++ b/lib/search.c |
| 58 | +@@ -1256,7 +1256,7 @@ static void add_relatives(int pos, IndexPtr idx, int rel1, int rel2) |
| 59 | + { |
| 60 | + int i; |
| 61 | + struct relgrp *rel, *last, *r; |
| 62 | +- |
| 63 | ++ last = NULL; |
| 64 | + /* If either of the new relatives are already in a relative group, |
| 65 | + then add the other to the existing group (transitivity). |
| 66 | + Otherwise create a new group and add these 2 senses to it. */ |
| 67 | +@@ -1281,8 +1281,9 @@ static void add_relatives(int pos, IndexPtr idx, int rel1, int rel2) |
| 68 | + rel->senses[rel1] = rel->senses[rel2] = 1; |
| 69 | + if (rellist == NULL) |
| 70 | + rellist = rel; |
| 71 | +- else |
| 72 | +- last->next = rel; |
| 73 | ++ else if (last) { |
| 74 | ++ last->next = rel; |
| 75 | ++ } |
| 76 | + } |
| 77 | + |
| 78 | + static struct relgrp *mkrellist(void) |
0 commit comments