Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 451294 | Differences between
and this patch

Collapse All | Expand All

(-)bindings/tk-x-plat/plplotter.c.ORIG (-12 / +12 lines)
Lines 463-469 Link Here
463
    PlPlotterFirstInit( (ClientData) plPlotterPtr );
463
    PlPlotterFirstInit( (ClientData) plPlotterPtr );
464
    Tk_GeometryRequest( plPlotterPtr->tkwin, 200, 200 );
464
    Tk_GeometryRequest( plPlotterPtr->tkwin, 200, 200 );
465
465
466
    interp->result = Tk_PathName( plPlotterPtr->tkwin );
466
    Tcl_SetResult(interp,(char*)Tk_PathName(plPlotterPtr->tkwin) ,TCL_VOLATILE);
467
467
468
    return TCL_OK;
468
    return TCL_OK;
469
}
469
}
Lines 2018-2024 Link Here
2018
//
2018
//
2019
// Results:
2019
// Results:
2020
//      The return value is a standard Tcl result.  If TCL_ERROR is
2020
//      The return value is a standard Tcl result.  If TCL_ERROR is
2021
//      returned, then interp->result contains an error message.
2021
//      returned, then Tcl_GetStringResult(interp) contains an error message.
2022
//
2022
//
2023
// Side effects:
2023
// Side effects:
2024
//      Configuration information, such as text string, colors, font, etc.
2024
//      Configuration information, such as text string, colors, font, etc.
Lines 2469-2475 Link Here
2469
        plr->at_bop = 0;
2469
        plr->at_bop = 0;
2470
        if ( Tcl_Eval( interp, plPlotterPtr->bopCmd ) != TCL_OK )
2470
        if ( Tcl_Eval( interp, plPlotterPtr->bopCmd ) != TCL_OK )
2471
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2471
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2472
                plPlotterPtr->bopCmd, interp->result );
2472
                plPlotterPtr->bopCmd, Tcl_GetStringResult(interp) );
2473
    }
2473
    }
2474
2474
2475
// Signal eop if necessary
2475
// Signal eop if necessary
Lines 2479-2485 Link Here
2479
        plr->at_eop = 0;
2479
        plr->at_eop = 0;
2480
        if ( Tcl_Eval( interp, plPlotterPtr->eopCmd ) != TCL_OK )
2480
        if ( Tcl_Eval( interp, plPlotterPtr->eopCmd ) != TCL_OK )
2481
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2481
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2482
                plPlotterPtr->eopCmd, interp->result );
2482
                plPlotterPtr->eopCmd, Tcl_GetStringResult(interp) );
2483
    }
2483
    }
2484
2484
2485
    return result;
2485
    return result;
Lines 2491-2497 Link Here
2491
    {
2491
    {
2492
        if ( Tcl_Eval( interp, plPlotterPtr->eopCmd ) != TCL_OK )
2492
        if ( Tcl_Eval( interp, plPlotterPtr->eopCmd ) != TCL_OK )
2493
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2493
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2494
                plPlotterPtr->eopCmd, interp->result );
2494
                plPlotterPtr->eopCmd, Tcl_GetStringResult(interp) );
2495
    }
2495
    }
2496
}
2496
}
2497
2497
Lines 2501-2507 Link Here
2501
    {
2501
    {
2502
        if ( Tcl_Eval( interp, plPlotterPtr->bopCmd ) != TCL_OK )
2502
        if ( Tcl_Eval( interp, plPlotterPtr->bopCmd ) != TCL_OK )
2503
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2503
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2504
                plPlotterPtr->bopCmd, interp->result );
2504
                plPlotterPtr->bopCmd, Tcl_GetStringResult(interp ) );
2505
    }
2505
    }
2506
}
2506
}
2507
2507
Lines 2536-2542 Link Here
2536
        {
2536
        {
2537
        #endif
2537
        #endif
2538
            Tcl_AppendResult( interp, "Packet receive failed:\n\t %s\n",
2538
            Tcl_AppendResult( interp, "Packet receive failed:\n\t %s\n",
2539
                interp->result, (char *) NULL );
2539
                Tcl_GetStringResult(interp), (char *) NULL );
2540
            return TCL_ERROR;
2540
            return TCL_ERROR;
2541
        }
2541
        }
2542
2542
Lines 3082-3088 Link Here
3082
3082
3083
    if ( argc == 0 )
3083
    if ( argc == 0 )
3084
    {
3084
    {
3085
        interp->result = "report what?";
3085
        Tcl_SetResult(interp,(char*)"report what?",TCL_VOLATILE);
3086
        return TCL_ERROR;
3086
        return TCL_ERROR;
3087
    }
3087
    }
3088
3088
Lines 3093-3099 Link Here
3093
3093
3094
        if ( argc != 3 )
