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
This commit is contained in:
Christian Soffke 2024-12-13 18:31:27 +01:00
parent a86b1999d0
commit 727c800c0d
8 changed files with 25 additions and 33 deletions

View file

@ -70,7 +70,7 @@ static int seek_ogg_page(uint64_t filepos)
break;
if (memcmp(buf, synccode, sizeof(buf)) == 0) {
ci->seek_buffer(ci->curpos - sizeof(buf));
LOGF("next page %ld", ci->curpos);
LOGF("next page %jd", (intmax_t) ci->curpos);
return 1;
} else
ci->seek_buffer(ci->curpos - (sizeof(buf) - 1));
@ -91,7 +91,7 @@ static int seek_opus_tags(void)
break;
if (memcmp(buf, synccode, sizeof(buf)) == 0) {
ci->seek_buffer(ci->curpos - sizeof(buf));
LOGF("OpusTags %ld", ci->curpos);
LOGF("OpusTags %jd", (intmax_t) ci->curpos);
return 1;
} else
ci->seek_buffer(ci->curpos - (sizeof(buf) - 1));

View file

@ -167,7 +167,7 @@ static spx_int64_t seek_backwards(spx_ogg_sync_state *oy, spx_ogg_page *og,
offset = ret;
continue;
}
} else if (ret == -3)
} else if (ret == -3)
return(-3);
else if (ret<=0)
break;
@ -187,8 +187,8 @@ static int speex_seek_page_granule(spx_int64_t pos, spx_int64_t curpos,
spx_ogg_sync_state *oy,
spx_int64_t headerssize)
{
/* TODO: Someone may want to try to implement seek to packet,
instead of just to page (should be more accurate, not be any
/* TODO: Someone may want to try to implement seek to packet,
instead of just to page (should be more accurate, not be any
faster) */
spx_int64_t crofs;
@ -222,9 +222,9 @@ static int speex_seek_page_granule(spx_int64_t pos, spx_int64_t curpos,
offset = get_next_page(oy,&og,-1);
if (offset < 0) { /* could not find new page,use old offset */
LOGF("Seek/guess/fault:%lld->-<-%d,%lld:%lld,%d,%ld,%d\n",
LOGF("Seek/guess/fault:%lld->-<-%d,%lld:%lld,%d,%jd,%d\n",
(long long int)curpos,0, (long long int)pos,
(long long int)offset,0,ci->curpos,/*stream_length*/0);
(long long int)offset,0, (intmax_t) ci->curpos,/*stream_length*/0);
curoffset = *curbyteoffset;
@ -233,9 +233,9 @@ static int speex_seek_page_granule(spx_int64_t pos, spx_int64_t curpos,
spx_ogg_sync_reset(oy);
} else {
if (spx_ogg_page_granulepos(&og) == 0 && pos > 5000) {
LOGF("SEEK/guess/fault:%lld->-<-%lld,%lld:%lld,%d,%ld,%d\n",
LOGF("SEEK/guess/fault:%lld->-<-%lld,%lld:%lld,%d,%jd,%d\n",
(long long int)curpos,(long long int)spx_ogg_page_granulepos(&og),
(long long int)pos, (long long int)offset,0,ci->curpos,/*stream_length*/0);
(long long int)pos, (long long int)offset,0, (intmax_t) ci->curpos,/*stream_length*/0);
curoffset = *curbyteoffset;
@ -271,7 +271,7 @@ static int speex_seek_page_granule(spx_int64_t pos, spx_int64_t curpos,
lastgranule = spx_ogg_page_granulepos(&og);
if ( ((lastgranule - (avgpagelen/4)) < pos && ( lastgranule +
if ( ((lastgranule - (avgpagelen/4)) < pos && ( lastgranule +
avgpagelen + (avgpagelen / 4)) > pos) ||
lastgranule > pos) {
@ -339,7 +339,7 @@ static void *process_header(spx_ogg_packet *op,
DEBUGF("Too old bitstream");
return NULL;
}
st = speex_decoder_init(mode);
if (!st){
DEBUGF("Decoder init failed");