[GRASS-SVN] r55872 - in grass/branches/releasebranch_6_4: lib/form visualization/nviz/src
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Apr 17 23:53:31 PDT 2013
Author: hamish
Date: 2013-04-17 23:53:31 -0700 (Wed, 17 Apr 2013)
New Revision: 55872
Modified:
grass/branches/releasebranch_6_4/lib/form/form.c
grass/branches/releasebranch_6_4/visualization/nviz/src/Makefile
grass/branches/releasebranch_6_4/visualization/nviz/src/anim_support.c
grass/branches/releasebranch_6_4/visualization/nviz/src/cutplane_obj.c
grass/branches/releasebranch_6_4/visualization/nviz/src/do_zoom.c
grass/branches/releasebranch_6_4/visualization/nviz/src/draw.c
grass/branches/releasebranch_6_4/visualization/nviz/src/exag.c
grass/branches/releasebranch_6_4/visualization/nviz/src/lights.c
grass/branches/releasebranch_6_4/visualization/nviz/src/map_obj.c
grass/branches/releasebranch_6_4/visualization/nviz/src/misc.c
grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c
grass/branches/releasebranch_6_4/visualization/nviz/src/position.c
grass/branches/releasebranch_6_4/visualization/nviz/src/togl_flythrough.c
grass/branches/releasebranch_6_4/visualization/nviz/src/volume.c
Log:
Tcl 8.6 compatibility:
Funda Wang <fundawang mandriva.org>: fixes for deprecated Tcl interp->result;
reverted TCL hack 330 as no longer needed (trac #462; merge r35718 from devbr6)
Modified: grass/branches/releasebranch_6_4/lib/form/form.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/form/form.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/lib/form/form.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -6,8 +6,6 @@
#include <sys/time.h>
#include <sys/types.h>
-/* hack for tcl 8.6 */
-#define USE_INTERP_RESULT
#include <tcl.h>
#include <tk.h>
@@ -197,7 +195,7 @@
TCL_ERROR) {
G_warning
("Could not set Tcl system encoding to '%s' (%s)",
- Columns[i].value, interp->result);
+ Columns[i].value, Tcl_GetStringResult(interp));
}
}
continue;
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/Makefile
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/Makefile 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/Makefile 2013-04-18 06:53:31 UTC (rev 55872)
@@ -37,7 +37,7 @@
EXTRA_CFLAGS= $(TCLINCDIR) $(TKINCDIR) \
$(INC) \
$(TIFFINCPATH) $(DSPINC) \
- $(VECT_CFLAGS) $(OPENGLINC) -D USE_INTERP_RESULT
+ $(VECT_CFLAGS) $(OPENGLINC)
ifeq ($(OPENGL_X11),1)
EXTRA_CFLAGS += $(XCFLAGS)
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/anim_support.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/anim_support.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/anim_support.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -39,7 +39,7 @@
int mode;
if (argc != 2) {
- interp->result = "Error: should be Nset_interp_mode linear | spline";
+ Tcl_SetResult(interp, "Error: should be Nset_interp_mode linear | spline", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -48,8 +48,9 @@
else if (!strncmp(argv[1], "spline", 6))
mode = KF_SPLINE;
else {
- interp->result =
- "Error: interpoloation type must be either linear or spline";
+ Tcl_SetResult(interp,
+ "Error: interpoloation type must be either linear or spline",
+ TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -83,7 +84,7 @@
double tension;
if (argc != 2) {
- interp->result = "Error: should be Nset_tension float_value";
+ Tcl_SetResult(interp, "Error: should be Nset_tension float_value", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -91,8 +92,9 @@
return (TCL_ERROR);
if ((tension < 0) || (tension > 1)) {
- interp->result =
- "Error: float_value should be between 0 and 1 inclusive";
+ Tcl_SetResult(interp,
+ "Error: float_value should be between 0 and 1 inclusive",
+ TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -129,7 +131,7 @@
/* Parse arguments */
if (argc != 1) {
- interp->result = "Error: should be Nshowtension_start";
+ Tcl_SetResult(interp, "Error: should be Nshowtension_start", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -148,7 +150,7 @@
/* Parse arguments */
if (argc != 1) {
- interp->result = "Error: should be Nupdate_tension";
+ Tcl_SetResult(interp, "Error: should be Nupdate_tension", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -167,7 +169,7 @@
/* Parse arguments */
if (argc != 1) {
- interp->result = "Error: should be Nshowtension_stop";
+ Tcl_SetResult(interp, "Error: should be Nshowtension_stop", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -203,7 +205,7 @@
/* Parse arguments */
if (argc != 1) {
- interp->result = "Error: should be Nupdate_frames";
+ Tcl_SetResult(interp, "Error: should be Nupdate_frames", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -239,7 +241,7 @@
long num_frames;
if (argc != 2) {
- interp->result = "Error: should be Nset_numsteps #_frames";
+ Tcl_SetResult(interp, "Error: should be Nset_numsteps #_frames", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -276,7 +278,7 @@
/* Parse arguments */
if (argc != 1) {
- interp->result = "Error: should be Nclear_keys";
+ Tcl_SetResult(interp, "Error: should be Nclear_keys", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -349,10 +351,11 @@
int force_replace;
const char **listels;
int numels, i;
+ char tmp[128];
if (argc != 5) {
- interp->result =
- "Error: should be Nadd_key pos fmask_list force_replace precis";
+ Tcl_SetResult(interp,
+ "Error: should be Nadd_key pos fmask_list force_replace precis", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -401,8 +404,9 @@
fmask |= KF_ALL_MASK;
}
else {
- sprintf(interp->result, "Error: mask constant %s not understood",
+ sprintf(tmp, "Error: mask constant %s not understood",
listels[i]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
Tcl_Free((char *)listels);
return (TCL_ERROR);
}
@@ -446,9 +450,10 @@
double pos, precis;
int justone;
int num_deleted;
+ char tmp[10];
if (argc != 4) {
- interp->result = "Error: should be Ndelete_key pos precis justone";
+ Tcl_SetResult(interp, "Error: should be Ndelete_key pos precis justone", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -462,7 +467,8 @@
/* Call the function */
num_deleted = GK_delete_key((float)pos, (float)precis, justone);
- sprintf(interp->result, "%d", num_deleted);
+ sprintf(tmp, "%d", num_deleted);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_OK);
}
@@ -494,9 +500,10 @@
/* Parse arguments */
double new_pos, old_pos, precis;
int num_moved;
+ char tmp[10];
if (argc != 4) {
- interp->result = "Error: should be Nmove_key oldpos precis newpos";
+ Tcl_SetResult(interp, "Error: should be Nmove_key oldpos precis newpos", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -515,7 +522,8 @@
(float)old_pos, (float)precis, (float)new_pos);
G_debug(3, "Frames moved = %d\n", num_moved);
- sprintf(interp->result, "%d", num_moved);
+ sprintf(tmp, "%d", num_moved);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_OK);
}
@@ -547,8 +555,8 @@
int render_type;
if (argc != 3) {
- interp->result =
- "Error: should be Ndo_framestep frame_# [TRUE | FALSE]";
+ Tcl_SetResult(interp,
+ "Error: should be Ndo_framestep frame_# [TRUE | FALSE]", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -589,7 +597,7 @@
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nshow_site [ TRUE | FALSE] ";
+ Tcl_SetResult(interp, "Error: should be Nshow_site [ TRUE | FALSE] ", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -612,7 +620,7 @@
{
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nprint_keys filename";
+ Tcl_SetResult(interp, "Error: should be Nprint_keys filename", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -633,7 +641,7 @@
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nshow_vect [ TRUE | FALSE] ";
+ Tcl_SetResult(interp, "Error: should be Nshow_vect [ TRUE | FALSE] ", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -658,7 +666,7 @@
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nshow_vol [ TRUE | FALSE] ";
+ Tcl_SetResult(interp, "Error: should be Nshow_vol [ TRUE | FALSE] ", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -683,7 +691,7 @@
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nshow_lab [ TRUE | FALSE] ";
+ Tcl_SetResult(interp, "Error: should be Nshow_lab [ TRUE | FALSE] ", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -709,7 +717,7 @@
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nshow_path [ TRUE | FALSE] ";
+ Tcl_SetResult(interp, "Error: should be Nshow_path [ TRUE | FALSE] ", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -746,7 +754,7 @@
{
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nwrite_ppm file_name";
+ Tcl_SetResult(interp, "Error: should be Nwrite_ppm file_name", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -779,7 +787,7 @@
{
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Nwrite_ppm file_name";
+ Tcl_SetResult(interp, "Error: should be Nwrite_ppm file_name", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -787,7 +795,7 @@
/* Call the function */
GS_write_tif(argv[1]);
#else
- interp->result = "Error: no TIFF support";
+ Tcl_SetResult(interp, "Error: no TIFF support", TCL_VOLATILE);
return (TCL_ERROR);
#endif
@@ -809,7 +817,7 @@
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Noff_screen flag";
+ Tcl_SetResult(interp, "Error: should be Noff_screen flag", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -818,14 +826,14 @@
if (flag == 1) {
if (Create_OS_Ctx(width, height) == -1) {
- interp->result = "Error: Off screen context returned error";
+ Tcl_SetResult(interp, "Error: Off screen context returned error", TCL_VOLATILE);
return (TCL_ERROR);
}
}
else {
if (Destroy_OS_Ctx() == -1) {
- interp->result = "Error: Destroy context returned error";
+ Tcl_SetResult(interp, "Error: Destroy context returned error", TCL_VOLATILE);
return (TCL_ERROR);
}
}
@@ -846,14 +854,14 @@
{
/* Parse arguments */
if (argc != 2) {
- interp->result = "Error: should be Ninit_mpeg file_name";
+ Tcl_SetResult(interp, "Error: should be Ninit_mpeg file_name", TCL_VOLATILE);
return (TCL_ERROR);
}
/* Call the function */
if (gsd_init_mpeg(argv[1])) {
- interp->result =
- "Error: gsd_init_mpeg failed to initialize MPEG stream";
+ Tcl_SetResult(interp,
+ "Error: gsd_init_mpeg failed to initialize MPEG stream", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -872,7 +880,7 @@
{
/* Parse arguments */
if (argc != 1) {
- interp->result = "Error: should be Nwrite_mpeg_frame";
+ Tcl_SetResult(interp, "Error: should be Nwrite_mpeg_frame", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -894,7 +902,7 @@
{
/* Parse arguments */
if (argc != 1) {
- interp->result = "Error: should be Nclose_mpeg";
+ Tcl_SetResult(interp, "Error: should be Nclose_mpeg", TCL_VOLATILE);
return (TCL_ERROR);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/cutplane_obj.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/cutplane_obj.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/cutplane_obj.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -19,8 +19,8 @@
{
/* Verify arguments */
if (argc != 2) {
- sprintf(interp->result,
- "Usage: Nset_fence_color ABOVE | BELOW | BLEND | GREY | OFF");
+ Tcl_SetResult(interp,
+ "Usage: Nset_fence_color ABOVE | BELOW | BLEND | GREY | OFF", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -41,8 +41,8 @@
GS_set_fencecolor(FC_OFF);
}
else {
- sprintf(interp->result,
- "Error in Nset_fence_color, second argument must be one of ABOVE, BELOW, BLEND, GREY or OFF.");
+ Tcl_SetResult(interp,
+ "Error in Nset_fence_color, second argument must be one of ABOVE, BELOW, BLEND, GREY or OFF.", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -133,6 +133,7 @@
)
{
int id;
+ char tmp[128];
id = get_cp_idnum(argv[0]);
@@ -153,9 +154,10 @@
else if (!strcmp(argv[1], "get_trans"))
return (cp_get_trans(data, interp, id, argv, argc));
else {
- sprintf(interp->result,
+ sprintf(tmp,
"Usage: %s \tdraw [surf1 surf2]\n\t\ton\n\t\toff\n\t\tset_rot dx dy dz\n\t\tset_trans dx dy dz\n\t\tget_rot\n\t\tget_trans",
argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
}
@@ -189,7 +191,7 @@
int num_id;
if (argc != 2) {
- interp->result = "Usage: Nnew_cutplane_obj id_num";
+ Tcl_SetResult(interp, "Usage: Nnew_cutplane_obj id_num", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -367,10 +369,12 @@
int argc)
{
int bound1, bound2;
+ char tmp[128];
/* Verify arguments */
if ((argc != 2) && (argc != 4)) {
- sprintf(interp->result, "Usage: %s draw [surf1 surf2]", argv[0]);
+ sprintf(tmp, "Usage: %s draw [surf1 surf2]", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -380,16 +384,18 @@
}
else {
if (Tcl_GetInt(interp, argv[2], &bound1) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s draw %s %s, expected integer argument in surf1 field",
argv[0], argv[2], argv[3]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
if (Tcl_GetInt(interp, argv[3], &bound2) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s draw %s %s, expected integer argument in surf2 field",
argv[0], argv[2], argv[3]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
}
@@ -416,9 +422,11 @@
int
on_cp_obj(Nv_data * data, Tcl_Interp * interp, int id, char **argv, int argc)
{
+ char tmp[128];
/* Verify arguments are correct */
if (argc != 2) {
- sprintf(interp->result, "Usage: %s on", argv[0]);
+ sprintf(tmp, "Usage: %s on", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -445,9 +453,11 @@
int
off_cp_obj(Nv_data * data, Tcl_Interp * interp, int id, char **argv, int argc)
{
+ char tmp[128];
/* Verify arguments */
if (argc != 2) {
- sprintf(interp->result, "Usage: %s off", argv[0]);
+ sprintf(tmp, "Usage: %s off", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -474,9 +484,11 @@
state_cp_obj(Nv_data * data, Tcl_Interp * interp, int id, char **argv,
int argc)
{
+ char tmp[128];
/* Verify arguments */
if (argc != 2) {
- sprintf(interp->result, "Usage: %s state", argv[0]);
+ sprintf(tmp, "Usage: %s state", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -505,32 +517,37 @@
cp_set_rot(Nv_data * data, Tcl_Interp * interp, int id, char **argv, int argc)
{
double dx, dy, dz;
+ char tmp[128];
/* Verify arguments */
if (argc != 5) {
- sprintf(interp->result, "Usage: %s set_rot dx dy dz", argv[0]);
+ sprintf(tmp, "Usage: %s set_rot dx dy dz", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
/* Extract nummerical arguments */
if (Tcl_GetDouble(interp, argv[2], &dx) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s set_rot %s %s %s, expected numerical argument in dx field",
argv[0], argv[2], argv[3], argv[4]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
if (Tcl_GetDouble(interp, argv[3], &dy) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s set_rot %s %s %s, expected numerical argument in dy field",
argv[0], argv[2], argv[3], argv[4]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
if (Tcl_GetDouble(interp, argv[4], &dz) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s set_rot %s %s %s, expected numerical argument in dz field",
argv[0], argv[2], argv[3], argv[4]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -563,32 +580,37 @@
int argc)
{
double dx, dy, dz;
+ char tmp[128];
/* Verify arguments */
if (argc != 5) {
- sprintf(interp->result, "Usage: %s set_trans dx dy dz", argv[0]);
+ sprintf(tmp, "Usage: %s set_trans dx dy dz", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
/* Extract nummerical arguments */
if (Tcl_GetDouble(interp, argv[2], &dx) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s set_trans %s %s %s, expected numerical argument in dx field",
argv[0], argv[2], argv[3], argv[4]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
if (Tcl_GetDouble(interp, argv[3], &dy) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s set_trans %s %s %s, expected numerical argument in dy field",
argv[0], argv[2], argv[3], argv[4]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
if (Tcl_GetDouble(interp, argv[4], &dz) != TCL_OK) {
- sprintf(interp->result,
+ sprintf(tmp,
"Error in %s set_trans %s %s %s, expected numerical argument in dz field",
argv[0], argv[2], argv[3], argv[4]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -614,9 +636,11 @@
cp_get_rot(Nv_data * data, Tcl_Interp * interp, int id, char **argv, int argc)
{
char x[32], y[32], z[32];
+ char tmp[128];
if (argc != 2) {
- sprintf(interp->result, "Usage: %s get_rot", argv[0]);
+ sprintf(tmp, "Usage: %s get_rot", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -642,9 +666,11 @@
int argc)
{
char x[32], y[32], z[32];
+ char tmp[128];
if (argc != 2) {
- sprintf(interp->result, "Usage: %s get_trans", argv[0]);
+ sprintf(tmp, "Usage: %s get_trans", argv[0]);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_ERROR);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/do_zoom.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/do_zoom.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/do_zoom.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -67,8 +67,8 @@
/* Parse arguments */
if (argc != 4) {
- interp->result =
- "Error: should be Nstart_zoom file_name width height";
+ Tcl_SetResult(interp,
+ "Error: should be Nstart_zoom file_name width height", TCL_VOLATILE);
return (TCL_ERROR);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/draw.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/draw.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/draw.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -241,8 +241,7 @@
list[2] = z;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/exag.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/exag.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/exag.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -127,8 +127,7 @@
list[1] = min;
list[2] = max;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return TCL_OK;
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/lights.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/lights.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/lights.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -120,8 +120,7 @@
list[2] = b;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -142,8 +141,7 @@
list[2] = b;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -166,8 +164,7 @@
list[3] = w;
list[4] = NULL;
- interp->result = Tcl_Merge(4, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(4, list), TCL_DYNAMIC);
return (TCL_OK);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/map_obj.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/map_obj.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/map_obj.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -905,8 +905,7 @@
list[2] = wire;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -1028,8 +1027,7 @@
return (TCL_ERROR);
}
- interp->result = Tcl_Merge(n, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(n, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -1193,8 +1191,7 @@
list[2] = ztrans;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -2020,6 +2017,7 @@
int get_mask_mode(int id, int type, Nv_data * data, Tcl_Interp * interp)
{
int mode;
+ char tmp[10];
if (type != SURF) {
Tcl_SetResult(interp, "Type must be SURF for get_mask_mode",
@@ -2028,7 +2026,9 @@
}
GS_get_maskmode(id, &mode);
- sprintf(interp->result, "%d", mode);
+ sprintf(tmp, "%d", mode);
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, tmp);
return (TCL_OK);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/misc.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/misc.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/misc.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -33,7 +33,7 @@
/* Parse Arguments */
if (argc != 2) {
- interp->result = "Error: should be Nset_SDsurf id";
+ Tcl_SetResult(interp, "Error: should be Nset_SDsurf id", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -51,7 +51,7 @@
)
{
if (argc != 1) {
- interp->result = "Error: should be Nunset_SDsurf";
+ Tcl_SetResult(interp, "Error: should be Nunset_SDsurf", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -69,7 +69,7 @@
float scale;
if (argc != 2) {
- interp->result = "Error: should be Nset_SDscale scale";
+ Tcl_SetResult(interp, "Error: should be Nset_SDscale scale", TCL_VOLATILE);
return (TCL_ERROR);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -174,7 +174,7 @@
/* Put in the "please wait..." message unless we are in demo mode */
if ((strstr(cmd, "nviz") != NULL) && (!demo->answer)) {
if (Tcl_Eval(interp, startup_script) != TCL_OK)
- G_fatal_error("%s", interp->result);
+ G_fatal_error("%s", Tcl_GetStringResult(interp));
}
@@ -226,7 +226,7 @@
/* Look for scriptkill flag */
if (script_kill->answer) {
if (Tcl_VarEval(interp, "set NvizScriptKill 1 ", NULL) != TCL_OK)
- G_fatal_error("%s", interp->result);
+ G_fatal_error("%s", Tcl_GetStringResult(interp));
}
/* See if an alternative panel path is specified */
@@ -235,14 +235,14 @@
*/
if (Tcl_VarEval(interp, "set NvizAltPath ", panel_path->answer,
NULL) != TCL_OK)
- G_fatal_error("%s", interp->result);
+ G_fatal_error("%s", Tcl_GetStringResult(interp));
}
/* Get State file from command line */
if (state->answer) {
if (Tcl_VarEval(interp, "set NvizLoadState ", state->answer,
NULL) != TCL_OK)
- G_fatal_error("%s", interp->result);
+ G_fatal_error("%s", Tcl_GetStringResult(interp));
}
/* See if a script file was specified */
@@ -250,7 +250,7 @@
/* If so then set the variable NvizPlayScript to the file */
if (Tcl_VarEval(interp, "set NvizPlayScript ", script->answer,
NULL) != TCL_OK)
- G_fatal_error("%s", interp->result);
+ G_fatal_error("%s", Tcl_GetStringResult(interp));
}
#ifdef XSCRIPT
@@ -301,16 +301,16 @@
/* See if we should autoload the color file */
if (aload) {
- strncpy(tmp, interp->result, 29);
+ strncpy(tmp, Tcl_GetStringResult(interp), 29);
if (colr->answers) {
if (Tcl_VarEval(interp, tmp, " set_att color ",
colr->answers[i], NULL) != TCL_OK)
- G_fatal_error("%s", interp->result);
+ G_fatal_error("%s", Tcl_GetStringResult(interp));
}
else {
if (Tcl_VarEval(interp, tmp, " set_att color ",
elev->answers[i], NULL) != TCL_OK)
- G_fatal_error("%s", interp->result);
+ G_fatal_error("%s", Tcl_GetStringResult(interp));
}
}
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/position.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/position.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/position.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -36,8 +36,7 @@
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -61,8 +60,7 @@
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
@@ -283,7 +281,7 @@
else if (state_flag == 0)
GS_set_nofocus(); /* no center of view -- use viewdir */
else {
- interp->result = "Error: Flag must be either 0|1";
+ Tcl_SetResult(interp, "Error: Flag must be either 0|1", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -459,8 +457,7 @@
sprintf(fov_name, "%d", fov);
list[0] = fov_name;
list[1] = NULL;
- interp->result = Tcl_Merge(1, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(1, list), TCL_DYNAMIC);
return (TCL_OK);
@@ -498,8 +495,7 @@
sprintf(twist_name, "%d", twist);
list[0] = twist_name;
list[1] = NULL;
- interp->result = Tcl_Merge(1, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(1, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -525,8 +521,7 @@
list[3] = west;
list[4] = NULL;
- interp->result = Tcl_Merge(4, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(4, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -551,8 +546,7 @@
if (!GS_get_selected_point_on_surface(sx, sy, &id, &x, &y, &z)) {
list[0] = NULL;
- interp->result = Tcl_Merge(0, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(0, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -568,8 +562,7 @@
list[3] = idname;
list[4] = NULL;
- interp->result = Tcl_Merge(4, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(4, list), TCL_DYNAMIC);
return (TCL_OK);
@@ -600,8 +593,7 @@
if (!GS_get_selected_point_on_surface(sx, sy, &id, &x, &y, &z)) {
list[0] = NULL;
- interp->result = Tcl_Merge(0, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(0, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -618,8 +610,7 @@
list[4] = (char *)query_vect(name, x, y);
list[5] = NULL;
- interp->result = Tcl_Merge(5, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(5, list), TCL_DYNAMIC);
return (TCL_OK);
@@ -791,8 +782,7 @@
list[2] = NULL;
- interp->result = Tcl_Merge(2, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(2, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -802,7 +792,7 @@
char temp[40];
if (argc != 1) {
- interp->result = "Usage: Nget_xyrange";
+ Tcl_SetResult(interp, "Usage: Nget_xyrange", TCL_VOLATILE);
return (TCL_ERROR);
}
@@ -834,8 +824,7 @@
list[2] = cmid;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -894,7 +883,7 @@
/* Try and find a surface to use as a reference */
if ((Tcl_Eval(interp, "Nget_surf_list") != TCL_OK) ||
- (Tcl_SplitList(interp, interp->result, &list_count, &list_space) !=
+ (Tcl_SplitList(interp, Tcl_GetStringResult(interp), &list_count, &list_space) !=
TCL_OK)) {
Tcl_SetResult(interp,
"Internal Error: Parse failure in Nsave_3dview_cmd",
@@ -941,7 +930,7 @@
/* Try and find a surface to use as a reference */
if ((Tcl_Eval(interp, "Nget_surf_list") != TCL_OK) ||
- (Tcl_SplitList(interp, interp->result, &list_count, &list_space) !=
+ (Tcl_SplitList(interp, Tcl_GetStringResult(interp), &list_count, &list_space) !=
TCL_OK)) {
Tcl_SetResult(interp,
"Internal Error: Parse failure in Nsave_3dview_cmd",
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/togl_flythrough.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/togl_flythrough.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/togl_flythrough.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -193,8 +193,7 @@
list[0] = scale0;
list[1] = scale1;
- interp->result = Tcl_Merge(2, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(2, list), TCL_DYNAMIC);
return (TCL_OK);
}
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/volume.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/volume.c 2013-04-18 06:47:35 UTC (rev 55871)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/volume.c 2013-04-18 06:53:31 UTC (rev 55872)
@@ -48,8 +48,7 @@
list[2] = z;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -332,6 +331,7 @@
int isosurf_get_mask_mode(int id, Tcl_Interp * interp, int argc, char *argv[])
{
int mode, isosurf_id;
+ char tmp[128];
if (argc != 4) {
Tcl_SetResult(interp,
@@ -343,7 +343,8 @@
isosurf_id = atoi(argv[3]);
GVL_isosurf_get_maskmode(id, isosurf_id, &mode);
- sprintf(interp->result, "%d", mode);
+ sprintf(tmp, "%d", mode);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_OK);
}
@@ -454,8 +455,7 @@
list[2] = z;
list[3] = NULL;
- interp->result = Tcl_Merge(3, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(3, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -577,8 +577,7 @@
list[6] = rdir;
list[7] = NULL;
- interp->result = Tcl_Merge(7, list);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, Tcl_Merge(7, list), TCL_DYNAMIC);
return (TCL_OK);
}
@@ -699,6 +698,7 @@
int slice_get_transp(int id, Tcl_Interp * interp, int argc, char *argv[])
{
int slice_id, transp;
+ char tmp[128];
if (argc != 4) {
Tcl_SetResult(interp,
@@ -711,7 +711,8 @@
GVL_slice_get_transp(id, slice_id, &transp);
- sprintf(interp->result, "%d", transp);
+ sprintf(tmp, "%d", transp);
+ Tcl_SetResult(interp, tmp, TCL_VOLATILE);
return (TCL_OK);
}
More information about the grass-commit
mailing list