3094
        if ( argc != 3 )
3095
        {
3095
        {
3096
            interp->result = "Wrong # of args: report wc x y";
3096
            Tcl_SetResult(interp,(char*)"Wrong # of args: report wc x y",TCL_VOLATILE);
3097
            return TCL_ERROR;
3097
            return TCL_ERROR;
3098
        }
3098
        }
3099
3099
Lines 3107-3121 Link Here
3107
3107
3108
        if ( plTranslateCursor( gin ) )
3108
        if ( plTranslateCursor( gin ) )
3109
        {
3109
        {
3110
            sprintf( interp->result, "%f %f", gin->wX, gin->wY );
3110
            sprintf( Tcl_GetStringResult(interp), "%f %f", gin->wX, gin->wY );
3111
            return TCL_OK;
3111
            return TCL_OK;
3112
        }
3112
        }
3113
3113
3114
        interp->result = "Cannot locate";
3114
        Tcl_SetResult(interp,(char*)"Cannot locate",TCL_VOLATILE);
3115
        return TCL_OK;
3115
        return TCL_OK;
3116
    }
3116
    }
3117
3117
3118
    interp->result = "nonsensical request.";
3118
    Tcl_SetResult(interp,(char*)"nonsensical request.",TCL_VOLATILE);
3119
    return TCL_ERROR;
3119
    return TCL_ERROR;
3120
}
3120
}
3121
3121
(-)bindings/tk/tkshell.c.ORIG (-1 / +1 lines)
Lines 115-121 Link Here
115
        if ( Tcl_ExprBoolean( interp, argv[1], &result ) )
115
        if ( Tcl_ExprBoolean( interp, argv[1], &result ) )
116
        {
116
        {
117
            fprintf( stderr, "wait_until command \"%s\" failed:\n\t %s\n",
117
            fprintf( stderr, "wait_until command \"%s\" failed:\n\t %s\n",
118
                argv[1], interp->result );
118
                argv[1], Tcl_GetStringResult(interp) );
119
            break;
119
            break;
120
        }
120
        }
121
        if ( result )
121
        if ( result )
(-)bindings/tk/plserver.c.ORIG (-5 / +5 lines)
Lines 126-136 Link Here
126
    if ( Tk_ParseArgv( interp, (Tk_Window) NULL, &argc, argv,
126
    if ( Tk_ParseArgv( interp, (Tk_Window) NULL, &argc, argv,
127
             argTable, TK_ARGV_NO_DEFAULTS ) != TCL_OK )
127
             argTable, TK_ARGV_NO_DEFAULTS ) != TCL_OK )
