diff --git a/sc2/src/sc2code/libs/compiler.h b/sc2/src/sc2code/libs/compiler.h index 0d00fc579..cd9cedea2 100644 --- a/sc2/src/sc2code/libs/compiler.h +++ b/sc2/src/sc2code/libs/compiler.h @@ -49,8 +49,6 @@ typedef unsigned char UNICODE; typedef PVOID PTR_DESC; -#define FAR_PTR_ADD(fp,val) (*((PBYTE *) (fp)) += (val)) - #define PARAGRAPH_SIZE (1 << PARAGRAPH_SHIFT) #define NULL_PTR 0L diff --git a/sc2/src/sc2code/libs/decomp/lzdecode.c b/sc2/src/sc2code/libs/decomp/lzdecode.c index 1ab4c2790..5213ce286 100644 --- a/sc2/src/sc2code/libs/decomp/lzdecode.c +++ b/sc2/src/sc2code/libs/decomp/lzdecode.c @@ -409,11 +409,6 @@ ReenterRun: } } while (size); - if (_StreamType == MEMORY_STREAM) - { - FAR_PTR_ADD (&_Stream, 0); - } - lpCodeDesc->buf_index = r; lpCodeDesc->Stream = _Stream; lpCodeDesc->workbuf = _workbuf; diff --git a/sc2/src/sc2code/libs/decomp/lzencode.c b/sc2/src/sc2code/libs/decomp/lzencode.c index 4bf19dc66..6a0e7cde6 100644 --- a/sc2/src/sc2code/libs/decomp/lzencode.c +++ b/sc2/src/sc2code/libs/decomp/lzencode.c @@ -60,9 +60,9 @@ InitTree (void) *(MEM_HANDLE *)lson = h; lson = (PSWORD)((PBYTE)lson + sizeof (h)); rson = lson; - FAR_PTR_ADD (&rson, (N + 1) * sizeof (lson[0])); + ((BYTE *) rson) += (N + 1) * sizeof (lson[0]); dad = rson; - FAR_PTR_ADD (&dad, (N + 257) * sizeof (rson[0])); + ((BYTE *) dad) += (N + 257) * sizeof (rson[0]); for (i = N + 1; i <= N + 256; i++) rson[i] = NIL; /* root */ @@ -463,10 +463,6 @@ EncodeRestart: } } while (last_match_length == 0); - if (_StreamType == MEMORY_STREAM) - { - FAR_PTR_ADD (&_Stream, 0); - } EncodeExit: lpCodeDesc->buf_index = r; lpCodeDesc->restart_index = s; diff --git a/sc2/src/sc2code/libs/graphics/drawable.c b/sc2/src/sc2code/libs/graphics/drawable.c index e871df76c..a8975adcd 100644 --- a/sc2/src/sc2code/libs/graphics/drawable.c +++ b/sc2/src/sc2code/libs/graphics/drawable.c @@ -157,8 +157,8 @@ CopyDrawable (DRAWABLE Drawable) num_bytes = size >= 0x7FFF ? 0x7FFF : (COUNT)size; memcpy (lpDst, lpSrc, num_bytes); - FAR_PTR_ADD (&lpDst, num_bytes); - FAR_PTR_ADD (&lpSrc, num_bytes); + lpDst += num_bytes; + lpSrc += num_bytes; size -= num_bytes; } while (size); CopyDrawablePtr->hDrawable = (MEM_HANDLE)CopyDrawable; diff --git a/sc2/src/sc2code/libs/resource/loadres.c b/sc2/src/sc2code/libs/resource/loadres.c index 2cf4114be..48a38454b 100644 --- a/sc2/src/sc2code/libs/resource/loadres.c +++ b/sc2/src/sc2code/libs/resource/loadres.c @@ -62,7 +62,7 @@ GetResourceData (FILE *fp, DWORD length, MEM_FLAGS mem_flags) if ((int)(ReadResFile (RDPtr, 1, num_read, fp)) != (int)num_read) break; } - FAR_PTR_ADD (&RDPtr, num_read); + ((BYTE *) RDPtr) += num_read; } while (length -= num_read); UnlockResourceData (RData); diff --git a/sc2/src/sc2code/libs/strings/strings.c b/sc2/src/sc2code/libs/strings/strings.c index 36e38b212..13182019f 100644 --- a/sc2/src/sc2code/libs/strings/strings.c +++ b/sc2/src/sc2code/libs/strings/strings.c @@ -177,7 +177,7 @@ GetStringSoundClip (STRING String) else { StringAddr = (STRINGPTR)StringTablePtr; - FAR_PTR_ADD (&StringAddr, StringTablePtr->StringOffsets[StringIndex]); + ((BYTE *) StringAddr) += StringTablePtr->StringOffsets[StringIndex]; } UnlockStringTable (StringTable); } @@ -201,7 +201,7 @@ GetStringAddress (STRING String) StringIndex = STRING_INDEX (String); LockStringTable (StringTable, &StringTablePtr); StringAddr = (STRINGPTR)StringTablePtr; - FAR_PTR_ADD (&StringAddr, StringTablePtr->StringOffsets[StringIndex]); + ((BYTE *) StringAddr) += StringTablePtr->StringOffsets[StringIndex]; UnlockStringTable (StringTable); }