From 7421b4f74a8b48b8c7e759d6a619bfd4f7f96aa8 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 22 Jan 2023 16:44:03 +0100 Subject: [PATCH] cleanup: minor tweaks --- src/coding/ice_decoder_icelib.h | 4 ++-- src/coding/mpeg_custom_utils_ahx.c | 10 +++++----- src/util/m2_psb.c | 2 +- vspf.py | 13 ++++++------- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/coding/ice_decoder_icelib.h b/src/coding/ice_decoder_icelib.h index bcfb40cd..f7255f91 100644 --- a/src/coding/ice_decoder_icelib.h +++ b/src/coding/ice_decoder_icelib.h @@ -26,9 +26,9 @@ typedef struct { int filebuf_size; /* custom IO */ - void* arg; + void* arg; int (*read)(void* dst, int size, int n, void* arg); - int (*seek)(void* arg, int offset, int whence); + int (*seek)(void* arg, int offset, int whence); } icesnd_callback_t; diff --git a/src/coding/mpeg_custom_utils_ahx.c b/src/coding/mpeg_custom_utils_ahx.c index 9a689432..03da2285 100644 --- a/src/coding/mpeg_custom_utils_ahx.c +++ b/src/coding/mpeg_custom_utils_ahx.c @@ -23,11 +23,11 @@ #define AHX_GRANULES 12 static const uint8_t AHX_BITALLOC_TABLE[32] = { 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; static const uint8_t AHX_OFFSET_TABLE[5][16] = { - { 0 }, - { 0 }, - { 0, 1, 3, 4, }, - { 0, 1, 3, 4, 5, 6, 7, 8, }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 } + { 0 }, + { 0 }, + { 0, 1, 3, 4, }, + { 0, 1, 3, 4, 5, 6, 7, 8, }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 } }; static const int8_t AHX_QBITS_TABLE[17] = { -5, -7, 3, -10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; diff --git a/src/util/m2_psb.c b/src/util/m2_psb.c index 26ca6960..d38dcd77 100644 --- a/src/util/m2_psb.c +++ b/src/util/m2_psb.c @@ -15,7 +15,7 @@ * 21 // object: root (x2 listN + other data) * 0D 04 0D 06,0B,0D,0E // list8[4]: key indexes (#0 "id", #1 "spec", #2 "version", #3 "voice"; found in a separate "key names" table) * 0D 04 0D 00,02,04,09 // list8[4]: byte offsets of next 4 items - * 15 02 // #0 string8: string key #2 ("pc") + * 15 02 // #0 string8: string key #2 ("pc") * 1E 5C8F823F // #1 float32: 1.02 * 05 02 // #2 int8: 2 * 21 // #3 object diff --git a/vspf.py b/vspf.py index 0d6c27d9..c48e338e 100644 --- a/vspf.py +++ b/vspf.py @@ -38,17 +38,16 @@ class ProjectFixer: def read(self): - with open (self.prj_pathname, 'r', encoding='utf-8') as f: + with open (self.prj_pathname, 'r', encoding='utf-8-sig') as f: lines = f.readlines() self.in_lines = [line.strip('\r\n') for line in lines] - def add(self, text): self.out_lines.append(text) def get_files(self, ext): files = glob.glob(self.prj_path + '/**/*.' + ext, recursive=True) - + items = [] for file in files: basefile = file[len(self.prj_path) + 1 : ].replace('/', '\\') @@ -57,8 +56,8 @@ class ProjectFixer: pos = basefile.rindex('\\') path = basefile[0 : pos + 1] items.append( (basefile, path) ) - return items - + return items + def write_section(self, is_includes): if is_includes: @@ -94,7 +93,7 @@ class ProjectFixer: # - writes lines if not target section # - when target section found (includes or compiles), redo section's files again def process(self): - + lines_itr = iter(self.in_lines) for line in lines_itr: self.add(line) @@ -122,7 +121,7 @@ class ProjectFixer: self.add(next_line) #print("done", len(self.out_lines)) - + def write(self): if not self.is_changed(): print("no changes detected for %s" % (self.prj_pathname))