1
0

Minor code cleanup

Mostly const fixes in headers to make it easier for users to have more warnings enabled in static code analysis
Also updating our own rules a bit (kicking some out we won't need yet).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6583 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2024-01-01 15:29:28 +00:00
parent 2fdb1fc156
commit bff1a50c34
14 changed files with 53 additions and 59 deletions

View File

@@ -45,18 +45,17 @@ inline void heapsort(T* array_, s32 size)
// the maximum always +2 and the element always +1
T* virtualArray = array_ - 1;
s32 virtualSize = size + 2;
s32 i;
const s32 virtualSize = size + 2;
// build heap
for (i=((size-1)/2); i>=0; --i)
for (s32 i=((size-1)/2); i>=0; --i)
heapsink(virtualArray, i+1, virtualSize-1);
// sort array, leave out the last element (0)
for (i=size-1; i>0; --i)
for (s32 i=size-1; i>0; --i)
{
T t = array_[0];
const T t = array_[0];
array_[0] = array_[i];
array_[i] = t;
heapsink(virtualArray, 1, i + 1);