Skip to content

Commit

Permalink
__const() usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Cole committed Nov 5, 2023
1 parent 71c0f10 commit 022b2b1
Show file tree
Hide file tree
Showing 23 changed files with 220 additions and 186 deletions.
12 changes: 6 additions & 6 deletions YSI_Coding/y_inline/y_inline_impl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ stock Inline_EBC__(owner, tag)
return
++timerID,
//// Set a timer to kill this inline eventually.
YSI_SetTimerEx__(&Inline_TBC__, owner, false, YSI_gcI, timerID),
SetTimerEx(&Inline_TBC__, owner, false, __const(YSI_gcI), timerID),
(timerID | (0x1FF << 22)) & cellmax;
}
else
Expand Down Expand Up @@ -1227,7 +1227,7 @@ stock Function:GetRemoteFunction(const func[], const spec[], tag = 0)
mset(closure, _:E_INDIRECTION_HANDER, _:addressof (Callback_RemoteHandler_<x>));
mset(closure, _:E_INDIRECTION_CLAIM, _:addressof (Callback_Claim_));
mset(closure, _:E_INDIRECTION_RELEASE, _:addressof (Callback_Release_<tResolvedAlloc:>));
mset(closure, _:E_PUBLIC_CALL_TIMER, YSI_SetTimerEx__(&Inline_MaybeFree_<tAlloc:>, 0, false, YSI_gcI, _:closure));
mset(closure, _:E_PUBLIC_CALL_TIMER, SetTimerEx(&Inline_MaybeFree_<tAlloc:>, 0, false, __const(YSI_gcI), _:closure));
mset(closure, _:E_PUBLIC_CALL_FLAGS, e_INLINE_FLAG_PUBLIC);
mset(closure, _:E_INDIRECTION_METADATA, 0);
if (tag)
Expand Down Expand Up @@ -1285,7 +1285,7 @@ stock Function:GetLocalFunction(const func[], const spec[], tag = 0)
mset(closure, _:E_INDIRECTION_HANDER, _:addressof (Callback_LocalHandler_<x>));
mset(closure, _:E_INDIRECTION_CLAIM, _:addressof (Callback_Claim_));
mset(closure, _:E_INDIRECTION_RELEASE, _:addressof (Callback_Release_<tResolvedAlloc:>));
mset(closure, _:E_PUBLIC_CALL_TIMER, YSI_SetTimerEx__(&Inline_MaybeFree_<tAlloc:>, 0, false, YSI_gcI, _:closure));
mset(closure, _:E_PUBLIC_CALL_TIMER, SetTimerEx(&Inline_MaybeFree_<tAlloc:>, 0, false, __const(YSI_gcI), _:closure));
mset(closure, _:E_PUBLIC_CALL_FLAGS, e_INLINE_FLAG_PUBLIC);
mset(closure, _:E_INDIRECTION_METADATA, 0);
if (tag)
Expand Down Expand Up @@ -1404,7 +1404,7 @@ static stock Callback_InlineByName(const name[], tag)
mset(closure, _:E_INDIRECTION_HANDER, _:addressof (Callback_CallHandler_<x>));
mset(closure, _:E_INDIRECTION_CLAIM, _:addressof (Callback_Claim_));
mset(closure, _:E_INDIRECTION_RELEASE, _:addressof (Callback_Release_<tResolvedAlloc:>));
mset(closure, _:E_INLINE_CALL_TIMER, YSI_SetTimerEx__(&Inline_MaybeFree_<tAlloc:>, 0, false, YSI_gcI, _:closure));
mset(closure, _:E_INLINE_CALL_TIMER, SetTimerEx(&Inline_MaybeFree_<tAlloc:>, 0, false, __const(YSI_gcI), _:closure));
mset(closure, _:E_INLINE_CALL_FLAGS, e_INLINE_FLAG_CONST);
mset(closure, _:E_INDIRECTION_METADATA, 0);
mset(closure, _:E_INDIRECTION_TAG, tag);
Expand Down Expand Up @@ -1670,7 +1670,7 @@ stock Callback_Release(const input[E_CALLBACK_DATA])
static stock Callback_Claim_(func[E_INLINE_CALL])
{
KillTimer(func[E_INLINE_CALL_TIMER]);
func[E_INLINE_CALL_TIMER] = YSI_SetTimerEx__(&Inline_MaybeConst_<tResolvedAlloc:>, 0, false, YSI_gcI, AMX_Ref(func[E_INLINE_CALL:E_INDIRECTION_ALWAYS_NULL]));
func[E_INLINE_CALL_TIMER] = SetTimerEx(&Inline_MaybeConst_<tResolvedAlloc:>, 0, false, __const(YSI_gcI), AMX_Ref(func[E_INLINE_CALL:E_INDIRECTION_ALWAYS_NULL]));
}

