Decompile fn_18368 (FillMessageBuckets)
Batch #1207 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_18368 FillMessageBuckets: logic confirmed by peer review Peer-reviewed-by: eAthena Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
f491ad1deb
commit
bce0cc6603
1 changed files with 24 additions and 0 deletions
|
|
@ -60,6 +60,30 @@ namespace {
|
|||
}
|
||||
|
||||
// OFFSET: 0x00B00360
|
||||
// FUNCTION: fn_18368
|
||||
int FillMessageBuckets(int* first, std::uintptr_t last, int* value) {
|
||||
int result = 0;
|
||||
int* dest = first;
|
||||
unsigned int count = (last - reinterpret_cast<std::uintptr_t>(first) + 3) >> 2;
|
||||
if (reinterpret_cast<std::uintptr_t>(first) > last) {
|
||||
count = 0;
|
||||
}
|
||||
if (count >= 4) {
|
||||
result = *value;
|
||||
if (first > value || &first[count - 1] < value) {
|
||||
unsigned int aligned = count & ~3u;
|
||||
dest = &first[aligned];
|
||||
for (int* p = first; p != dest; ++p) {
|
||||
*p = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (; dest != reinterpret_cast<int*>(last); ++dest) {
|
||||
result = *value;
|
||||
*dest = *value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
struct MessageBucketVector {
|
||||
void* begin;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue