mirror of
https://github.com/RGBCube/serenity
synced 2025-08-10 16:47:35 +00:00
Revert "Userland: static vs non-static constexpr variables"
This reverts commit 800ea8ea96
.
Booting the system no longer worked after these changes.
This commit is contained in:
parent
68f76b9e37
commit
d60ebbbba6
38 changed files with 184 additions and 192 deletions
|
@ -36,7 +36,7 @@ static constexpr i32 lookup_server_endpoint_magic = 9001;
|
|||
|
||||
// Get service entry buffers and file information for the getservent() family of functions.
|
||||
static FILE* services_file = nullptr;
|
||||
static constexpr char services_path[] = "/etc/services";
|
||||
static const char* services_path = "/etc/services";
|
||||
|
||||
static bool fill_getserv_buffers(const char* line, ssize_t read);
|
||||
static servent __getserv_buffer;
|
||||
|
@ -50,7 +50,7 @@ static ssize_t service_file_offset = 0;
|
|||
|
||||
// Get protocol entry buffers and file information for the getprotent() family of functions.
|
||||
static FILE* protocols_file = nullptr;
|
||||
static constexpr char protocols_path[] = "/etc/protocols";
|
||||
static const char* protocols_path = "/etc/protocols";
|
||||
|
||||
static bool fill_getproto_buffers(const char* line, ssize_t read);
|
||||
static protoent __getproto_buffer;
|
||||
|
|
|
@ -70,9 +70,10 @@ char* ctime_r(const time_t* t, char* buf)
|
|||
return asctime_r(localtime_r(t, &tm_buf), buf);
|
||||
}
|
||||
|
||||
static const int __seconds_per_day = 60 * 60 * 24;
|
||||
|
||||
static void time_to_tm(struct tm* tm, time_t t)
|
||||
{
|
||||
constexpr int __seconds_per_day = 60 * 60 * 24;
|
||||
int year = 1970;
|
||||
for (; t >= days_in_year(year) * __seconds_per_day; ++year)
|
||||
t -= days_in_year(year) * __seconds_per_day;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <LibGUI/Calendar.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
@ -17,21 +16,21 @@ REGISTER_WIDGET(GUI, Calendar);
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static constexpr Array long_day_names = {
|
||||
static const char* long_day_names[] = {
|
||||
"Sunday", "Monday", "Tuesday", "Wednesday",
|
||||
"Thursday", "Friday", "Saturday"
|
||||
};
|
||||
|
||||
static constexpr Array short_day_names = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
static constexpr Array mini_day_names = { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" };
|
||||
static constexpr Array micro_day_names = { "S", "M", "T", "W", "T", "F", "S" };
|
||||
static const char* short_day_names[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
static const char* mini_day_names[] = { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" };
|
||||
static const char* micro_day_names[] = { "S", "M", "T", "W", "T", "F", "S" };
|
||||
|
||||
static constexpr Array long_month_names = {
|
||||
static const char* long_month_names[] = {
|
||||
"January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December"
|
||||
};
|
||||
|
||||
static constexpr Array short_month_names = {
|
||||
static const char* short_month_names[] = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
|
|
@ -15,9 +15,9 @@ REGISTER_WIDGET(GUI, CheckBox)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static constexpr int s_box_width = 13;
|
||||
static constexpr int s_box_height = 13;
|
||||
static constexpr int s_horizontal_padding = 6;
|
||||
static const int s_box_width = 13;
|
||||
static const int s_box_height = 13;
|
||||
static const int s_horizontal_padding = 6;
|
||||
|
||||
CheckBox::CheckBox(String text)
|
||||
: AbstractButton(move(text))
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static constexpr char s_arrow_bitmap_data[] = {
|
||||
static const char* s_arrow_bitmap_data = {
|
||||
" "
|
||||
" # "
|
||||
" ## "
|
||||
|
@ -24,8 +24,8 @@ static constexpr char s_arrow_bitmap_data[] = {
|
|||
" # "
|
||||
" "
|
||||
};
|
||||
static constexpr int s_arrow_bitmap_width = 9;
|
||||
static constexpr int s_arrow_bitmap_height = 9;
|
||||
static const int s_arrow_bitmap_width = 9;
|
||||
static const int s_arrow_bitmap_height = 9;
|
||||
|
||||
ColumnsView::ColumnsView()
|
||||
{
|
||||
|
|
|
@ -169,10 +169,7 @@ Icon FileIconProvider::icon_for_executable(const String& path)
|
|||
int image_size;
|
||||
};
|
||||
|
||||
constexpr Array icon_sections = {
|
||||
IconSection { .section_name = "serenity_icon_s", .image_size = 16 },
|
||||
IconSection { .section_name = "serenity_icon_m", .image_size = 32 }
|
||||
};
|
||||
static const IconSection icon_sections[] = { { .section_name = "serenity_icon_s", .image_size = 16 }, { .section_name = "serenity_icon_m", .image_size = 32 } };
|
||||
|
||||
bool had_error = false;
|
||||
for (const auto& icon_section : icon_sections) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static constexpr char s_resize_corner_shadows_data[] = {
|
||||
static const char* s_resize_corner_shadows_data = {
|
||||
" "
|
||||
" ## "
|
||||
" # "
|
||||
|
@ -31,7 +31,7 @@ static constexpr char s_resize_corner_shadows_data[] = {
|
|||
" "
|
||||
};
|
||||
|
||||
static constexpr char s_resize_corner_highlights_data[] = {
|
||||
static const char* s_resize_corner_highlights_data = {
|
||||
" "
|
||||
" "
|
||||
" # "
|
||||
|
@ -52,8 +52,8 @@ static constexpr char s_resize_corner_highlights_data[] = {
|
|||
|
||||
static Gfx::CharacterBitmap* s_resize_corner_shadows_bitmap;
|
||||
static Gfx::CharacterBitmap* s_resize_corner_highlights_bitmap;
|
||||
static constexpr int s_resize_corner_bitmap_width = 16;
|
||||
static constexpr int s_resize_corner_bitmap_height = 16;
|
||||
static const int s_resize_corner_bitmap_width = 16;
|
||||
static const int s_resize_corner_bitmap_height = 16;
|
||||
|
||||
ResizeCorner::ResizeCorner()
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ REGISTER_WIDGET(GUI, Scrollbar)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static constexpr char s_up_arrow_bitmap_data[] = {
|
||||
static const char* s_up_arrow_bitmap_data = {
|
||||
" "
|
||||
" # "
|
||||
" ### "
|
||||
|
@ -27,7 +27,7 @@ static constexpr char s_up_arrow_bitmap_data[] = {
|
|||
" "
|
||||
};
|
||||
|
||||
static constexpr char s_down_arrow_bitmap_data[] = {
|
||||
static const char* s_down_arrow_bitmap_data = {
|
||||
" "
|
||||
" ### "
|
||||
" ### "
|
||||
|
@ -39,7 +39,7 @@ static constexpr char s_down_arrow_bitmap_data[] = {
|
|||
" "
|
||||
};
|
||||
|
||||
static constexpr char s_left_arrow_bitmap_data[] = {
|
||||
static const char* s_left_arrow_bitmap_data = {
|
||||
" "
|
||||
" # "
|
||||
" ## "
|
||||
|
@ -51,7 +51,7 @@ static constexpr char s_left_arrow_bitmap_data[] = {
|
|||
" "
|
||||
};
|
||||
|
||||
static constexpr char s_right_arrow_bitmap_data[] = {
|
||||
static const char* s_right_arrow_bitmap_data = {
|
||||
" "
|
||||
" # "
|
||||
" ## "
|
||||
|
|
|
@ -354,7 +354,7 @@ void ClassicStylePainter::paint_radio_button(Painter& painter, const IntRect& re
|
|||
painter.blit(rect.location(), bitmap, bitmap.rect());
|
||||
}
|
||||
|
||||
static constexpr char s_checked_bitmap_data[] = {
|
||||
static const char* s_checked_bitmap_data = {
|
||||
" "
|
||||
" # "
|
||||
" ## "
|
||||
|
@ -367,8 +367,8 @@ static constexpr char s_checked_bitmap_data[] = {
|
|||
};
|
||||
|
||||
static Gfx::CharacterBitmap* s_checked_bitmap;
|
||||
static constexpr int s_checked_bitmap_width = 9;
|
||||
static constexpr int s_checked_bitmap_height = 9;
|
||||
static const int s_checked_bitmap_width = 9;
|
||||
static const int s_checked_bitmap_height = 9;
|
||||
|
||||
void ClassicStylePainter::paint_check_box(Painter& painter, const IntRect& rect, const Palette& palette, bool is_enabled, bool is_checked, bool is_being_pressed)
|
||||
{
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
#endif
|
||||
}
|
||||
|
||||
Color interpolate(const Color& other, float weight) const
|
||||
constexpr Color interpolate(const Color& other, float weight) const
|
||||
{
|
||||
u8 r = red() + roundf(static_cast<float>(other.red() - red()) * weight);
|
||||
u8 g = green() + roundf(static_cast<float>(other.green() - green()) * weight);
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
// Row strides and offsets for each interlace pass.
|
||||
static const int INTERLACE_ROW_STRIDES[] = { 8, 8, 4, 2 };
|
||||
static const int INTERLACE_ROW_OFFSETS[] = { 0, 4, 2, 1 };
|
||||
|
||||
struct ImageDescriptor {
|
||||
u16 x { 0 };
|
||||
u16 y { 0 };
|
||||
|
@ -108,8 +112,8 @@ enum class GIFFormat {
|
|||
|
||||
static Optional<GIFFormat> decode_gif_header(InputMemoryStream& stream)
|
||||
{
|
||||
constexpr char valid_header_87[] = "GIF87a";
|
||||
constexpr char valid_header_89[] = "GIF89a";
|
||||
static const char valid_header_87[] = "GIF87a";
|
||||
static const char valid_header_89[] = "GIF89a";
|
||||
|
||||
Array<u8, 6> header;
|
||||
stream >> header;
|
||||
|
@ -374,8 +378,6 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
|
|||
if (pixel_index % image.width == 0) {
|
||||
if (image.interlaced) {
|
||||
if (interlace_pass < 4) {
|
||||
constexpr Array INTERLACE_ROW_STRIDES = { 8, 8, 4, 2 };
|
||||
constexpr Array INTERLACE_ROW_OFFSETS = { 0, 4, 2, 1 };
|
||||
if (row + INTERLACE_ROW_STRIDES[interlace_pass] >= image.height) {
|
||||
++interlace_pass;
|
||||
if (interlace_pass < 4)
|
||||
|
|
|
@ -861,20 +861,20 @@ static void dequantize(JPGLoadingContext& context, Vector<Macroblock>& macrobloc
|
|||
|
||||
static void inverse_dct(const JPGLoadingContext& context, Vector<Macroblock>& macroblocks)
|
||||
{
|
||||
const float m0 = 2.0 * cos(1.0 / 16.0 * 2.0 * M_PI);
|
||||
const float m1 = 2.0 * cos(2.0 / 16.0 * 2.0 * M_PI);
|
||||
const float m3 = 2.0 * cos(2.0 / 16.0 * 2.0 * M_PI);
|
||||
const float m5 = 2.0 * cos(3.0 / 16.0 * 2.0 * M_PI);
|
||||
const float m2 = m0 - m5;
|
||||
const float m4 = m0 + m5;
|
||||
const float s0 = cos(0.0 / 16.0 * M_PI) / sqrt(8);
|
||||
const float s1 = cos(1.0 / 16.0 * M_PI) / 2.0;
|
||||
const float s2 = cos(2.0 / 16.0 * M_PI) / 2.0;
|
||||
const float s3 = cos(3.0 / 16.0 * M_PI) / 2.0;
|
||||
const float s4 = cos(4.0 / 16.0 * M_PI) / 2.0;
|
||||
const float s5 = cos(5.0 / 16.0 * M_PI) / 2.0;
|
||||
const float s6 = cos(6.0 / 16.0 * M_PI) / 2.0;
|
||||
const float s7 = cos(7.0 / 16.0 * M_PI) / 2.0;
|
||||
static const float m0 = 2.0 * cos(1.0 / 16.0 * 2.0 * M_PI);
|
||||
static const float m1 = 2.0 * cos(2.0 / 16.0 * 2.0 * M_PI);
|
||||
static const float m3 = 2.0 * cos(2.0 / 16.0 * 2.0 * M_PI);
|
||||
static const float m5 = 2.0 * cos(3.0 / 16.0 * 2.0 * M_PI);
|
||||
static const float m2 = m0 - m5;
|
||||
static const float m4 = m0 + m5;
|
||||
static const float s0 = cos(0.0 / 16.0 * M_PI) / sqrt(8);
|
||||
static const float s1 = cos(1.0 / 16.0 * M_PI) / 2.0;
|
||||
static const float s2 = cos(2.0 / 16.0 * M_PI) / 2.0;
|
||||
static const float s3 = cos(3.0 / 16.0 * M_PI) / 2.0;
|
||||
static const float s4 = cos(4.0 / 16.0 * M_PI) / 2.0;
|
||||
static const float s5 = cos(5.0 / 16.0 * M_PI) / 2.0;
|
||||
static const float s6 = cos(6.0 / 16.0 * M_PI) / 2.0;
|
||||
static const float s7 = cos(7.0 / 16.0 * M_PI) / 2.0;
|
||||
|
||||
for (u32 vcursor = 0; vcursor < context.mblock_meta.vcount; vcursor += context.vsample_factor) {
|
||||
for (u32 hcursor = 0; hcursor < context.mblock_meta.hcount; hcursor += context.hsample_factor) {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
static constexpr Array png_header = { 0x89, 'P', 'N', 'G', 13, 10, 26, 10 };
|
||||
static const u8 png_header[8] = { 0x89, 'P', 'N', 'G', 13, 10, 26, 10 };
|
||||
|
||||
struct PNG_IHDR {
|
||||
NetworkOrdered<u32> width;
|
||||
|
@ -512,7 +512,7 @@ static bool decode_png_header(PNGLoadingContext& context)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (memcmp(context.data, png_header.data(), sizeof(png_header)) != 0) {
|
||||
if (memcmp(context.data, png_header, sizeof(png_header)) != 0) {
|
||||
dbgln_if(PNG_DEBUG, "Invalid PNG header");
|
||||
context.state = PNGLoadingContext::State::Error;
|
||||
return false;
|
||||
|
@ -661,14 +661,14 @@ static int adam7_width(PNGLoadingContext& context, int pass)
|
|||
}
|
||||
}
|
||||
|
||||
// Index 0 unused (non-interlaced case)
|
||||
static int adam7_starty[8] = { 0, 0, 0, 4, 0, 2, 0, 1 };
|
||||
static int adam7_startx[8] = { 0, 0, 4, 0, 2, 0, 1, 0 };
|
||||
static int adam7_stepy[8] = { 1, 8, 8, 8, 4, 4, 2, 2 };
|
||||
static int adam7_stepx[8] = { 1, 8, 8, 4, 4, 2, 2, 1 };
|
||||
|
||||
static bool decode_adam7_pass(PNGLoadingContext& context, Streamer& streamer, int pass)
|
||||
{
|
||||
// Index 0 unused (non-interlaced case)
|
||||
constexpr Array adam7_starty = { 0, 0, 0, 4, 0, 2, 0, 1 };
|
||||
constexpr Array adam7_startx = { 0, 0, 4, 0, 2, 0, 1, 0 };
|
||||
constexpr Array adam7_stepy = { 1, 8, 8, 8, 4, 4, 2, 2 };
|
||||
constexpr Array adam7_stepx = { 1, 8, 8, 4, 4, 2, 2, 1 };
|
||||
|
||||
PNGLoadingContext subimage_context;
|
||||
subimage_context.width = adam7_width(context, pass);
|
||||
subimage_context.height = adam7_height(context, pass);
|
||||
|
|
|
@ -1476,7 +1476,7 @@ void do_draw_text(const IntRect& rect, const TextType& text, const Font& font, T
|
|||
lines.append(line);
|
||||
}
|
||||
|
||||
constexpr int line_spacing = 4;
|
||||
static const int line_spacing = 4;
|
||||
int line_height = font.glyph_height() + line_spacing;
|
||||
IntRect bounding_rect { 0, 0, 0, (static_cast<int>(lines.size()) * line_height) - line_spacing };
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include <AK/Function.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibJS/Runtime/Error.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/NumberObject.h>
|
||||
|
@ -13,6 +12,17 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
static const u8 max_precision_for_radix[37] = {
|
||||
// clang-format off
|
||||
0, 0, 52, 32, 26, 22, 20, 18, 17, 16,
|
||||
15, 15, 14, 14, 13, 13, 13, 12, 12, 12,
|
||||
12, 11, 11, 11, 11, 11, 11, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
NumberPrototype::NumberPrototype(GlobalObject& global_object)
|
||||
: NumberObject(0, *global_object.object_prototype())
|
||||
{
|
||||
|
@ -31,8 +41,6 @@ NumberPrototype::~NumberPrototype()
|
|||
|
||||
JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_string)
|
||||
{
|
||||
constexpr StringView digits = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
Value number_value;
|
||||
|
||||
auto this_value = vm.this_value(global_object);
|
||||
|
@ -99,14 +107,6 @@ JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_string)
|
|||
if (decimal_part != 0.0) {
|
||||
characters.append('.');
|
||||
|
||||
constexpr u8 max_precision_for_radix[37] = {
|
||||
// clang-format off
|
||||
0, 0, 52, 32, 26, 22, 20, 18, 17, 16,
|
||||
15, 15, 14, 14, 13, 13, 13, 12, 12, 12,
|
||||
12, 11, 11, 11, 11, 11, 11, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10,
|
||||
// clang-format on
|
||||
};
|
||||
u8 precision = max_precision_for_radix[radix];
|
||||
|
||||
for (u8 i = 0; i < precision; ++i) {
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
namespace JS {
|
||||
|
||||
// Used in various abstract operations to make it obvious when a non-optional return value must be discarded.
|
||||
static constexpr double INVALID { 0 };
|
||||
static const double INVALID { 0 };
|
||||
|
||||
static inline bool same_type_for_equality(const Value& lhs, const Value& rhs)
|
||||
{
|
||||
|
|
|
@ -56,11 +56,11 @@ union FloatExtractor;
|
|||
// This assumes long double is 80 bits, which is true with GCC on Intel platforms
|
||||
template<>
|
||||
union FloatExtractor<long double> {
|
||||
static constexpr int mantissa_bits = 64;
|
||||
static constexpr unsigned long long mantissa_max = ~0u;
|
||||
static constexpr int exponent_bias = 16383;
|
||||
static constexpr int exponent_bits = 15;
|
||||
static constexpr unsigned exponent_max = 32767;
|
||||
static const int mantissa_bits = 64;
|
||||
static const unsigned long long mantissa_max = ~0u;
|
||||
static const int exponent_bias = 16383;
|
||||
static const int exponent_bits = 15;
|
||||
static const unsigned exponent_max = 32767;
|
||||
struct {
|
||||
unsigned long long mantissa;
|
||||
unsigned exponent : 15;
|
||||
|
@ -72,11 +72,11 @@ union FloatExtractor<long double> {
|
|||
|
||||
template<>
|
||||
union FloatExtractor<double> {
|
||||
static constexpr int mantissa_bits = 52;
|
||||
static constexpr unsigned long long mantissa_max = (1ull << 52) - 1;
|
||||
static constexpr int exponent_bias = 1023;
|
||||
static constexpr int exponent_bits = 11;
|
||||
static constexpr unsigned exponent_max = 2047;
|
||||
static const int mantissa_bits = 52;
|
||||
static const unsigned long long mantissa_max = (1ull << 52) - 1;
|
||||
static const int exponent_bias = 1023;
|
||||
static const int exponent_bits = 11;
|
||||
static const unsigned exponent_max = 2047;
|
||||
struct {
|
||||
unsigned long long mantissa : 52;
|
||||
unsigned exponent : 11;
|
||||
|
@ -87,11 +87,11 @@ union FloatExtractor<double> {
|
|||
|
||||
template<>
|
||||
union FloatExtractor<float> {
|
||||
static constexpr int mantissa_bits = 23;
|
||||
static constexpr unsigned mantissa_max = (1 << 23) - 1;
|
||||
static constexpr int exponent_bias = 127;
|
||||
static constexpr int exponent_bits = 8;
|
||||
static constexpr unsigned exponent_max = 255;
|
||||
static const int mantissa_bits = 23;
|
||||
static const unsigned mantissa_max = (1 << 23) - 1;
|
||||
static const int exponent_bias = 127;
|
||||
static const int exponent_bits = 8;
|
||||
static const unsigned exponent_max = 255;
|
||||
struct {
|
||||
unsigned long long mantissa : 23;
|
||||
unsigned exponent : 8;
|
||||
|
|
|
@ -6,24 +6,25 @@
|
|||
|
||||
#include <LibC/bits/pthread_forward.h>
|
||||
|
||||
static const PthreadFunctions s_functions = {
|
||||
.pthread_mutex_trylock = pthread_mutex_trylock,
|
||||
.pthread_mutex_destroy = pthread_mutex_destroy,
|
||||
|
||||
.pthread_mutexattr_init = pthread_mutexattr_init,
|
||||
.pthread_mutexattr_settype = pthread_mutexattr_settype,
|
||||
.pthread_mutexattr_destroy = pthread_mutexattr_destroy,
|
||||
|
||||
.pthread_once = pthread_once,
|
||||
|
||||
.pthread_cond_broadcast = pthread_cond_broadcast,
|
||||
.pthread_cond_init = pthread_cond_init,
|
||||
.pthread_cond_signal = pthread_cond_signal,
|
||||
.pthread_cond_wait = pthread_cond_wait,
|
||||
.pthread_cond_destroy = pthread_cond_destroy,
|
||||
.pthread_cond_timedwait = pthread_cond_timedwait,
|
||||
};
|
||||
|
||||
[[gnu::constructor]] static void forward_pthread_functions()
|
||||
{
|
||||
constexpr PthreadFunctions s_functions = {
|
||||
.pthread_mutex_trylock = pthread_mutex_trylock,
|
||||
.pthread_mutex_destroy = pthread_mutex_destroy,
|
||||
|
||||
.pthread_mutexattr_init = pthread_mutexattr_init,
|
||||
.pthread_mutexattr_settype = pthread_mutexattr_settype,
|
||||
.pthread_mutexattr_destroy = pthread_mutexattr_destroy,
|
||||
|
||||
.pthread_once = pthread_once,
|
||||
|
||||
.pthread_cond_broadcast = pthread_cond_broadcast,
|
||||
.pthread_cond_init = pthread_cond_init,
|
||||
.pthread_cond_signal = pthread_cond_signal,
|
||||
.pthread_cond_wait = pthread_cond_wait,
|
||||
.pthread_cond_destroy = pthread_cond_destroy,
|
||||
.pthread_cond_timedwait = pthread_cond_timedwait,
|
||||
};
|
||||
__init_pthread_forward(s_functions);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
|
||||
namespace regex {
|
||||
|
||||
static constexpr size_t c_max_recursion = 5000;
|
||||
static constexpr size_t c_match_preallocation_count = 0;
|
||||
static const constexpr size_t c_max_recursion = 5000;
|
||||
static const constexpr size_t c_match_preallocation_count = 0;
|
||||
|
||||
struct RegexResult final {
|
||||
bool success { false };
|
||||
|
|
|
@ -16,8 +16,8 @@ namespace VT {
|
|||
struct Attribute {
|
||||
Attribute() { reset(); }
|
||||
|
||||
static constexpr u32 default_foreground_color = xterm_colors[7];
|
||||
static constexpr u32 default_background_color = xterm_colors[0];
|
||||
static const u32 default_foreground_color = xterm_colors[7];
|
||||
static const u32 default_background_color = xterm_colors[0];
|
||||
|
||||
void reset()
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include "ParsedCookie.h"
|
||||
#include <AK/Array.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibIPC/Decoder.h>
|
||||
|
@ -265,7 +264,7 @@ Optional<Core::DateTime> parse_date_time(StringView date_string)
|
|||
};
|
||||
|
||||
auto parse_month = [&](StringView token) {
|
||||
constexpr Array months { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };
|
||||
static const char* months[] { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };
|
||||
|
||||
for (unsigned i = 0; i < 12; ++i) {
|
||||
if (token.equals_ignoring_case(months[i])) {
|
||||
|
|
|
@ -100,7 +100,7 @@ static void build(InstructionDescriptor* table, u8 op, const char* mnemonic, Ins
|
|||
case OP_AX_moff16:
|
||||
case OP_EAX_moff32:
|
||||
case OP_NEAR_imm:
|
||||
d.imm1_bytes = InstructionDescriptor::CurrentAddressSize;
|
||||
d.imm1_bytes = CurrentAddressSize;
|
||||
break;
|
||||
//default:
|
||||
case InvalidFormat:
|
||||
|
|
|
@ -28,9 +28,9 @@ protected:
|
|||
|
||||
template<typename T>
|
||||
struct TypeTrivia {
|
||||
static constexpr size_t bits = sizeof(T) * 8;
|
||||
static constexpr T sign_bit = 1 << (bits - 1);
|
||||
static constexpr T mask = MakeUnsigned<T>(-1);
|
||||
static const size_t bits = sizeof(T) * 8;
|
||||
static const T sign_bit = 1 << (bits - 1);
|
||||
static const T mask = MakeUnsigned<T>(-1);
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
|
@ -159,9 +159,9 @@ enum InstructionFormat {
|
|||
OP_NEAR_imm,
|
||||
};
|
||||
|
||||
struct InstructionDescriptor {
|
||||
static constexpr unsigned CurrentAddressSize = 0xB33FBABE;
|
||||
static const unsigned CurrentAddressSize = 0xB33FBABE;
|
||||
|
||||
struct InstructionDescriptor {
|
||||
InstructionHandler handler { nullptr };
|
||||
bool opcode_has_register_index { false };
|
||||
const char* mnemonic { nullptr };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue