summaryrefslogtreecommitdiff
path: root/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci
diff options
context:
space:
mode:
authorAbhinav Dronamraju2017-07-10 22:08:27 +0530
committerAbhinav Dronamraju2017-07-10 22:08:27 +0530
commitf80b5800ddb8417530f68049f6895beccb89cadf (patch)
tree564a23878bc400ecc0873bb4b1f5b172af22cfc6 /2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci
parentc1874d367d68cb47b82cc7a1173caaf38e9e3d68 (diff)
parent2e9eadc75e51483c41a30544496b4e05c0cf7c41 (diff)
downloadScilab2C-f80b5800ddb8417530f68049f6895beccb89cadf.tar.gz
Scilab2C-f80b5800ddb8417530f68049f6895beccb89cadf.tar.bz2
Scilab2C-f80b5800ddb8417530f68049f6895beccb89cadf.zip
Pulled from upstream master
Diffstat (limited to '2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci')
-rw-r--r--2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci7
1 files changed, 7 insertions, 0 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci b/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci
index 475e2e0c..bdaf9c0e 100644
--- a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci
+++ b/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci
@@ -11,6 +11,10 @@ function Cdeclaration = C_GenDeclarations_Dup(InArg,NInArg,com_type,ArgStruct,CD
//
// Status:
// 27-Oct-2007 -- Raffaele Nutricato: Author.
+//
+// 25-June-2017 -- Ukasha Noor: Modified it.
+// This function is called for array declaration in C.
+//
// 10-Jun-2008 -- Raffaele Nutricato: adapted to work with realloc function.
//
// Copyright 2007 Raffaele Nutricato.
@@ -84,6 +88,9 @@ if (ArgStruct.Dimension > 0)
computedSize = computedSize + ' * ' + ArgStruct.Size(sizeIterator);
computedSizeField = computedSizeField + ', ' + ArgStruct.Size(sizeIterator);
end
+// Modified Changes: row tells number of rows and col is number of columns in array.
+// col_type tells whether it is floatComplex or doubleComplex or real.
+// and accordingly it declares the array.
Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+' '+ArgStruct.Name+'['+computedSize+']={';
row = eval(ArgStruct.Size(1))
col = eval(ArgStruct.Size(2))