Skip to content

Commit 6edb679

Browse files
author
Matthias Kastner
committed
fix inconsistency
since Function parsing is the first thing in parseProcedure(), numEntries=0 and idx is basically starting to run at idx=0 in the for loop. Therefore, function parsing worked as expected. This is unwanted behaviour, as the function depends on being called first. If not, not all list items from `funcList` will be read in `func = StringFromList(idx, funcList)`. Depending on numEntries in declWave. Changing this to a for loop that parses all functions no matter of the current length of declWave.
1 parent 397cff9 commit 6edb679

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

procedures/CodeBrowser.ipf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,16 +294,18 @@ Function addDecoratedFunctions(module, procedure, declWave, lineWave)
294294
String options, funcList
295295
string func, funcDec, fi
296296
string threadsafeTag, specialTag, params, subtypeTag, returnType
297-
variable idx, numMatches, numEntries
297+
variable i, idx, numMatches, numEntries
298298

299299
// list normal, userdefined, override and static functions
300300
options = "KIND:18,WIN:" + procedure
301301
funcList = FunctionList("*", ";", options)
302302
numMatches = ItemsInList(funcList)
303303
numEntries = DimSize(declWave, 0)
304304
Redimension/N=(numEntries + numMatches, -1) declWave, lineWave
305-
for(idx = numEntries; idx < (numEntries + numMatches); idx += 1)
306-
func = StringFromList(idx, funcList)
305+
306+
idx = numEntries
307+
for(i = 0; i < numMatches; i += 1)
308+
func = StringFromList(i, funcList)
307309
fi = FunctionInfo(module + "#" + func, procedure)
308310
if(!cmpstr(func, "Procedures Not Compiled"))
309311
fi = ReplaceNumberByKey("PROCLINE", fi, 0)
@@ -319,6 +321,7 @@ Function addDecoratedFunctions(module, procedure, declWave, lineWave)
319321
declWave[idx][0] = createMarkerForType("function" + specialTag + threadsafeTag)
320322
declWave[idx][1] = formatDecl(func, params, subtypeTag, returnType = returnType)
321323
lineWave[idx] = NumberByKey("PROCLINE", fi)
324+
idx += 1
322325
endfor
323326

324327
string msg

0 commit comments

Comments
 (0)