128
    {
128
    {
129
        fprintf( stderr, "\n(plserver) %s\n\n", interp->result );
129
        fprintf( stderr, "\n(plserver) %s\n\n", Tcl_GetStringResult(interp) );
130
        fprintf( stderr, "\
130
        fprintf( stderr, "\
131
The client_<xxx> and -child options should not be used except via the\n\
131
The client_<xxx> and -child options should not be used except via the\n\
132
PLplot/Tk driver.\n\n(wish) " );
132
PLplot/Tk driver.\n\n(wish) " );
133
        if ( strncmp( interp->result, helpmsg, strlen( helpmsg ) ) )
133
        if ( strncmp( Tcl_GetStringResult(interp), helpmsg, strlen( helpmsg ) ) )
134
            exit( 1 );
134
            exit( 1 );
135
    }
135
    }
136
136
Lines 158-164 Link Here
158
//
158
//
159
// Results:
159
// Results:
160
//	Returns a standard Tcl completion code, and leaves an error
160
//	Returns a standard Tcl completion code, and leaves an error
161
//	message in interp->result if an error occurs.
161
//	message in Tcl_GetStringResult(interp) if an error occurs.
162
//
162
//
163
// Side effects:
163
// Side effects:
164
//	Depends on the startup script.
164
//	Depends on the startup script.
Lines 257-264 Link Here
257
257
258
// Print error message if one given
258
// Print error message if one given
259
259
260
    if ( interp->result != NULL && interp->result[0] != '\0' )
260
    if ( Tcl_GetStringResult(interp) != NULL && Tcl_GetStringResult(interp)[0] != '\0' )
261
        fprintf( stderr, "%s\n", interp->result );
261
        fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
262
262
263
// Best to check the syntax before proceeding
263
// Best to check the syntax before proceeding
264
264
(-)bindings/tk/tkMain.c.ORIG (-21 / +10 lines)
Lines 85-101 Link Here
85
85
86
// From tclIntDecls.h
86
// From tclIntDecls.h
87
87
88
#ifndef Tcl_Import_TCL_DECLARED
89
EXTERN int Tcl_Import _ANSI_ARGS_( ( Tcl_Interp * interp,
90
                                     Tcl_Namespace * nsPtr, char * pattern,
91
                                     int allowOverwrite ) );
92
#endif
93
94
#ifndef Tcl_GetGlobalNamespace_TCL_DECLARE
95
EXTERN Tcl_Namespace * Tcl_GetGlobalNamespace _ANSI_ARGS_( (
96
                                                               Tcl_Interp * interp ) );
97
#endif
98
99
//
88
//
100
// Declarations for various library procedures and variables (don't want
89
// Declarations for various library procedures and variables (don't want
101
// to include tkInt.h or tkConfig.h here, because people might copy this
90
// to include tkInt.h or tkConfig.h here, because people might copy this
Lines 180-186 Link Here
180
pltkMain( int argc, const char **argv, char *RcFileName,
180
pltkMain( int argc, const char **argv, char *RcFileName,
181
          int ( *AppInit )( Tcl_Interp *interp ) )
181
          int ( *AppInit )( Tcl_Interp *interp ) )
182
{
182
{
183
    char       *args, *msg;
183
    char       *args; const char *msg;
184
    const char *p;
184
    const char *p;
185
    char       buf[20];
185
    char       buf[20];
186
    int        code;
186
    int        code;
Lines 202-208 Link Here
202
    if ( Tk_ParseArgv( interp, (Tk_Window) NULL, &argc, argv, argTable, 0 )
202
    if ( Tk_ParseArgv( interp, (Tk_Window) NULL, &argc, argv, argTable, 0 )
203
         != TCL_OK )
203
         != TCL_OK )
204
    {
204
    {
205
        fprintf( stderr, "%s\n", interp->result );
205
        fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
206
        exit( 1 );
206
        exit( 1 );
207
    }
207
    }
208
    if ( name == NULL )
208
    if ( name == NULL )
Lines 331-337 Link Here
331
331
332
    if ( ( *AppInit )( interp ) != TCL_OK )
332
    if ( ( *AppInit )( interp ) != TCL_OK )
333
    {
333
    {
334
        fprintf( stderr, "(*AppInit) failed: %s\n", interp->result );
334
        fprintf( stderr, "(*AppInit) failed: %s\n", Tcl_GetStringResult(interp) );
335
    }
335
    }
336
336
337
    //
337
    //
Lines 343-349 Link Here
343
        code = Tcl_VarEval( interp, "wm geometry . ", geometry, (char *) NULL );
343
        code = Tcl_VarEval( interp, "wm geometry . ", geometry, (char *) NULL );
344
        if ( code != TCL_OK )
344
        if ( code != TCL_OK )
345
        {
345
        {
346
            fprintf( stderr, "%s\n", interp->result );
346
            fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
347
        }
347
        }
348
    }
348
    }
349
349
Lines 393-399 Link Here
393
            fullName = Tcl_TildeSubst( interp, RcFileName, &buffer );
393
            fullName = Tcl_TildeSubst( interp, RcFileName, &buffer );
394
            if ( fullName == NULL )
394
            if ( fullName == NULL )
395
            {
395
            {
396
                fprintf( stderr, "%s\n", interp->result );
396
                fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
397
            }
397
            }
398
            else
398
            else
399
            {
399
            {
Lines 403-409 Link Here
403
                    code = Tcl_EvalFile( interp, fullName );
403
                    code = Tcl_EvalFile( interp, fullName );
404
                    if ( code != TCL_OK )
404
                    if ( code != TCL_OK )
405
                    {
405
                    {
406
                        fprintf( stderr, "%s\n", interp->result );
406
                        fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
407
                    }
407
                    }
408
                    fclose( f );
408
                    fclose( f );
409
                }
409
                }
Lines 442-448 Link Here
442
    msg = (char *) Tcl_GetVar( interp, "errorInfo", TCL_GLOBAL_ONLY );
442
    msg = (char *) Tcl_GetVar( interp, "errorInfo", TCL_GLOBAL_ONLY );
443
    if ( msg == NULL )
443
    if ( msg == NULL )
444
    {
444
    {
445
        msg = interp->result;
445
        msg = Tcl_GetStringResult(interp);
446
    }
446
    }
447
    fprintf( stderr, "%s\n", msg );
447
    fprintf( stderr, "%s\n", msg );
448
    Tcl_Eval( interp, errorExitCmd );
448
    Tcl_Eval( interp, errorExitCmd );
Lines 535-545 Link Here
535
    Tk_CreateFileHandler( 0, TK_READABLE, StdinProc, (ClientData) 0 );
535
    Tk_CreateFileHandler( 0, TK_READABLE, StdinProc, (ClientData) 0 );
536
#endif
536
#endif
537
    Tcl_DStringFree( &command );
537
    Tcl_DStringFree( &command );
538
    if ( *interp->result != 0 )
538
    if ( Tcl_GetStringResult(interp) )
539
    {
539
    {
540
        if ( ( code != TCL_OK ) || ( tty ) )
540
        if ( ( code != TCL_OK ) || ( tty ) )
541
        {
541
        {
542
            printf( "%s\n", interp->result );
542
            printf( "%s\n", Tcl_GetStringResult(interp) );
543
        }
543
        }
544
    }
544
    }
545
545
Lines 599-605 Link Here
599
        {
599
        {
600
            Tcl_AddErrorInfo( interp,
600
            Tcl_AddErrorInfo( interp,
601
                "\n    (script that generates prompt)" );
601
                "\n    (script that generates prompt)" );
602
            fprintf( stderr, "%s\n", interp->result );
602
            fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
603
            goto defaultPrompt;
603
            goto defaultPrompt;
604
        }
604
        }
605
    }
605
    }