/*-------------------------------------------------------------------------*//**
Expand Down Expand Up @@ -2251,7 +2251,7 @@ stock Inline_UI_(const &header, tag)
mset(closure, _:E_INDIRECTION_HANDER, _:addressof (Callback_CallHandler_<x>));
mset(closure, _:E_INDIRECTION_CLAIM, _:addressof (Callback_Claim_));
mset(closure, _:E_INDIRECTION_RELEASE, _:addressof (Callback_Release_<tResolvedAlloc:>));
mset(closure, _:E_INLINE_CALL_TIMER, YSI_SetTimerEx__(&Inline_MaybeFree_<tAlloc:>, 0, false, YSI_gcI, _:closure));
mset(closure, _:E_INLINE_CALL_TIMER, SetTimerEx(&Inline_MaybeFree_<tAlloc:>, 0, false, __const(YSI_gcI), _:closure));
mset(closure, _:E_INLINE_CALL_FLAGS, e_INLINE_FLAG_CONST);
mset(closure, _:E_INDIRECTION_METADATA, 0);
mset(closure, _:E_INDIRECTION_TAG, tag);
Expand Down
2 changes: 1 addition & 1 deletion YSI_Coding/y_malloc/y_malloc_tests.inc
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,6 @@ public y_malloc_Deferred(Alloc:alloc)
{
mset(alloc, i, i * 2);
}
YSI_SetTimerEx__("y_malloc_Deferred", 10, false, "i", _:alloc);
SetTimerEx(__const("y_malloc_Deferred"), 10, false, __const(YSI_gcI), _:alloc);
}

8 changes: 4 additions & 4 deletions YSI_Coding/y_timers/y_timers_impl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public OnCodeInit()
Debug_Print7("Timer_OnYSIInit: %s", Unpack(buffer));
// Get the time offset for the current call. This should mean
// that all the functions are nicely spread out.
YSI_SetTimerEx__(buffer, time * pre / total, false, "ii", 1, -1);
SetTimerEx(__const(buffer), time * pre / total, false, __const(YSI_gcII), 1, -1);
}
}
}
Expand Down Expand Up @@ -290,7 +290,7 @@ stock _y@T:_Timer_I(const func[], interval, {_, _@yT}:action, &result)
{
if (!result)
{
result = YSI_SetTimer__(func, interval, true);
result = SetTimer(__const(func), interval, true);
}
}
}
Expand Down Expand Up @@ -344,13 +344,13 @@ stock _y@T:_Timer_D(const func[], interval, const {_, _@yT}:action, who, results
{
if (!results[who])
{
results[who] = YSI_SetTimerEx__(func, interval, true, YSI_gcI, who);
results[who] = SetTimerEx(__const(func), interval, true, __const(YSI_gcI), who);
}
}
}
else if (!results[who])
{
results[who] = YSI_SetTimerEx__(func, interval, true, YSI_gcI, who);
results[who] = SetTimerEx(__const(func), interval, true, __const(YSI_gcI), who);
}
}
}
Expand Down
Loading

0 comments on commit 022b2b1

Please sign in to comment.