From f6f5a7d421af26fbc240e1f92466af2206b1228e Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Mon, 8 Mar 2010 14:56:50 -0600 Subject: Remove const statements where possible --- Tools/CodeGen/CalculationFunction.m | 2 +- Tools/CodeGen/CodeGen.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index cad6bbf..2f05811 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -156,7 +156,7 @@ assignVariableFromExpression[dest_, expr_] := Module[{tSym, type, cleanExpr, cod cleanExpr = ReplacePowers[expr] /. sym`t -> tSym; If[SOURCELANGUAGE == "C", - code = type <> " const " <> ToString[dest] <> " = " <> ToString[cleanExpr, CForm, PageWidth -> Infinity] <> ";\n", + code = type <> " " <> ToString[dest] <> " = " <> ToString[cleanExpr, CForm, PageWidth -> Infinity] <> ";\n", code = ToString@dest <> ".eq." <> ToString[cleanExpr, FortranForm, PageWidth -> 120] <> "\n" ]; diff --git a/Tools/CodeGen/CodeGen.m b/Tools/CodeGen/CodeGen.m index 1fb2a05..e7799a1 100644 --- a/Tools/CodeGen/CodeGen.m +++ b/Tools/CodeGen/CodeGen.m @@ -294,8 +294,8 @@ MaybeAssignVariableInLoop[dest_, src_, cond_] := DeclareMaybeAssignVariableInLoop[type_, dest_, src_, mmaCond_, codeCond_] := If [mmaCond, - {type, " const ", dest, " = (", codeCond, ") ? (", src, ") : 0.0", EOL[]}, - {type, " const ", dest, " = ", src, EOL[]}]; + {type, " ", dest, " = (", codeCond, ") ? (", src, ") : 0.0", EOL[]}, + {type, " ", dest, " = ", src, EOL[]}]; (* TODO: move these into OpenMP loop *) DeclareVariablesInLoopVectorised[dests_, temps_, srcs_] := -- cgit v1.2.3