mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
add a bunch of missing 'extern "C"'
Change-Id: I8c0ada049ce9fa7ef14164b90d58e999cdabba53
This commit is contained in:
parent
421eb99db3
commit
6aac1df17b
@ -16,6 +16,10 @@
|
||||
#include "./bit_writer.h"
|
||||
#include "./tcoder.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_SYMBOLS 255
|
||||
#define ALPHA_HEADER_LEN 2
|
||||
|
||||
@ -351,15 +355,15 @@ static int DecompressZlibTCoder(const uint8_t* data, size_t data_size,
|
||||
VP8BitReader br;
|
||||
VP8InitBitReader(&br, data, data + data_size);
|
||||
while (pos < output_size && !br.eof_) {
|
||||
const int dist = TCoderDecode(coderd, &br);
|
||||
const size_t dist = TCoderDecode(coderd, &br);
|
||||
if (dist == 0) {
|
||||
const int literal = TCoderDecode(coder, &br);
|
||||
output[pos] = literal;
|
||||
++pos;
|
||||
} else {
|
||||
const int len = MIN_LEN + TCoderDecode(coderl, &br);
|
||||
int k;
|
||||
if (pos + len > output_size) goto End;
|
||||
const size_t len = MIN_LEN + TCoderDecode(coderl, &br);
|
||||
size_t k;
|
||||
if (pos + len > output_size || pos < dist) goto End;
|
||||
for (k = 0; k < len; ++k) {
|
||||
output[pos + k] = output[pos + k - dist];
|
||||
}
|
||||
@ -429,3 +433,7 @@ int DecodeAlpha(const uint8_t* data, size_t data_size,
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
@ -15,6 +15,10 @@
|
||||
|
||||
#include "./alpha.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NUM_SYMBOLS 256
|
||||
|
||||
#define MAX_ITER 6 // Maximum number of convergence steps.
|
||||
@ -141,3 +145,7 @@ int QuantizeLevels(uint8_t* data, int width, int height,
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user