Check-in [403c5120ce]
Overview
SHA1:403c5120ce07e6b58e4760f690d9fc7849648894
Date: 2011-09-09 15:04:23
User: rkeene
Comment:Fixed up interp->result accesses
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2011-09-11
19:27
[d18db48a4f] Updated to initialize stubs correctly (user: rkeene, tags: trunk)
2011-09-09
15:04
[403c5120ce] Fixed up interp->result accesses (user: rkeene, tags: trunk)
14:53
[d0146d1870] Fixed bug in installation Updated to install pkgIndex.tcl (user: rkeene, tags: trunk)
Changes

Deleted interp_violation.out version [396cf32bf5].

     1         -tkCmds.c:	    (char *) NULL) == TCL_OK  && interp->result[0] != '\0') {
     2         -tkCmds.c:	if (interp->result[1] == '\0') {
     3         -tkCmds.c:	    if (interp->result[0] == '1') {
     4         -tkCmds.c:	    } else if (interp->result[0] == '0') {
     5         -tkCmds.c:	if (interp->result[0] == 'd'
     6         -tkCmds.c:		&& strcmp(interp->result, "disabled") == 0) goto nofocus;
     7         -tkCmds.c:    if (strstr(interp->result, "Key"))  goto focus;
     8         -tkCmds.c:    if (strstr(interp->result, "Focus"))  goto focus;
     9         -tkCmds.c:    if (strstr(interp->result, "Key"))  goto focus;
    10         -tkCmds.c:    if (strstr(interp->result, "Focus"))  goto focus;
    11         -tkEvent.c:    char *errorMsg;		/* The error message (interp->result when
    12         -tkEvent.c:    errPtr->errorMsg = (char *) ckalloc((unsigned) (strlen(interp->result)
    13         -tkEvent.c:    strcpy(errPtr->errorMsg, interp->result);
    14         -tkEvent.c:	    if (strcmp(interp->result, "\"tkerror\" is an invalid command name or ambiguous abbreviation") == 0) {
    15         -tkEvent.c:		fprintf(stderr, "    Error in tkerror: %s\n", interp->result);
    16         -tkFrame.c:		    placeArgv[1], interp->result);
    17         -tkMain.c:	fprintf(stderr, "%s\n", interp->result);
    18         -tkMain.c:	fprintf(stderr, "%s\n", interp->result);
    19         -tkMain.c:	    fprintf(stderr, "%s\n", interp->result);
    20         -tkMain.c:            Tcl_Write(errChannel, interp->result, -1);
    21         -tkMain.c:                    Tcl_Write(errChannel, interp->result, -1);
    22         -tkMain.c:                            Tcl_Write(errChannel, interp->result, -1);
    23         -tkMain.c:    if (*interp->result != 0) {
    24         -tkMain.c:	    puts(interp->result);
    25         -tkMain.c:	    fprintf(stderr, "%s\n", interp->result);
    26         -tkText.c:	TkTextPrintIndex(&index1, interp->result);
    27         -tkText.c:	    TkTextPrintIndex(&index, interp->result);

Modified tkCmds.c from [101f176c12] to [108adb8130].

  1328   1328       if (! (winPtr->flags & CTK_DISPLAYED))  goto nofocus;
  1329   1329   
  1330   1330       /*
  1331   1331        * Check widget's -takefocus option.
  1332   1332        */
  1333   1333   
  1334   1334       if (Tcl_VarEval(interp, Tk_PathName(winPtr), " cget -takefocus",
  1335         -	    (char *) NULL) == TCL_OK  && interp->result[0] != '\0') {
         1335  +	    (char *) NULL) == TCL_OK  && Tcl_GetStringResult(interp)[0] != '\0') {
  1336   1336   	
  1337   1337   	/*
  1338   1338   	 * Try to interpret option value as simple 1 or 0.
  1339   1339   	 */
  1340   1340   
  1341         -	if (interp->result[1] == '\0') {
  1342         -	    if (interp->result[0] == '1') {
         1341  +	if (Tcl_GetStringResult(interp)[1] == '\0') {
         1342  +	    if (Tcl_GetStringResult(interp)[0] == '1') {
  1343   1343   		goto focus;
  1344         -	    } else if (interp->result[0] == '0') {
         1344  +	    } else if (Tcl_GetStringResult(interp)[0] == '0') {
  1345   1345   		goto nofocus;
  1346   1346   	    }
  1347   1347   	}
  1348   1348   	{
  1349   1349   	
  1350   1350   	    /*
  1351   1351   	     * The -takefocus option is not 1 or 0, append window
................................................................................
  1375   1375       /*
  1376   1376        * Check widget's -state option.  If value is "disaabled",
  1377   1377        * don't focus.
  1378   1378        */
  1379   1379   
  1380   1380       if (Tcl_VarEval(interp, Tk_PathName(winPtr), " cget -state",
  1381   1381   	    (char *) NULL) == TCL_OK) {
  1382         -	if (interp->result[0] == 'd'
  1383         -		&& strcmp(interp->result, "disabled") == 0) goto nofocus;
         1382  +	if (Tcl_GetStringResult(interp)[0] == 'd'
         1383  +		&& strcmp(Tcl_GetStringResult(interp), "disabled") == 0) goto nofocus;
  1384   1384       }
  1385   1385   
  1386   1386       /*
  1387   1387        * Check if widget has any Keyboard related bindings (check
  1388   1388        * individual widget tag and its class tag).
  1389   1389        */
  1390   1390   
  1391   1391       if (Tcl_VarEval(interp, "bind ", Tk_PathName(winPtr), (char *) NULL)
  1392   1392   	    != TCL_OK)  return TCL_ERROR;
  1393         -    if (strstr(interp->result, "Key"))  goto focus;
  1394         -    if (strstr(interp->result, "Focus"))  goto focus;
         1393  +    if (strstr(Tcl_GetStringResult(interp), "Key"))  goto focus;
         1394  +    if (strstr(Tcl_GetStringResult(interp), "Focus"))  goto focus;
  1395   1395   
  1396   1396       if (Tcl_VarEval(interp, "bind ", Tk_Class(winPtr), (char *) NULL)
  1397   1397   	    != TCL_OK)  return TCL_ERROR;
  1398         -    if (strstr(interp->result, "Key"))  goto focus;
  1399         -    if (strstr(interp->result, "Focus"))  goto focus;
         1398  +    if (strstr(Tcl_GetStringResult(interp), "Key"))  goto focus;
         1399  +    if (strstr(Tcl_GetStringResult(interp), "Focus"))  goto focus;
  1400   1400   
  1401   1401   nofocus:
  1402   1402       *flagPtr = 0;
  1403   1403       return TCL_OK;
  1404   1404   
  1405   1405   focus:
  1406   1406       *flagPtr = 1;

Modified tkFrame.c from [ee306166b0] to [8f4373b3fd].

   295    295   	placeArgv[5] = "0.5";
   296    296   	placeArgv[6] = "-anchor";
   297    297   	placeArgv[7] = "center";
   298    298   	placeArgv[8] = NULL;
   299    299   	if (Tk_PlaceCmd((ClientData) framePtr->tkwin, interp,
   300    300   		8, placeArgv) != TCL_OK) {
   301    301   	    panic("place failed for toplevel: %s: %s",
   302         -		    placeArgv[1], interp->result);
          302  +		    placeArgv[1], Tcl_GetStringResult(interp));
   303    303   	}
   304    304       } else {
   305    305   	tkwin->fillStyle = CTK_INVISIBLE_STYLE;
   306    306       }
   307    307       Tcl_SetResult(interp,Tk_PathName(framePtr->tkwin),TCL_VOLATILE);
   308    308       return (char *) framePtr;
   309    309   }

Modified tkMain.c from [a4667caf1c] to [a1538ac5fc].

   149    149       if ((argc > 1) && (argv[1][0] != '-')) {
   150    150   	fileName = argv[1];
   151    151   	argc--;
   152    152   	argv++;
   153    153       }
   154    154       if (Tk_ParseArgv(interp, (Tk_Window) NULL, &argc, argv, argTable, 0)
   155    155   	    != TCL_OK) {
   156         -	fprintf(stderr, "%s\n", interp->result);
          156  +	fprintf(stderr, "%s\n", Tcl_GetStringResult(interp));
   157    157   	exit(1);
   158    158       }
   159    159       if (name == NULL) {
   160    160   	if (fileName != NULL) {
   161    161   	    p = fileName;
   162    162   	} else {
   163    163   	    p = argv[0];
................................................................................
   212    212       }
   213    213       class = (char *) ckalloc((unsigned) (strlen(name) + 1));
   214    214       strcpy(class, name);
   215    215       class[0] = toupper((unsigned char) class[0]);
   216    216       mainWindow = Tk_CreateMainWindow(interp, display, name, class);
   217    217       ckfree(class);
   218    218       if (mainWindow == NULL) {
   219         -	fprintf(stderr, "%s\n", interp->result);
          219  +	fprintf(stderr, "%s\n", Tcl_GetStringResult(interp));
   220    220   	exit(1);
   221    221       }
   222    222   
   223    223       /*
   224    224        * Set the "tcl_interactive" variable.
   225    225        */
   226    226   
................................................................................
   233    233        * requested geometry into the "geometry" variable.
   234    234        */
   235    235   
   236    236       if (geometry != NULL) {
   237    237   	Tcl_SetVar(interp, "geometry", geometry, TCL_GLOBAL_ONLY);
   238    238   	code = Tcl_VarEval(interp, "wm geometry . ", geometry, (char *) NULL);
   239    239   	if (code != TCL_OK) {
   240         -	    fprintf(stderr, "%s\n", interp->result);
          240  +	    fprintf(stderr, "%s\n", Tcl_GetStringResult(interp));
   241    241   	}
   242    242       }
   243    243   
   244    244       /*
   245    245        * Invoke application-specific initialization.
   246    246        */
   247    247   
   248    248       if ((*appInitProc)(interp) != TCL_OK) {
   249    249          errChannel = Tcl_GetStdChannel(TCL_STDERR);
   250    250          if (errChannel) {
   251    251               Tcl_Write(errChannel,
   252    252                      "application-specific initialization failed: ", -1);
   253         -            Tcl_Write(errChannel, interp->result, -1);
          253  +            Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1);
   254    254               Tcl_Write(errChannel, "\n", 1);
   255    255           }
   256    256   
   257    257   	goto error;
   258    258       }
   259    259   
   260    260       /*
................................................................................
   280    280   	    Tcl_DString buffer;
   281    281   	    char *fullName;
   282    282   
   283    283               fullName = Tcl_TranslateFileName(interp, fileName, &buffer);
   284    284   	    if (fullName == NULL) {
   285    285                  errChannel = Tcl_GetStdChannel(TCL_STDERR);
   286    286                  if (errChannel) {
   287         -                    Tcl_Write(errChannel, interp->result, -1);
          287  +                    Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1);
   288    288                       Tcl_Write(errChannel, "\n", 1);
   289    289                   }
   290    290   	    } else {
   291    291   
   292    292                   /*
   293    293                    * NOTE: The following relies on O_RDONLY==0.
   294    294                    */
................................................................................
   295    295                   
   296    296                   chan = Tcl_OpenFileChannel(interp, fullName, "r", 0);
   297    297                   if (chan != (Tcl_Channel) NULL) {
   298    298                       Tcl_Close(NULL, chan);
   299    299                       if (Tcl_EvalFile(interp, fullName) != TCL_OK) {
   300    300                          errChannel = Tcl_GetStdChannel(TCL_STDERR);
   301    301                          if (errChannel) {
   302         -                            Tcl_Write(errChannel, interp->result, -1);
          302  +                            Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1);
   303    303                               Tcl_Write(errChannel, "\n", 1);
   304    304                           }
   305    305                       }
   306    306                   }
   307    307   	    }
   308    308   
   309    309   	    Tcl_DStringFree(&buffer);
................................................................................
   435    435        * command being evaluated.
   436    436        */
   437    437   
   438    438       Tcl_CreateFileHandler(chan, 0, StdinProc, (ClientData) chan);
   439    439       code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL);
   440    440       Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, (ClientData) chan);
   441    441       Tcl_DStringFree(&command);
   442         -    if (*interp->result != 0) {
          442  +    if (*(Tcl_GetStringResult(interp)) != 0) {
   443    443   	if ((code != TCL_OK) || (tty)) {
   444    444   	    /*
   445    445   	     * The statement below used to call "printf", but that resulted
   446    446   	     * in core dumps under Solaris 2.3 if the result was very long.
   447    447   	     *
   448    448   	     * NOTE: This probably will not work under Windows either.
   449    449   	     */
   450    450   
   451         -	    puts(interp->result);
          451  +	    puts(Tcl_GetStringResult(interp));
   452    452   	}
   453    453       }
   454    454   
   455    455       /*
   456    456        * Output a prompt.
   457    457        */
   458    458   
................................................................................
   499    499   	    fputs("% ", stdout);
   500    500   	}
   501    501       } else {
   502    502   	code = Tcl_Eval(interp, promptCmd);
   503    503   	if (code != TCL_OK) {
   504    504   	    Tcl_AddErrorInfo(interp,
   505    505   		    "\n    (script that generates prompt)");
   506         -	    fprintf(stderr, "%s\n", interp->result);
          506  +	    fprintf(stderr, "%s\n", Tcl_GetStringResult(interp));
   507    507   	    goto defaultPrompt;
   508    508   	}
   509    509       }
   510    510       fflush(stdout);
   511    511   }

