A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
2
fork

Configure Feed

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

Don't force gcc as host compiler + fix clang warnings

On MacOS, gcc is a symlink for clang.

Patch gets rid of the warnings produced by clang,
when it is set as HOSTCC, and fixes voicetools
compilation on MacOS when calling make voicetools
from the simulator directory.

lua rb_defines_helper:
format specifies type 'int' but the argument has
type 'long'

codecs: opus / speex (LOGF):
format '%ld' expects argument of type 'long int',
but argument 7 has type 'off_t'

gigabeat:
variable 'size' set but not used

rdf2binary:
a function declaration without a prototype is
deprecated in all versions of C

rbspeexdec:
passing 'unsigned char *' to parameter of type
'char *' converts between pointers to integer
types where one is of the unique plain 'char'
type and the other is not

hmac-sha1.c
defining a type within 'offsetof' is a Clang
extension

Change-Id: I90539906698868f9589650585d865aee9f7e8539

+25 -33
+2 -2
apps/plugins/lua/rbdefines_helper.pl
··· 161 161 } 162 162 elsif(@$define{'value'} =~ /^[0-9]+$/) #number 163 163 { 164 - printf "\tprintf(\"%s[\\\"%%s\\\"] = %%d\\n\", stringify(%s), %s);\n", $lua_table, @$define{'name'}, @$define{'name'}; 164 + printf "\tprintf(\"%s[\\\"%%s\\\"] = %%ld\\n\", stringify(%s), (long) %s);\n", $lua_table, @$define{'name'}, @$define{'name'}; 165 165 } 166 166 else #might be a string but we don't know since the macro isn't expanded far enough 167 167 { ··· 199 199 } 200 200 elsif ($var =~$num_regex) #it must be a number 201 201 { 202 - printf "\tprintf(\"%s[\\\"%%s\\\"] = %%d\\n\", stringify(%s), %s);\n", $lua_table, @$define{'name'}, @$define{'name'}; 202 + printf "\tprintf(\"%s[\\\"%%s\\\"] = %%ld\\n\", stringify(%s), (long) %s);\n", $lua_table, @$define{'name'}, @$define{'name'}; 203 203 } 204 204 else { warn "Skipping ".@$define{'name'}." indeterminate macro type\n"; } 205 205 }
+2 -2
lib/rbcodec/codecs/opus.c
··· 70 70 break; 71 71 if (memcmp(buf, synccode, sizeof(buf)) == 0) { 72 72 ci->seek_buffer(ci->curpos - sizeof(buf)); 73 - LOGF("next page %ld", ci->curpos); 73 + LOGF("next page %jd", (intmax_t) ci->curpos); 74 74 return 1; 75 75 } else 76 76 ci->seek_buffer(ci->curpos - (sizeof(buf) - 1)); ··· 91 91 break; 92 92 if (memcmp(buf, synccode, sizeof(buf)) == 0) { 93 93 ci->seek_buffer(ci->curpos - sizeof(buf)); 94 - LOGF("OpusTags %ld", ci->curpos); 94 + LOGF("OpusTags %jd", (intmax_t) ci->curpos); 95 95 return 1; 96 96 } else 97 97 ci->seek_buffer(ci->curpos - (sizeof(buf) - 1));
+9 -9
lib/rbcodec/codecs/speex.c
··· 167 167 offset = ret; 168 168 continue; 169 169 } 170 - } else if (ret == -3) 170 + } else if (ret == -3) 171 171 return(-3); 172 172 else if (ret<=0) 173 173 break; ··· 187 187 spx_ogg_sync_state *oy, 188 188 spx_int64_t headerssize) 189 189 { 190 - /* TODO: Someone may want to try to implement seek to packet, 191 - instead of just to page (should be more accurate, not be any 190 + /* TODO: Someone may want to try to implement seek to packet, 191 + instead of just to page (should be more accurate, not be any 192 192 faster) */ 193 193 194 194 spx_int64_t crofs; ··· 222 222 offset = get_next_page(oy,&og,-1); 223 223 224 224 if (offset < 0) { /* could not find new page,use old offset */ 225 - LOGF("Seek/guess/fault:%lld->-<-%d,%lld:%lld,%d,%ld,%d\n", 225 + LOGF("Seek/guess/fault:%lld->-<-%d,%lld:%lld,%d,%jd,%d\n", 226 226 (long long int)curpos,0, (long long int)pos, 227 - (long long int)offset,0,ci->curpos,/*stream_length*/0); 227 + (long long int)offset,0, (intmax_t) ci->curpos,/*stream_length*/0); 228 228 229 229 curoffset = *curbyteoffset; 230 230 ··· 233 233 spx_ogg_sync_reset(oy); 234 234 } else { 235 235 if (spx_ogg_page_granulepos(&og) == 0 && pos > 5000) { 236 - LOGF("SEEK/guess/fault:%lld->-<-%lld,%lld:%lld,%d,%ld,%d\n", 236 + LOGF("SEEK/guess/fault:%lld->-<-%lld,%lld:%lld,%d,%jd,%d\n", 237 237 (long long int)curpos,(long long int)spx_ogg_page_granulepos(&og), 238 - (long long int)pos, (long long int)offset,0,ci->curpos,/*stream_length*/0); 238 + (long long int)pos, (long long int)offset,0, (intmax_t) ci->curpos,/*stream_length*/0); 239 239 240 240 curoffset = *curbyteoffset; 241 241 ··· 271 271 272 272 lastgranule = spx_ogg_page_granulepos(&og); 273 273 274 - if ( ((lastgranule - (avgpagelen/4)) < pos && ( lastgranule + 274 + if ( ((lastgranule - (avgpagelen/4)) < pos && ( lastgranule + 275 275 avgpagelen + (avgpagelen / 4)) > pos) || 276 276 lastgranule > pos) { 277 277 ··· 339 339 DEBUGF("Too old bitstream"); 340 340 return NULL; 341 341 } 342 - 342 + 343 343 st = speex_decoder_init(mode); 344 344 if (!st){ 345 345 DEBUGF("Decoder init failed");
+2 -7
tools/configure
··· 16 16 GLOBAL_LDOPTS="" 17 17 LDMAP_OPT="-Map" 18 18 19 - HOSTCC=gcc 20 - HOSTAR=ar 21 - 22 19 extradefines="" 23 20 use_logf="#undef ROCKBOX_HAS_LOGF" 24 21 use_bootchart="#undef DO_BOOTCHART" ··· 398 395 if $CC --version | grep -q "clang"; then 399 396 echo "[Warning] Clang compiler ($CC) in your path is unsupported. Trying gcc-14." 400 397 CC=gcc-14 401 - HOSTCC=gcc-14 402 398 AR=gcc-ar-14 403 - HOSTAR=gcc-ar-14 404 399 CPP=cpp-14 405 400 fi 406 401 LDOPTS="$LDOPTS -ldl" ··· 4612 4607 fi 4613 4608 4614 4609 # figure out the full path to the various commands if possible 4615 - HOSTCC=`findtool ${HOSTCC} --lit` 4616 - HOSTAR=`findtool ${HOSTAR} --lit` 4610 + HOSTCC=`findtool gcc --lit` 4611 + HOSTAR=`findtool ar --lit` 4617 4612 CC=`findtool ${CC} --lit` 4618 4613 CPP=`findtool ${CPP} --lit` 4619 4614 LD=`findtool ${LD} --lit`
+1 -4
tools/gigabeat.c
··· 52 52 int gigabeat_code(char *infile, char *outfile) 53 53 { 54 54 FILE *in, *out; 55 - unsigned long size = 0; 56 55 unsigned long bytes_read; 57 56 unsigned char buf[4]; 58 57 unsigned long data; ··· 66 65 67 66 /* Read in little-endian */ 68 67 data = le2int(buf); 69 - 68 + 70 69 data = data ^ key; 71 70 72 71 key = key + (key << 1); 73 72 key = key + 0x19751217; 74 - 75 - size += bytes_read; 76 73 77 74 /* Write out little-endian */ 78 75 int2le(data, buf);
+1 -1
tools/hmac-sha1.c
··· 225 225 if (len >= 64) 226 226 { 227 227 #if !_STRING_ARCH_unaligned 228 - # define alignof(type) offsetof (struct { char c; type x; }, x) 228 + # define alignof(type) __alignof__(type) 229 229 # define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0) 230 230 if (UNALIGNED_P (buffer)) 231 231 while (len > 64)
+7 -7
tools/rbspeex/rbspeexdec.c
··· 17 17 * KIND, either express or implied. 18 18 * 19 19 ***************************************************************************/ 20 - 20 + 21 21 #include <speex/speex.h> 22 22 #include <stdio.h> 23 23 #include <stdlib.h> 24 24 #include "string.h" 25 25 #include "rbspeex.h" 26 - 26 + 27 27 #define USAGE_TEXT \ 28 28 "Usage: rbspeexdec infile outfile\n"\ 29 29 "rbspeexdec outputs mono 16 bit 16 kHz WAV files.\n"\ ··· 50 50 51 51 /* Rockbox speex streams are always assumed to be WB */ 52 52 st = speex_decoder_init(&speex_wb_mode); 53 - 53 + 54 54 /* Set the perceptual enhancement on (is default, but doesn't hurt) */ 55 55 tmp = 1; 56 56 speex_decoder_ctl(st, SPEEX_SET_ENH, &tmp); 57 57 speex_decoder_ctl(st, SPEEX_GET_LOOKAHEAD, &lookahead); 58 58 speex_decoder_ctl(st, SPEEX_GET_FRAME_SIZE, &frame_size); 59 - 59 + 60 60 if ((fin = fopen(argv[1], "rb")) == NULL) { 61 61 printf("Error: could not open input file\n"); 62 62 return 1; ··· 74 74 fclose(fin); 75 75 76 76 /* fill in wav header */ 77 - strcpy(wavhdr, "RIFF"); 78 - strcpy(wavhdr + 8, "WAVEfmt "); 77 + strcpy((char *) wavhdr, "RIFF"); 78 + strcpy((char *) wavhdr + 8, "WAVEfmt "); 79 79 put_uint_le(16, wavhdr + 16); 80 80 put_ushort_le(1, wavhdr + 20); /* PCM data */ 81 81 put_ushort_le(1, wavhdr + 22); /* mono */ ··· 83 83 put_uint_le(16000*2, wavhdr + 28); /* chan*sr*bbs/8 */ 84 84 put_ushort_le(2, wavhdr + 32); /* chan*bps/8 */ 85 85 put_ushort_le(16, wavhdr + 34); /* bits per sample */ 86 - strcpy(wavhdr + 36, "data"); 86 + strcpy((char *) wavhdr + 36, "data"); 87 87 fwrite(wavhdr, 1, 44, fout); /* write header */ 88 88 /* make bit buffer use our own buffer */ 89 89 speex_bits_set_bit_buffer(&bits, indata, insize);
+1 -1
tools/rdf2binary.c
··· 58 58 } 59 59 60 60 61 - int main() 61 + int main(void) 62 62 { 63 63 FILE *in, *idx_out, *desc_out; 64 64 struct word w;