Skip to content

Commit bb29886

Browse files
committed
format all
1 parent cb39e8f commit bb29886

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

examples/common/stb_image.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ static stbi__uint32 stbi__get32le(stbi__context* s)
12441244
}
12451245
#endif
12461246

1247-
#define STBI__BYTECAST(x) ((stbi_uc)((x)&255)) // truncate int to byte without warnings
1247+
#define STBI__BYTECAST(x) ((stbi_uc)((x) & 255)) // truncate int to byte without warnings
12481248

12491249
//////////////////////////////////////////////////////////////////////////////
12501250
//
@@ -1283,7 +1283,7 @@ static unsigned char* stbi__convert_format(unsigned char* data, int img_n, int r
12831283
unsigned char* src = data + j * x * img_n;
12841284
unsigned char* dest = good + j * x * req_comp;
12851285

1286-
#define STBI__COMBO(a, b) ((a)*8 + (b))
1286+
#define STBI__COMBO(a, b) ((a) * 8 + (b))
12871287
#define STBI__CASE(a, b) \
12881288
case STBI__COMBO(a, b): \
12891289
for (i = x - 1; i >= 0; --i, src += a, dest += b)
@@ -1387,7 +1387,7 @@ static stbi__uint16* stbi__convert_format16(stbi__uint16* data, int img_n, int r
13871387
stbi__uint16* src = data + j * x * img_n;
13881388
stbi__uint16* dest = good + j * x * req_comp;
13891389

1390-
#define STBI__COMBO(a, b) ((a)*8 + (b))
1390+
#define STBI__COMBO(a, b) ((a) * 8 + (b))
13911391
#define STBI__CASE(a, b) \
13921392
case STBI__COMBO(a, b): \
13931393
for (i = x - 1; i >= 0; --i, src += a, dest += b)
@@ -2114,8 +2114,8 @@ stbi_inline static stbi_uc stbi__clamp(int x)
21142114
return (stbi_uc)x;
21152115
}
21162116

2117-
#define stbi__f2f(x) ((int)(((x)*4096 + 0.5)))
2118-
#define stbi__fsh(x) ((x)*4096)
2117+
#define stbi__f2f(x) ((int)(((x) * 4096 + 0.5)))
2118+
#define stbi__fsh(x) ((x) * 4096)
21192119

21202120
// derived from jidctint -- DCT_ISLOW
21212121
#define STBI__IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7) \
@@ -3518,7 +3518,7 @@ static stbi_uc* stbi__resample_row_generic(stbi_uc* out, stbi_uc* in_near, stbi_
35183518

35193519
// this is a reduced-precision calculation of YCbCr-to-RGB introduced
35203520
// to make sure the code produces the same results in both SIMD and scalar
3521-
#define stbi__float2fixed(x) (((int)((x)*4096.0f + 0.5f)) << 8)
3521+
#define stbi__float2fixed(x) (((int)((x) * 4096.0f + 0.5f)) << 8)
35223522
static void stbi__YCbCr_to_RGB_row(stbi_uc* out, const stbi_uc* y, const stbi_uc* pcb, const stbi_uc* pcr, int count,
35233523
int step)
35243524
{

examples/common/stb_image_write.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean);
9090
#define STBIW_ASSERT(x) assert(x)
9191
#endif
9292

93-
#define STBIW_UCHAR(x) (unsigned char)((x)&0xff)
93+
#define STBIW_UCHAR(x) (unsigned char)((x) & 0xff)
9494

9595
#ifdef STB_IMAGE_WRITE_STATIC
9696
static int stbi__flip_vertically_on_write = 0;

tests/common/stb_image.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ static stbi__uint32 stbi__get32le(stbi__context* s)
12441244
}
12451245
#endif
12461246

1247-
#define STBI__BYTECAST(x) ((stbi_uc)((x)&255)) // truncate int to byte without warnings
1247+
#define STBI__BYTECAST(x) ((stbi_uc)((x) & 255)) // truncate int to byte without warnings
12481248

12491249
//////////////////////////////////////////////////////////////////////////////
12501250
//
@@ -1283,7 +1283,7 @@ static unsigned char* stbi__convert_format(unsigned char* data, int img_n, int r
12831283
unsigned char* src = data + j * x * img_n;
12841284
unsigned char* dest = good + j * x * req_comp;
12851285

1286-
#define STBI__COMBO(a, b) ((a)*8 + (b))
1286+
#define STBI__COMBO(a, b) ((a) * 8 + (b))
12871287
#define STBI__CASE(a, b) \
12881288
case STBI__COMBO(a, b): \
12891289
for (i = x - 1; i >= 0; --i, src += a, dest += b)
@@ -1387,7 +1387,7 @@ static stbi__uint16* stbi__convert_format16(stbi__uint16* data, int img_n, int r
13871387
stbi__uint16* src = data + j * x * img_n;
13881388
stbi__uint16* dest = good + j * x * req_comp;
13891389

1390-
#define STBI__COMBO(a, b) ((a)*8 + (b))
1390+
#define STBI__COMBO(a, b) ((a) * 8 + (b))
13911391
#define STBI__CASE(a, b) \
13921392
case STBI__COMBO(a, b): \
13931393
for (i = x - 1; i >= 0; --i, src += a, dest += b)
@@ -2114,8 +2114,8 @@ stbi_inline static stbi_uc stbi__clamp(int x)
21142114
return (stbi_uc)x;
21152115
}
21162116

2117-
#define stbi__f2f(x) ((int)(((x)*4096 + 0.5)))
2118-
#define stbi__fsh(x) ((x)*4096)
2117+
#define stbi__f2f(x) ((int)(((x) * 4096 + 0.5)))
2118+
#define stbi__fsh(x) ((x) * 4096)
21192119

21202120
// derived from jidctint -- DCT_ISLOW
21212121
#define STBI__IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7) \
@@ -3518,7 +3518,7 @@ static stbi_uc* stbi__resample_row_generic(stbi_uc* out, stbi_uc* in_near, stbi_
35183518

35193519
// this is a reduced-precision calculation of YCbCr-to-RGB introduced
35203520
// to make sure the code produces the same results in both SIMD and scalar
3521-
#define stbi__float2fixed(x) (((int)((x)*4096.0f + 0.5f)) << 8)
3521+
#define stbi__float2fixed(x) (((int)((x) * 4096.0f + 0.5f)) << 8)
35223522
static void stbi__YCbCr_to_RGB_row(stbi_uc* out, const stbi_uc* y, const stbi_uc* pcb, const stbi_uc* pcr, int count,
35233523
int step)
35243524
{

tests/common/stb_image_write.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean);
9090
#define STBIW_ASSERT(x) assert(x)
9191
#endif
9292

93-
#define STBIW_UCHAR(x) (unsigned char)((x)&0xff)
93+
#define STBIW_UCHAR(x) (unsigned char)((x) & 0xff)
9494

9595
#ifdef STB_IMAGE_WRITE_STATIC
9696
static int stbi__flip_vertically_on_write = 0;

0 commit comments

Comments
 (0)