Mercurial > molko
changeset 40:2a087210c0b8
misc: invalid indent
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 14 Jan 2020 13:40:26 +0100 |
parents | 9d1421c09dfb |
children | 3996f873a54b |
files | src/event.h src/sys.c |
diffstat | 2 files changed, 53 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event.h Tue Jan 14 13:05:45 2020 +0100 +++ b/src/event.h Tue Jan 14 13:40:26 2020 +0100 @@ -48,17 +48,17 @@ union event { enum event_type type; /*!< Which kind of event */ - /** - * Store key down/up event. - */ + /** + * Store key down/up event. + */ struct { enum event_type type; /*!< EVENT_KEYDOWN or EVENT_KEYUP */ enum key key; /*!< Which key */ } key; - /** - * Store mouse motion event. - */ + /** + * Store mouse motion event. + */ struct { enum event_type type; /*!< EVENT_MOUSE */ enum mouse_button buttons; /*!< OR'ed buttons that are pressed */ @@ -66,9 +66,9 @@ int32_t y; /*!< Mouse position in y */ } mouse; - /** - * Store mouse click event. - */ + /** + * Store mouse click event. + */ struct { enum event_type type; /*!< EVENT_CLICKDOWN or EVENT_CLICKUP */ enum mouse_button button; /*!< Unique button that was pressed */
--- a/src/sys.c Tue Jan 14 13:05:45 2020 +0100 +++ b/src/sys.c Tue Jan 14 13:40:26 2020 +0100 @@ -37,10 +37,10 @@ static void determine(char path[], size_t pathlen) { - char *base = SDL_GetBasePath(); + char *base = SDL_GetBasePath(); /* On Windows, the data hierarchy is the same as the project. */ - snprintf(path, pathlen, "%sassets", base); + snprintf(path, pathlen, "%sassets", base); SDL_free(base); } @@ -49,47 +49,47 @@ static bool is_absolute(const char *path) { - assert(path); + assert(path); - return path[0] == '/'; + return path[0] == '/'; } static void determine(char path[], size_t pathlen) { - char localassets[FILENAME_MAX]; - char *base = SDL_GetBasePath(); - DIR *dp; + char localassets[FILENAME_MAX]; + char *base = SDL_GetBasePath(); + DIR *dp; - /* Try assets directory where executable lives. */ - snprintf(localassets, sizeof (localassets), "%sassets", base); + /* Try assets directory where executable lives. */ + snprintf(localassets, sizeof (localassets), "%sassets", base); - if ((dp = opendir(localassets))) { - snprintf(path, pathlen, "%sassets", base); - closedir(dp); - } else { - /* We are not in the project source directory. */ - if (is_absolute(SHAREDIR)) { - /* SHAREDIR is absolute */ - snprintf(path, pathlen, "%s/molko", SHAREDIR); - } else if (is_absolute(BINDIR)) { - /* SHAREDIR is relative but BINDIR is absolute */ - snprintf(path, pathlen, "%s/%s/molko", PREFIX, SHAREDIR); - } else { - /* SHAREDIR, BINDIR are both relative */ - char *ptr = strstr(base, BINDIR); + if ((dp = opendir(localassets))) { + snprintf(path, pathlen, "%sassets", base); + closedir(dp); + } else { + /* We are not in the project source directory. */ + if (is_absolute(SHAREDIR)) { + /* SHAREDIR is absolute */ + snprintf(path, pathlen, "%s/molko", SHAREDIR); + } else if (is_absolute(BINDIR)) { + /* SHAREDIR is relative but BINDIR is absolute */ + snprintf(path, pathlen, "%s/%s/molko", PREFIX, SHAREDIR); + } else { + /* SHAREDIR, BINDIR are both relative */ + char *ptr = strstr(base, BINDIR); - if (ptr) { - *ptr = '\0'; - snprintf(path, pathlen, "%s%s/molko", base, SHAREDIR); - } else { - /* Unable to determine. */ - snprintf(path, pathlen, "."); - } - } - } + if (ptr) { + *ptr = '\0'; + snprintf(path, pathlen, "%s%s/molko", base, SHAREDIR); + } else { + /* Unable to determine. */ + snprintf(path, pathlen, "."); + } + } + } - SDL_free(base); + SDL_free(base); } #endif @@ -123,26 +123,26 @@ const char * sys_datapath(const char *fmt, ...) { - const char *ret; - va_list ap; + const char *ret; + va_list ap; - va_start(ap, fmt); - ret = sys_datapathv(fmt, ap); - va_end(ap); + va_start(ap, fmt); + ret = sys_datapathv(fmt, ap); + va_end(ap); - return ret; + return ret; } const char * sys_datapathv(const char *fmt, va_list ap) { - static char path[2048]; - char filename[FILENAME_MAX]; + static char path[2048]; + char filename[FILENAME_MAX]; - vsnprintf(filename, sizeof (filename), fmt, ap); - snprintf(path, sizeof (path), "%s/%s", sys_datadir(), filename); + vsnprintf(filename, sizeof (filename), fmt, ap); + snprintf(path, sizeof (path), "%s/%s", sys_datadir(), filename); - return path; + return path; } void