Cleanup whitespace and suppress unused variable warnings
This commit is contained in:
parent
85bb292a31
commit
8c2fea9edf
|
|
@ -646,7 +646,7 @@ static BAN::Vector<WINDOW> get_path_to_child(WINDOW wid, int32_t x, int32_t y)
|
||||||
const auto& window = object.object.get<Object::Window>();
|
const auto& window = object.object.get<Object::Window>();
|
||||||
if (!window_contains(window, x, y))
|
if (!window_contains(window, x, y))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
MUST(result.push_back(wid));
|
MUST(result.push_back(wid));
|
||||||
|
|
||||||
const WINDOW old_wid = wid;
|
const WINDOW old_wid = wid;
|
||||||
|
|
@ -849,11 +849,11 @@ static void on_window_close_event(Client& client_info, WINDOW wid)
|
||||||
{
|
{
|
||||||
if (WM_PROTOCOLS == None || WM_DELETE_WINDOW == None)
|
if (WM_PROTOCOLS == None || WM_DELETE_WINDOW == None)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto wm_protocols_it = window.properties.find(WM_PROTOCOLS);
|
auto wm_protocols_it = window.properties.find(WM_PROTOCOLS);
|
||||||
if (wm_protocols_it == window.properties.end())
|
if (wm_protocols_it == window.properties.end())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto& wm_protocols = wm_protocols_it->value;
|
const auto& wm_protocols = wm_protocols_it->value;
|
||||||
if (wm_protocols.type != XA_ATOM || wm_protocols.format != 32)
|
if (wm_protocols.type != XA_ATOM || wm_protocols.format != 32)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1101,7 +1101,7 @@ static void on_mouse_button_event(Client& client_info, WINDOW wid, uint8_t xbutt
|
||||||
case Button5: mask = Button5Mask; break;
|
case Button5: mask = Button5Mask; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pressed)
|
if (pressed)
|
||||||
s_butmask |= mask;
|
s_butmask |= mask;
|
||||||
else
|
else
|
||||||
s_butmask &= ~mask;
|
s_butmask &= ~mask;
|
||||||
|
|
@ -1672,7 +1672,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
|
|
||||||
if (!window_changed)
|
if (!window_changed)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
invalidate_window(request.window, min_x, min_y, max_x - min_x, max_y + min_y);
|
invalidate_window(request.window, min_x, min_y, max_x - min_x, max_y + min_y);
|
||||||
|
|
||||||
if (window.event_mask & StructureNotifyMask)
|
if (window.event_mask & StructureNotifyMask)
|
||||||
|
|
@ -1904,7 +1904,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
.data = {},
|
.data = {},
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& property = it->value;
|
auto& property = it->value;
|
||||||
ASSERT(property.format == request.format);
|
ASSERT(property.format == request.format);
|
||||||
|
|
||||||
|
|
@ -2028,7 +2028,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto& property = it->value;
|
const auto& property = it->value;
|
||||||
|
|
||||||
const size_t offset = request.longOffset * 4;
|
const size_t offset = request.longOffset * 4;
|
||||||
const size_t bytes = BAN::Math::min<size_t>(request.longLength * 4, property.data.size() - offset);
|
const size_t bytes = BAN::Math::min<size_t>(request.longLength * 4, property.data.size() - offset);
|
||||||
ASSERT(bytes % (property.format / 8) == 0);
|
ASSERT(bytes % (property.format / 8) == 0);
|
||||||
|
|
@ -2538,7 +2538,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
TRY(client_info.objects.insert(request.gc));
|
TRY(client_info.objects.insert(request.gc));
|
||||||
TRY(g_objects.insert(request.gc, TRY(BAN::UniqPtr<Object>::create(Object {
|
TRY(g_objects.insert(request.gc, TRY(BAN::UniqPtr<Object>::create(Object {
|
||||||
.type = Object::Type::GraphicsContext,
|
.type = Object::Type::GraphicsContext,
|
||||||
.object = Object::GraphicsContext {
|
.object = Object::GraphicsContext {
|
||||||
.foreground = foreground,
|
.foreground = foreground,
|
||||||
.background = background,
|
.background = background,
|
||||||
.line_width = line_width,
|
.line_width = line_width,
|
||||||
|
|
@ -2956,7 +2956,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
.nColors = static_cast<CARD16>(count),
|
.nColors = static_cast<CARD16>(count),
|
||||||
};
|
};
|
||||||
TRY(encode(client_info.output_buffer, reply));
|
TRY(encode(client_info.output_buffer, reply));
|
||||||
|
|
||||||
dprintln(" colors:");
|
dprintln(" colors:");
|
||||||
for (size_t i = 0; i < count; i++)
|
for (size_t i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -3003,7 +3003,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
case X_CreateCursor:
|
case X_CreateCursor:
|
||||||
{
|
{
|
||||||
auto request = decode<xCreateCursorReq>(packet).value();
|
auto request = decode<xCreateCursorReq>(packet).value();
|
||||||
|
|
||||||
dprintln("CreateCursor");
|
dprintln("CreateCursor");
|
||||||
dprintln(" cid: {}", request.cid);
|
dprintln(" cid: {}", request.cid);
|
||||||
dprintln(" source: {}", request.source);
|
dprintln(" source: {}", request.source);
|
||||||
|
|
@ -3071,7 +3071,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
case X_FreeCursor:
|
case X_FreeCursor:
|
||||||
{
|
{
|
||||||
const auto cid = packet.as_span<const uint32_t>()[1];
|
const auto cid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("FreeCursor");
|
dprintln("FreeCursor");
|
||||||
dprintln(" cid: {}", cid);
|
dprintln(" cid: {}", cid);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,12 @@ banan_link_library(xbanan libdeflate)
|
||||||
banan_link_library(xbanan libgui)
|
banan_link_library(xbanan libgui)
|
||||||
banan_link_library(xbanan libinput)
|
banan_link_library(xbanan libinput)
|
||||||
|
|
||||||
target_compile_options(xbanan PRIVATE -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers)
|
target_compile_options(xbanan PRIVATE -Wall -Wextra)
|
||||||
|
target_compile_options(xbanan PRIVATE
|
||||||
|
-Wno-sign-compare
|
||||||
|
-Wno-missing-field-initializers
|
||||||
|
-Wno-unused-variable
|
||||||
|
-Wno-unused-but-set-variable
|
||||||
|
)
|
||||||
|
|
||||||
install(TARGETS xbanan OPTIONAL)
|
install(TARGETS xbanan OPTIONAL)
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ BAN::ErrorOr<void> fill_poly(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
dprintln(" gc: {}", request.gc);
|
dprintln(" gc: {}", request.gc);
|
||||||
dprintln(" shape: {}", request.shape);
|
dprintln(" shape: {}", request.shape);
|
||||||
dprintln(" coordMode: {}", request.coordMode);
|
dprintln(" coordMode: {}", request.coordMode);
|
||||||
|
|
||||||
auto [out_data_u32, out_w, out_h, _] = TRY(get_drawable_info(client_info, request.drawable, X_FillPoly));
|
auto [out_data_u32, out_w, out_h, _] = TRY(get_drawable_info(client_info, request.drawable, X_FillPoly));
|
||||||
|
|
||||||
const auto& gc = TRY_REF(get_gc(client_info, request.gc, X_FillPoly));
|
const auto& gc = TRY_REF(get_gc(client_info, request.gc, X_FillPoly));
|
||||||
|
|
@ -268,7 +268,7 @@ BAN::ErrorOr<void> fill_poly(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_objects[request.drawable]->type == Object::Type::Window)
|
if (g_objects[request.drawable]->type == Object::Type::Window)
|
||||||
invalidate_window(request.drawable, min_x, min_y, max_x - min_x + 1, max_y - min_y + 1);
|
invalidate_window(request.drawable, min_x, min_y, max_x - min_x + 1, max_y - min_y + 1);
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
@ -347,7 +347,7 @@ BAN::ErrorOr<void> poly_fill_arc(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
|
|
||||||
const int32_t min_x = BAN::Math::max<int32_t>(0, arc.x);
|
const int32_t min_x = BAN::Math::max<int32_t>(0, arc.x);
|
||||||
const int32_t min_y = BAN::Math::max<int32_t>(0, arc.y);
|
const int32_t min_y = BAN::Math::max<int32_t>(0, arc.y);
|
||||||
|
|
||||||
const int32_t max_x = BAN::Math::min<int32_t>(out_w, arc.x + arc.width);
|
const int32_t max_x = BAN::Math::min<int32_t>(out_w, arc.x + arc.width);
|
||||||
const int32_t max_y = BAN::Math::min<int32_t>(out_h, arc.y + arc.height);
|
const int32_t max_y = BAN::Math::min<int32_t>(out_h, arc.y + arc.height);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ BAN::ErrorOr<void> extension_glx(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
delete &TRY_REF(get_glx_context(request.context));
|
delete &TRY_REF(get_glx_context(request.context));
|
||||||
client_info.objects.remove(request.context);
|
client_info.objects.remove(request.context);
|
||||||
g_objects.remove(request.context);
|
g_objects.remove(request.context);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case X_GLXIsDirect:
|
case X_GLXIsDirect:
|
||||||
|
|
@ -253,7 +253,7 @@ BAN::ErrorOr<void> extension_glx(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
.n = static_cast<CARD16>(string.size()),
|
.n = static_cast<CARD16>(string.size()),
|
||||||
};
|
};
|
||||||
TRY(encode(client_info.output_buffer, reply));
|
TRY(encode(client_info.output_buffer, reply));
|
||||||
|
|
||||||
TRY(encode(client_info.output_buffer, string));
|
TRY(encode(client_info.output_buffer, string));
|
||||||
for (size_t i = 0; (string.size() + i) % 4; i++)
|
for (size_t i = 0; (string.size() + i) % 4; i++)
|
||||||
TRY(encode(client_info.output_buffer, '\0'));
|
TRY(encode(client_info.output_buffer, '\0'));
|
||||||
|
|
@ -289,7 +289,7 @@ BAN::ErrorOr<void> extension_glx(Client& client_info, BAN::ConstByteSpan packet)
|
||||||
.numAttribs = attribs,
|
.numAttribs = attribs,
|
||||||
};
|
};
|
||||||
TRY(encode(client_info.output_buffer, reply));
|
TRY(encode(client_info.output_buffer, reply));
|
||||||
|
|
||||||
TRY(encode(client_info.output_buffer, g_fb_configs));
|
TRY(encode(client_info.output_buffer, g_fb_configs));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ static BAN::ErrorOr<void> extension_randr(Client& client_info, BAN::ConstByteSpa
|
||||||
{
|
{
|
||||||
static CARD32 crtc_id = 5;
|
static CARD32 crtc_id = 5;
|
||||||
static CARD32 output_id = 6;
|
static CARD32 output_id = 6;
|
||||||
static CARD32 mode_id = 7;
|
static CARD32 mode_id = 7;
|
||||||
static CARD32 timestamp = time(nullptr);
|
static CARD32 timestamp = time(nullptr);
|
||||||
|
|
||||||
static xRenderTransform transform {
|
static xRenderTransform transform {
|
||||||
|
|
|
||||||
|
|
@ -455,7 +455,7 @@ static void initialize_fonts()
|
||||||
|
|
||||||
auto it = s_available_fonts.find(BAN::String(name));
|
auto it = s_available_fonts.find(BAN::String(name));
|
||||||
if (it == s_available_fonts.end())
|
if (it == s_available_fonts.end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
MUST(s_available_fonts.insert(BAN::String(alias), it->value));
|
MUST(s_available_fonts.insert(BAN::String(alias), it->value));
|
||||||
}
|
}
|
||||||
|
|
@ -756,7 +756,7 @@ static void write_text(WriteTextInfo& info)
|
||||||
for (size_t i = 0; i < info.string_len; i++)
|
for (size_t i = 0; i < info.string_len; i++)
|
||||||
{
|
{
|
||||||
const uint16_t codepoint = info.wide ? (info.string[i * 2] << 8) | info.string[i * 2 + 1] : info.string[i];
|
const uint16_t codepoint = info.wide ? (info.string[i * 2] << 8) | info.string[i * 2 + 1] : info.string[i];
|
||||||
|
|
||||||
auto glyph_index = info.font->find_glyph(codepoint);
|
auto glyph_index = info.font->find_glyph(codepoint);
|
||||||
if (!glyph_index.has_value())
|
if (!glyph_index.has_value())
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue