Skip to content

Commit 59c033d

Browse files
committed
Fixed various compilation warnings and runtime "errors"
- Fixed some typing or naming errors resulting in compilation warnings - No longer show errors for ENOENT - Adjusted some things regularly causing merge conflicts All those things are fixed in dev branch but people tend to use master as a basis for their fork (which is usually a good idea!), and those specific items have come up in the issues. So I'm exceptionally committing those fixes to master between releases.
1 parent df5b842 commit 59c033d

File tree

10 files changed

+25
-8
lines changed

10 files changed

+25
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- All: French translation now has accents
77
- New device support: LILYGO T-Deck Plus
88
- New device support: Null Nano by Ampersand
9+
- New device support: crokpocket
10+
- New device support: VMU
911

1012

1113
# Retro-Go 1.44 (2025-02-03)

components/retro-go/rg_audio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ void rg_audio_set_sample_rate(int sampleRate)
236236
{
237237
audio.driver->set_sample_rate(sampleRate);
238238
audio.sampleRate = sampleRate;
239+
RG_LOGI("Samplerate set to %d", audio.sampleRate);
239240
RELEASE_DEVICE();
240241
}
241242
}

components/retro-go/rg_display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void lcd_set_window(int left, int top, int width, int height);
3737
static inline uint16_t *lcd_get_buffer(size_t length);
3838
static inline void lcd_send_buffer(uint16_t *buffer, size_t length);
3939

40-
#if RG_SCREEN_DRIVER == 0 /* ILI9341/ST7789 */
40+
#if RG_SCREEN_DRIVER == 0 || RG_SCREEN_DRIVER == 1 /* ILI9341/ST7789 */
4141
#include "drivers/display/ili9341.h"
4242
#elif RG_SCREEN_DRIVER == 99
4343
#include "drivers/display/sdl2.h"

components/retro-go/rg_storage.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,17 @@ bool rg_storage_scandir(const char *path, rg_scandir_cb_t *callback, void *arg,
334334

335335
DIR *dir = opendir(path);
336336
if (!dir)
337+
{
338+
if (errno != ENOENT) // Only log unusual errors. Path not found isn't unusual.
339+
RG_LOGE("Opendir failed (%d): '%s'", errno, path);
337340
return false;
341+
}
338342

339343
// We allocate on heap in case we go recursive through rg_storage_delete
340344
rg_scandir_t *result = calloc(1, sizeof(rg_scandir_t));
341345
if (!result)
342346
{
347+
RG_LOGE("Memory allocation failed: '%s'", path);
343348
closedir(dir);
344349
return false;
345350
}
@@ -433,7 +438,8 @@ bool rg_storage_read_file(const char *path, void **data_out, size_t *data_len, u
433438
FILE *fp = fopen(path, "rb");
434439
if (!fp)
435440
{
436-
RG_LOGE("Fopen failed (%d): '%s'", errno, path);
441+
if (errno != ENOENT) // Only log unusual errors. Path not found isn't unusual.
442+
RG_LOGE("Fopen failed (%d): '%s'", errno, path);
437443
return false;
438444
}
439445

@@ -551,7 +557,8 @@ bool rg_storage_unzip_file(const char *zip_path, const char *filter, void **data
551557
FILE *fp = fopen(zip_path, "rb");
552558
if (!fp)
553559
{
554-
RG_LOGE("Fopen failed (%d): '%s'", errno, zip_path);
560+
if (errno != ENOENT) // Only log unusual errors. Path not found isn't unusual.
561+
RG_LOGE("Fopen failed (%d): '%s'", errno, zip_path);
555562
return false;
556563
}
557564

components/retro-go/rg_surface.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ rg_surface_t *rg_surface_load_image_file(const char *filename, uint32_t flags)
314314
return img;
315315
}
316316

317+
// RG_LOGE("Image loading failed: '%s'", filename);
317318
return NULL;
318319
}
319320

components/retro-go/translations.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include "rg_localization.h"
22

3-
static const char *language_names[RG_LANG_MAX] = {"English", "Francais"};
3+
static const char *language_names[RG_LANG_MAX] = {
4+
[RG_LANG_EN] = "English",
5+
[RG_LANG_FR] = "Francais",
6+
};
47

58
static const char *translations[][RG_LANG_MAX] =
69
{

gwenesis/components/gwenesis/src/vdp/gwenesis_vdp_gfx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,8 @@ void gwenesis_vdp_render_config()
988988
#define CONV(b) ((0x3e00000 & b)>>10) | ((0xfc00 & b)>>5) | ((0x1f & b))
989989
#define SPACE(c) ((0xe800 & c)<<10) | ((0x7e0 & c)<<5) | ((0x1f & c))
990990

991+
/* Function unused
992+
991993
__attribute__((optimize("unroll-loops"))) static void
992994
blit_4to5_line(uint16_t *in, uint16_t *out) {
993995
@@ -1006,6 +1008,7 @@ blit_4to5_line(uint16_t *in, uint16_t *out) {
10061008
dest_row[x_dst + 4] = CONV(b3);
10071009
}
10081010
}
1011+
*/
10091012

10101013
void gwenesis_vdp_render_line(int line)
10111014
{

launcher/main/gui.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ void gui_load_preview(tab_t *tab)
631631

632632
if (!tab->preview && file->checksum && (show_missing_cover || errors))
633633
{
634-
RG_LOGI("No image found for '%s'\n", file->name);
634+
RG_LOGD("No image found for '%s'\n", file->name);
635635
gui_set_status(tab, NULL, errors ? "Bad cover" : "No cover");
636636
// gui_draw_status(tab);
637637
// tab->preview = gui_get_image("cover", file->app);

prboom-go/components/prboom/opl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static Chip opl_chip;
7676

7777
// Temporary mixing buffer used by the mixing callback.
7878

79-
static int *mix_buffer = NULL;
79+
static int32_t *mix_buffer = NULL;
8080

8181
// Register number that was written.
8282

@@ -107,7 +107,7 @@ int OPL_Init (unsigned int rate)
107107
current_time = 0;
108108

109109

110-
mix_buffer = malloc(opl_sample_rate * sizeof(uint32_t));
110+
mix_buffer = malloc(opl_sample_rate * sizeof(int32_t));
111111

112112
// Create the emulator structure:
113113

retro-core/components/handy/eeprom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "system.h"
99
#include "eeprom.h"
1010

11-
CEEPROM::CEEPROM(UBYTE typ)
11+
CEEPROM::CEEPROM(UBYTE type)
1212
{
1313
*filename=0;
1414
memset(romdata, 0xff, sizeof(romdata));

0 commit comments

Comments
 (0)