Skip to content

Commit

Permalink
- Avoid some unused expression warnings for failure(_ = fn())
Browse files Browse the repository at this point in the history
- Fix the variableFilter regex for OSX


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19689 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 22, 2014
1 parent fdc58e2 commit c05c104
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenC.tpl
Expand Up @@ -7665,7 +7665,7 @@ case STMT_NORETCALL(__) then
let expPart = daeExp(exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
<<
<%preExp%>
<%expPart%>;
<% if endsWith(expPart,".c1") then "" else '<%expPart%>;' %>
>>
end algStmtNoretcall;

Expand Down
7 changes: 7 additions & 0 deletions Compiler/Template/SimCodeTV.mo
Expand Up @@ -2365,6 +2365,13 @@ package Util
input String in;
output String out;
end testsuiteFriendly;

function endsWith
input String str;
input String suffix;
output Boolean b;
end endsWith;

end Util;

package List
Expand Down
16 changes: 16 additions & 0 deletions Compiler/Util/Util.mo
Expand Up @@ -4155,4 +4155,20 @@ algorithm
v := v + 1;
end nextPowerOf2;

public function endsWith
input String str;
input String suffix;
output Boolean b;
algorithm
b := match (str,suffix)
local
String strSuffix;
case ("",_) then false;
case (_,_)
equation
strSuffix = System.substring(str, if_(stringLength(str) > stringLength(suffix)+1, stringLength(str) - stringLength(suffix) + 1, 1), stringLength(str));
then stringEq(strSuffix,suffix);
end match;
end endsWith;

end Util;

0 comments on commit c05c104

Please sign in to comment.