Modified tkText.c from [a50bb61e12] to [14ae6d53f2].

   455    455   	    result = TCL_ERROR;
   456    456   	    goto done;
   457    457   	}
   458    458   	if (TkTextGetIndex(interp, textPtr, argv[2], &index1) != TCL_OK) {
   459    459   	    result = TCL_ERROR;
   460    460   	    goto done;
   461    461   	}
   462         -	TkTextPrintIndex(&index1, interp->result);
          462  +	TkTextPrintIndex(&index1, Tcl_GetStringResult(interp));
   463    463       } else if ((c == 'i') && (strncmp(argv[1], "insert", length) == 0)
   464    464   	    && (length >= 3)) {
   465    465   	int i, j, numTags;
   466    466   	char **tagNames;
   467    467   	TkTextTag **oldTagArrayPtr;
   468    468   
   469    469   	if (argc < 4) {
................................................................................
  1340   1340   		sprintf(buffer, "%d", matchLength);
  1341   1341   		if (Tcl_SetVar(interp, varName, buffer, TCL_LEAVE_ERR_MSG)
  1342   1342   			== NULL) {
  1343   1343   		    code = TCL_ERROR;
  1344   1344   		    goto done;
  1345   1345   		}
  1346   1346   	    }
  1347         -	    TkTextPrintIndex(&index, interp->result);
         1347  +	    TkTextPrintIndex(&index, Tcl_GetStringResult(interp));
  1348   1348   	    goto done;
  1349   1349   	}
  1350   1350   
  1351   1351   	/*
  1352   1352   	 * Go to the next (or previous) line;
  1353   1353   	 */
  1354   1354