all repos — mgba @ 3c73afb7a94e3fab0adc45b04093b3f96fdbe147

mGBA Game Boy Advance Emulator

Core: Const-correctness
Vicki Pfau vi@endrift.com
Thu, 25 Jun 2020 18:10:55 -0700
commit

3c73afb7a94e3fab0adc45b04093b3f96fdbe147

parent

a903fe19d8ae9eff97c25f2595f17e0ed5d6bc34

3 files changed, 5 insertions(+), 5 deletions(-)

jump to
M include/mgba/core/core.hinclude/mgba/core/core.h

@@ -70,7 +70,7 @@ void (*setSync)(struct mCore*, struct mCoreSync*);

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);
M src/gb/core.csrc/gb/core.c

@@ -277,8 +277,8 @@ return;

} } -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;
M src/gba/core.csrc/gba/core.c

@@ -388,9 +388,9 @@ }

} } -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);