mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-07 15:01:24 +01:00
cleanup: minor compiler warnings, etc
This commit is contained in:
parent
a6fc7546fe
commit
bb445efea1
@ -131,7 +131,7 @@ static void transform(int32_t* invbuf, int32_t* tmpbuf) {
|
|||||||
for (lpc1 = 0; lpc1 < 12 - 2; lpc1++) {
|
for (lpc1 = 0; lpc1 < 12 - 2; lpc1++) {
|
||||||
int sub1, sub2;
|
int sub1, sub2;
|
||||||
int i1, i2, i3, i4;
|
int i1, i2, i3, i4;
|
||||||
int64_t cos1, sin1, cos2, sin2; /* needs i64 to force 64b ops (avoid overflows) */
|
int64_t cos1, sin1, cos2, sin2; /* needs i64 to force 64b ops (avoid overflows) then converted to i32 */
|
||||||
|
|
||||||
cos1 = (int64_t)sincos_table[sc1 + 1024];
|
cos1 = (int64_t)sincos_table[sc1 + 1024];
|
||||||
sin1 = (int64_t)sincos_table[sc1 + 0];
|
sin1 = (int64_t)sincos_table[sc1 + 0];
|
||||||
@ -153,8 +153,8 @@ static void transform(int32_t* invbuf, int32_t* tmpbuf) {
|
|||||||
sub2 = tmpbuf[i1 + 1] - tmpbuf[i2 + 1];
|
sub2 = tmpbuf[i1 + 1] - tmpbuf[i2 + 1];
|
||||||
invbuf[i1 + 1] += invbuf[i2 + 1];
|
invbuf[i1 + 1] += invbuf[i2 + 1];
|
||||||
tmpbuf[i1 + 1] += tmpbuf[i2 + 1];
|
tmpbuf[i1 + 1] += tmpbuf[i2 + 1];
|
||||||
invbuf[i2 + 1] = ((sub1 * cos1) >> 12) + ((sub2 * sin1) >> 12);
|
invbuf[i2 + 1] = (int32_t)( ((sub1 * cos1) >> 12) + ((sub2 * sin1) >> 12) );
|
||||||
tmpbuf[i2 + 1] = ((sub2 * cos1) >> 12) - ((sub1 * sin1) >> 12);
|
tmpbuf[i2 + 1] = (int32_t)( ((sub2 * cos1) >> 12) - ((sub1 * sin1) >> 12) );
|
||||||
|
|
||||||
sub1 = invbuf[i3 + 0] - invbuf[i4 + 0];
|
sub1 = invbuf[i3 + 0] - invbuf[i4 + 0];
|
||||||
sub2 = tmpbuf[i3 + 0] - tmpbuf[i4 + 0];
|
sub2 = tmpbuf[i3 + 0] - tmpbuf[i4 + 0];
|
||||||
@ -167,8 +167,8 @@ static void transform(int32_t* invbuf, int32_t* tmpbuf) {
|
|||||||
sub2 = tmpbuf[i3 + 1] - tmpbuf[i4 + 1];
|
sub2 = tmpbuf[i3 + 1] - tmpbuf[i4 + 1];
|
||||||
invbuf[i3 + 1] += invbuf[i4 + 1];
|
invbuf[i3 + 1] += invbuf[i4 + 1];
|
||||||
tmpbuf[i3 + 1] += tmpbuf[i4 + 1];
|
tmpbuf[i3 + 1] += tmpbuf[i4 + 1];
|
||||||
invbuf[i4 + 1] = ((sub2 * cos1) >> 12) - ((sub1 * sin1) >> 12);
|
invbuf[i4 + 1] = (int32_t)( ((sub2 * cos1) >> 12) - ((sub1 * sin1) >> 12) );
|
||||||
tmpbuf[i4 + 1] = -(((sub1 * cos1) >> 12) + ((sub2 * sin1) >> 12));
|
tmpbuf[i4 + 1] = (int32_t)( -(((sub1 * cos1) >> 12) + ((sub2 * sin1) >> 12)) );
|
||||||
|
|
||||||
i1 += step1;
|
i1 += step1;
|
||||||
i2 += step1;
|
i2 += step1;
|
||||||
@ -194,15 +194,15 @@ static void transform(int32_t* invbuf, int32_t* tmpbuf) {
|
|||||||
sub2 = tmpbuf[i1] - tmpbuf[i2];
|
sub2 = tmpbuf[i1] - tmpbuf[i2];
|
||||||
invbuf[i1] += invbuf[i2];
|
invbuf[i1] += invbuf[i2];
|
||||||
tmpbuf[i1] += tmpbuf[i2];
|
tmpbuf[i1] += tmpbuf[i2];
|
||||||
invbuf[i2] = ((sub1 * cos2) >> 12) + ((sub2 * sin2) >> 12);
|
invbuf[i2] = (int32_t)( ((sub1 * cos2) >> 12) + ((sub2 * sin2) >> 12) );
|
||||||
tmpbuf[i2] = ((sub2 * cos2) >> 12) - ((sub1 * sin2) >> 12);
|
tmpbuf[i2] = (int32_t)( ((sub2 * cos2) >> 12) - ((sub1 * sin2) >> 12) );
|
||||||
|
|
||||||
sub1 = invbuf[i3] - invbuf[i4];
|
sub1 = invbuf[i3] - invbuf[i4];
|
||||||
sub2 = tmpbuf[i3] - tmpbuf[i4];
|
sub2 = tmpbuf[i3] - tmpbuf[i4];
|
||||||
invbuf[i3] += invbuf[i4];
|
invbuf[i3] += invbuf[i4];
|
||||||
tmpbuf[i3] += tmpbuf[i4];
|
tmpbuf[i3] += tmpbuf[i4];
|
||||||
invbuf[i4] = ((sub2 * cos2) >> 12) - ((sub1 * sin2) >> 12);
|
invbuf[i4] = (int32_t)( ((sub2 * cos2) >> 12) - ((sub1 * sin2) >> 12) );
|
||||||
tmpbuf[i4] = -(((sub1 * cos2) >> 12) + ((sub2 * sin2) >> 12));
|
tmpbuf[i4] = (int32_t)( -(((sub1 * cos2) >> 12) + ((sub2 * sin2) >> 12)) );
|
||||||
|
|
||||||
i1 += step1;
|
i1 += step1;
|
||||||
i2 += step1;
|
i2 += step1;
|
||||||
|
@ -100,7 +100,7 @@ fail:
|
|||||||
|
|
||||||
/* for simple style speex (seen in EA-Speex and libspeex's sampledec.c) */
|
/* for simple style speex (seen in EA-Speex and libspeex's sampledec.c) */
|
||||||
static int read_frame(speex_codec_data* data, VGMSTREAMCHANNEL* stream) {
|
static int read_frame(speex_codec_data* data, VGMSTREAMCHANNEL* stream) {
|
||||||
uint8_t bytes;
|
size_t bytes;
|
||||||
|
|
||||||
data->frame_size = read_u8(stream->offset, stream->streamfile);
|
data->frame_size = read_u8(stream->offset, stream->streamfile);
|
||||||
stream->offset += 0x01;
|
stream->offset += 0x01;
|
||||||
|
@ -60,7 +60,6 @@ static void wasf_get_name(WINAMP_STREAMFILE* sf, char* buffer, size_t length) {
|
|||||||
|
|
||||||
static STREAMFILE *wasf_open(WINAMP_STREAMFILE* sf, const char* const filename, size_t buffersize) {
|
static STREAMFILE *wasf_open(WINAMP_STREAMFILE* sf, const char* const filename, size_t buffersize) {
|
||||||
in_char wpath[PATH_LIMIT];
|
in_char wpath[PATH_LIMIT];
|
||||||
char name[PATH_LIMIT];
|
|
||||||
|
|
||||||
if (!filename)
|
if (!filename)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -69,7 +68,8 @@ static STREAMFILE *wasf_open(WINAMP_STREAMFILE* sf, const char* const filename,
|
|||||||
/* When enabling this for MSVC it'll seemingly work, but there are issues possibly related to underlying
|
/* When enabling this for MSVC it'll seemingly work, but there are issues possibly related to underlying
|
||||||
* IO buffers when using dup(), noticeable by re-opening the same streamfile with small buffer sizes
|
* IO buffers when using dup(), noticeable by re-opening the same streamfile with small buffer sizes
|
||||||
* (reads garbage). This reportedly causes issues in Android too */
|
* (reads garbage). This reportedly causes issues in Android too */
|
||||||
|
{
|
||||||
|
char name[PATH_LIMIT];
|
||||||
sf->stdiosf->get_name(sf->stdiosf, name, PATH_LIMIT);
|
sf->stdiosf->get_name(sf->stdiosf, name, PATH_LIMIT);
|
||||||
/* if same name, duplicate the file descriptor we already have open */ //unsure if all this is needed
|
/* if same name, duplicate the file descriptor we already have open */ //unsure if all this is needed
|
||||||
if (sf->infile_ref && !strcmp(name,filename)) {
|
if (sf->infile_ref && !strcmp(name,filename)) {
|
||||||
@ -87,6 +87,7 @@ static STREAMFILE *wasf_open(WINAMP_STREAMFILE* sf, const char* const filename,
|
|||||||
|
|
||||||
/* on failure just close and try the default path (which will probably fail a second time) */
|
/* on failure just close and try the default path (which will probably fail a second time) */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* STREAMFILEs carry char/UTF8 names, convert to wchar for Winamp */
|
/* STREAMFILEs carry char/UTF8 names, convert to wchar for Winamp */
|
||||||
|
@ -629,7 +629,7 @@ double WINAPI xmplay_GetGranularity() {
|
|||||||
/* seek to a position (in granularity units), return new position or -1 = failed */
|
/* seek to a position (in granularity units), return new position or -1 = failed */
|
||||||
double WINAPI xmplay_SetPosition(DWORD pos) {
|
double WINAPI xmplay_SetPosition(DWORD pos) {
|
||||||
double cpos;
|
double cpos;
|
||||||
int seek_sample = pos * xmplay_GetGranularity() * vgmstream->sample_rate;
|
int32_t seek_sample = (int32_t)(pos * xmplay_GetGranularity() * vgmstream->sample_rate);
|
||||||
|
|
||||||
if (pos == XMPIN_POS_AUTOLOOP || pos == XMPIN_POS_LOOP)
|
if (pos == XMPIN_POS_AUTOLOOP || pos == XMPIN_POS_LOOP)
|
||||||
xmplay_doneloop = 1;
|
xmplay_doneloop = 1;
|
||||||
@ -714,10 +714,9 @@ static DWORD WINAPI xmplay_GetSubSongs(float *length) {
|
|||||||
/* get times for all subsongs */
|
/* get times for all subsongs */
|
||||||
//todo request updating playlist update every subsong change instead?
|
//todo request updating playlist update every subsong change instead?
|
||||||
{
|
{
|
||||||
int stream_length_samples;
|
|
||||||
|
|
||||||
/* not good for vgmstream as would mean re-parsing many times */
|
/* not good for vgmstream as would mean re-parsing many times */
|
||||||
//int i;
|
//int i;
|
||||||
|
//*length = 0;
|
||||||
//for (i = 0; i < subsong_count; i++) {
|
//for (i = 0; i < subsong_count; i++) {
|
||||||
// float subsong_length = ...
|
// float subsong_length = ...
|
||||||
// *length += subsong_length;
|
// *length += subsong_length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user