Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 57fb8ee

Browse files
perostOpenModelica-Hudson
authored andcommitted
Rename System.stringHashDjb2Mod alias.
- Replace all calls to System.stringHashDjb2Mod with the builtin stringHashDjb2Mod, and remove the alias in meta_modelica_builtin.h. Belonging to [master]: - #2943
1 parent 0eec718 commit 57fb8ee

17 files changed

+22
-26
lines changed

Compiler/BackEnd/BinaryTree.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected
118118
Integer keyhash;
119119
algorithm
120120
keystr := ComponentReference.printComponentRefStr(key);
121-
keyhash := System.stringHashDjb2Mod(keystr,BaseHashTable.hugeBucketSize);
121+
keyhash := stringHashDjb2Mod(keystr,BaseHashTable.hugeBucketSize);
122122
v := treeGet3(bt, keystr, keyhash, treeGet2(bt, keystr, keyhash));
123123
end treeGet;
124124

@@ -207,7 +207,7 @@ protected
207207
algorithm
208208
str := ComponentReference.printComponentRefStr(inKey);
209209
// We use modulo hashes in order to avoid problems with boxing/unboxing of integers in bootstrapped OMC
210-
outBinTree := treeAdd2(inBinTree,inKey,System.stringHashDjb2Mod(str,BaseHashTable.hugeBucketSize),str,inValue);
210+
outBinTree := treeAdd2(inBinTree,inKey,stringHashDjb2Mod(str,BaseHashTable.hugeBucketSize),str,inValue);
211211
end treeAdd;
212212

213213
protected function treeAdd2 "author: PA

Compiler/BackEnd/Unit.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ protected
182182
String str;
183183
algorithm
184184
str := unit2string(inKey);
185-
outHash := System.stringHashDjb2Mod(str, inMod);
185+
outHash := stringHashDjb2Mod(str, inMod);
186186
end hashUnitMod;
187187

188188
public function unitEqual

Compiler/FrontEnd/Patternm.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ algorithm
954954

955955
case (DAE.PAT_CONSTANT(exp=DAE.SCONST(str))::pats,_,_,_,_)
956956
equation
957-
ix = System.stringHashDjb2Mod(str,65536);
957+
ix = stringHashDjb2Mod(str,65536);
958958
false = listMember(ix,ixs);
959959
(ty,extraarg) = findPatternToConvertToSwitch2(pats,ix::ixs,DAE.T_STRING_DEFAULT,allSubPatternsMatch,numPatternsInMatrix);
960960
then (ty,extraarg);

Compiler/NFFrontEnd/NFCardinalityTable.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ encapsulated package NFCardinalityTable
7272
input Integer size;
7373
output Table table;
7474
algorithm
75-
table := BaseHashTable.emptyHashTableWork(size, (System.stringHashDjb2Mod, stringEq, Util.id, intString));
75+
table := BaseHashTable.emptyHashTableWork(size, (stringHashDjb2Mod, stringEq, Util.id, intString));
7676
end emptyCardinalityTable;
7777

7878
function fromConnections

Compiler/NFFrontEnd/NFComponentRef.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ public
660660
function hash
661661
input ComponentRef cref;
662662
input Integer mod;
663-
output Integer hash = System.stringHashDjb2Mod(toString(cref), mod);
663+
output Integer hash = stringHashDjb2Mod(toString(cref), mod);
664664
end hash;
665665

666666
function toPath

Compiler/NFFrontEnd/NFHashTableStringToUnit.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function emptyHashTableSized
109109
input Integer size;
110110
output HashTable hashTable;
111111
algorithm
112-
hashTable := BaseHashTable.emptyHashTableWork(size, (System.stringHashDjb2Mod, stringEq, Util.id, NFUnit.unit2string));
112+
hashTable := BaseHashTable.emptyHashTableWork(size, (stringHashDjb2Mod, stringEq, Util.id, NFUnit.unit2string));
113113
end emptyHashTableSized;
114114

115115
annotation(__OpenModelica_Interface="frontend");

Compiler/NFFrontEnd/NFUnit.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ protected
182182
String str;
183183
algorithm
184184
str := unit2string(inKey);
185-
outHash := System.stringHashDjb2Mod(str, inMod);
185+
outHash := stringHashDjb2Mod(str, inMod);
186186
end hashUnitMod;
187187

188188
public function unitEqual

Compiler/Template/SimCodeTV.mo

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ package builtin
185185
output TypeVar head;
186186
end listHead;
187187

188+
function stringHashDjb2Mod
189+
input String str;
190+
input Integer mod;
191+
output Integer hash;
192+
end stringHashDjb2Mod;
193+
188194
uniontype SourceInfo "The Info attribute provides location information for elements and classes."
189195
record SOURCEINFO
190196
String fileName;
@@ -1493,12 +1499,6 @@ package System
14931499
output Integer result;
14941500
end unescapedStringLength;
14951501

1496-
function stringHashDjb2Mod
1497-
input String str;
1498-
input Integer mod;
1499-
output Integer hash;
1500-
end stringHashDjb2Mod;
1501-
15021502
function escapedString
15031503
input String unescapedString;
15041504
input Boolean unescapeNewline;

Compiler/Util/HashSetString.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function emptyHashSetSized
8888
input Integer size;
8989
output HashSet hashSet;
9090
algorithm
91-
hashSet := BaseHashSet.emptyHashSetWork(size,(System.stringHashDjb2Mod,stringEq,Util.id));
91+
hashSet := BaseHashSet.emptyHashSetWork(size,(stringHashDjb2Mod,stringEq,Util.id));
9292
end emptyHashSetSized;
9393

9494
annotation(__OpenModelica_Interface="util");

Compiler/Util/HashTable5.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected
8888
String crstr;
8989
algorithm
9090
crstr := Dump.printComponentRefStr(cr);
91-
res := System.stringHashDjb2Mod(crstr,mod);
91+
res := stringHashDjb2Mod(crstr,mod);
9292
end hashFunc;
9393

9494
public function emptyHashTable

0 commit comments

Comments
 (0)