Core: Replace C math headers with C++ equivalents

- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
This commit is contained in:
Thaddeus Crews
2025-03-19 14:18:09 -05:00
parent c5c1cd4440
commit ad40939b6f
101 changed files with 414 additions and 498 deletions

View File

@ -525,11 +525,11 @@ Ref<PListNode> PList::read_bplist_obj(Ref<FileAccess> p_file, uint64_t p_offset_
} break;
case 0x10: {
node->data_type = PL_NODE_TYPE_INTEGER;
node->data_int = static_cast<int64_t>(read_bplist_var_size_int(p_file, pow(2, marker_size)));
node->data_int = static_cast<int64_t>(read_bplist_var_size_int(p_file, std::pow(2, marker_size)));
} break;
case 0x20: {
node->data_type = PL_NODE_TYPE_REAL;
node->data_int = static_cast<int64_t>(read_bplist_var_size_int(p_file, pow(2, marker_size)));
node->data_int = static_cast<int64_t>(read_bplist_var_size_int(p_file, std::pow(2, marker_size)));
} break;
case 0x30: {
node->data_type = PL_NODE_TYPE_DATE;
@ -539,7 +539,7 @@ Ref<PListNode> PList::read_bplist_obj(Ref<FileAccess> p_file, uint64_t p_offset_
case 0x40: {
if (marker_size == 0x0F) {
uint8_t ext = p_file->get_8() & 0xF;
marker_size = read_bplist_var_size_int(p_file, pow(2, ext));
marker_size = read_bplist_var_size_int(p_file, std::pow(2, ext));
}
node->data_type = PL_NODE_TYPE_DATA;
PackedByteArray buf;
@ -550,7 +550,7 @@ Ref<PListNode> PList::read_bplist_obj(Ref<FileAccess> p_file, uint64_t p_offset_
case 0x50: {
if (marker_size == 0x0F) {
uint8_t ext = p_file->get_8() & 0xF;
marker_size = read_bplist_var_size_int(p_file, pow(2, ext));
marker_size = read_bplist_var_size_int(p_file, std::pow(2, ext));
}
node->data_type = PL_NODE_TYPE_STRING;
node->data_string.resize(marker_size + 1);
@ -559,7 +559,7 @@ Ref<PListNode> PList::read_bplist_obj(Ref<FileAccess> p_file, uint64_t p_offset_
case 0x60: {
if (marker_size == 0x0F) {
uint8_t ext = p_file->get_8() & 0xF;
marker_size = read_bplist_var_size_int(p_file, pow(2, ext));
marker_size = read_bplist_var_size_int(p_file, std::pow(2, ext));
}
Char16String cs16;
cs16.resize(marker_size + 1);
@ -577,7 +577,7 @@ Ref<PListNode> PList::read_bplist_obj(Ref<FileAccess> p_file, uint64_t p_offset_
case 0xC0: {
if (marker_size == 0x0F) {
uint8_t ext = p_file->get_8() & 0xF;
marker_size = read_bplist_var_size_int(p_file, pow(2, ext));
marker_size = read_bplist_var_size_int(p_file, std::pow(2, ext));
}
uint64_t pos = p_file->get_position();
@ -594,7 +594,7 @@ Ref<PListNode> PList::read_bplist_obj(Ref<FileAccess> p_file, uint64_t p_offset_
case 0xD0: {
if (marker_size == 0x0F) {
uint8_t ext = p_file->get_8() & 0xF;
marker_size = read_bplist_var_size_int(p_file, pow(2, ext));
marker_size = read_bplist_var_size_int(p_file, std::pow(2, ext));
}
uint64_t pos = p_file->get_position();