(-)bindings/tk/plframe.c.ORIG (-12 / +12 lines)
Lines 484-490 Link Here
484
        Tk_DestroyWindow( plFramePtr->tkwin );
484
        Tk_DestroyWindow( plFramePtr->tkwin );
485
        return TCL_ERROR;
485
        return TCL_ERROR;
486
    }
486
    }
487
    interp->result = Tk_PathName( plFramePtr->tkwin );
487
    Tcl_SetResult(interp,(char*)Tk_PathName( plFramePtr->tkwin) ,TCL_VOLATILE);
488
488
489
    return TCL_OK;
489
    return TCL_OK;
490
}
490
}
Lines 616-622 Link Here
616
            {
616
            {
617
                bcb.cmd = PLESC_DOUBLEBUFFERING_QUERY;
617
                bcb.cmd = PLESC_DOUBLEBUFFERING_QUERY;
618
                pl_cmd( PLESC_DOUBLEBUFFERING, &bcb );
618
                pl_cmd( PLESC_DOUBLEBUFFERING, &bcb );
619
                sprintf( interp->result, "%d", bcb.result );
619
                sprintf( Tcl_GetStringResult(interp), "%d", bcb.result );
620
            }
620
            }
621
        }
621
        }
622
622
Lines 2215-2221 Link Here
2215
//
2215
//
2216
// Results:
2216
// Results:
2217
//	The return value is a standard Tcl result.  If TCL_ERROR is
2217
//	The return value is a standard Tcl result.  If TCL_ERROR is
2218
//	returned, then interp->result contains an error message.
2218
//	returned, then Tcl_GetStringResult(interp) contains an error message.
2219
//
2219
//
2220
// Side effects:
2220
// Side effects:
2221
//	Configuration information, such as text string, colors, font, etc.
2221
//	Configuration information, such as text string, colors, font, etc.
Lines 2675-2681 Link Here
2675
        plr->at_bop = 0;
2675
        plr->at_bop = 0;
2676
        if ( Tcl_Eval( interp, plFramePtr->bopCmd ) != TCL_OK )
2676
        if ( Tcl_Eval( interp, plFramePtr->bopCmd ) != TCL_OK )
2677
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2677
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2678
                plFramePtr->bopCmd, interp->result );
2678
                plFramePtr->bopCmd, Tcl_GetStringResult(interp) );
2679
    }
2679
    }
2680
2680
2681
// Signal eop if necessary
2681
// Signal eop if necessary
Lines 2685-2691 Link Here
2685
        plr->at_eop = 0;
2685
        plr->at_eop = 0;
2686
        if ( Tcl_Eval( interp, plFramePtr->eopCmd ) != TCL_OK )
2686
        if ( Tcl_Eval( interp, plFramePtr->eopCmd ) != TCL_OK )
2687
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2687
            fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
2688
                plFramePtr->eopCmd, interp->result );
2688
                plFramePtr->eopCmd, Tcl_GetStringResult(interp) );
2689
    }
2689
    }
2690
2690
2691
    return result;
2691
    return result;
Lines 3275-3281 Link Here
3275
3275
3276
    if ( argc == 0 )
3276
    if ( argc == 0 )
3277
    {
3277
    {
3278
        interp->result = "report what?";
3278
        Tcl_SetResult(interp,(char*)"report what?",TCL_VOLATILE);
3279
        return TCL_ERROR;
3279
        return TCL_ERROR;
3280
    }
3280
    }
3281
3281
Lines 3286-3292 Link Here
3286
3286
3287
        if ( argc != 3 )
3287
        if ( argc != 3 )
3288
        {
3288
        {
3289
            interp->result = "Wrong # of args: report wc x y";
3289
            Tcl_SetResult(interp,(char*)"Wrong # of args: report wc x y",TCL_VOLATILE);
3290
            return TCL_ERROR;
3290
            return TCL_ERROR;
3291
        }
3291
        }
3292
3292
Lines 3300-3314 Link Here
3300
3300
3301
        if ( plTranslateCursor( gin ) )
3301
        if ( plTranslateCursor( gin ) )
3302
        {
3302
        {
3303
            sprintf( interp->result, "%f %f", gin->wX, gin->wY );
3303
            sprintf( Tcl_GetStringResult(interp), "%f %f", gin->wX, gin->wY );
3304
            return TCL_OK;
3304
            return TCL_OK;
3305
        }
3305
        }
3306
3306
3307
        interp->result = "Cannot locate";
3307
        Tcl_SetResult(interp,(char*)"Cannot locate",TCL_VOLATILE);
3308
        return TCL_OK;
3308
        return TCL_OK;
3309
    }
3309
    }
3310
3310
3311
    interp->result = "nonsensical request.";
3311
    Tcl_SetResult(interp,(char*)"nonsensical request.",TCL_VOLATILE);
3312
    return TCL_ERROR;
3312
    return TCL_ERROR;
3313
}
3313
}
3314
3314
Lines 3324-3330 Link Here
3324
3324
3325
    if ( Tcl_Eval( plFramePtr->interp, plFramePtr->bopCmd ) != TCL_OK )
3325
    if ( Tcl_Eval( plFramePtr->interp, plFramePtr->bopCmd ) != TCL_OK )
3326
        fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
3326
        fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
3327
            plFramePtr->bopCmd, plFramePtr->interp->result );
3327
            plFramePtr->bopCmd, Tcl_GetStringResult(plFramePtr->interp) );
3328
}
3328
}
3329
3329
3330
//--------------------------------------------------------------------------
3330
//--------------------------------------------------------------------------
Lines 3339-3345 Link Here
3339
3339
3340
    if ( Tcl_Eval( plFramePtr->interp, plFramePtr->eopCmd ) != TCL_OK )
3340
    if ( Tcl_Eval( plFramePtr->interp, plFramePtr->eopCmd ) != TCL_OK )
3341
        fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
3341
        fprintf( stderr, "Command \"%s\" failed:\n\t %s\n",
3342
            plFramePtr->eopCmd, plFramePtr->interp->result );
3342
            plFramePtr->eopCmd, Tcl_GetStringResult(plFramePtr->interp) );
3343
}
3343
}
3344
3344
3345
//--------------------------------------------------------------------------
3345
//--------------------------------------------------------------------------
(-)utils/pltcl.c.ORIG (-1 / +1 lines)
Lines 119-125 Link Here
119
//
119
//
120
// Results:
120
// Results:
121
//	Returns a standard Tcl completion code, and leaves an error
121
//	Returns a standard Tcl completion code, and leaves an error
122
//	message in interp->result if an error occurs.
122
//	message in Tcl_GetStringResult(interp) if an error occurs.
123
//
123
//
124
// Side effects:
124
// Side effects:
125
//	Depends on the startup script.
125
//	Depends on the startup script.
(-)doc/docbook/src/plplotdoc.info-1.ORIG (-2 / +2 lines)
Lines 6435-6441 Link Here
6435
     	if (pm->fdata[i] > max)
6435
     	if (pm->fdata[i] > max)
6436
     	max = pm->fdata[i];
6436
     	max = pm->fdata[i];
6437
6437
6438
     	sprintf( interp->result, "%f", max );
6438
     	sprintf( Tcl_GetStringResult(interp), "%f", max );
6439
     	return TCL_OK;
6439
     	return TCL_OK;
6440
     	}
6440
     	}
6441
6441
Lines 6448-6454 Link Here
6448
     	if (pm->fdata[i] < min)
6448
     	if (pm->fdata[i] < min)
6449
     	min = pm->fdata[i];
6449
     	min = pm->fdata[i];
6450
6450
6451
     	sprintf( interp->result, "%f", min );
6451
     	sprintf( Tcl_GetStringResult(interp), "%f", min );
6452
     	return TCL_OK;
6452
     	return TCL_OK;
6453
     	}
6453
     	}
6454
6454
(-)doc/docbook/src/plplotdoc.texi.ORIG (-2 / +2 lines)
Lines 6722-6728 Link Here
6722
	if (pm->fdata[i] > max)
6722
	if (pm->fdata[i] > max)
6723
	max = pm->fdata[i];
6723
	max = pm->fdata[i];
6724
6724
6725
	sprintf( interp->result, "%f", max );
6725
	sprintf( Tcl_GetStringResult(interp), "%f", max );
6726
	return TCL_OK;
6726
	return TCL_OK;
6727
	@}
6727
	@}
6728
6728
Lines 6735-6741 Link Here
6735
	if (pm->fdata[i] < min)
6735
	if (pm->fdata[i] < min)
6736
	min = pm->fdata[i];
6736
	min = pm->fdata[i];
6737
6737
6738
	sprintf( interp->result, "%f", min );
