Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

3ds: Various fixes, mostly for compiler warnings

- Move all devkitpro includes before the Rockbox ones so that the macros which are both conflicting and unused can be undef'd
- Remove unused result variables
- Exclude an unused function from being compiled for this target
- Fix hex number formatting
- Fix the return value of dummy functions
- Fix macro redefinition in the plugins keypad config
- Remove duplicate button mapping
- Turn off -Wchar-subscripts as it's already handled in Rockbox's ctype.h

Change-Id: I3f5a3d492c585f233277a380feaea5fe877a044f

authored by

Vencislav Atanasov and committed by
Solomon Peachy
a77c5d22 6246e9b4

+93 -60
+2 -1
apps/plugins/lib/keymaps.h
··· 310 310 (CONFIG_KEYPAD != ONDAVX777_PAD) && \ 311 311 (CONFIG_KEYPAD != CREATIVE_ZENXFI2_PAD) && \ 312 312 (CONFIG_KEYPAD != SHANLING_Q1_PAD) && \ 313 - (CONFIG_KEYPAD != HIBY_R3PROII_PAD) 313 + (CONFIG_KEYPAD != HIBY_R3PROII_PAD) && \ 314 + (CONFIG_KEYPAD != CTRU_PAD) 314 315 #define BTN_FIRE BUTTON_BOTTOMLEFT 315 316 #define BTN_PAUSE BUTTON_TOPLEFT 316 317 #endif
+1 -1
apps/plugins/plugin_crt0.c
··· 28 28 #ifdef CTRU 29 29 /* dummy undefined symbols to build plugins for ctru */ 30 30 void __aeabi_unwind_cpp_pr0(void) {} 31 - struct _reent * _EXFUN(__getreent, (void)) {} 31 + struct _reent * _EXFUN(__getreent, (void)) { return NULL; } 32 32 #endif 33 33 34 34 /*
+2 -2
firmware/kernel/thread-common.c
··· 231 231 snprintf(buf, bufsize, fmt, name, thread->id); 232 232 } 233 233 234 - #ifndef HAVE_SDL_THREADS 234 + #if !defined(HAVE_SDL_THREADS) && !defined(CTRU) 235 235 /*--------------------------------------------------------------------------- 236 236 * Returns the maximum percentage of the stack ever used during runtime. 237 237 *--------------------------------------------------------------------------- ··· 252 252 253 253 return usage; 254 254 } 255 - #endif /* HAVE_SDL_THREADS */ 255 + #endif /* !defined(HAVE_SDL_THREADS) && !defined(CTRU) */ 256 256 257 257 #if NUM_CORES > 1 258 258 int core_get_debug_info(unsigned int core, struct core_debug_info *infop)
+4 -2
firmware/target/hosted/ctru/backlight-ctru.c
··· 23 23 #include <unistd.h> 24 24 #include <string.h> 25 25 #include <stdio.h> 26 + 27 + #include <3ds/services/gsplcd.h> 28 + #include <3ds/result.h> 29 + 26 30 #include "config.h" 27 31 #include "backlight-target.h" 28 32 #include "sysfs.h" ··· 30 34 #include "lcd.h" 31 35 #include "debug.h" 32 36 33 - #include <3ds/services/gsplcd.h> 34 - #include <3ds/result.h> 35 37 #include "luminance-ctru.h" 36 38 37 39 /* TODO: To use calibrated values in rockbox,
+7 -9
firmware/target/hosted/ctru/button-ctru.c
··· 22 22 #include <math.h> 23 23 #include <stdlib.h> /* EXIT_SUCCESS */ 24 24 #include <stdio.h> 25 + 26 + #include <3ds/types.h> 27 + #include <3ds/services/apt.h> 28 + #include <3ds/services/hid.h> 29 + #include <3ds/services/mcuhwc.h> 30 + #include <3ds/services/dsp.h> 31 + 25 32 #include "config.h" 26 33 #include "button.h" 27 34 #include "kernel.h" ··· 37 44 #include "misc.h" 38 45 39 46 #include "touchscreen.h" 40 - 41 - #include <3ds/types.h> 42 - #include <3ds/services/apt.h> 43 - #include <3ds/services/hid.h> 44 - #include <3ds/services/mcuhwc.h> 45 - #include <3ds/services/dsp.h> 46 47 47 48 static u8 old_slider_level = 0; 48 49 static int last_y, last_x; ··· 135 136 } 136 137 if (kDown & KEY_DDOWN) { 137 138 key |= BUTTON_DOWN; 138 - } 139 - if (kDown & KEY_START) { 140 - key |= BUTTON_POWER; 141 139 } 142 140 143 141 touchPosition touch;
+3 -2
firmware/target/hosted/ctru/filesystem-ctru.c
··· 24 24 #include <stdio.h> 25 25 #include <errno.h> 26 26 #include <utime.h> 27 + 28 + #include <3ds/archive.h> 29 + 27 30 #include "config.h" 28 31 #include "system.h" 29 32 #include "file.h" ··· 32 35 #include "debug.h" 33 36 #include "pathfuncs.h" 34 37 #include "string-extra.h" 35 - 36 - #include <3ds/archive.h> 37 38 38 39 void paths_init(void) 39 40 {
+7 -1
firmware/target/hosted/ctru/lc-ctru.c
··· 19 19 * 20 20 ****************************************************************************/ 21 21 #define RB_FILESYSTEM_OS 22 - #include <dlfcn.h> 23 22 #include <stdlib.h> 24 23 #include <string.h> 24 + 25 + /* this is part of CTRDL and includes 3ds.h */ 26 + #include <dlfcn.h> 27 + #ifdef RGB565 28 + #undef RGB565 29 + #endif 30 + 25 31 #include "system.h" 26 32 #include "load_code.h" 27 33 #include "filesystem-ctru.h"
+11 -6
firmware/target/hosted/ctru/lcd-bitmap.c
··· 22 22 #include <math.h> 23 23 #include <stdlib.h> 24 24 #include <string.h> 25 + 26 + #include <3ds/gfx.h> 27 + #ifdef RGB565 28 + #undef RGB565 29 + #endif 30 + 31 + #include <3ds/allocator/linear.h> 32 + #include <3ds/console.h> 33 + #include <3ds/services/cfgu.h> 34 + 25 35 #include "debug.h" 26 36 #include "system.h" 27 37 #include "button-ctru.h" 28 38 #include "screendump.h" 29 39 #include "lcd-target.h" 30 - 31 - #include <3ds/gfx.h> 32 - #include <3ds/allocator/linear.h> 33 - #include <3ds/console.h> 34 - #include <3ds/services/cfgu.h> 35 40 36 41 /*#define LOGF_ENABLE*/ 37 42 #include "logf.h" ··· 186 191 /* hidInit(); */ 187 192 188 193 u16 fb_width, fb_height; 189 - u8* fb = gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, &fb_width, &fb_height); 194 + gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, &fb_width, &fb_height); 190 195 u32 bufsize = fb_width * fb_height * 2; 191 196 192 197 dev_fb = (fb_data *) linearAlloc(bufsize);
+4
firmware/target/hosted/ctru/lib/bfile/bfile-internal.h
··· 10 10 #include <math.h> 11 11 12 12 #include <3ds/gfx.h> 13 + #ifdef RGB565 14 + #undef RGB565 15 + #endif 16 + 13 17 #include <3ds/svc.h> 14 18 #include <3ds/types.h> 15 19 #include <3ds/thread.h>
+8 -5
firmware/target/hosted/ctru/lib/sys_dir.c
··· 19 19 * 20 20 ****************************************************************************/ 21 21 #define DIRFUNCTIONS_DEFINED 22 - #include "config.h" 23 22 #include <errno.h> 24 23 #include <string.h> 24 + #include "fs_defines.h" 25 + 26 + #include <3ds/archive.h> 27 + #include <3ds/util/utf.h> 28 + /* this includes a couple of 3ds headers */ 29 + #include "sys_file.h" 30 + 31 + #include "config.h" 25 32 #include "debug.h" 26 33 #include "dir.h" 27 34 #include "pathfuncs.h" 28 35 #include "timefuncs.h" 29 36 #include "system.h" 30 - #include "fs_defines.h" 31 - #include "sys_file.h" 32 37 33 - #include <3ds/archive.h> 34 - #include <3ds/util/utf.h> 35 38 36 39 /* This file is based on firmware/common/dir.c */ 37 40
+8 -5
firmware/target/hosted/ctru/lib/sys_file.c
··· 18 18 * KIND, either express or implied. 19 19 * 20 20 ****************************************************************************/ 21 - #define RB_FILESYSTEM_OS 22 - #include "config.h" 23 - #include "system.h" 24 21 #include <string.h> 25 22 #include <errno.h> 26 23 #include <fcntl.h> 27 24 #include <unistd.h> 28 25 #include <utime.h> 26 + #include "fs_defines.h" 27 + 28 + /* this includes a couple of 3ds headers */ 29 + #include "sys_file.h" 30 + 31 + #define RB_FILESYSTEM_OS 32 + #include "config.h" 33 + #include "system.h" 29 34 #include "file.h" 30 35 #include "debug.h" 31 36 #include "string-extra.h" 32 - #include "fs_defines.h" 33 - #include "sys_file.h" 34 37 35 38 /* This file is based on firmware/common/file.c */ 36 39
+2 -2
firmware/target/hosted/ctru/lib/sys_thread.h
··· 22 22 #ifndef __SYSTHREAD_H__ 23 23 #define __SYSTHREAD_H__ 24 24 25 - #include "thread.h" 26 - 27 25 #include <3ds/synchronization.h> 28 26 #include <3ds/thread.h> 29 27 #include <3ds/services/apt.h> 28 + 29 + #include "thread.h" 30 30 31 31 /* Complementary atomic operations */ 32 32 bool _AtomicCAS(u32 *ptr, int oldval, int newval);
+5 -3
firmware/target/hosted/ctru/lib/sys_timer.c
··· 24 24 #include <stdio.h> 25 25 #include <string.h> 26 26 #include <assert.h> 27 - #include "debug.h" 28 - #include "logf.h" 29 27 30 28 #include <3ds/os.h> 29 + /* these include a couple of 3ds headers */ 31 30 #include "sys_thread.h" 32 31 #include "sys_timer.h" 32 + 33 + #include "debug.h" 34 + #include "logf.h" 33 35 34 36 #define CACHELINE_SIZE 128 35 37 ··· 283 285 /* Shutdown the timer thread */ 284 286 if (data->thread) { 285 287 LightSemaphore_Release(&data->sem, 1); 286 - Result res = threadJoin(data->thread, U64_MAX); 288 + threadJoin(data->thread, U64_MAX); 287 289 threadFree(data->thread); 288 290 data->thread = NULL; 289 291 }
+7 -6
firmware/target/hosted/ctru/pcm-ctru.c
··· 27 27 #include <stdlib.h> 28 28 #include <stdbool.h> 29 29 #include <stdio.h> 30 + 31 + #include <3ds/ndsp/ndsp.h> 32 + #include <3ds/ndsp/channel.h> 33 + #include <3ds/services/dsp.h> 34 + #include <3ds/synchronization.h> 35 + #include <3ds/allocator/linear.h> 36 + 30 37 #include "config.h" 31 38 #include "debug.h" 32 39 #include "sound.h" ··· 46 53 #include "pcm_sampr.h" 47 54 #include "pcm_mixer.h" 48 55 #include "pcm_sink.h" 49 - 50 - #include <3ds/ndsp/ndsp.h> 51 - #include <3ds/ndsp/channel.h> 52 - #include <3ds/services/dsp.h> 53 - #include <3ds/synchronization.h> 54 - #include <3ds/allocator/linear.h> 55 56 56 57 /*#define LOGF_ENABLE*/ 57 58 #include "logf.h"
+5 -5
firmware/target/hosted/ctru/powermgmt-ctru.c
··· 22 22 #include <unistd.h> 23 23 #include <stdbool.h> 24 24 25 + #include <3ds/types.h> 26 + #include <3ds/result.h> 27 + #include <3ds/services/mcuhwc.h> 28 + #include <3ds/services/ptmu.h> 29 + 25 30 #include "config.h" 26 31 #include "kernel.h" 27 32 #include "powermgmt.h" ··· 29 34 #include "adc.h" 30 35 #include "system.h" 31 36 #include "debug.h" 32 - 33 - #include <3ds/types.h> 34 - #include <3ds/result.h> 35 - #include <3ds/services/mcuhwc.h> 36 - #include <3ds/services/ptmu.h> 37 37 38 38 void mcuhwc_init(void) 39 39 {
+9 -6
firmware/target/hosted/ctru/system-ctru.c
··· 23 23 #include <stdio.h> 24 24 #include <string.h> 25 25 #include <inttypes.h> 26 + 27 + /* this includes a couple of 3ds headers */ 28 + #include "bfile.h" 29 + 30 + #include <3ds/types.h> 31 + #include <3ds/allocator/linear.h> 32 + #include <3ds/services/cfgu.h> 33 + 26 34 #include "system.h" 27 35 #include "kernel.h" 28 36 #include "thread-ctru.h" ··· 31 39 #include "lcd-bitmap.h" 32 40 #include "panic.h" 33 41 #include "debug.h" 34 - 35 - #include <3ds/types.h> 36 - #include <3ds/allocator/linear.h> 37 - #include <3ds/services/cfgu.h> 38 - #include "bfile.h" 39 42 40 43 const char *audiodev = NULL; 41 44 ··· 94 97 95 98 svcGetThreadPriority(&main_thread_priority, CUR_THREAD_HANDLE); 96 99 if (main_thread_priority != 0x30) { 97 - DEBUGF("warning, main_thread_priority = 0x%x\n", main_thread_priority); 100 + DEBUGF("warning, main_thread_priority = 0x%lx\n", main_thread_priority); 98 101 } 99 102 100 103 /* check for New 3DS model */
+6 -2
firmware/target/hosted/ctru/system-ctru.h
··· 23 23 24 24 #include <stdbool.h> 25 25 #include <stdbool.h> 26 - #include "config.h" 27 - #include "gcc_extensions.h" 28 26 29 27 #include <3ds/types.h> 30 28 #include <3ds/svc.h> 31 29 #include "sys_timer.h" 30 + #ifdef BIT 31 + #undef BIT 32 + #endif 33 + 34 + #include "config.h" 35 + #include "gcc_extensions.h" 32 36 33 37 #define HIGHEST_IRQ_LEVEL 1 34 38
+1 -1
lib/rbcodec/codecs/codec_crt0.c
··· 34 34 #ifdef CTRU 35 35 /* dummy undefined symbols */ 36 36 void __aeabi_unwind_cpp_pr0(void) {} 37 - struct _reent * _EXFUN(__getreent, (void)) {} 37 + struct _reent * _EXFUN(__getreent, (void)) { return NULL; } 38 38 #endif 39 39 40 40 enum codec_status codec_start(enum codec_entry_call_reason reason)
+1 -1
tools/configure
··· 939 939 GCCOPTS=`echo $GCCOPTS | sed -e s/\ -Os/\ -Og/` 940 940 fi 941 941 942 - GCCOPTS="$GCCOPTS -fno-builtin -g -Wno-unused-result" 942 + GCCOPTS="$GCCOPTS -fno-builtin -g -Wno-unused-result -Wno-char-subscripts" 943 943 GCCOPTS="$GCCOPTS -I$DEVKITPRO/libctru/include -I$DEVKITPRO/portlibs/3ds/include" 944 944 GCCOPTS="$GCCOPTS -mword-relocations -ffunction-sections -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft" 945 945 GCCOPTS="$GCCOPTS -D_GNU_SOURCE=1 -D_REENTRANT -masm-syntax-unified"