From 2489d1e17b4de32db8c6514cead1e28486362218 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 22 Aug 2021 13:15:06 +0200 Subject: [PATCH] cleanup --- Makefile | 4 +++- README.md | 2 +- src/coding/relic_decoder_lib.c | 4 ++-- src/meta/cpk.c | 18 ++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 4e070901..a51c9bee 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ export RMF SHELL CC AR STRIP WINDRES DLLTOOL ############################################################################### ### build defs -DEF_CFLAGS += -ffast-math -O3 -Wall -Werror=format-security -Wlogical-op -Wdeclaration-after-statement -Wvla -Wimplicit-function-declaration -Wignored-qualifiers +DEF_CFLAGS += -ffast-math -O3 -Wall -Werror=format-security -Wdeclaration-after-statement -Wvla -Wimplicit-function-declaration -Wignored-qualifiers VGM_DEBUG_FLAGS = 0 ifeq ($(VGM_DEBUG_FLAGS),1) @@ -67,6 +67,7 @@ ifeq ($(VGM_DEBUG_FLAGS),1) DEF_CFLAGS += -Wall DEF_CFLAGS += -Wextra DEF_CFLAGS += -Wno-sign-compare + DEF_CFLAGS += -Wlogical-op #DEF_CFLAGS += -pedantic -Wconversion -std=gnu90 #DEF_CFLAGS += -Wfloat-equal DEF_CFLAGS += -Wdisabled-optimization -Wunsafe-loop-optimizations -Wswitch-default @@ -77,6 +78,7 @@ ifeq ($(VGM_DEBUG_FLAGS),1) DEF_CFLAGS += -Wredundant-decls -Wmissing-include-dirs -Wmissing-declarations #DEF_CFLAGS += -Wshadow #DEF_CFLAGS += -Wstack-protector -fstack-protector + STRIP = echo endif LIBS_CFLAGS= diff --git a/README.md b/README.md index d669198c..05514439 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ Since XMPlay supports Winamp plugins you may also use `in_vgmstream.dll` instead Because the XMPlay MP3 decoder incorrectly tries to play some vgmstream extensions, you need to manually fix it by going to **options > plugins > input > vgmstream** -and in the "priority filetypes" put: `ahx,asf,awc,ckd,fsb,genh,msf,p3d,rak,scd,txth,xvag` +and in the "priority filetypes" put: `ahx,asf,awc,ckd,fsb,genh,lwav,msf,p3d,rak,scd,txth,xvag` XMPlay cannot support subsongs due to player limitations (with any plugin), try using *TXTP* instead (explained below). diff --git a/src/coding/relic_decoder_lib.c b/src/coding/relic_decoder_lib.c index c2f4ed47..7e050146 100644 --- a/src/coding/relic_decoder_lib.c +++ b/src/coding/relic_decoder_lib.c @@ -238,9 +238,9 @@ static void init_dequantization(float* scales) { static int unpack_frame(uint8_t* buf, int buf_size, float* freq1, float* freq2, const float* scales, uint8_t* exponents, int freq_size) { uint8_t flags, cb_bits, ev_bits, ei_bits, qv_bits; - int qv; + int qv, pos; uint8_t ev; - uint8_t move, pos; + uint8_t move; uint32_t bit_offset, max_offset; int i, j; int freq_half = freq_size >> 1; diff --git a/src/meta/cpk.c b/src/meta/cpk.c index 6ed9437d..b04e7d80 100644 --- a/src/meta/cpk.c +++ b/src/meta/cpk.c @@ -28,9 +28,9 @@ VGMSTREAM* init_vgmstream_cpk_memory(STREAMFILE* sf, STREAMFILE* sf_acb) { /* checks */ if (!check_extensions(sf, "awb")) goto fail; - if (read_u32be(0x00,sf) != 0x43504B20) /* "CPK " */ + if (!is_id32be(0x00,sf, "CPK ")) goto fail; - if (read_u32be(0x10,sf) != 0x40555446) /* "@UTF" */ + if (!is_id32be(0x10,sf, "@UTF")) goto fail; /* 04: 0xFF? */ /* 08: 0x02A0? */ @@ -176,23 +176,21 @@ VGMSTREAM* init_vgmstream_cpk_memory(STREAMFILE* sf, STREAMFILE* sf_acb) { //;VGM_LOG("CPK: subfile offset=%lx + %x, id=%i\n", subfile_offset, subfile_size, subfile_id); - if ((read_u32be(subfile_offset,sf) & 0x7f7f7f7f) == 0x48434100) { /* "HCA\0" */ + if ((read_u32be(subfile_offset,sf) & 0x7f7f7f7f) == get_id32be("HCA\0")) { type = HCA; extension = "hca"; } - else if (read_u32be(subfile_offset,sf) == 0x43574156) { /* "CWAV" */ + else if (is_id32be(subfile_offset,sf, "CWAV")) { type = CWAV; extension = "bcwav"; } else if (read_u16be(subfile_offset, sf) == 0x8000) { - off_t test_offset = subfile_offset + read_u16be(subfile_offset + 0x02, sf) + 0x04; - if (read_u16be(test_offset - 0x06, sf) != 0x2863 || /* "(c" */ - read_u32be(test_offset - 0x04, sf) != 0x29435249) /* ")CRI" */ - goto fail; - type = ADX; extension = "adx"; } + else { + goto fail; + } temp_sf = setup_subfile_streamfile(sf, subfile_offset, subfile_size, extension); if (!temp_sf) goto fail; @@ -248,7 +246,7 @@ static void load_cpk_name(STREAMFILE* sf, STREAMFILE* sf_acb, VGMSTREAM* vgmstre if (!sf_acb) return; - /* companion .acb probably loaded */ + /* companion .acb probably loaded */ load_acb_wave_name(sf_acb, vgmstream, waveid, port, is_memory); close_streamfile(sf_acb);