From 3c73afb7a94e3fab0adc45b04093b3f96fdbe147 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 25 Jun 2020 18:10:55 -0700 Subject: [PATCH] Core: Const-correctness --- include/mgba/core/core.h | 2 +- src/gb/core.c | 4 ++-- src/gba/core.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/mgba/core/core.h b/include/mgba/core/core.h index eeafb2724..18e05cd89 100644 --- a/include/mgba/core/core.h +++ b/include/mgba/core/core.h @@ -70,7 +70,7 @@ struct mCore { void (*loadConfig)(struct mCore*, const struct mCoreConfig*); void (*reloadConfigOption)(struct mCore*, const char* option, const struct mCoreConfig*); - void (*desiredVideoDimensions)(struct mCore*, unsigned* width, unsigned* height); + void (*desiredVideoDimensions)(const struct mCore*, unsigned* width, unsigned* height); void (*setVideoBuffer)(struct mCore*, color_t* buffer, size_t stride); void (*setVideoGLTex)(struct mCore*, unsigned texid); diff --git a/src/gb/core.c b/src/gb/core.c index 8dee77ce3..a3dd7dd79 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -277,8 +277,8 @@ static void _GBCoreReloadConfigOption(struct mCore* core, const char* option, co } } -static void _GBCoreDesiredVideoDimensions(struct mCore* core, unsigned* width, unsigned* height) { - struct GB* gb = core->board; +static void _GBCoreDesiredVideoDimensions(const struct mCore* core, unsigned* width, unsigned* height) { + const struct GB* gb = core->board; if (gb && (!(gb->model & GB_MODEL_SGB) || !gb->video.sgbBorders)) { *width = GB_VIDEO_HORIZONTAL_PIXELS; *height = GB_VIDEO_VERTICAL_PIXELS; diff --git a/src/gba/core.c b/src/gba/core.c index c134e5d45..a1cd7f187 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -388,9 +388,9 @@ static void _GBACoreReloadConfigOption(struct mCore* core, const char* option, c } } -static void _GBACoreDesiredVideoDimensions(struct mCore* core, unsigned* width, unsigned* height) { +static void _GBACoreDesiredVideoDimensions(const struct mCore* core, unsigned* width, unsigned* height) { #if defined(BUILD_GLES2) || defined(BUILD_GLES3) - struct GBACore* gbacore = (struct GBACore*) core; + const struct GBACore* gbacore = (const struct GBACore*) core; int scale = gbacore->glRenderer.scale; #else UNUSED(core);