mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:37:45 +00:00
Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one. We avoid mixed usage for now though. Also clean up some stale math includes and improper floatingpoint usage.
This commit is contained in:
parent
c5f6ba6e71
commit
ed46d52252
40 changed files with 116 additions and 156 deletions
|
@ -9,11 +9,11 @@
|
|||
#include <AK/Debug.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/MappedFile.h>
|
||||
#include <AK/Math.h>
|
||||
#include <AK/Memory.h>
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <LibGfx/GIFLoader.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -138,7 +138,7 @@ public:
|
|||
: m_lzw_bytes(lzw_bytes)
|
||||
, m_code_size(min_code_size)
|
||||
, m_original_code_size(min_code_size)
|
||||
, m_table_capacity(pow(2, min_code_size))
|
||||
, m_table_capacity(AK::exp2<u32>(min_code_size))
|
||||
{
|
||||
init_code_table();
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ public:
|
|||
m_code_table.clear();
|
||||
m_code_table.extend(m_original_code_table);
|
||||
m_code_size = m_original_code_size;
|
||||
m_table_capacity = pow(2, m_code_size);
|
||||
m_table_capacity = AK::exp2<u32>(m_code_size);
|
||||
m_output.clear();
|
||||
}
|
||||
|
||||
|
@ -563,7 +563,7 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context)
|
|||
image.interlaced = (packed_fields & 0x40) != 0;
|
||||
|
||||
if (!image.use_global_color_map) {
|
||||
size_t local_color_table_size = pow(2, (packed_fields & 7) + 1);
|
||||
size_t local_color_table_size = AK::exp2<size_t>((packed_fields & 7) + 1);
|
||||
|
||||
for (size_t i = 0; i < local_color_table_size; ++i) {
|
||||
u8 r = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue