Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Chromium | third_party/blink/renderer/platform/wtf/text/wtf_string.h | String &replace(unsigned index, unsigned length_to_replace,
const StringView &replacement) {
if (impl_)
impl_ = impl_->Replace(index, length_to_replace, replacement);
return *this;
} | [
0,
0
] |
Chromium | third_party/blink/renderer/platform/wtf/text/wtf_string.h | template <wtf_size_t inlineCapacity>
static WARN_UNUSED_RESULT String
Make8BitFrom16BitSource(const Vector<UChar, inlineCapacity> &buffer) {
return Make8BitFrom16BitSource(buffer.data(), buffer.size());
} | [
0,
0
] |
Chromium | third_party/blink/renderer/platform/wtf/text/wtf_string.h |
inline void swap(String &a, String &b) { a.swap(b); } | [
0,
0
] |
Chromium | third_party/blink/web_tests/external/wpt/tools/third_party/aioquic/src/aioquic/_buffer.c |
static PyObject *Buffer_pull_uint32(BufferObject *self, PyObject *args) {
CHECK_READ_BOUNDS(self, 4)
uint32_t value =
(uint32_t)(*(self->pos)) << 24 | (uint32_t)(*(self->pos + 1)) << 16 |
(uint32_t)(*(self->pos + 2)) << 8 | (uint32_t)(*(self->pos + 3));
self->pos += 4;
return PyLong_FromUnsignedLo... | [
0,
0
] |
Chromium | third_party/blink/web_tests/external/wpt/tools/third_party/aioquic/src/aioquic/_buffer.c |
static PyObject *Buffer_pull_uint64(BufferObject *self, PyObject *args) {
CHECK_READ_BOUNDS(self, 8)
uint64_t value =
(uint64_t)(*(self->pos)) << 56 | (uint64_t)(*(self->pos + 1)) << 48 |
(uint64_t)(*(self->pos + 2)) << 40 | (uint64_t)(*(self->pos + 3)) << 32 |
(uint64_t)(*(self->pos + 4)) << 24... | [
0,
0
] |
Chromium | third_party/blink/web_tests/external/wpt/tools/third_party/aioquic/src/aioquic/_crypto.c |
static PyObject *AEAD_decrypt(AEADObject *self, PyObject *args) {
const unsigned char *data, *associated;
Py_ssize_t data_len, associated_len;
int outlen, outlen2, res;
uint64_t pn;
if (!PyArg_ParseTuple(args, "y#y#K", &data, &data_len, &associated,
&associated_len, &pn))
return ... | [
1,
0
] |
Chromium | third_party/blink/web_tests/external/wpt/tools/third_party/aioquic/src/aioquic/_crypto.c |
static PyObject *AEAD_encrypt(AEADObject *self, PyObject *args) {
const unsigned char *data, *associated;
Py_ssize_t data_len, associated_len;
int outlen, outlen2, res;
uint64_t pn;
if (!PyArg_ParseTuple(args, "y#y#K", &data, &data_len, &associated,
&associated_len, &pn))
return ... | [
1,
0
] |
Chromium | third_party/blink/web_tests/external/wpt/tools/third_party/aioquic/src/aioquic/_crypto.c |
static void HeaderProtection_dealloc(HeaderProtectionObject *self) {
EVP_CIPHER_CTX_free(self->ctx);
} | [
0,
0
] |
Chromium | third_party/blink/web_tests/external/wpt/tools/third_party/aioquic/src/aioquic/_crypto.c |
static PyObject *HeaderProtection_remove(HeaderProtectionObject *self,
PyObject *args) {
const unsigned char *packet;
Py_ssize_t packet_len;
int pn_offset, res;
if (!PyArg_ParseTuple(args, "y#I", &packet, &packet_len, &pn_offset))
return NULL;
res = HeaderProtec... | [
1,
0
] |
Chromium | third_party/brotli/common/platform.h | static BROTLI_INLINE uint16_t BrotliUnalignedRead16(const void *p) {
uint16_t t;
memcpy(&t, p, sizeof t);
return t;
} | [
1,
0
] |
Chromium | third_party/brotli/common/platform.h | static BROTLI_INLINE void BrotliUnalignedWrite64(void *p, uint64_t v) {
*(uint64_t *)p = v;
}
#else
/* Avoid emitting LDRD / STRD, which require properly aligned address. */
/* If __attribute__(aligned) is available, use that. Otherwise, memcpy. */
#if BROTLI_GNUC_HAS_ATTRIBUTE(aligned, 2, 7, 0) | [
0,
0
] |
Chromium | third_party/brotli/common/platform.h | static BROTLI_INLINE void BrotliUnalignedWrite64(void *p, uint64_t v) {
brotli_unaligned_uint64_t *dwords = (brotli_unaligned_uint64_t *)p;
dwords[0] = (brotli_unaligned_uint64_t)v;
}
#else | [
0,
0
] |
Chromium | third_party/brotli/common/platform.h | static BROTLI_INLINE uint64_t BROTLI_UNALIGNED_LOAD64LE(const void *p) {
const uint8_t *in = (const uint8_t *)p;
uint64_t value = (uint64_t)(in[0]);
value |= (uint64_t)(in[1]) << 8;
value |= (uint64_t)(in[2]) << 16;
value |= (uint64_t)(in[3]) << 24;
value |= (uint64_t)(in[4]) << 32;
value |= (uint64_t)(in... | [
0,
0
] |
Chromium | third_party/brotli/common/platform.h | static BROTLI_INLINE void BrotliRBit(void) {}
#endif
#define BROTLI_REPEAT(N, X) \
{ \
if ((N & 1) != 0) { \
X; ... | [
1,
0
] |
Chromium | third_party/brotli/common/platform.h | static void BrotliDefaultFreeFunc(void *opaque, void *address) {
BROTLI_UNUSED(opaque);
free(address);
} | [
1,
0
] |
Chromium | third_party/brotli/common/platform.h |
BROTLI_UNUSED_FUNCTION void BrotliSuppressUnusedFunctions(void) {
BROTLI_UNUSED(&BrotliSuppressUnusedFunctions);
BROTLI_UNUSED(&BrotliUnalignedRead16);
BROTLI_UNUSED(&BrotliUnalignedRead32);
BROTLI_UNUSED(&BrotliUnalignedRead64);
BROTLI_UNUSED(&BrotliUnalignedWrite64);
BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD1... | [
0,
0
] |
Chromium | third_party/brotli/enc/block_splitter_inc.h |
static void FN(RandomSample)(uint32_t *seed, const DataType *data,
size_t length, size_t stride,
HistogramType *sample) {
size_t pos = 0;
if (stride >= length) {
stride = length;
} else {
pos = MyRand(seed) % (length - stride + 1);
}
FN(Histog... | [
0,
0
] |
Chromium | third_party/brotli/enc/block_splitter_inc.h |
static void FN(BuildBlockHistograms)(const DataType *data, const size_t length,
const uint8_t *block_ids,
const size_t num_histograms,
HistogramType *histograms) {
size_t i;
FN(ClearHistograms)(histograms... | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_composite_inc.h |
static BROTLI_INLINE size_t FN(HashTypeLength)(void) {
size_t a = FN_A(HashTypeLength)();
size_t b = FN_B(HashTypeLength)();
return a > b ? a : b;
} | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_composite_inc.h | static void FN(Initialize)(HasherHandle handle,
const BrotliEncoderParams *params) {
HashComposite *self = FN(Self)(handle);
self->ha = 0;
self->hb = 0;
self->params = params;
/* TODO: Initialize of the hashers is defered to Prepare (and params
remembered here) because we don't... | [
0,
1
] |
Chromium | third_party/brotli/enc/hash_composite_inc.h |
static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
size_t input_size, const uint8_t *data) {
HashComposite *self = FN(Self)(handle);
if (!self->ha) {
HasherCommon *common_a;
HasherCommon *common_b;
self->ha = handle + sizeof(HasherCommon) + sizeof(HashComposite)... | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_composite_inc.h |
static BROTLI_INLINE size_t
FN(HashMemAllocInBytes)(const BrotliEncoderParams *params, BROTLI_BOOL one_shot,
size_t input_size) {
return sizeof(HashComposite) + 2 * sizeof(HasherCommon) +
FN_A(HashMemAllocInBytes)(params, one_shot, input_size) +
FN_B(HashMemAllocInBytes)(par... | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_composite_inc.h |
static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
size_t num_bytes,
size_t position,
const uint8_t *ringbuffer,
... | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_composite_inc.h |
static BROTLI_INLINE void
FN(PrepareDistanceCache)(HasherHandle handle,
int *BROTLI_RESTRICT distance_cache) {
HashComposite *self = FN(Self)(handle);
FN_A(PrepareDistanceCache)(self->ha, distance_cache);
FN_B(PrepareDistanceCache)(self->hb, distance_cache);
} | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_composite_inc.h |
static BROTLI_INLINE void FN(FindLongestMatch)(
HasherHandle handle, const BrotliEncoderDictionary *dictionary,
const uint8_t *BROTLI_RESTRICT data, const size_t ring_buffer_mask,
const int *BROTLI_RESTRICT distance_cache, const size_t cur_ix,
const size_t max_length, const size_t max_backward, const s... | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_forgetful_chain_inc.h | static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; } | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_forgetful_chain_inc.h |
static BROTLI_INLINE HashForgetfulChain *FN(Self)(HasherHandle handle) {
return (HashForgetfulChain *)&(GetHasherCommon(handle)[1]);
} | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_forgetful_chain_inc.h | static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
size_t input_size, const uint8_t *data) {
HashForgetfulChain *self = FN(Self)(handle);
size_t partial_prepare_threshold = BUCKET_SIZE >> 6;
if (one_shot && input_size <= partial_prepare_threshold) {
size_t i;
for (... | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_forgetful_chain_inc.h |
static BROTLI_INLINE size_t
FN(HashMemAllocInBytes)(const BrotliEncoderParams *params, BROTLI_BOOL one_shot,
size_t input_size) {
BROTLI_UNUSED(params);
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
return sizeof(HashForgetfulChain);
} | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_forgetful_chain_inc.h | static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
size_t num_bytes,
size_t position,
const uint8_t *ringbuffer,
... | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match64_inc.h | static BROTLI_INLINE uint32_t FN(HashBytes)(const uint8_t *data,
const uint64_t mask,
const int shift) {
const uint64_t h = (BROTLI_UNALIGNED_LOAD64LE(data) & mask) * kHashMul64Long;
return (uint32_t)(h >> shift);
} | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match64_inc.h |
static BROTLI_INLINE size_t
FN(HashMemAllocInBytes)(const BrotliEncoderParams *params, BROTLI_BOOL one_shot,
size_t input_size) {
size_t bucket_size = (size_t)1 << params->hasher.bucket_bits;
size_t block_size = (size_t)1 << params->hasher.block_bits;
BROTLI_UNUSED(one_shot);
BROTLI_UNU... | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match_inc.h | static uint32_t FN(HashBytes)(const uint8_t *data, const int shift) {
uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32;
return (uint32_t)(h >> shift);
} | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match_inc.h |
static BROTLI_INLINE size_t
FN(HashMemAllocInBytes)(const BrotliEncoderParams *params, BROTLI_BOOL one_shot,
size_t input_size) {
size_t bucket_size = (size_t)1 << params->hasher.bucket_bits;
size_t block_size = (size_t)1 << params->hasher.block_bits;
BROTLI_UNUSED(one_shot);
BROTLI_UNU... | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match_inc.h | static BROTLI_INLINE void FN(Store)(HasherHandle handle, const uint8_t *data,
const size_t mask, const size_t ix) {
HashLongestMatch *self = FN(Self)(handle);
uint16_t *num = FN(Num)(self);
const uint32_t key = FN(HashBytes)(&data[ix & mask], self->hash_shift_);
const size_t ... | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match_inc.h |
static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
const uint8_t *data, const size_t mask,
const size_t ix_start,
const size_t ix_end) {
size_t i;
for (i = ix_start; i < ix_end; ++i... | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match_quickly_inc.h |
static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 8; } | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match_quickly_inc.h | static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 8; } | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_longest_match_quickly_inc.h | static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
size_t input_size, const uint8_t *data) {
HashLongestMatchQuickly *self = FN(Self)(handle);
size_t partial_prepare_threshold = HASH_MAP_SIZE >> 7;
if (one_shot && input_size <= partial_prepare_threshold) {
size_t i;
... | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_rolling_inc.h | static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; } | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_rolling_inc.h | static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; } | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_rolling_inc.h | static uint32_t FN(HashByte)(uint8_t byte) { return (uint32_t)byte + 1u; } | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_rolling_inc.h |
static uint32_t FN(HashRollingFunction)(uint32_t state, uint8_t add,
uint8_t rem, uint32_t factor,
uint32_t factor_remove) {
return (uint32_t)(factor * state + FN(HashByte)(add) -
factor_remove * FN(HashByte)(rem));
} | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_rolling_inc.h | static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
size_t input_size, const uint8_t *data) {
HashRolling *self = FN(Self)(handle);
size_t i;
if (input_size < CHUNKLEN)
return;
self->state = 0;
for (i = 0; i < CHUNKLEN; i += JUMP) {
self->state =
FN(Hash... | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_rolling_inc.h |
static BROTLI_INLINE size_t
FN(HashMemAllocInBytes)(const BrotliEncoderParams *params, BROTLI_BOOL one_shot,
size_t input_size) {
return sizeof(HashRolling) + NUMBUCKETS * sizeof(uint32_t);
BROTLI_UNUSED(params);
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
} | [
1,
0
] |
Chromium | third_party/brotli/enc/hash_rolling_inc.h |
static BROTLI_INLINE void
FN(PrepareDistanceCache)(HasherHandle handle,
int *BROTLI_RESTRICT distance_cache) {
BROTLI_UNUSED(handle);
BROTLI_UNUSED(distance_cache);
} | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_to_binary_tree_inc.h |
static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; } | [
0,
0
] |
Chromium | third_party/brotli/enc/hash_to_binary_tree_inc.h | static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
size_t num_bytes,
size_t position,
const uint8_t *ringbuffer,
... | [
0,
0
] |
Chromium | third_party/brotli/enc/quality.h | static BROTLI_INLINE void ChooseHasher(const BrotliEncoderParams *params,
BrotliHasherParams *hparams) {
if (params->quality > 9) {
hparams->type = 10;
} else if (params->quality == 4 && params->size_hint >= (1 << 20)) {
hparams->type = 54;
} else if (params->quality... | [
1,
0
] |
Chromium | third_party/brotli/tools/brotli.c |
static FILE *ms_fopen(const char *filename, const char *mode) {
FILE *result = 0;
fopen_s(&result, filename, mode);
return result;
} | [
0,
0
] |
Chromium | third_party/brotli/tools/brotli.c |
static const char *PrintablePath(const char *path) {
return path ? path : "con";
} | [
0,
0
] |
Chromium | third_party/brotli/tools/brotli.c | static void CopyStat(const char *input_path, const char *output_path) {
struct stat statbuf;
struct utimbuf times;
int res;
if (input_path == 0 || output_path == 0) {
return;
}
if (stat(input_path, &statbuf) != 0) {
return;
}
times.actime = statbuf.st_atime;
times.modtime = statbuf.st_mtime;
... | [
0,
1
] |
Chromium | third_party/brotli/tools/brotli.c |
static BROTLI_BOOL OpenFiles(Context *context) {
BROTLI_BOOL is_ok = OpenInputFile(context->current_input_path, &context->fin);
if (!context->test_integrity && is_ok) {
is_ok = OpenOutputFile(context->current_output_path, &context->fout,
context->force_overwrite);
}
return is_ok;... | [
0,
0
] |
Chromium | third_party/brotli/tools/brotli.c | static BROTLI_BOOL WriteOutput(Context *context) {
size_t out_size = (size_t)(context->next_out - context->output);
if (out_size == 0)
return BROTLI_TRUE;
if (context->test_integrity)
return BROTLI_TRUE;
fwrite(context->output, 1, out_size, context->fout);
if (ferror(context->fout)) {
fprintf(std... | [
0,
0
] |
Chromium | third_party/brotli/tools/brotli.c | static BROTLI_BOOL DecompressFiles(Context *context) {
while (NextFile(context)) {
BROTLI_BOOL is_ok = BROTLI_TRUE;
BrotliDecoderState *s = BrotliDecoderCreateInstance(NULL, NULL, NULL);
if (!s) {
fprintf(stderr, "out of memory\n");
return BROTLI_FALSE;
}
BrotliDecoderSetParameter(s, ... | [
0,
0
] |
Chromium | third_party/crashpad/crashpad/third_party/cpp-httplib/cpp-httplib/httplib.h |
template <typename T>
inline bool read_and_close_socket(socket_t sock, size_t keep_alive_max_count,
T callback) {
bool ret = false;
if (keep_alive_max_count > 0) {
auto count = keep_alive_max_count;
while (count > 0 &&
detail::select_read(sock, CPPHTTPLIB_KEEPA... | [
0,
0
] |
Chromium | third_party/crashpad/crashpad/third_party/cpp-httplib/cpp-httplib/httplib.h | template <typename Fn>
socket_t create_socket(const char *host, int port, Fn fn,
int socket_flags = 0) {
#ifdef _WIN32
#define SO_SYNCHRONOUS_NONALERT 0x20
#define SO_OPENTYPE 0x7008
int opt = SO_SYNCHRONOUS_NONALERT;
setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&opt,
... | [
1,
0
] |
Chromium | third_party/crashpad/crashpad/third_party/cpp-httplib/cpp-httplib/httplib.h |
inline bool is_connection_error() {
#ifdef _WIN32
return WSAGetLastError() != WSAEWOULDBLOCK;
#else
return errno != EINPROGRESS;
#endif
} | [
0,
0
] |
Chromium | third_party/crashpad/crashpad/third_party/cpp-httplib/cpp-httplib/httplib.h |
template <typename T> inline void write_headers(Stream &strm, const T &info) {
for (const auto &x : info.headers) {
strm.write_format("%s: %s\r\n", x.first.c_str(), x.second.c_str());
}
strm.write("\r\n");
} | [
0,
0
] |
Chromium | third_party/lcov/example/methods/iterate.c | int iterate_get_sum(int min, int max) {
int i, total;
total = 0;
for (i = min; i <= max; i++) {
/* We can detect an overflow by checking whether the new
sum would become negative. */
if (total + i < total) {
printf("Error: sum too large!\n");
exit(1);
}
/* Everything seems t... | [
0,
0
] |
Chromium | third_party/libaom/source/config/ios/arm-neon/config/aom_config.c | const char *aom_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libaom/source/config/ios/arm64/config/aom_config.c | const char *aom_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.c | const char *aom_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libaom/source/config/linux/generic/config/aom_config.c | const char *aom_codec_build_config(void) { return cfg; } | [
0,
0
] |
Chromium | third_party/libpng/arm/filter_neon_intrinsics.c |
void png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row) {
png_bytep rp = row;
png_bytep rp_stop = row + row_info->rowbytes;
uint8x8x4_t vdest;
vdest.val[3] = vdup_n_u8(0);
png_debug(1, "in png_read_filter_row_sub4_neon");
for... | [
0,
0
] |
Chromium | third_party/libpng/arm/palette_neon_intrinsics.c | int png_do_expand_palette_rgba8_neon(png_structrp png_ptr,
png_row_infop row_info,
png_const_bytep row, png_bytepp ssp,
png_bytepp ddp) {
png_uint_32 row_width = row_info->width;
const png_uint_32 *riffled... | [
1,
0
] |
Chromium | third_party/libpng/intel/filter_sse2_intrinsics.c |
static __m128i load3(const void *p) {
png_uint_32 tmp = 0;
memcpy(&tmp, p, 3);
return _mm_cvtsi32_si128(tmp);
} | [
1,
0
] |
Chromium | third_party/libpng/intel/filter_sse2_intrinsics.c | static __m128i abs_i16(__m128i x) {
#if PNG_INTEL_SSE_IMPLEMENTATION >= 2
return _mm_abs_epi16(x);
#else
__m128i is_negative = _mm_cmplt_epi16(x, _mm_setzero_si128());
/* Flip negative lanes. */
x = _mm_xor_si128(x, is_negative);
/* +1 to negative lanes, else +0. */
x = _mm_sub_epi16(x, is_negative);
r... | [
0,
0
] |
Chromium | third_party/libpng/intel/filter_sse2_intrinsics.c | static __m128i if_then_else(__m128i c, __m128i t, __m128i e) {
#if PNG_INTEL_SSE_IMPLEMENTATION >= 3
return _mm_blendv_epi8(e, t, c);
#else
return _mm_or_si128(_mm_and_si128(c, t), _mm_andnot_si128(c, e));
#endif
} | [
0,
0
] |
Chromium | third_party/libpng/png.c | void png_reset_crc(png_structrp png_ptr) {
png_ptr->crc = (png_uint_32)crc32(0, Z_NULL, 0);
} | [
0,
0
] |
Chromium | third_party/libpng/png.c | void png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr,
size_t length) {
int need_crc = 1;
if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0) {
if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
(PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
need... | [
1,
0
] |
Chromium | third_party/libpng/png.c | void PNGAPI png_data_freer(png_const_structrp png_ptr, png_inforp info_ptr,
int freer, png_uint_32 mask) {
png_debug(1, "in png_data_freer");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (freer == PNG_DESTROY_WILL_FREE_DATA)
info_ptr->free_me |= mask;
else if (freer ... | [
1,
0
] |
Chromium | third_party/libpng/png.c | png_voidp PNGAPI png_get_io_ptr(png_const_structrp png_ptr) {
if (png_ptr == NULL)
return (NULL);
return (png_ptr->io_ptr);
}
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
#ifdef PNG_STDIO_SUPPORTED | [
0,
0
] |
Chromium | third_party/libpng/png.c | void PNGAPI png_init_io(png_structrp png_ptr, png_FILE_p fp) {
png_debug(1, "in png_init_io");
if (png_ptr == NULL)
return;
png_ptr->io_ptr = (png_voidp)fp;
}
#endif
#ifdef PNG_SAVE_INT_32_SUPPORTED | [
0,
0
] |
Chromium | third_party/libpng/png.c | int PNGAPI png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime) {
static const char short_months[12][4] = {"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec"};
if (out == NULL)
re... | [
1,
0
] |
Chromium | third_party/libpng/png.c | png_const_charp PNGAPI png_get_copyright(png_const_structrp png_ptr) {
PNG_UNUSED(png_ptr)
#ifdef PNG_STRING_COPYRIGHT
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE
"libpng version 1.6.37" PNG_STRING_NEWLINE
"Copyright (c) 2018-2019 Cosmin Truta" PNG_STRING_NEWLINE
"Copyright (c) 1... | [
0,
0
] |
Chromium | third_party/libpng/png.c | void PNGAPI png_build_grayscale_palette(int bit_depth, png_colorp palette) {
int num_palette;
int color_inc;
int i;
int v;
png_debug(1, "in png_do_build_grayscale_palette");
if (palette == NULL)
return;
switch (bit_depth) {
case 1:
num_palette = 2;
color_inc = 0xff;
break;
case 2:
... | [
1,
0
] |
Chromium | third_party/libpng/png.c | int PNGAPI png_handle_as_unknown(png_const_structrp png_ptr,
png_const_bytep chunk_name) {
png_const_bytep p, p_end;
if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list == 0)
return PNG_HANDLE_CHUNK_AS_DEFAULT;
p_end = png_ptr->chunk_list;
p = p_end + png... | [
1,
0
] |
Chromium | third_party/libpng/png.c | int PNGAPI png_reset_zstream(png_structrp png_ptr) {
if (png_ptr == NULL)
return Z_STREAM_ERROR;
return (inflateReset(&png_ptr->zstream));
}
#endif /* READ */ | [
0,
0
] |
Chromium | third_party/libpng/png.c | png_uint_32 PNGAPI png_access_version_number(void) {
return ((png_uint_32)PNG_LIBPNG_VER);
}
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) | [
0,
0
] |
Chromium | third_party/libpng/png.c | static int png_colorspace_check_gamma(png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_fixed_point gAMA, int from)
{
png_fixed_point gtest;
if ((colorspace->flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
(png_muldiv(>est, ... | [
1,
0
] |
Chromium | third_party/libpng/png.c | static int png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ) {
png_int_32 d, dwhite, whiteX, whiteY;
d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d) == 0)
return 1;
if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0)
return 1;
dwhite = d;
whiteX = XYZ... | [
0,
0
] |
Chromium | third_party/libpng/png.c | static int png_colorspace_endpoints_match(const png_xy *xy1, const png_xy *xy2,
int delta) {
if (PNG_OUT_OF_RANGE(xy1->whitex, xy2->whitex, delta) ||
PNG_OUT_OF_RANGE(xy1->whitey, xy2->whitey, delta) ||
PNG_OUT_OF_RANGE(xy1->redx, xy2->redx, delta) ||
PNG_O... | [
1,
0
] |
Chromium | third_party/libpng/png.c | static int png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ) {
int result;
png_XYZ XYZtemp;
result = png_XYZ_normalize(XYZ);
if (result != 0)
return result;
result = png_xy_from_XYZ(xy, XYZ);
if (result != 0)
return result;
XYZtemp = *XYZ;
return png_colorspace_check_xy(&XYZtemp, xy);
} | [
0,
0
] |
Chromium | third_party/libpng/png.c | static int png_colorspace_set_xy_and_XYZ(png_const_structrp png_ptr,
png_colorspacerp colorspace,
const png_xy *xy, const png_XYZ *XYZ,
int preferred) {
if ((colorspace->flags & PNG_COLORSPACE_IN... | [
1,
0
] |
Chromium | third_party/libpng/png.c | int png_colorspace_set_endpoints(png_const_structrp png_ptr,
png_colorspacerp colorspace,
const png_XYZ *XYZ_in, int preferred) {
png_XYZ XYZ = *XYZ_in;
png_xy xy;
switch (png_colorspace_check_XYZ(&xy, &XYZ)) {
case 0:
return png_colorspace_... | [
0,
0
] |
Chromium | third_party/libpng/png.c | static int is_ICC_signature(png_alloc_size_t it) {
return is_ICC_signature_char(it >> 24) &&
is_ICC_signature_char((it >> 16) & 0xff) &&
is_ICC_signature_char((it >> 8) & 0xff) &&
is_ICC_signature_char(it & 0xff);
} | [
0,
0
] |
Chromium | third_party/libpng/png.c | static int icc_check_length(png_const_structrp png_ptr,
png_colorspacerp colorspace, png_const_charp name,
png_uint_32 profile_length) {
if (profile_length < 132)
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
... | [
0,
0
] |
Chromium | third_party/libpng/png.c | int png_icc_check_length(png_const_structrp png_ptr,
png_colorspacerp colorspace, png_const_charp name,
png_uint_32 profile_length) {
if (!icc_check_length(png_ptr, colorspace, name, profile_length))
return 0;
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
else if (png_p... | [
0,
0
] |
Chromium | third_party/libpng/png.c | static int png_gt(size_t a, size_t b) { return a > b; }
#else
#define png_gt(a, b) ((a) > (b))
#endif | [
0,
0
] |
Chromium | third_party/libpng/png.c | png_fixed_point png_fixed(png_const_structrp png_ptr, double fp,
png_const_charp text) {
double r = floor(100000 * fp + .5);
if (r > 2147483647. || r < -2147483648.)
png_fixed_error(png_ptr, text);
#ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(text)
#endif
return (png_fixed_point)... | [
1,
0
] |
Chromium | third_party/libpng/png.c | png_fixed_point png_muldiv_warn(png_const_structrp png_ptr, png_fixed_point a,
png_int_32 times, png_int_32 divisor) {
png_fixed_point result;
if (png_muldiv(&result, a, times, divisor) != 0)
return result;
png_warning(png_ptr, "fixed point overflow ignored");
return 0;
}
#... | [
0,
0
] |
Chromium | third_party/libpng/png.c | png_fixed_point png_reciprocal(png_fixed_point a) {
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
double r = floor(1E10 / a + .5);
if (r <= 2147483647. && r >= -2147483648.)
return (png_fixed_point)r;
#else
png_fixed_point res;
if (png_muldiv(&res, 100000, 100000, a) != 0)
return res;
#endif
return 0;
} | [
0,
0
] |
Chromium | third_party/libpng/png.c | int png_gamma_significant(png_fixed_point gamma_val) {
return gamma_val < PNG_FP_1 - PNG_GAMMA_THRESHOLD_FIXED ||
gamma_val > PNG_FP_1 + PNG_GAMMA_THRESHOLD_FIXED;
}
#endif | [
1,
0
] |
Chromium | third_party/libpng/png.c | static png_fixed_point png_product2(png_fixed_point a, png_fixed_point b) {
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
double r = a * 1E-5;
r *= b;
r = floor(r + .5);
if (r <= 2147483647. && r >= -2147483648.)
return (png_fixed_point)r;
#else
png_fixed_point res;
if (png_muldiv(&res, a, b, 100000) != 0... | [
0,
0
] |
Chromium | third_party/libpng/png.c | png_fixed_point png_reciprocal2(png_fixed_point a, png_fixed_point b) {
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
if (a != 0 && b != 0) {
double r = 1E15 / a;
r /= b;
r = floor(r + .5);
if (r <= 2147483647. && r >= -2147483648.)
return (png_fixed_point)r;
}
#else
/* This may overflow becaus... | [
1,
0
] |
Chromium | third_party/libpng/png.c | static png_uint_32 png_exp(png_fixed_point x) {
if (x > 0 && x <= 0xfffff) {
/* Obtain a 4-bit approximation */
png_uint_32 e = png_32bit_exp[(x >> 12) & 0x0f];
/* Incorporate the low 12 bits - these decrease the returned value by
* multiplying by a number less than 1 if the bit is set. The multipl... | [
1,
0
] |
Chromium | third_party/libpng/png.c | png_byte png_gamma_8bit_correct(unsigned int value, png_fixed_point gamma_val) {
if (value > 0 && value < 255) {
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
double r =
floor(255 * pow((int)/*SAFE*/ value / 255., gamma_val * .00001) + .5);
return (png_byte)r;
#else
png_int_32 lg2 = png_log8bit(value)... | [
1,
0
] |
Chromium | third_party/libpng/png.c | png_uint_16 png_gamma_correct(png_structrp png_ptr, unsigned int value,
png_fixed_point gamma_val) {
if (png_ptr->bit_depth == 8)
return png_gamma_8bit_correct(value, gamma_val);
#ifdef PNG_16BIT_SUPPORTED
else
return png_gamma_16bit_correct(value, gamma_val);
#else
return ... | [
0,
0
] |
Chromium | third_party/libpng/png.c | int png_image_error(png_imagep image, png_const_charp error_message) {
png_safecat(image->message, (sizeof image->message), 0, error_message);
image->warning_or_error |= PNG_IMAGE_ERROR;
png_image_free(image);
return 0;
}
#endif /* SIMPLIFIED READ/WRITE */ | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.