6738
	sprintf( Tcl_GetStringResult(interp), "%f", min );
6739
	return TCL_OK;
6739
	return TCL_OK;
6740
	@}
6740
	@}
6741
      
6741
      
(-)doc/docbook/src/tcl.xml.ORIG (-2 / +2 lines)
Lines 576-582 Link Here
576
	if (pm->fdata[i] > max)
576
	if (pm->fdata[i] > max)
577
	max = pm->fdata[i];
577
	max = pm->fdata[i];
578
578
579
	sprintf( interp->result, "%f", max );
579
	sprintf( Tcl_GetStringResult(interp), "%f", max );
580
	return TCL_OK;
580
	return TCL_OK;
581
	}
581
	}
582
582
Lines 589-595 Link Here
589
	if (pm->fdata[i] &lt; min)
589
	if (pm->fdata[i] &lt; min)
590
	min = pm->fdata[i];
590
	min = pm->fdata[i];
591
591
592
	sprintf( interp->result, "%f", min );
592
	sprintf( Tcl_GetStringResult(interp), "%f", min );
593
	return TCL_OK;
593
	return TCL_OK;
594
	}
594
	}
595
      </programlisting>
595
      </programlisting>
(-)drivers/ntk.c.ORIG (-11 / +11 lines)
Lines 115-121 Link Here
115
        //
115
        //
116
        sprintf( scmd, "send %s {%s}", rem_interp, cmd ); // mess! make it more efficient
116
        sprintf( scmd, "send %s {%s}", rem_interp, cmd ); // mess! make it more efficient
117
        if ( Tcl_Eval( interp, scmd ) != TCL_OK )
117
        if ( Tcl_Eval( interp, scmd ) != TCL_OK )
118
            fprintf( stderr, "%s\n", interp->result );
118
            fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
119
    }
119
    }
120
}
120
}
121
121
Lines 264-270 Link Here
264
        sprintf( cmd, "send %s \"set client [tk appname]; wm deiconify .\"", rem_interp );
264
        sprintf( cmd, "send %s \"set client [tk appname]; wm deiconify .\"", rem_interp );
265
        if ( Tcl_Eval( interp, cmd ) != TCL_OK )
265
        if ( Tcl_Eval( interp, cmd ) != TCL_OK )
266
        {
266
        {
267
            fprintf( stderr, "%s\n", interp->result );
267
            fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) );
268
            plexit( "No such tk server." );
268
            plexit( "No such tk server." );
269
        }
269
        }
270
    }
270
    }
Lines 301-307 Link Here
301
    // Set up device parameters
301
    // Set up device parameters
302
302
303
    Tcl_Eval( interp, "tk scaling" ); // pixels per mm
303
    Tcl_Eval( interp, "tk scaling" ); // pixels per mm
304
    ppm = (PLFLT) atof( interp->result ) / ( 25.4 / 72. );
304
    ppm = (PLFLT) atof( Tcl_GetStringResult(interp) ) / ( 25.4 / 72. );
305
    plP_setpxl( ppm, ppm );
305
    plP_setpxl( ppm, ppm );
306
    plP_setphy( xmin, xmax * scale, ymin, ymax * scale );
306
    plP_setphy( xmin, xmax * scale, ymin, ymax * scale );
307
}
307
}
Lines 371-381 Link Here
371
        {
371
        {
372
            tk_cmd( "update" );
372
            tk_cmd( "update" );
373
            tk_cmd( "info exists keypress" );
373
            tk_cmd( "info exists keypress" );
374
            sscanf( interp->result, "%d", &st );
374
            sscanf( Tcl_GetStringResult(interp), "%d", &st );
375
        }
375
        }
376
376
377
        tk_cmd( "set keypress" );
377
        tk_cmd( "set keypress" );
378
        sscanf( interp->result, "%d", &key );
378
        sscanf( Tcl_GetStringResult(interp), "%d", &key );
379
//fprintf(stderr,"\n%d\n", key);fflush(stderr);
379
//fprintf(stderr,"\n%d\n", key);fflush(stderr);
380
        tk_cmd( "unset keypress" );
380
        tk_cmd( "unset keypress" );
381
        st = 0;
381
        st = 0;
Lines 433-439 Link Here
433
        {
433
        {
434
            tk_cmd( "update" );
434
            tk_cmd( "update" );
435
            tk_cmd( "winfo exists $plf.f2.c$ccanv" );
435
            tk_cmd( "winfo exists $plf.f2.c$ccanv" );
436
            sscanf( interp->result, "%d", &st );
436
            sscanf( Tcl_GetStringResult(interp), "%d", &st );
437
        }
437
        }
438
        st = 0;
438
        st = 0;
439
        // this give a "Segmentation fault", even after checking for the canvas!
