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

Re: Problems with tcl-8.0.5



On Thu, Aug 19, 1999 at 11:52:59AM +0200, Andreas Tille wrote:
> More information about the problem could befound in the debian-devel
> archive as well as in the bug repository Bug#43009.
> 
> May be the problem is in the TCL package.  I really have o clue about
> TCL/TK and I'm not able to fix the problem.

The problem is with the wordnet Tcl extension because it was written
for Tcl 7.6.  The attached patch fixes the obvious problems, but there
could very well be others.

David
-- 
David Engel
dlengel@home.com
--- stubs.c.orig	Thu Aug 19 11:45:49 1999
+++ stubs.c	Thu Aug 19 11:58:52 1999
@@ -41,8 +41,7 @@
    char *morph;
    int pos;
    if (argc != 3) {
-      interp -> result = 
-         "usage: findvalidsearches searchword partofspeechnum";
+      Tcl_SetResult(interp, "usage: findvalidsearches searchword partofspeechnum", TCL_STATIC);
       return TCL_ERROR;
    }
    pos = atoi (argv[2]);
@@ -53,7 +52,7 @@
       } while ((morph = morphstr (NULL, pos)) != NULL);
    }
    sprintf (bitfieldstr, "%u", bitfield);
-   interp -> result = bitfieldstr;
+   Tcl_SetResult(interp, bitfieldstr, TCL_VOLATILE);
    return TCL_OK;
 }
 
@@ -70,13 +69,13 @@
    char bitfieldstr[32];
    int whichbit;
    if (argc != 2) {
-      interp -> result = "usage: bit bitnum";
+      Tcl_SetResult(interp, "usage: bit bitnum", TCL_STATIC);
       return TCL_ERROR;
    }
    whichbit = atoi (argv[1]);
    bitfield = bit (whichbit);
    sprintf (bitfieldstr, "%u", bitfield);
-   interp -> result = bitfieldstr;
+   Tcl_SetResult(interp, bitfieldstr, TCL_VOLATILE);
    return TCL_OK;
 } 
 
@@ -90,8 +89,7 @@
    int pos, searchtype, sense;
    char *morph;
    if (argc != 5) {
-      interp -> result = 
-         "usage: search searchword partofspeechnum searchtypenum sensenum";
+      Tcl_SetResult(interp, "usage: search searchword partofspeechnum searchtypenum sensenum", TCL_STATIC);
       return TCL_ERROR;
    }
    pos = atoi (argv[2]);
@@ -103,7 +101,7 @@
          strcat (resultbuf, findtheinfo (morph, pos, searchtype, sense));
       } while ((morph = morphstr (NULL, pos)) != NULL);
    }
-   interp -> result = resultbuf;
+   Tcl_SetResult(interp, resultbuf, TCL_VOLATILE);
    return TCL_OK;
 }
 
@@ -115,7 +113,7 @@
 int wn_glosses (ClientData clientData, Tcl_Interp *interp,
    int argc, char *argv[]) {
    if (argc != 2) {
-      interp -> result = "usage: glosses [1 | 0]";
+      Tcl_SetResult(interp, "usage: glosses [1 | 0]", TCL_STATIC);
       return TCL_ERROR;
    }
    dflag = atoi (argv[1]);
@@ -130,7 +128,7 @@
 int wn_fileinfo (ClientData clientData, Tcl_Interp *interp,
    int argc, char *argv[]) {
    if (argc != 2) {
-      interp -> result = "usage: fileinfo [1 | 0]";
+      Tcl_SetResult(interp, "usage: fileinfo [1 | 0]", TCL_STATIC);
       return TCL_ERROR;
    }
    fileinfoflag = atoi (argv[1]);
@@ -145,7 +143,7 @@
 int wn_byteoffset (ClientData clientData, Tcl_Interp *interp,
    int argc, char *argv[]) {
    if (argc != 2) {
-      interp -> result = "usage: byteoffset [1 | 0]";
+      Tcl_SetResult(interp, "usage: byteoffset [1 | 0]", TCL_STATIC);
       return TCL_ERROR;
    }
    offsetflag = atoi (argv[1]);
@@ -160,7 +158,7 @@
 int wn_senseflag (ClientData clientData, Tcl_Interp *interp,
    int argc, char *argv[]) {
    if (argc != 2) {
-      interp -> result = "usage: senseflag [1 | 0]";
+      Tcl_SetResult(interp, "usage: senseflag [1 | 0]", TCL_STATIC);
       return TCL_ERROR;
    }
    wnsnsflag = atoi (argv[1]);
@@ -176,12 +174,12 @@
    int argc, char *argv[]) {
    int pos, searchtype;
    if (argc != 3) {
-      interp -> result = "usage: contextualhelp partofspeechnum searchtypenum";
+      Tcl_SetResult(interp, "usage: contextualhelp partofspeechnum searchtypenum", TCL_STATIC);
       return TCL_ERROR;
    }
    pos = atoi (argv[1]);
    searchtype = atoi (argv[2]);
-   interp -> result = helptext[pos][searchtype];
+   Tcl_SetResult(interp, helptext[pos][searchtype], TCL_VOLATILE);
    return TCL_OK;
 }
 
@@ -191,7 +189,7 @@
 int wn_reopendb (ClientData clientData, Tcl_Interp *interp,
    int argc, char *argv[]) {
    if (argc != 1) {
-      interp -> result = "usage: reopendb";
+      Tcl_SetResult(interp, "usage: reopendb", TCL_STATIC);
       return TCL_ERROR;
    }
    re_wninit ();
@@ -205,7 +203,7 @@
 int wn_abortsearch (ClientData clientData, Tcl_Interp *interp,
    int argc, char *argv[]) {
    if (argc != 1) {
-      interp -> result = "usage: abortsearch";
+      Tcl_SetResult(interp, "usage: abortsearch", TCL_STATIC);
       return TCL_ERROR;
    }
    abortsearch = 1;

Reply to: