Skip to content

Commit 8bd779f

Browse files
committed
Resync
1 parent ef7a110 commit 8bd779f

17 files changed

Lines changed: 209 additions & 224 deletions

formats/png/rpng.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static int rpng_reverse_filter_init(const struct png_ihdr *ihdr,
500500
{
501501
size_t pass_size;
502502

503-
if ( !(pngp->flags & RPNG_PROCESS_FLAG_ADAM7_PASS_INITIALIZED)
503+
if ( !(pngp->flags & RPNG_PROCESS_FLAG_ADAM7_PASS_INITIALIZED)
504504
&& ihdr->interlace)
505505
{
506506
if ( ihdr->width <= rpng_passes[pngp->pass_pos].x
@@ -924,7 +924,7 @@ static enum png_chunk_type rpng_read_chunk_header(
924924
type[i] = byte;
925925
}
926926

927-
if (
927+
if (
928928
type[0] == 'I'
929929
&& type[1] == 'H'
930930
&& type[2] == 'D'
@@ -998,7 +998,7 @@ bool rpng_iterate_image(rpng_t *rpng)
998998
return false;
999999

10001000
case PNG_CHUNK_IHDR:
1001-
if ( (rpng->flags & RPNG_FLAG_HAS_IHDR)
1001+
if ( (rpng->flags & RPNG_FLAG_HAS_IHDR)
10021002
|| (rpng->flags & RPNG_FLAG_HAS_IDAT)
10031003
|| (rpng->flags & RPNG_FLAG_HAS_IEND))
10041004
return false;
@@ -1016,8 +1016,8 @@ bool rpng_iterate_image(rpng_t *rpng)
10161016
rpng->ihdr.filter = buf[11];
10171017
rpng->ihdr.interlace = buf[12];
10181018

1019-
if ( rpng->ihdr.width == 0
1020-
|| rpng->ihdr.height == 0
1019+
if ( rpng->ihdr.width == 0
1020+
|| rpng->ihdr.height == 0
10211021
/* ensure multiplications don't overflow and wrap around, that'd give buffer overflow crashes */
10221022
|| (uint64_t)rpng->ihdr.width*rpng->ihdr.height*sizeof(uint32_t) >= 0x80000000)
10231023
return false;
@@ -1091,10 +1091,10 @@ bool rpng_iterate_image(rpng_t *rpng)
10911091
break;
10921092

10931093
case PNG_CHUNK_IDAT:
1094-
if ( !(rpng->flags & RPNG_FLAG_HAS_IHDR)
1094+
if ( !(rpng->flags & RPNG_FLAG_HAS_IHDR)
10951095
|| (rpng->flags & RPNG_FLAG_HAS_IEND)
1096-
|| (rpng->ihdr.color_type == PNG_IHDR_COLOR_PLT
1097-
&&
1096+
|| (rpng->ihdr.color_type == PNG_IHDR_COLOR_PLT
1097+
&&
10981098
!(rpng->flags & RPNG_FLAG_HAS_PLTE)))
10991099
return false;
11001100

@@ -1112,7 +1112,7 @@ bool rpng_iterate_image(rpng_t *rpng)
11121112
break;
11131113

11141114
case PNG_CHUNK_IEND:
1115-
if ( !(rpng->flags & RPNG_FLAG_HAS_IHDR)
1115+
if ( !(rpng->flags & RPNG_FLAG_HAS_IHDR)
11161116
|| !(rpng->flags & RPNG_FLAG_HAS_IDAT))
11171117
return false;
11181118

@@ -1129,7 +1129,7 @@ bool rpng_iterate_image(rpng_t *rpng)
11291129
}
11301130

11311131
int rpng_process_image(rpng_t *rpng,
1132-
void **_data, size_t size, unsigned *width, unsigned *height)
1132+
void **_data, size_t len, unsigned *width, unsigned *height)
11331133
{
11341134
uint32_t **data = (uint32_t**)_data;
11351135

hash/lrc_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static void sha256_subhash(struct sha256_ctx *p, uint32_t *t)
179179
*
180180
* Hashes SHA256 and outputs a human readable string.
181181
**/
182-
void sha256_hash(char *s, const uint8_t *in, size_t size)
182+
void sha256_hash(char *s, const uint8_t *in, size_t len)
183183
{
184184
unsigned i;
185185
struct sha256_ctx sha;
@@ -191,7 +191,7 @@ void sha256_hash(char *s, const uint8_t *in, size_t size)
191191
} shahash;
192192

193193
sha256_init(&sha);
194-
sha256_chunk(&sha, in, (unsigned)size);
194+
sha256_chunk(&sha, in, (unsigned)len);
195195
sha256_final(&sha);
196196
sha256_subhash(&sha, shahash.u32);
197197

include/compat/msvc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ extern "C" {
3838
#ifndef snprintf
3939
#define snprintf c99_snprintf_retro__
4040
#endif
41-
int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...);
41+
int c99_snprintf_retro__(char *s, size_t len, const char *format, ...);
4242

4343
#ifndef vsnprintf
4444
#define vsnprintf c99_vsnprintf_retro__
4545
#endif
46-
int c99_vsnprintf_retro__(char *outBuf, size_t size, const char *format, va_list ap);
46+
int c99_vsnprintf_retro__(char *s, size_t len, const char *format, va_list ap);
4747
#endif
4848

4949
#ifdef __cplusplus

include/compat/strl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ RETRO_BEGIN_DECLS
6060
* @brief Portable implementation of \c strlcpy(3).
6161
* @see https://linux.die.net/man/3/strlcpy
6262
*/
63-
size_t strlcpy(char *dest, const char *source, size_t size);
63+
size_t strlcpy(char *s, const char *source, size_t len);
6464

6565
/**
6666
* @brief Portable implementation of \c strlcat(3).
6767
* @see https://linux.die.net/man/3/strlcpy
6868
*/
69-
size_t strlcat(char *dest, const char *source, size_t size);
69+
size_t strlcat(char *s, const char *source, size_t len);
7070

7171
#endif
7272

include/fastcpy.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,68 +25,68 @@
2525
#include <string.h>
2626
#include <retro_inline.h>
2727

28-
static INLINE void* memcpy16(void* dst,void* src,size_t size)
28+
static INLINE void* memcpy16(void* dst, void* src, size_t len)
2929
{
30-
return memcpy(dst,src,size * 2);
30+
return memcpy(dst, src, len * 2);
3131
}
3232

33-
static INLINE void* memcpy32(void* dst,void* src,size_t size)
33+
static INLINE void* memcpy32(void* dst, void* src, size_t len)
3434
{
35-
return memcpy(dst,src,size * 4);
35+
return memcpy(dst, src, len * 4);
3636
}
3737

38-
static INLINE void* memcpy64(void* dst,void* src,size_t size)
38+
static INLINE void* memcpy64(void* dst, void* src, size_t len)
3939
{
40-
return memcpy(dst,src,size * 8);
40+
return memcpy(dst, src, len * 8);
4141
}
4242

4343
#ifdef USECPPSTDFILL
4444
#include <algorithm>
4545

46-
static INLINE void* memset16(void* dst,uint16_t val,size_t size)
46+
static INLINE void* memset16(void* dst,uint16_t val, size_t len)
4747
{
4848
uint16_t *typedptr = (uint16_t*)dst;
49-
std::fill(typedptr, typedptr + size, val);
49+
std::fill(typedptr, typedptr + len, val);
5050
return dst;
5151
}
5252

53-
static INLINE void* memset32(void* dst,uint32_t val,size_t size)
53+
static INLINE void* memset32(void* dst, uint32_t val, size_t len)
5454
{
5555
uint32_t *typedptr = (uint32_t*)dst;
56-
std::fill(typedptr, typedptr + size, val);
56+
std::fill(typedptr, typedptr + len, val);
5757
return dst;
5858
}
5959

60-
static INLINE void* memset64(void* dst,uint64_t val,size_t size)
60+
static INLINE void* memset64(void* dst, uint64_t val, size_t len)
6161
{
6262
uint64_t *typedptr = (uint64_t*)dst;
63-
std::fill(typedptr, typedptr + size, val);
63+
std::fill(typedptr, typedptr + len, val);
6464
return dst;
6565
}
6666
#else
67-
static INLINE void *memset16(void* dst,uint16_t val,size_t size)
67+
static INLINE void *memset16(void* dst, uint16_t val, size_t len)
6868
{
6969
size_t i;
7070
uint16_t *typedptr = (uint16_t*)dst;
71-
for (i = 0;i < size;i++)
71+
for (i = 0; i < len; i++)
7272
typedptr[i] = val;
7373
return dst;
7474
}
7575

76-
static INLINE void *memset32(void* dst,uint32_t val,size_t size)
76+
static INLINE void *memset32(void* dst, uint32_t val, size_t len)
7777
{
7878
size_t i;
7979
uint32_t *typedptr = (uint32_t*)dst;
80-
for (i = 0; i < size; i++)
80+
for (i = 0; i < len; i++)
8181
typedptr[i] = val;
8282
return dst;
8383
}
8484

85-
static INLINE void *memset64(void* dst,uint64_t val,size_t size)
85+
static INLINE void *memset64(void* dst, uint64_t val, size_t len)
8686
{
8787
size_t i;
8888
uint64_t *typedptr = (uint64_t*)dst;
89-
for (i = 0; i < size;i++)
89+
for (i = 0; i < len;i++)
9090
typedptr[i] = val;
9191
return dst;
9292
}

0 commit comments

Comments
 (0)