[clang-tidy] readability-isolate-declaration

This commit is contained in:
akallabeth
2024-01-23 16:49:54 +01:00
committed by akallabeth
parent 735dc61cd9
commit 207def5c56
223 changed files with 1951 additions and 803 deletions

View File

@@ -109,7 +109,8 @@ static const struct zwp_fullscreen_shell_v1_listener fullscreen_shell_listener =
static void display_destroy_seat(UwacDisplay* d, uint32_t name)
{
UwacSeat *seat, *tmp;
UwacSeat* seat;
UwacSeat* tmp;
wl_list_for_each_safe(seat, tmp, &d->seats, link)
{
if (seat->seat_id == name)
@@ -204,7 +205,8 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin
}
else if (strcmp(interface, "wl_data_device_manager") == 0)
{
UwacSeat *seat, *tmp;
UwacSeat* seat;
UwacSeat* tmp;
d->data_device_manager = wl_registry_bind(registry, id, &wl_data_device_manager_interface,
min(TARGET_DDM_INTERFACE, version));
@@ -458,7 +460,9 @@ out_free:
int UwacDisplayDispatch(UwacDisplay* display, int timeout)
{
int ret, count, i;
int ret;
int count;
int i;
UwacTask* task;
struct epoll_event ep[16];
wl_display_dispatch_pending(display->display);
@@ -498,10 +502,14 @@ UwacReturnCode UwacDisplayGetLastError(const UwacDisplay* display)
UwacReturnCode UwacCloseDisplay(UwacDisplay** pdisplay)
{
UwacDisplay* display;
UwacSeat *seat, *tmpSeat;
UwacWindow *window, *tmpWindow;
UwacOutput *output, *tmpOutput;
UwacGlobal *global, *tmpGlobal;
UwacSeat* seat;
UwacSeat* tmpSeat;
UwacWindow* window;
UwacWindow* tmpWindow;
UwacOutput* output;
UwacOutput* tmpOutput;
UwacGlobal* global;
UwacGlobal* tmpGlobal;
assert(pdisplay);
display = *pdisplay;
@@ -622,7 +630,8 @@ const char* UwacErrorString(UwacReturnCode error)
UwacReturnCode UwacDisplayQueryInterfaceVersion(const UwacDisplay* display, const char* name,
uint32_t* version)
{
const UwacGlobal *global, *tmp;
const UwacGlobal* global;
const UwacGlobal* tmp;
if (!display)
return UWAC_ERROR_INVALID_DISPLAY;
@@ -675,7 +684,8 @@ uint32_t UwacDisplayGetNbOutputs(const UwacDisplay* display)
const UwacOutput* UwacDisplayGetOutput(UwacDisplay* display, int index)
{
int i, display_count;
int i;
int display_count;
UwacOutput* ret = NULL;
if (!display)

View File

@@ -97,7 +97,8 @@ static UwacReturnCode set_cursor_image(UwacSeat* seat, uint32_t serial)
struct wl_cursor* cursor;
struct wl_cursor_image* image = NULL;
struct wl_surface* surface = NULL;
int32_t x = 0, y = 0;
int32_t x = 0;
int32_t y = 0;
if (!seat || !seat->display || !seat->default_cursor || !seat->default_cursor->images)
return UWAC_ERROR_INTERNAL;
@@ -362,7 +363,8 @@ static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, uint32
UwacWindow* window = input->keyboard_focus;
UwacKeyEvent* keyEvent;
uint32_t code, num_syms;
uint32_t code;
uint32_t num_syms;
enum wl_keyboard_key_state state = state_w;
const xkb_keysym_t* syms;
xkb_keysym_t sym;

View File

@@ -91,7 +91,8 @@ static void xdg_handle_toplevel_configure(void* data, struct xdg_toplevel* xdg_t
width *= scale;
height *= scale;
UwacConfigureEvent* event;
int ret, surfaceState;
int ret;
int surfaceState;
enum xdg_toplevel_state* state;
surfaceState = 0;
wl_array_for_each(state, states)
@@ -321,7 +322,8 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32
{
int ret = UWAC_SUCCESS;
UwacBuffer* newBuffers;
int i, fd;
int i;
int fd;
void* data;
struct wl_shm_pool* pool;
size_t pagesize = sysconf(_SC_PAGESIZE);
@@ -456,7 +458,8 @@ UwacWindow* UwacCreateWindowShm(UwacDisplay* display, uint32_t width, uint32_t h
enum wl_shm_format format)
{
UwacWindow* w;
int allocSize, ret;
int allocSize;
int ret;
if (!display)
{
@@ -679,8 +682,12 @@ static const struct wl_callback_listener frame_listener = { frame_done_cb };
#ifdef UWAC_HAVE_PIXMAN_REGION
static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale)
{
int nrects, i;
int x, y, w, h;
int nrects;
int i;
int x;
int y;
int w;
int h;
const pixman_box32_t* box = pixman_region32_rectangles(&buffer->damage, &nrects);
for (i = 0; i < nrects; i++, box++)
@@ -697,8 +704,12 @@ static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale)
#else
static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale)
{
uint32_t nrects, i;
int x, y, w, h;
uint32_t nrects;
uint32_t i;
int x;
int y;
int w;
int h;
const RECTANGLE_16* box = region16_rects(&buffer->damage, &nrects);
for (i = 0; i < nrects; i++, box++)