diff options
author | jofret | 2010-07-16 22:47:14 +0000 |
---|---|---|
committer | jofret | 2010-07-16 22:47:14 +0000 |
commit | 33751b04f9a0245a1a7f2d8f5f4c8db350e58636 (patch) | |
tree | faf169707e51c2ff595b1453c7fe03f692de7f09 | |
parent | aefd433b85ce8faf42f04f17b2990ebffa3db871 (diff) | |
download | scilab2c-33751b04f9a0245a1a7f2d8f5f4c8db350e58636.tar.gz scilab2c-33751b04f9a0245a1a7f2d8f5f4c8db350e58636.tar.bz2 scilab2c-33751b04f9a0245a1a7f2d8f5f4c8db350e58636.zip |
Correct BUG caused by multiple output management
3 files changed, 15 insertions, 13 deletions
diff --git a/scilab2c/macros/FunctionAnnotation/FA_GetFunAnn.sci b/scilab2c/macros/FunctionAnnotation/FA_GetFunAnn.sci index 86b99328..7c0ed937 100644 --- a/scilab2c/macros/FunctionAnnotation/FA_GetFunAnn.sci +++ b/scilab2c/macros/FunctionAnnotation/FA_GetFunAnn.sci @@ -4,7 +4,7 @@ function [FunTypeAnnot,FunSizeAnnot] = ... // FA_GetFunAnn(NInArg,NOutArg,FunName,FileInfo,SharedInfo)
// -----------------------------------------------------------------
// #RNU_RES_B
-// This function extracts the TYPE and SIZE annotations from the
+// This function extracts the TYPE and SIZE annotations from the
// input .ann file.
// No blank lines are allowed between function annotations.
//
@@ -65,7 +65,7 @@ while ((meof(inclsfid) == 0) & (FoundNIn == 0) & (FoundNOut == 0)) check_string = stripblanks(mgetl(inclsfid,1));
line_position = line_position + 1;
if (~isempty(check_string))
-
+
// #RNU_RES_B
// --- Search for the NIN annotation. ---
// #RNU_RES_E
@@ -83,13 +83,13 @@ while ((meof(inclsfid) == 0) & (FoundNIn == 0) & (FoundNOut == 0)) check_string = stripblanks(mgetl(inclsfid,1));
line_position = line_position + 1;
if (~isempty(check_string))
-
+
// #RNU_RES_B
// --- Search for the NOUT annotation. ---
// #RNU_RES_E
if (SCI2Cstrncmps1size(SharedInfo.Annotations.FUNNOUT,check_string))
FUNNOUTAnnot = part(check_string,length(SharedInfo.Annotations.FUNNOUT)+1:length(check_string));
-
+
// #RNU_RES_B
// --- Check NOUT value. ---
// #RNU_RES_E
@@ -133,7 +133,7 @@ if (FoundNOut*FoundNIn == 0) else
for cntout = 1:NOutArg
SCI2C_nout=cntout; // Useful for eval.
-
+
// #RNU_RES_B
// Read the Fun type annotation.
// #RNU_RES_E
@@ -154,16 +154,16 @@ else PrintStringInfo('SCI2CERROR: Line '+string(line_position)+' Function type annotation not found in file: '+SCI2CClassFileName,ReportFileName,'both','y');
PrintStringInfo(' ',ReportFileName,'both','y');
error(9999, 'SCI2CERROR: Line '+string(line_position)+' Function type annotation not found in file: '+SCI2CClassFileName);
- end
+ end
// #RNU_RES_B
// --- Read the Fun size annotation. ---
// #RNU_RES_E
SCI2C_nelem = 0; // Useful for eval.
- while(SCI2C_nelem < 2 | isempty(check_string) == %F)
+ while(SCI2C_nelem < 2 & isempty(check_string) == %F)
SCI2C_nelem = SCI2C_nelem + 1
line_position = line_position + 1;
- if (isempty(check_string) == %F)
+ if (isempty(check_string) == %F)
tmpannstring = eval(SharedInfo.Annotations.FUNSIZE);
check_string = stripblanks(mgetl(inclsfid,1));
if (SCI2Cstrncmps1size(tmpannstring,check_string))
diff --git a/scilab2c/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/scilab2c/macros/FunctionAnnotation/FA_GetOutArgInfo.sci index 8b379a54..cc18dcd9 100644 --- a/scilab2c/macros/FunctionAnnotation/FA_GetOutArgInfo.sci +++ b/scilab2c/macros/FunctionAnnotation/FA_GetOutArgInfo.sci @@ -68,7 +68,8 @@ for counterin = 1:NInArg end
for counterout = 1:NOutArg
- if(mtlb_strcmp(FunTypeAnnot,'FA_TP_USER'))
+
+ if(FunTypeAnnot == 'FA_TP_USER')
UpdatedOutArg(counterout).Type = FA_TP_USER(FunPrecSpecifier,DefaultPrecision);
else
UpdatedOutArg(counterout).Type = eval(FunTypeAnnot(counterout));
@@ -97,8 +98,9 @@ for counterout = 1:NOutArg // This is a dynamic memory extension of a local variable and for the moment
// we issue an error according to SCI2C specifications
// #RNU_RES_E
+
for iterOutputPosition=1:size(FunSizeAnnot, '*')
- tmpeval = eval(FunSizeAnnot(counterout,iterOutputPosition));
+ tmpeval = eval(FunSizeAnnot(iterOutputPosition));
if (IsNanSize(tmpeval))
if SharedInfo.ForExpr.OnExec == 0
EM_NanSize(ReportFileName);
diff --git a/scilab2c/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/scilab2c/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 4474bbb0..60b13cbf 100644 --- a/scilab2c/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/scilab2c/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -1505,16 +1505,16 @@ PrintStringInfo('NIN= 1',ClassFileName,'file','y'); PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
-PrintStringInfo('OUT(1).SZ(2)= FA_SZ_RTMAX(FA_MUL(IN(1).SZ(1),IN(1).SZ(2)))',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MUL(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
PrintStringInfo('NIN= 1',ClassFileName,'file','y');
PrintStringInfo('NOUT= 2 ',ClassFileName,'file','y');
PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
-PrintStringInfo('OUT(1).SZ(2)= FA_SZ_RTMAX(FA_MUL(IN(1).SZ(1),IN(1).SZ(2)))',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MAX(FA_MUL(IN(1).SZ(1),IN(1).SZ(2)),''1'')',ClassFileName,'file','y');
PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(2)= FA_SZ_RTMAX(FA_MUL(IN(1).SZ(1),IN(1).SZ(2)))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= FA_MAX(FA_MUL(IN(1).SZ(1),IN(1).SZ(2)),''1'')',ClassFileName,'file','y');
PrintStringInfo('NIN= 2',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
|