diff options
author | JustOff <Off.Just.Off@gmail.com> | 2018-06-29 20:57:44 +0300 |
---|---|---|
committer | JustOff <Off.Just.Off@gmail.com> | 2018-06-29 20:57:44 +0300 |
commit | 47e9f9d4c1674cb3ee3bf29c415141520225243d (patch) | |
tree | 8b51f96dd85bb3253c0c61fa2b214465d53a95ed /media/libwebp/utils/utils.h | |
parent | 445ebe5a302895418ba993943de136449c743403 (diff) | |
download | UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.gz UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.lz UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.xz UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.zip |
Sync libwebp sources with https://chromium.googlesource.com/webm/libwebp/+/v1.0.0
Diffstat (limited to 'media/libwebp/utils/utils.h')
-rw-r--r-- | media/libwebp/utils/utils.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/media/libwebp/utils/utils.h b/media/libwebp/utils/utils.h index 3ab459050..27dc7e090 100644 --- a/media/libwebp/utils/utils.h +++ b/media/libwebp/utils/utils.h @@ -48,13 +48,13 @@ extern "C" { // somewhere (like: malloc(num_pixels * sizeof(*something))). That's why this // safe malloc() borrows the signature from calloc(), pointing at the dangerous // underlying multiply involved. -WEBP_EXTERN(void*) WebPSafeMalloc(uint64_t nmemb, size_t size); +WEBP_EXTERN void* WebPSafeMalloc(uint64_t nmemb, size_t size); // Note that WebPSafeCalloc() expects the second argument type to be 'size_t' // in order to favor the "calloc(num_foo, sizeof(foo))" pattern. -WEBP_EXTERN(void*) WebPSafeCalloc(uint64_t nmemb, size_t size); +WEBP_EXTERN void* WebPSafeCalloc(uint64_t nmemb, size_t size); // Companion deallocation function to the above allocations. -WEBP_EXTERN(void) WebPSafeFree(void* const ptr); +WEBP_EXTERN void WebPSafeFree(void* const ptr); //------------------------------------------------------------------------------ // Alignment @@ -66,7 +66,7 @@ WEBP_EXTERN(void) WebPSafeFree(void* const ptr); // memcpy() is the safe way of moving potentially unaligned 32b memory. static WEBP_INLINE uint32_t WebPMemToUint32(const uint8_t* const ptr) { uint32_t A; - memcpy(&A, (const int*)ptr, sizeof(A)); + memcpy(&A, ptr, sizeof(A)); return A; } static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) { @@ -112,12 +112,12 @@ static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) { #define WEBP_NEED_LOG_TABLE_8BIT extern const uint8_t WebPLogTable8bit[256]; static WEBP_INLINE int WebPLog2FloorC(uint32_t n) { - int log = 0; + int log_value = 0; while (n >= 256) { - log += 8; + log_value += 8; n >>= 8; } - return log + WebPLogTable8bit[n]; + return log_value + WebPLogTable8bit[n]; } // Returns (int)floor(log2(n)). n must be > 0. @@ -147,14 +147,14 @@ static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return WebPLog2FloorC(n); } struct WebPPicture; // Copy width x height pixels from 'src' to 'dst' honoring the strides. -WEBP_EXTERN(void) WebPCopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, - int width, int height); +WEBP_EXTERN void WebPCopyPlane(const uint8_t* src, int src_stride, + uint8_t* dst, int dst_stride, + int width, int height); // Copy ARGB pixels from 'src' to 'dst' honoring strides. 'src' and 'dst' are // assumed to be already allocated and using ARGB data. -WEBP_EXTERN(void) WebPCopyPixels(const struct WebPPicture* const src, - struct WebPPicture* const dst); +WEBP_EXTERN void WebPCopyPixels(const struct WebPPicture* const src, + struct WebPPicture* const dst); //------------------------------------------------------------------------------ // Unique colors. @@ -166,8 +166,8 @@ WEBP_EXTERN(void) WebPCopyPixels(const struct WebPPicture* const src, // MAX_PALETTE_SIZE, also outputs the actual unique colors into 'palette'. // Note: 'palette' is assumed to be an array already allocated with at least // MAX_PALETTE_SIZE elements. -WEBP_EXTERN(int) WebPGetColorPalette(const struct WebPPicture* const pic, - uint32_t* const palette); +WEBP_EXTERN int WebPGetColorPalette(const struct WebPPicture* const pic, + uint32_t* const palette); //------------------------------------------------------------------------------ |