Skip to content

Commit d3a292e

Browse files
committed
[[ Cleanup ]] libscript: Don't store 64-bit pointers in 32-bit integers.
1 parent 34cf406 commit d3a292e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

libscript/src/module-byte.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ extern "C" MC_DLLEXPORT void MCByteStoreByteOf(MCDataRef p_value, index_t p_inde
147147

148148
extern "C" MC_DLLEXPORT bool MCByteRepeatForEachByte(void*& x_iterator, MCDataRef& r_iterand, MCDataRef p_data)
149149
{
150-
uindex_t t_offset;
151-
t_offset = (uindex_t)x_iterator;
150+
uintptr_t t_offset;
151+
t_offset = (uintptr_t)x_iterator;
152152

153153
if (t_offset == MCDataGetLength(p_data))
154154
return false;

libscript/src/module-char.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ extern "C" MC_DLLEXPORT void MCCharEvalNewlineCharacter(MCStringRef& r_output)
153153
// Will result in tChar containing the value it had at the point of end repeat.
154154
extern "C" MC_DLLEXPORT bool MCCharRepeatForEachChar(void*& x_iterator, MCStringRef& r_iterand, MCStringRef p_string)
155155
{
156-
uindex_t t_offset;
157-
t_offset = (uindex_t)x_iterator;
156+
uintptr_t t_offset;
157+
t_offset = (uintptr_t)x_iterator;
158158

159159
if (t_offset == MCStringGetLength(p_string))
160160
return false;

libscript/src/module-list.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ extern "C" MC_DLLEXPORT void MCListEvalEmpty(MCProperListRef& r_output)
333333

334334
extern "C" bool MCListRepeatForEachElement(void*& x_iterator, MCValueRef& r_iterand, MCProperListRef p_list)
335335
{
336-
uindex_t t_offset;
337-
t_offset = (uindex_t)x_iterator;
336+
uintptr_t t_offset;
337+
t_offset = (uintptr_t)x_iterator;
338338

339339
if (t_offset == MCProperListGetLength(p_list))
340340
return false;

0 commit comments

Comments
 (0)