439
        // this give a "Segmentation fault", even after checking for the canvas!
Lines 450-465 Link Here
450
    {
450
    {
451
        tk_cmd( "update" );
451
        tk_cmd( "update" );
452
        tk_cmd( "info exists xloc" );
452
        tk_cmd( "info exists xloc" );
453
        sscanf( interp->result, "%d", &st );
453
        sscanf( Tcl_GetStringResult(interp), "%d", &st );
454
    }
454
    }
455
    tk_cmd( "set xloc" );
455
    tk_cmd( "set xloc" );
456
    sscanf( interp->result, "%d", &gin.pX );
456
    sscanf( Tcl_GetStringResult(interp), "%d", &gin.pX );
457
    tk_cmd( "set yloc" );
457
    tk_cmd( "set yloc" );
458
    sscanf( interp->result, "%d", &gin.pY );
458
    sscanf( Tcl_GetStringResult(interp), "%d", &gin.pY );
459
    tk_cmd( "set bloc" );
459
    tk_cmd( "set bloc" );
460
    sscanf( interp->result, "%d", &gin.button );
460
    sscanf( Tcl_GetStringResult(interp), "%d", &gin.button );
461
    tk_cmd( "set sloc" );
461
    tk_cmd( "set sloc" );
462
    sscanf( interp->result, "%d", &gin.state );
462
    sscanf( Tcl_GetStringResult(interp), "%d", &gin.state );
463
463
464
    gin.dX = (PLFLT) gin.pX / xmax;
464
    gin.dX = (PLFLT) gin.pX / xmax;
465
    gin.dY = 1. - (PLFLT) gin.pY / ymax;
465
    gin.dY = 1. - (PLFLT) gin.pY / ymax;
(-)drivers/tk.c.ORIG (-7 / +7 lines)
Lines 764-770 Link Here
764
764
765
    if ( Tcl_Init( dev->interp ) != TCL_OK )
765
    if ( Tcl_Init( dev->interp ) != TCL_OK )
766
    {
766
    {
767
        fprintf( stderr, "%s\n", dev->interp->result );
767
        fprintf( stderr, "%s\n", Tcl_GetStringResult(dev->interp) );
768
        abort_session( pls, "Unable to initialize Tcl" );
768
        abort_session( pls, "Unable to initialize Tcl" );
769
    }
769
    }
770
770
Lines 1568-1574 Link Here
1568
                 0, 1, ( ClientData ) & iodev->file ) != TCL_OK )
1568
                 0, 1, ( ClientData ) & iodev->file ) != TCL_OK )
1569
        {
1569
        {
1570
            fprintf( stderr, "Cannot get file info:\n\t %s\n",
1570
            fprintf( stderr, "Cannot get file info:\n\t %s\n",
1571
                dev->interp->result );
1571
                Tcl_GetStringResult(dev->interp) );
1572
            abort_session( pls, "" );
1572
            abort_session( pls, "" );
1573
        }
1573
        }
1574
        iodev->fd = fileno( iodev->file );
1574
        iodev->fd = fileno( iodev->file );
Lines 1673-1679 Link Here
1673
        if ( pl_PacketSend( dev->interp, dev->iodev, pls->pdfs ) )
1673
        if ( pl_PacketSend( dev->interp, dev->iodev, pls->pdfs ) )
1674
        {
1674
        {
1675
            fprintf( stderr, "Packet send failed:\n\t %s\n",
1675
            fprintf( stderr, "Packet send failed:\n\t %s\n",
1676
                dev->interp->result );
1676
                Tcl_GetStringResult(dev->interp) );
1677
            abort_session( pls, "" );
1677
            abort_session( pls, "" );
1678
        }
1678
        }
1679
        pdfs->bp = 0;
1679
        pdfs->bp = 0;
Lines 2131-2137 Link Here
2131
2131
2132
    if ( Tk_Init( interp ) )
2132
    if ( Tk_Init( interp ) )
2133
    {
2133
    {
2134
        fprintf( stderr, "tk_init:%s\n", interp->result );
2134
        fprintf( stderr, "tk_init:%s\n", Tcl_GetStringResult(interp) );
2135
        return 1;
2135
        return 1;
2136
    }
2136
    }
2137
2137
Lines 2165-2171 Link Here
2165
        if ( Tcl_ExprBoolean( dev->interp, dev->cmdbuf, &result ) )
2165
        if ( Tcl_ExprBoolean( dev->interp, dev->cmdbuf, &result ) )
2166
        {
2166
        {
2167
            fprintf( stderr, "tk_wait command \"%s\" failed:\n\t %s\n",
2167
            fprintf( stderr, "tk_wait command \"%s\" failed:\n\t %s\n",
2168
                cmd, dev->interp->result );
2168
                cmd, Tcl_GetStringResult(dev->interp) );
2169
            break;
2169
            break;
2170
        }
2170
        }
2171
        if ( result )
2171
        if ( result )
Lines 2225-2231 Link Here
2225
    if ( result != TCL_OK )
2225
    if ( result != TCL_OK )
2226
    {
2226
    {
2227
        fprintf( stderr, "Server command \"%s\" failed:\n\t %s\n",
2227
        fprintf( stderr, "Server command \"%s\" failed:\n\t %s\n",
2228
            cmd, dev->interp->result );
2228
            cmd, Tcl_GetStringResult(dev->interp) );
2229
        abort_session( pls, "" );
2229
        abort_session( pls, "" );
2230
    }
2230
    }
2231
}
2231
}
Lines 2247-2253 Link Here
2247
    if ( Tcl_VarEval( dev->interp, cmd, (char **) NULL ) != TCL_OK )
2247
    if ( Tcl_VarEval( dev->interp, cmd, (char **) NULL ) != TCL_OK )
2248
    {
2248
    {
2249
        fprintf( stderr, "TCL command \"%s\" failed:\n\t %s\n",
2249
        fprintf( stderr, "TCL command \"%s\" failed:\n\t %s\n",
2250
            cmd, dev->interp->result );
2250
            cmd, Tcl_GetStringResult(dev->interp) );
2251
        abort_session( pls, "" );
2251
        abort_session( pls, "" );
2252
    }
2252
    }
2253
}
2253
}
(-)examples/tk/xtk01.c.ORIG (-1 / +1 lines)
Lines 53-59 Link Here
53
//
53
//
54
// Results:
54
// Results:
55
//	Returns a standard Tcl completion code, and leaves an error
55
//	Returns a standard Tcl completion code, and leaves an error
56
//	message in interp->result if an error occurs.
56
//	message in Tcl_GetStringResult(interp) if an error occurs.
57
//
57
//
58
// Side effects:
58
// Side effects:
59
//	Depends on the startup script.
59
//	Depends on the startup script.
(-)examples/tk/xtk02.c.ORIG (-2 / +2 lines)
Lines 49-55 Link Here
49
        pm->fdata[i] = y;
49
        pm->fdata[i] = y;
50
    }
50
    }
51
51
52
    interp->result = "Things are cool in gumbyville.";
52
    Tcl_SetResult(interp,(char*)"Things are cool in gumbyville.",TCL_VOLATILE);
53
    return TCL_OK;
53
    return TCL_OK;
54
}
54
}
55
55
Lines 82-88 Link Here
82
//
82
//
83
// Results:
83
// Results:
84
//	Returns a standard Tcl completion code, and leaves an error
84
//	Returns a standard Tcl completion code, and leaves an error
85
//	message in interp->result if an error occurs.
85
//	message in Tcl_GetStringResult(interp) if an error occurs.
86
//
86
//
87
// Side effects:
87
// Side effects:
88
//	Depends on the startup script.
88
//	Depends on the startup script.
(-)examples/tk/xtk04.c.ORIG (-4 / +4 lines)
Lines 35-41 Link Here
35
        if ( pm->fdata[i] > max )
35
        if ( pm->fdata[i] > max )
36
            max = pm->fdata[i];
36
            max = pm->fdata[i];
37
37
38
    sprintf( interp->result, "%f", max );
38
    sprintf( Tcl_GetStringResult(interp), "%f", max );
39
    return TCL_OK;
39
    return TCL_OK;
40
}
40
}
41
41
Lines 48-54 Link Here
48
        if ( pm->fdata[i] < min )
48
        if ( pm->fdata[i] < min )
49
            min = pm->fdata[i];
49
            min = pm->fdata[i];
50
50
51
    sprintf( interp->result, "%f", min );
51
    sprintf( Tcl_GetStringResult(interp), "%f", min );
52
    return TCL_OK;
52
    return TCL_OK;
53
}
53
}
54
54
Lines 80-86 Link Here
80
//
80
//
81
// Results:
81
// Results:
82
//	Returns a standard Tcl completion code, and leaves an error
82
//	Returns a standard Tcl completion code, and leaves an error
83
//	message in interp->result if an error occurs.
83
//	message in Tcl_GetStringResult(interp) if an error occurs.
84
//
84
//
85
// Side effects:
85
// Side effects:
86
//	Depends on the startup script.
86
//	Depends on the startup script.
Lines 158-164 Link Here
158
158
159
    if ( pm->dim != 2 )
159
    if ( pm->dim != 2 )
160
    {
160
    {
161
        interp->result = "must use 2-d matrix.";
161
        Tcl_SetResult(interp,(char*)"must use 2-d matrix.",TCL_VOLATILE);
162
        return TCL_ERROR;
162
        return TCL_ERROR;
163
    }
163
    }
164
164

Return to bug 451294