Revision dc742c14
ID | dc742c140dd32eea71e8d73abafa3674079ba94e |
Fixed bugs and compiler warnings in old code.
scout/libscout/src/helper_classes/PQWrapper.cpp | ||
---|---|---|
20 | 20 |
void PQWrapper::insert(Order o) |
21 | 21 |
{ |
22 | 22 |
|
23 |
int position=0; |
|
23 |
unsigned int position=0;
|
|
24 | 24 |
bool foundPosition = false; |
25 | 25 |
while (!foundPosition && position < arrContents) |
26 | 26 |
{ |
... | ... | |
37 | 37 |
{ |
38 | 38 |
if (arrContents<arrCapacity) |
39 | 39 |
{ |
40 |
for (int i = arrContents; i >=position+1; i--) |
|
40 |
for (unsigned int i = arrContents; i >=position+1; i--)
|
|
41 | 41 |
{ |
42 | 42 |
minElems[i] = minElems[i-1]; |
43 | 43 |
} |
... | ... | |
47 | 47 |
else |
48 | 48 |
{ |
49 | 49 |
pq.push(minElems[arrCapacity-1]); |
50 |
for (int i = arrContents-1; i >= position+1; i--) |
|
50 |
for (unsigned int i = arrContents-1; i >= position+1; i--)
|
|
51 | 51 |
{ |
52 | 52 |
minElems[i] = minElems[i-1]; |
53 | 53 |
} |
... | ... | |
71 | 71 |
{ |
72 | 72 |
if (index >= arrContents) return minElems[-1];//TODO: can I return null? |
73 | 73 |
Order toDelete = minElems[index]; |
74 |
for (int i = index; i < arrContents - 1; i++) |
|
74 |
for (unsigned int i = index; i < arrContents - 1; i++)
|
|
75 | 75 |
{ |
76 | 76 |
minElems[i] = minElems[i+1]; |
77 | 77 |
} |
Also available in: Unified diff