From bb737e346990fa0d43d9e137509da460247bfdd4 Mon Sep 17 00:00:00 2001 From: Ioannis J Date: Tue, 17 Dec 2024 22:42:28 +0200 Subject: [PATCH] chore: cleanup and silencing warnings --- Makefile | 10 +-- .../libwebp/include/backward_references_enc.h | 1 + vendor/libwebp/include/bit_writer_utils.h | 1 + vendor/libwebp/include/color_cache_utils.h | 1 + vendor/libwebp/include/cost_enc.h | 1 + vendor/libwebp/include/cpu.h | 1 + vendor/libwebp/include/dsp.h | 1 + vendor/libwebp/include/encode.h | 1 + vendor/libwebp/include/filters_utils.h | 1 + vendor/libwebp/include/huffman_encode_utils.h | 1 + vendor/libwebp/include/lossless.h | 1 + vendor/libwebp/include/lossless_common.h | 1 + vendor/libwebp/include/mux.h | 1 + vendor/libwebp/include/mux_types.h | 1 + vendor/libwebp/include/muxi.h | 1 + vendor/libwebp/include/neon.h | 1 + vendor/libwebp/include/palette.h | 1 + vendor/libwebp/include/quant.h | 1 + vendor/libwebp/include/random_utils.h | 1 + vendor/libwebp/include/sharpyuv_cpu.h | 1 + vendor/libwebp/include/sharpyuv_csp.h | 1 + vendor/libwebp/include/sharpyuv_dsp.h | 1 + vendor/libwebp/include/sharpyuv_gamma.h | 1 + vendor/libwebp/include/thread_utils.h | 1 + vendor/libwebp/include/types.h | 7 +- vendor/libwebp/include/utils.h | 1 + vendor/libwebp/include/vp8i_enc.h | 1 + vendor/libwebp/include/yuv.h | 1 + vendor/libwebp/src/dsp/dec_neon.c | 8 +- vendor/libwebp/src/dsp/lossless.c | 7 -- .../libwebp/src/enc/backward_references_enc.c | 2 +- vendor/libwebp/src/mux/muxedit.c | 73 ------------------- vendor/libwebp/src/mux/muxinternal.c | 60 --------------- vendor/libwebp/src/mux/muxread.c | 18 ----- vendor/libwebp/src/utils/huffman_utils.c | 25 ------- 35 files changed, 41 insertions(+), 195 deletions(-) diff --git a/Makefile b/Makefile index ec9dd282d..fcdfe9b5b 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,12 @@ build: buildSdk buildExamples buildSdk: set -o pipefail && xcrun xcodebuild -downloadAllPlatforms - set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=ios | xcpretty #ios + set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=ios | xcpretty #ios set -o pipefail && xcrun swift build --arch arm64 #macOS - set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=macos | xcpretty #macOS - set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=tvos | xcpretty #tvOS - set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination generic/platform=watchos | xcpretty #watchOS - set -o pipefail && xcrun xcodebuild build -scheme PostHog -destination 'platform=visionOS Simulator,name=Apple Vision Pro' | xcpretty #visionOS + set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=macos | xcpretty #macOS + set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=tvos | xcpretty #tvOS + set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination generic/platform=watchos | xcpretty #watchOS + set -o pipefail && xcrun xcodebuild clean build -scheme PostHog -destination 'platform=visionOS Simulator,name=Apple Vision Pro' | xcpretty #visionOS buildExamples: set -o pipefail && xcrun xcodebuild -downloadAllPlatforms diff --git a/vendor/libwebp/include/backward_references_enc.h b/vendor/libwebp/include/backward_references_enc.h index e575d321a..fd04e5e8a 100644 --- a/vendor/libwebp/include/backward_references_enc.h +++ b/vendor/libwebp/include/backward_references_enc.h @@ -10,6 +10,7 @@ // Author: Jyrki Alakuijala (jyrki@google.com) // +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_ENC_BACKWARD_REFERENCES_ENC_H_ #define WEBP_ENC_BACKWARD_REFERENCES_ENC_H_ diff --git a/vendor/libwebp/include/bit_writer_utils.h b/vendor/libwebp/include/bit_writer_utils.h index 50f7db5cd..20e042922 100644 --- a/vendor/libwebp/include/bit_writer_utils.h +++ b/vendor/libwebp/include/bit_writer_utils.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_BIT_WRITER_UTILS_H_ #define WEBP_UTILS_BIT_WRITER_UTILS_H_ diff --git a/vendor/libwebp/include/color_cache_utils.h b/vendor/libwebp/include/color_cache_utils.h index 101db6ce2..6ba368dc7 100644 --- a/vendor/libwebp/include/color_cache_utils.h +++ b/vendor/libwebp/include/color_cache_utils.h @@ -12,6 +12,7 @@ // Authors: Jyrki Alakuijala (jyrki@google.com) // Urvang Joshi (urvang@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_COLOR_CACHE_UTILS_H_ #define WEBP_UTILS_COLOR_CACHE_UTILS_H_ diff --git a/vendor/libwebp/include/cost_enc.h b/vendor/libwebp/include/cost_enc.h index a28019869..549b35f33 100644 --- a/vendor/libwebp/include/cost_enc.h +++ b/vendor/libwebp/include/cost_enc.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_ENC_COST_ENC_H_ #define WEBP_ENC_COST_ENC_H_ diff --git a/vendor/libwebp/include/cpu.h b/vendor/libwebp/include/cpu.h index 77b1f6dfb..335fe8f21 100644 --- a/vendor/libwebp/include/cpu.h +++ b/vendor/libwebp/include/cpu.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_DSP_CPU_H_ #define WEBP_DSP_CPU_H_ diff --git a/vendor/libwebp/include/dsp.h b/vendor/libwebp/include/dsp.h index 528e10fc5..1ad3cbfb1 100644 --- a/vendor/libwebp/include/dsp.h +++ b/vendor/libwebp/include/dsp.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_DSP_DSP_H_ #define WEBP_DSP_DSP_H_ diff --git a/vendor/libwebp/include/encode.h b/vendor/libwebp/include/encode.h index da23c4f31..9d38efe87 100644 --- a/vendor/libwebp/include/encode.h +++ b/vendor/libwebp/include/encode.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_WEBP_ENCODE_H_ #define WEBP_WEBP_ENCODE_H_ diff --git a/vendor/libwebp/include/filters_utils.h b/vendor/libwebp/include/filters_utils.h index 7a1f9afd8..19ab3711d 100644 --- a/vendor/libwebp/include/filters_utils.h +++ b/vendor/libwebp/include/filters_utils.h @@ -11,6 +11,7 @@ // // Author: Urvang (urvang@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_FILTERS_UTILS_H_ #define WEBP_UTILS_FILTERS_UTILS_H_ diff --git a/vendor/libwebp/include/huffman_encode_utils.h b/vendor/libwebp/include/huffman_encode_utils.h index 3fa2ef40b..62324cc06 100644 --- a/vendor/libwebp/include/huffman_encode_utils.h +++ b/vendor/libwebp/include/huffman_encode_utils.h @@ -11,6 +11,7 @@ // // Entropy encoding (Huffman) for webp lossless +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_HUFFMAN_ENCODE_UTILS_H_ #define WEBP_UTILS_HUFFMAN_ENCODE_UTILS_H_ diff --git a/vendor/libwebp/include/lossless.h b/vendor/libwebp/include/lossless.h index b2be4a9e2..9e83f305a 100644 --- a/vendor/libwebp/include/lossless.h +++ b/vendor/libwebp/include/lossless.h @@ -12,6 +12,7 @@ // Authors: Vikas Arora (vikaas.arora@gmail.com) // Jyrki Alakuijala (jyrki@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_DSP_LOSSLESS_H_ #define WEBP_DSP_LOSSLESS_H_ diff --git a/vendor/libwebp/include/lossless_common.h b/vendor/libwebp/include/lossless_common.h index e51908b84..5e2d30d32 100644 --- a/vendor/libwebp/include/lossless_common.h +++ b/vendor/libwebp/include/lossless_common.h @@ -13,6 +13,7 @@ // Jyrki Alakuijala (jyrki@google.com) // Vincent Rabaud (vrabaud@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_DSP_LOSSLESS_COMMON_H_ #define WEBP_DSP_LOSSLESS_COMMON_H_ diff --git a/vendor/libwebp/include/mux.h b/vendor/libwebp/include/mux.h index 6de2d692c..c00abe6f1 100644 --- a/vendor/libwebp/include/mux.h +++ b/vendor/libwebp/include/mux.h @@ -12,6 +12,7 @@ // Authors: Urvang (urvang@google.com) // Vikas (vikasa@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_WEBP_MUX_H_ #define WEBP_WEBP_MUX_H_ diff --git a/vendor/libwebp/include/mux_types.h b/vendor/libwebp/include/mux_types.h index c585d2082..360564b88 100644 --- a/vendor/libwebp/include/mux_types.h +++ b/vendor/libwebp/include/mux_types.h @@ -11,6 +11,7 @@ // // Author: Urvang (urvang@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_WEBP_MUX_TYPES_H_ #define WEBP_WEBP_MUX_TYPES_H_ diff --git a/vendor/libwebp/include/muxi.h b/vendor/libwebp/include/muxi.h index acbbb97a9..bcdfb6d19 100644 --- a/vendor/libwebp/include/muxi.h +++ b/vendor/libwebp/include/muxi.h @@ -11,6 +11,7 @@ // // Author: Urvang (urvang@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_MUX_MUXI_H_ #define WEBP_MUX_MUXI_H_ diff --git a/vendor/libwebp/include/neon.h b/vendor/libwebp/include/neon.h index 4431f23ab..6ef524595 100644 --- a/vendor/libwebp/include/neon.h +++ b/vendor/libwebp/include/neon.h @@ -9,6 +9,7 @@ // // NEON common code. +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_DSP_NEON_H_ #define WEBP_DSP_NEON_H_ diff --git a/vendor/libwebp/include/palette.h b/vendor/libwebp/include/palette.h index ffd5a90fd..83c59dc0b 100644 --- a/vendor/libwebp/include/palette.h +++ b/vendor/libwebp/include/palette.h @@ -11,6 +11,7 @@ // // Author: Vincent Rabaud (vrabaud@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_PALETTE_H_ #define WEBP_UTILS_PALETTE_H_ diff --git a/vendor/libwebp/include/quant.h b/vendor/libwebp/include/quant.h index 1ae4f8f7c..8236e55db 100644 --- a/vendor/libwebp/include/quant.h +++ b/vendor/libwebp/include/quant.h @@ -7,6 +7,7 @@ // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_DSP_QUANT_H_ #define WEBP_DSP_QUANT_H_ diff --git a/vendor/libwebp/include/random_utils.h b/vendor/libwebp/include/random_utils.h index 291247a6c..5873ced7a 100644 --- a/vendor/libwebp/include/random_utils.h +++ b/vendor/libwebp/include/random_utils.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_RANDOM_UTILS_H_ #define WEBP_UTILS_RANDOM_UTILS_H_ diff --git a/vendor/libwebp/include/sharpyuv_cpu.h b/vendor/libwebp/include/sharpyuv_cpu.h index 02625fbad..3af1bbd86 100644 --- a/vendor/libwebp/include/sharpyuv_cpu.h +++ b/vendor/libwebp/include/sharpyuv_cpu.h @@ -7,6 +7,7 @@ // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_SHARPYUV_SHARPYUV_CPU_H_ #define WEBP_SHARPYUV_SHARPYUV_CPU_H_ diff --git a/vendor/libwebp/include/sharpyuv_csp.h b/vendor/libwebp/include/sharpyuv_csp.h index e85e9a8ec..34a6e13a3 100644 --- a/vendor/libwebp/include/sharpyuv_csp.h +++ b/vendor/libwebp/include/sharpyuv_csp.h @@ -9,6 +9,7 @@ // // Colorspace utilities. +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_SHARPYUV_SHARPYUV_CSP_H_ #define WEBP_SHARPYUV_SHARPYUV_CSP_H_ diff --git a/vendor/libwebp/include/sharpyuv_dsp.h b/vendor/libwebp/include/sharpyuv_dsp.h index 61ea3cca2..0f2aacdaa 100644 --- a/vendor/libwebp/include/sharpyuv_dsp.h +++ b/vendor/libwebp/include/sharpyuv_dsp.h @@ -9,6 +9,7 @@ // // Speed-critical functions for Sharp YUV. +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_SHARPYUV_SHARPYUV_DSP_H_ #define WEBP_SHARPYUV_SHARPYUV_DSP_H_ diff --git a/vendor/libwebp/include/sharpyuv_gamma.h b/vendor/libwebp/include/sharpyuv_gamma.h index 6c5a4ccd1..8b60346d1 100644 --- a/vendor/libwebp/include/sharpyuv_gamma.h +++ b/vendor/libwebp/include/sharpyuv_gamma.h @@ -9,6 +9,7 @@ // // Gamma correction utilities. +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_SHARPYUV_SHARPYUV_GAMMA_H_ #define WEBP_SHARPYUV_SHARPYUV_GAMMA_H_ diff --git a/vendor/libwebp/include/thread_utils.h b/vendor/libwebp/include/thread_utils.h index 7f1a57869..ac2eb12b2 100644 --- a/vendor/libwebp/include/thread_utils.h +++ b/vendor/libwebp/include/thread_utils.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_THREAD_UTILS_H_ #define WEBP_UTILS_THREAD_UTILS_H_ diff --git a/vendor/libwebp/include/types.h b/vendor/libwebp/include/types.h index a0273ea99..0fd674eca 100644 --- a/vendor/libwebp/include/types.h +++ b/vendor/libwebp/include/types.h @@ -11,15 +11,18 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" +#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module" + #ifndef WEBP_WEBP_TYPES_H_ #define WEBP_WEBP_TYPES_H_ #include // for size_t #ifndef _MSC_VER -#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module" + #include -#pragma clang diagnostic pop + #if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) #define WEBP_INLINE inline diff --git a/vendor/libwebp/include/utils.h b/vendor/libwebp/include/utils.h index 4499b8031..271c0980e 100644 --- a/vendor/libwebp/include/utils.h +++ b/vendor/libwebp/include/utils.h @@ -12,6 +12,7 @@ // Authors: Skal (pascal.massimino@gmail.com) // Urvang (urvang@google.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_UTILS_UTILS_H_ #define WEBP_UTILS_UTILS_H_ diff --git a/vendor/libwebp/include/vp8i_enc.h b/vendor/libwebp/include/vp8i_enc.h index 768e54d82..e2a4b033b 100644 --- a/vendor/libwebp/include/vp8i_enc.h +++ b/vendor/libwebp/include/vp8i_enc.h @@ -11,6 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_ENC_VP8I_ENC_H_ #define WEBP_ENC_VP8I_ENC_H_ diff --git a/vendor/libwebp/include/yuv.h b/vendor/libwebp/include/yuv.h index 6156fd534..ed25c7c92 100644 --- a/vendor/libwebp/include/yuv.h +++ b/vendor/libwebp/include/yuv.h @@ -32,6 +32,7 @@ // Author: Skal (pascal.massimino@gmail.com) +#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" #ifndef WEBP_DSP_YUV_H_ #define WEBP_DSP_YUV_H_ diff --git a/vendor/libwebp/src/dsp/dec_neon.c b/vendor/libwebp/src/dsp/dec_neon.c index acfe61d67..fa7ac6754 100644 --- a/vendor/libwebp/src/dsp/dec_neon.c +++ b/vendor/libwebp/src/dsp/dec_neon.c @@ -1427,8 +1427,8 @@ static void HE8uv_NEON(uint8_t* dst) { // horizontal } static WEBP_INLINE void DC8_NEON(uint8_t* dst, int do_top, int do_left) { - uint16x8_t sum_top; - uint16x8_t sum_left; + uint16x8_t sum_top = vdupq_n_u16(0);; + uint16x8_t sum_left = vdupq_n_u16(0);; uint8x8_t dc0; if (do_top) { @@ -1510,8 +1510,8 @@ static void HE16_NEON(uint8_t* dst) { // horizontal } static WEBP_INLINE void DC16_NEON(uint8_t* dst, int do_top, int do_left) { - uint16x8_t sum_top; - uint16x8_t sum_left; + uint16x8_t sum_top = vdupq_n_u16(0); + uint16x8_t sum_left = vdupq_n_u16(0); uint8x8_t dc0; if (do_top) { diff --git a/vendor/libwebp/src/dsp/lossless.c b/vendor/libwebp/src/dsp/lossless.c index 95bed80b0..fb9473a91 100644 --- a/vendor/libwebp/src/dsp/lossless.c +++ b/vendor/libwebp/src/dsp/lossless.c @@ -229,13 +229,6 @@ static WEBP_INLINE int ColorTransformDelta(int8_t color_pred, return ((int)color_pred * color) >> 5; } -static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, - VP8LMultipliers* const m) { - m->green_to_red_ = (color_code >> 0) & 0xff; - m->green_to_blue_ = (color_code >> 8) & 0xff; - m->red_to_blue_ = (color_code >> 16) & 0xff; -} - void VP8LTransformColorInverse_C(const VP8LMultipliers* const m, const uint32_t* src, int num_pixels, uint32_t* dst) { diff --git a/vendor/libwebp/src/enc/backward_references_enc.c b/vendor/libwebp/src/enc/backward_references_enc.c index 14fa0fb0a..a62c38eb2 100644 --- a/vendor/libwebp/src/enc/backward_references_enc.c +++ b/vendor/libwebp/src/enc/backward_references_enc.c @@ -647,7 +647,7 @@ static int BackwardReferencesLz77Box(int xsize, int ysize, for (i = 1; i < pix_count; ++i) { int ind; int best_length = VP8LHashChainFindLength(hash_chain_best, i); - int best_offset; + int best_offset = 0; int do_compute = 1; if (best_length >= MAX_LENGTH) { diff --git a/vendor/libwebp/src/mux/muxedit.c b/vendor/libwebp/src/mux/muxedit.c index 7efa80156..32af36ec9 100644 --- a/vendor/libwebp/src/mux/muxedit.c +++ b/vendor/libwebp/src/mux/muxedit.c @@ -75,77 +75,4 @@ void WebPMuxDelete(WebPMux* mux) { return err; \ } \ } while (0) - -static WebPMuxError MuxSet(WebPMux* const mux, uint32_t tag, - const WebPData* const data, int copy_data) { - WebPChunk chunk; - WebPMuxError err = WEBP_MUX_NOT_FOUND; - const CHUNK_INDEX idx = ChunkGetIndexFromTag(tag); - ASSERT(mux != NULL); - - ChunkInit(&chunk); - SWITCH_ID_LIST(IDX_VP8X, &mux->vp8x_); - SWITCH_ID_LIST(IDX_ICCP, &mux->iccp_); - SWITCH_ID_LIST(IDX_ANIM, &mux->anim_); - SWITCH_ID_LIST(IDX_EXIF, &mux->exif_); - SWITCH_ID_LIST(IDX_XMP, &mux->xmp_); - SWITCH_ID_LIST(IDX_UNKNOWN, &mux->unknown_); - return err; -} #undef SWITCH_ID_LIST - -static WebPMuxError DeleteChunks(WebPChunk** chunk_list, uint32_t tag) { - WebPMuxError err = WEBP_MUX_NOT_FOUND; - ASSERT(chunk_list); - while (*chunk_list) { - WebPChunk* const chunk = *chunk_list; - if (chunk->tag_ == tag) { - *chunk_list = ChunkDelete(chunk); - err = WEBP_MUX_OK; - } else { - chunk_list = &chunk->next_; - } - } - return err; -} - -//------------------------------------------------------------------------------ -// Set API(s). - -// Creates a chunk from given 'data' and sets it as 1st chunk in 'chunk_list'. -static WebPMuxError AddDataToChunkList( - const WebPData* const data, int copy_data, uint32_t tag, - WebPChunk** chunk_list) { - WebPChunk chunk; - WebPMuxError err; - ChunkInit(&chunk); - err = ChunkAssignData(&chunk, data, copy_data, tag); - if (err != WEBP_MUX_OK) goto Err; - err = ChunkSetHead(&chunk, chunk_list); - if (err != WEBP_MUX_OK) goto Err; - return WEBP_MUX_OK; - Err: - ChunkRelease(&chunk); - return err; -} - -// Total size of a list of images. -static size_t ImageListDiskSize(const WebPMuxImage* wpi_list) { - size_t size = 0; - while (wpi_list != NULL) { - size += MuxImageDiskSize(wpi_list); - wpi_list = wpi_list->next_; - } - return size; -} - -// Write out the given list of images into 'dst'. -static uint8_t* ImageListEmit(const WebPMuxImage* wpi_list, uint8_t* dst) { - while (wpi_list != NULL) { - dst = MuxImageEmit(wpi_list, dst); - wpi_list = wpi_list->next_; - } - return dst; -} - -//------------------------------------------------------------------------------ diff --git a/vendor/libwebp/src/mux/muxinternal.c b/vendor/libwebp/src/mux/muxinternal.c index 736199a10..713cea5a9 100644 --- a/vendor/libwebp/src/mux/muxinternal.c +++ b/vendor/libwebp/src/mux/muxinternal.c @@ -239,62 +239,6 @@ WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) { return next; } -//------------------------------------------------------------------------------ -// MuxImage search methods. - -// Get a reference to appropriate chunk list within an image given chunk tag. -static WebPChunk** GetChunkListFromId(const WebPMuxImage* const wpi, - WebPChunkId id) { - ASSERT(wpi != NULL); - switch (id) { - case WEBP_CHUNK_ANMF: return (WebPChunk**)&wpi->header_; - case WEBP_CHUNK_ALPHA: return (WebPChunk**)&wpi->alpha_; - case WEBP_CHUNK_IMAGE: return (WebPChunk**)&wpi->img_; - default: return NULL; - } -} - -//int MuxImageCount(const WebPMuxImage* wpi_list, WebPChunkId id) { -// int count = 0; -// const WebPMuxImage* current; -// for (current = wpi_list; current != NULL; current = current->next_) { -// if (id == WEBP_CHUNK_NIL) { -// ++count; // Special case: count all images. -// } else { -// const WebPChunk* const wpi_chunk = *GetChunkListFromId(current, id); -// if (wpi_chunk != NULL) { -// const WebPChunkId wpi_chunk_id = ChunkGetIdFromTag(wpi_chunk->tag_); -// if (wpi_chunk_id == id) ++count; // Count images with a matching 'id'. -// } -// } -// } -// return count; -//} - -// Outputs a pointer to 'prev_wpi->next_', -// where 'prev_wpi' is the pointer to the image at position (nth - 1). -// Returns true if nth image was found. -//static int SearchImageToGetOrDelete(WebPMuxImage** wpi_list, uint32_t nth, -// WebPMuxImage*** const location) { -// uint32_t count = 0; -// ASSERT(wpi_list); -// *location = wpi_list; -// -// if (nth == 0) { -// nth = MuxImageCount(*wpi_list, WEBP_CHUNK_NIL); -// if (nth == 0) return 0; // Not found. -// } -// -// while (*wpi_list != NULL) { -// WebPMuxImage* const cur_wpi = *wpi_list; -// ++count; -// if (count == nth) return 1; // Found. -// wpi_list = &cur_wpi->next_; -// *location = wpi_list; -// } -// return 0; // Not found. -//} - //------------------------------------------------------------------------------ // MuxImage writer methods. @@ -353,9 +297,5 @@ WebPChunk** MuxGetChunkListFromId(const WebPMux* mux, WebPChunkId id) { } } -static int IsNotCompatible(int feature, int num_items) { - return (feature != 0) != (num_items > 0); -} - //------------------------------------------------------------------------------ diff --git a/vendor/libwebp/src/mux/muxread.c b/vendor/libwebp/src/mux/muxread.c index 2c06e5ed4..52ba046b3 100644 --- a/vendor/libwebp/src/mux/muxread.c +++ b/vendor/libwebp/src/mux/muxread.c @@ -34,21 +34,3 @@ } while (0) #undef SWITCH_ID_LIST - -//------------------------------------------------------------------------------ -// Get API(s). - -// Count number of chunks matching 'tag' in the 'chunk_list'. -// If tag == NIL_TAG, any tag will be matched. -static int CountChunks(const WebPChunk* const chunk_list, uint32_t tag) { - int count = 0; - const WebPChunk* current; - for (current = chunk_list; current != NULL; current = current->next_) { - if (tag == NIL_TAG || current->tag_ == tag) { - count++; // Count chunks whose tags match. - } - } - return count; -} - -//------------------------------------------------------------------------------ diff --git a/vendor/libwebp/src/utils/huffman_utils.c b/vendor/libwebp/src/utils/huffman_utils.c index 24932d748..2097d7f5c 100644 --- a/vendor/libwebp/src/utils/huffman_utils.c +++ b/vendor/libwebp/src/utils/huffman_utils.c @@ -20,31 +20,6 @@ // bytes. #define MAX_HTREE_GROUPS 0x10000 -// Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the -// bit-wise reversal of the len least significant bits of key. -static WEBP_INLINE uint32_t GetNextKey(uint32_t key, int len) { - uint32_t step = 1 << (len - 1); - while (key & step) { - step >>= 1; - } - return step ? (key & (step - 1)) + step : key; -} - -// Returns the table width of the next 2nd level table. count is the histogram -// of bit lengths for the remaining symbols, len is the code length of the next -// processed symbol -static WEBP_INLINE int NextTableBitSize(const int* const count, - int len, int root_bits) { - int left = 1 << (len - root_bits); - while (len < MAX_ALLOWED_CODE_LENGTH) { - left -= count[len]; - if (left <= 0) break; - ++len; - left <<= 1; - } - return len - root_bits; -} - // Maximum code_lengths_size is 2328 (reached for 11-bit color_cache_bits). // More commonly, the value is around ~280. #define MAX_CODE_LENGTHS_SIZE \