Skip to content

Commit

Permalink
Format code again
Browse files Browse the repository at this point in the history
It's based on LLVM with a couple of personal touches
  • Loading branch information
GhostNaN committed Apr 25, 2024
1 parent 9a03925 commit 5b6bbfa
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 96 deletions.
32 changes: 16 additions & 16 deletions inc/glad/glad_egl.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,22 +268,22 @@ typedef void (APIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLin

#define CASE_STR(value) case value: return #value;
const char *eglGetErrorString(EGLint error) {
switch(error) {
CASE_STR( EGL_SUCCESS )
CASE_STR( EGL_NOT_INITIALIZED )
CASE_STR( EGL_BAD_ACCESS )
CASE_STR( EGL_BAD_ALLOC )
CASE_STR( EGL_BAD_ATTRIBUTE )
CASE_STR( EGL_BAD_CONTEXT )
CASE_STR( EGL_BAD_CONFIG )
CASE_STR( EGL_BAD_CURRENT_SURFACE )
CASE_STR( EGL_BAD_DISPLAY )
CASE_STR( EGL_BAD_SURFACE )
CASE_STR( EGL_BAD_MATCH )
CASE_STR( EGL_BAD_PARAMETER )
CASE_STR( EGL_BAD_NATIVE_PIXMAP )
CASE_STR( EGL_BAD_NATIVE_WINDOW )
CASE_STR( EGL_CONTEXT_LOST )
switch (error) {
CASE_STR(EGL_SUCCESS)
CASE_STR(EGL_NOT_INITIALIZED)
CASE_STR(EGL_BAD_ACCESS)
CASE_STR(EGL_BAD_ALLOC)
CASE_STR(EGL_BAD_ATTRIBUTE)
CASE_STR(EGL_BAD_CONTEXT)
CASE_STR(EGL_BAD_CONFIG)
CASE_STR(EGL_BAD_CURRENT_SURFACE)
CASE_STR(EGL_BAD_DISPLAY)
CASE_STR(EGL_BAD_SURFACE)
CASE_STR(EGL_BAD_MATCH)
CASE_STR(EGL_BAD_PARAMETER)
CASE_STR(EGL_BAD_NATIVE_PIXMAP)
CASE_STR(EGL_BAD_NATIVE_WINDOW)
CASE_STR(EGL_CONTEXT_LOST)
default: return "Unknown Error";
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/holder.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include <fcntl.h>
#include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/mman.h>
#include <time.h>
#include <unistd.h>

#include <wayland-client.h>
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
#include <wayland-client.h>

typedef unsigned int uint;

Expand All @@ -18,8 +18,8 @@ struct wl_state {
struct wl_compositor *compositor;
struct wl_shm *shm;
struct zwlr_layer_shell_v1 *layer_shell;
struct wl_list outputs; // struct display_output::link
char* monitor; // User selected output
struct wl_list outputs; // struct display_output::link
char *monitor; // User selected output
};

struct display_output {
Expand Down Expand Up @@ -215,14 +215,15 @@ static void output_done(void *data, struct wl_output *wl_output) {

static const struct wl_output_listener output_listener = {
.geometry = nop,
.mode = nop,
.done = output_done,
.scale = nop,
.name = output_name,
.description = nop,
.mode = nop,
.done = output_done,
.scale = nop,
.name = output_name,
.description = nop,
};

static void handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) {
static void handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface,
uint32_t version) {
(void)version;

struct wl_state *state = data;
Expand Down Expand Up @@ -261,10 +262,10 @@ static const struct wl_registry_listener registry_listener = {
.global_remove = handle_global_remove,
};

static void copy_argv(int argc, char* argv[]) {
static void copy_argv(int argc, char *argv[]) {
halt_info.argv_copy = calloc(argc+1, sizeof(char*));

for (int i = 0; i < argc; i++) {
for (int i=0; i < argc; i++) {
halt_info.argv_copy[i] = strdup(argv[i]);
}
}
Expand Down Expand Up @@ -304,7 +305,8 @@ static void parse_command_line(int argc, char **argv, struct wl_state *state) {
{"slideshow", required_argument, NULL, 'n'},
{"layer", required_argument, NULL, 'l'},
{"mpv-options", required_argument, NULL, 'o'},
{0, 0, 0, 0}};
{0, 0, 0, 0}
};

const char *usage =
"Usage: mpvpaper-holder <mpvpaper options>\n"
Expand Down Expand Up @@ -369,9 +371,7 @@ int main(int argc, char **argv) {
}

struct display_output *output, *tmp_output;
wl_list_for_each_safe(output, tmp_output, &state.outputs, link) {
destroy_display_output(output);
}
wl_list_for_each_safe(output, tmp_output, &state.outputs, link) { destroy_display_output(output); }

return EXIT_SUCCESS;
}
Loading

0 comments on commit 5b6bbfa

Please sign in to comment.