summaryrefslogtreecommitdiffstats
path: root/scilab/modules/graphics
diff options
context:
space:
mode:
authorPierre LANDO <pierre.lando@scilab.org>2010-03-29 17:20:38 +0200
committerPierre LANDO <pierre.lando@scilab.org>2010-03-29 17:20:38 +0200
commitc7d8e60d1f9b4a113f46490ec90898d33726ce4c (patch)
tree3cf8ec34fcf0ee00d0c06c803986cb3510d8bf47 /scilab/modules/graphics
parente0bef701fe37b29a00f3abce7db00d2ee85c9215 (diff)
downloadscilab-c7d8e60d1f9b4a113f46490ec90898d33726ce4c.zip
scilab-c7d8e60d1f9b4a113f46490ec90898d33726ce4c.tar.gz
Optimize call to "sciGetPointerFromHandle"
Diffstat (limited to 'scilab/modules/graphics')
-rw-r--r--scilab/modules/graphics/sci_gateway/c/sci_Legend.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/scilab/modules/graphics/sci_gateway/c/sci_Legend.c b/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
index 9b5ae22..d91dcad 100644
--- a/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
+++ b/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
@@ -96,27 +96,27 @@ int sci_Legend( char * fname, unsigned long fname_len )
96 for (i = 0; i < n;i++) 96 for (i = 0; i < n;i++)
97 { 97 {
98 handelsvalue = (unsigned long) (hstk(l1))[n-1-i]; 98 handelsvalue = (unsigned long) (hstk(l1))[n-1-i];
99 pobj = sciGetPointerFromHandle(handelsvalue);
99 100
100 /** 101 /**
101 We get the current pSubwin & pFigure from the first handel's parents. 102 We get the current pSubwin & pFigure from the first handel's parents.
102 **/ 103 **/
103 if (i==0) { 104 if (i==0) {
104 psubwin = sciGetParentSubwin( sciGetPointerFromHandle(handelsvalue) ); 105 psubwin = sciGetParentSubwin( pobj );
105 pFigure = sciGetParentFigure( sciGetPointerFromHandle(handelsvalue) ); 106 pFigure = sciGetParentFigure( pobj );
106 } 107 }
107 108
108 /** 109 /**
109 We check that the pSubwin is the same for all given handle. 110 We check that the pSubwin is the same for all given handle.
110 **/ 111 **/
111 if (psubwin!=sciGetParentSubwin( sciGetPointerFromHandle(handelsvalue) )) 112 if (psubwin!=sciGetParentSubwin(pobj))
112 { 113 {
113 Scierror(999,_("%s: Objects must have the same axes.\n"),fname); 114 Scierror(999,_("%s: Objects must have the same axes.\n"),fname);
114 return 0; 115 return 0;
115 } 116 }
116 117
117 pobj = sciGetPointerFromHandle(handelsvalue);
118 if (pobj == NULL) 118 if (pobj == NULL)
119 { 119 {
120 freeArrayOfString(Str,n); 120 freeArrayOfString(Str,n);
121 FREE(tabofhandles); 121 FREE(tabofhandles);
122 Scierror(999,_("%s: The handle is no more valid.\n"),fname); 122 Scierror(999,_("%s: The handle is no more valid.\n"),fname);
@@ -124,7 +124,7 @@ int sci_Legend( char * fname, unsigned long fname_len )
124 } 124 }
125 type=sciGetEntityType(pobj); 125 type=sciGetEntityType(pobj);
126 if (type != SCI_POLYLINE) 126 if (type != SCI_POLYLINE)
127 { 127 {
128 freeArrayOfString(Str,n); 128 freeArrayOfString(Str,n);
129 FREE(tabofhandles); 129 FREE(tabofhandles);
130 Scierror(999,_("%s: The %d th handle is not a polyline handle.\n"),fname,i+1); 130 Scierror(999,_("%s: The %d th handle is not a polyline handle.\n"),fname,i+1);