Fix issues resulting in memory trashing if over ~2500 entries were loaded.

This resulted from indexing off a pointer with signed int index values, which in some cases causes ORCA/C to generate code that only works within 32k bytes of the pointer base. The fix is to use unsigned index values, which results in indexing working correctly up to 64k bytes.
This commit is contained in:
Stephen Heumann 2019-04-18 23:20:51 -05:00
parent ef301fd7fc
commit 5ba69db3f2
2 changed files with 3 additions and 3 deletions

View File

@ -215,7 +215,7 @@ void UpdateControlState(void) {
}
/* Only allow "Mount Disk" to be clicked if there is a disk selected */
int currentSelection = NextMember2(0, (Handle)disksListHandle);
unsigned currentSelection = NextMember2(0, (Handle)disksListHandle);
if (currentSelection != 0) {
if (diskList[currentSelection-1].memPtr == moreResultsString) {
if (!moreResultsSelected) {

View File

@ -30,7 +30,7 @@
static Rect diskListRect = {45, 10, 147, 386};
/* Current length in disk list */
static int diskListLength = 0;
static unsigned diskListLength = 0;
/* Number of current page of results from server */
int pageNum;
@ -50,7 +50,7 @@ void DoSearch(boolean getMore) {
char *searchURL = NULL;
enum NetDiskError result = 0;
int initialDiskListLength = diskListLength;
unsigned initialDiskListLength = diskListLength;
WaitCursor();