Skip to content

Commit

Permalink
chore: cleanup and silencing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannisj committed Dec 17, 2024
1 parent 747d99b commit bb737e3
Show file tree
Hide file tree
Showing 35 changed files with 41 additions and 195 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/backward_references_enc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// Author: Jyrki Alakuijala ([email protected])
//

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_ENC_BACKWARD_REFERENCES_ENC_H_
#define WEBP_ENC_BACKWARD_REFERENCES_ENC_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/bit_writer_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_UTILS_BIT_WRITER_UTILS_H_
#define WEBP_UTILS_BIT_WRITER_UTILS_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/color_cache_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// Authors: Jyrki Alakuijala ([email protected])
// Urvang Joshi ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_UTILS_COLOR_CACHE_UTILS_H_
#define WEBP_UTILS_COLOR_CACHE_UTILS_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/cost_enc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_ENC_COST_ENC_H_
#define WEBP_ENC_COST_ENC_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_DSP_CPU_H_
#define WEBP_DSP_CPU_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_DSP_DSP_H_
#define WEBP_DSP_DSP_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/encode.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_WEBP_ENCODE_H_
#define WEBP_WEBP_ENCODE_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/filters_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Urvang ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_UTILS_FILTERS_UTILS_H_
#define WEBP_UTILS_FILTERS_UTILS_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/huffman_encode_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/lossless.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// Authors: Vikas Arora ([email protected])
// Jyrki Alakuijala ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_DSP_LOSSLESS_H_
#define WEBP_DSP_LOSSLESS_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/lossless_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// Jyrki Alakuijala ([email protected])
// Vincent Rabaud ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_DSP_LOSSLESS_COMMON_H_
#define WEBP_DSP_LOSSLESS_COMMON_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/mux.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// Authors: Urvang ([email protected])
// Vikas ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_WEBP_MUX_H_
#define WEBP_WEBP_MUX_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/mux_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Urvang ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_WEBP_MUX_TYPES_H_
#define WEBP_WEBP_MUX_TYPES_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/muxi.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Urvang ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_MUX_MUXI_H_
#define WEBP_MUX_MUXI_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Vincent Rabaud ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_UTILS_PALETTE_H_
#define WEBP_UTILS_PALETTE_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/quant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/random_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_UTILS_RANDOM_UTILS_H_
#define WEBP_UTILS_RANDOM_UTILS_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/sharpyuv_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/sharpyuv_csp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/sharpyuv_dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/sharpyuv_gamma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/thread_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_UTILS_THREAD_UTILS_H_
#define WEBP_UTILS_THREAD_UTILS_H_

Expand Down
7 changes: 5 additions & 2 deletions vendor/libwebp/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@
//
// Author: Skal ([email protected])

#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 <stddef.h> // for size_t

#ifndef _MSC_VER
#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"

#include <inttypes.h>
#pragma clang diagnostic pop

#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
#define WEBP_INLINE inline
Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// Authors: Skal ([email protected])
// Urvang ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_UTILS_UTILS_H_
#define WEBP_UTILS_UTILS_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/vp8i_enc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_ENC_VP8I_ENC_H_
#define WEBP_ENC_VP8I_ENC_H_

Expand Down
1 change: 1 addition & 0 deletions vendor/libwebp/include/yuv.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

// Author: Skal ([email protected])

#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#ifndef WEBP_DSP_YUV_H_
#define WEBP_DSP_YUV_H_

Expand Down
8 changes: 4 additions & 4 deletions vendor/libwebp/src/dsp/dec_neon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
7 changes: 0 additions & 7 deletions vendor/libwebp/src/dsp/lossless.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion vendor/libwebp/src/enc/backward_references_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
73 changes: 0 additions & 73 deletions vendor/libwebp/src/mux/muxedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

//------------------------------------------------------------------------------
Loading

0 comments on commit bb737e3

Please sign in to comment.