I have an array for registering external procedure loaders:
Code: Select all
DIM SHARED ArrayLoaders() AS UINTEGER
SUB RegisterLoader(LoaderPointer AS UINTEGER)
DIM LoaderIndex AS LONG = UBOUND(ArrayLoaders) + 1
REDIM PRESERVE ArrayLoaders(LoaderIndex)
ArrayLoaders(LoaderIndex) = LoaderPointer
END SUB
SUB RunLoaders()
DIM LoaderEntry AS SUB()
DIM LoaderIndex AS LONG = UBOUND(ArrayLoaders)
IF LoaderIndex >= 0 THEN
FOR i AS LONG = 0 TO LoaderIndex
LoaderEntry = ArrayLoaders(i)
IF LoaderEntry > 0 THEN
LoaderEntry()
END IF
NEXT
END IF
END SUB
Code: Select all
'These are the names of existing procedures
RegisterLoader(CINT(ProcPtr(LoadSession)))
RegisterLoader(CINT(ProcPtr(LoadUserData)))
core\modules.bas(96) warning 4(1): Suspicious pointer assignment
which line 96 is:
LoaderEntry = ArrayLoaders(i)
I tried converting the UINTEGER value to PTR with LoaderEntry = CPTR(UINTEGER PTR, ArrayLoaders(i)) but the warning persists.