# HG changeset patch # User Mike Becker # Date 1749894040 -7200 # Node ID 560772519ff982b2593d3af7c02a71fa4f964f43 # Parent 9f030f4026999de7cc4f541e881c189a2dffe282 resolve east-west conflict diff -r 9f030f402699 -r 560772519ff9 src/ascension/error.h --- a/src/ascension/error.h Fri Jun 13 18:09:49 2025 +0200 +++ b/src/ascension/error.h Sat Jun 14 11:40:40 2025 +0200 @@ -28,7 +28,7 @@ #ifndef ASC_ERROR_H #define ASC_ERROR_H -void asc_error_(const char *file, unsigned line, char const *fmt, ...); +void asc_error_(const char *file, unsigned line, const char *fmt, ...); #define asc_error(...) asc_error_(__FILE__, __LINE__, __VA_ARGS__) @@ -38,7 +38,7 @@ bool asc_has_error(void); -char const *asc_get_error(void); +const char *asc_get_error(void); void asc_clear_error(void); diff -r 9f030f402699 -r 560772519ff9 src/ascension/glcontext.h --- a/src/ascension/glcontext.h Fri Jun 13 18:09:49 2025 +0200 +++ b/src/ascension/glcontext.h Sat Jun 14 11:40:40 2025 +0200 @@ -59,7 +59,7 @@ bool asc_gl_context_initialize( AscGLContext *ctx, SDL_Window *window, - AscGLContextSettings const *settings + const AscGLContextSettings *settings ); void asc_gl_context_destroy(AscGLContext *ctx); diff -r 9f030f402699 -r 560772519ff9 src/ascension/sprite.h --- a/src/ascension/sprite.h Fri Jun 13 18:09:49 2025 +0200 +++ b/src/ascension/sprite.h Sat Jun 14 11:40:40 2025 +0200 @@ -44,7 +44,7 @@ } AscSprite; struct asc_sprite_create_args { - const char* name; + const char *name; AscTexture *texture; int x; int y; diff -r 9f030f402699 -r 560772519ff9 src/ascension/texture.h --- a/src/ascension/texture.h Fri Jun 13 18:09:49 2025 +0200 +++ b/src/ascension/texture.h Sat Jun 14 11:40:40 2025 +0200 @@ -87,9 +87,9 @@ asc_texture_init(tex, count, ASC_TEXTURE_2D, \ ASC_TEXTURE_MIN_FILTER_LINEAR, ASC_TEXTURE_MAG_FILTER_LINEAR) -void asc_texture_bind(AscTexture const *tex, int uniform_location, int unit); +void asc_texture_bind(const AscTexture *tex, int uniform_location, int unit); -void asc_texture_from_surface(AscTexture *tex, SDL_Surface const *surface); +void asc_texture_from_surface(AscTexture *tex, const SDL_Surface *surface); void asc_texture_from_file(AscTexture *tex, const char *name); diff -r 9f030f402699 -r 560772519ff9 src/ascension/ui/text.h --- a/src/ascension/ui/text.h Fri Jun 13 18:09:49 2025 +0200 +++ b/src/ascension/ui/text.h Sat Jun 14 11:40:40 2025 +0200 @@ -62,7 +62,7 @@ int x; int y; const char *name; - char const *text; + const char *text; enum asc_text_alignment alignment; unsigned short max_width; }; @@ -156,7 +156,7 @@ */ void asc_text_printf( AscSceneNode *node, - char const* format, + const char *format, ... ); diff -r 9f030f402699 -r 560772519ff9 src/ascension/window.h --- a/src/ascension/window.h Fri Jun 13 18:09:49 2025 +0200 +++ b/src/ascension/window.h Sat Jun 14 11:40:40 2025 +0200 @@ -47,7 +47,7 @@ typedef struct asc_window_settings_s { AscGLContextSettings glsettings; asc_vec2i dimensions; - char const* title; + const char *title; bool fullscreen; } AscWindowSettings; @@ -55,7 +55,7 @@ Uint32 id; bool resized; bool focused; - SDL_Window* window; + SDL_Window *window; asc_vec2u dimensions; AscGLContext glctx; AscScene ui; @@ -67,7 +67,7 @@ * * @param settings an uninitialized settings object */ -void asc_window_settings_init_defaults(AscWindowSettings* settings); +void asc_window_settings_init_defaults(AscWindowSettings *settings); /** * Creates and initializes a new window and a corresponding OpenGL context. @@ -80,7 +80,7 @@ * @param index the index of the new window * @param settings the settings to be used for initialization */ -void asc_window_initialize(unsigned int index, AscWindowSettings const* settings); +void asc_window_initialize(unsigned int index, const AscWindowSettings *settings); /** * Destroys the window and its OpenGL context. diff -r 9f030f402699 -r 560772519ff9 src/error.c --- a/src/error.c Fri Jun 13 18:09:49 2025 +0200 +++ b/src/error.c Sat Jun 14 11:40:40 2025 +0200 @@ -43,11 +43,11 @@ putchar('\n'); } -void asc_error_(const char* file, unsigned line, char const* fmt, ...) { +void asc_error_(const char *file, unsigned line, const char *fmt, ...) { asc_set_flag(asc_context.flags, ASC_FLAG_HAS_ERROR); // write to error buffer - CxBuffer* buf = &asc_context.error_buffer; + CxBuffer *buf = &asc_context.error_buffer; size_t bufpos = buf->pos; va_list args; va_start(args, fmt); @@ -65,7 +65,7 @@ return asc_test_flag(asc_context.flags, ASC_FLAG_HAS_ERROR); } -char const* asc_get_error(void) { +const char *asc_get_error(void) { // we zero-terminate the current buffer contents before providing them cxBufferPut(&asc_context.error_buffer, 0); --asc_context.error_buffer.pos; diff -r 9f030f402699 -r 560772519ff9 src/font.c --- a/src/font.c Fri Jun 13 18:09:49 2025 +0200 +++ b/src/font.c Sat Jun 14 11:40:40 2025 +0200 @@ -39,7 +39,7 @@ asc_context.active_font.size = size; } -static char const *asc_font_filename(enum AscFontStyle style) { +static const char *asc_font_filename(enum AscFontStyle style) { switch (style) { case ASC_FONT_REGULAR: return "OpenSans-Regular.ttf"; diff -r 9f030f402699 -r 560772519ff9 src/glcontext.c --- a/src/glcontext.c Fri Jun 13 18:09:49 2025 +0200 +++ b/src/glcontext.c Sat Jun 14 11:40:40 2025 +0200 @@ -34,8 +34,8 @@ static void asc_gl_debug_callback( GLenum source, GLenum type, GLuint id, GLenum severity, - GLsizei length, const GLchar* message, - __attribute__((__unused__)) const void* userParam + GLsizei length, const GLchar *message, + __attribute__((__unused__)) const void *userParam ) { if (type == GL_DEBUG_TYPE_ERROR) { asc_error("OpenGL source = %d, id = %u, type = %d, severity= %d, message = %.*s", @@ -74,7 +74,7 @@ bool asc_gl_context_initialize( AscGLContext *ctx, SDL_Window *window, - AscGLContextSettings const *settings + const AscGLContextSettings *settings ) { SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, settings->gl_major_version); diff -r 9f030f402699 -r 560772519ff9 src/text.c --- a/src/text.c Fri Jun 13 18:09:49 2025 +0200 +++ b/src/text.c Sat Jun 14 11:40:40 2025 +0200 @@ -125,7 +125,7 @@ void asc_text_printf( AscSceneNode *node, - char const* format, + const char *format, ... ) { AscText *text_node = (AscText*) node; diff -r 9f030f402699 -r 560772519ff9 src/texture.c --- a/src/texture.c Fri Jun 13 18:09:49 2025 +0200 +++ b/src/texture.c Sat Jun 14 11:40:40 2025 +0200 @@ -34,7 +34,7 @@ #include #include -void asc_texture_bind(AscTexture const *tex, int uniform_location, int unit) { +void asc_texture_bind(const AscTexture *tex, int uniform_location, int unit) { glActiveTexture(GL_TEXTURE0 + unit); GLenum error = glGetError(); if (error == GL_INVALID_ENUM) { @@ -47,7 +47,7 @@ asc_error_catch_all_gl(); } -void asc_texture_from_surface(AscTexture *tex, SDL_Surface const *surface) { +void asc_texture_from_surface(AscTexture *tex, const SDL_Surface *surface) { if (tex->tex_id == 0) { asc_error("Tried to use uninitialized texture (%"PRIxPTR ").", (uintptr_t) tex); return; diff -r 9f030f402699 -r 560772519ff9 src/window.c --- a/src/window.c Fri Jun 13 18:09:49 2025 +0200 +++ b/src/window.c Sat Jun 14 11:40:40 2025 +0200 @@ -31,7 +31,7 @@ #include -void asc_window_settings_init_defaults(AscWindowSettings* settings) { +void asc_window_settings_init_defaults(AscWindowSettings *settings) { settings->dimensions.width = 800; settings->dimensions.height = 600; settings->fullscreen = false; @@ -42,7 +42,7 @@ settings->title = "Ascended Window"; } -void asc_window_initialize(unsigned int index, AscWindowSettings const *settings) { +void asc_window_initialize(unsigned int index, const AscWindowSettings *settings) { if (index >= ASC_MAX_WINDOWS) { asc_error("Maximum number of windows exceeded (%u/%u).", index, ASC_MAX_WINDOWS); return; diff -r 9f030f402699 -r 560772519ff9 test/snake/snake.c --- a/test/snake/snake.c Fri Jun 13 18:09:49 2025 +0200 +++ b/test/snake/snake.c Sat Jun 14 11:40:40 2025 +0200 @@ -110,7 +110,7 @@ static void create_score_counter(void) { asc_font(ASC_FONT_BOLD, 16); asc_ink_rgb(0, 255, 0); - AscSceneNode* node = asc_text( + AscSceneNode *node = asc_text( .name = "Score Counter", .x = 10, .y = 10, .text = "Score: 0"