Skip to content

Commit b64eb76

Browse files
authored
Merge pull request #2461 from Matiiss/matiiss-run-new-clang-format
Fix linter failing due to new clang-format version
2 parents 681f5b5 + 8f931ee commit b64eb76

File tree

4 files changed

+83
-76
lines changed

4 files changed

+83
-76
lines changed

src_c/freetype/ft_wrap.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
#define FX16_ROUND_TO_INT(x) (((x) + 32768L) >> 16)
4444
#define INT_TO_FX6(i) ((FT_Fixed)((i) << 6))
4545
#define INT_TO_FX16(i) ((FT_Fixed)((i) << 16))
46-
#define FX16_TO_DBL(x) ((x)*1.52587890625e-5 /* 2.0^-16 */)
47-
#define DBL_TO_FX16(d) ((FT_Fixed)((d)*65536.0))
48-
#define FX6_TO_DBL(x) ((x)*1.5625e-2 /* 2.0^-6 */)
49-
#define DBL_TO_FX6(d) ((FT_Fixed)((d)*64.0))
46+
#define FX16_TO_DBL(x) ((x) * 1.52587890625e-5 /* 2.0^-16 */)
47+
#define DBL_TO_FX16(d) ((FT_Fixed)((d) * 65536.0))
48+
#define FX6_TO_DBL(x) ((x) * 1.5625e-2 /* 2.0^-6 */)
49+
#define DBL_TO_FX6(d) ((FT_Fixed)((d) * 64.0))
5050

5151
/* Internal configuration variables */
5252
#define PGFT_DEFAULT_CACHE_SIZE 64

src_c/math.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static PyTypeObject pgVectorIter_Type;
9393
#define _vector_subtype_new(x) \
9494
((pgVector *)(Py_TYPE(x)->tp_new(Py_TYPE(x), NULL, NULL)))
9595

96-
#define DEG2RAD(angle) ((angle)*M_PI / 180.)
97-
#define RAD2DEG(angle) ((angle)*180. / M_PI)
96+
#define DEG2RAD(angle) ((angle) * M_PI / 180.)
97+
#define RAD2DEG(angle) ((angle) * 180. / M_PI)
9898

9999
typedef struct {
100100
PyObject_HEAD double coords[VECTOR_MAX_SIZE]; /* Coordinates */

src_c/mixer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ const PG_sample_format_t PG_SAMPLE_LITTLE_ENDIAN = 0;
5757
const PG_sample_format_t PG_SAMPLE_BIG_ENDIAN = 0x20000u;
5858
#endif
5959
const PG_sample_format_t PG_SAMPLE_CHAR_SIGN = (char)0xff > 0 ? 0 : 0x10000u;
60-
#define PG_SAMPLE_SIZE(sf) ((sf)&0x0ffffu)
61-
#define PG_IS_SAMPLE_SIGNED(sf) ((sf)&PG_SAMPLE_SIGNED != 0)
62-
#define PG_IS_SAMPLE_NATIVE_ENDIAN(sf) ((sf)&PG_SAMPLE_NATIVE_ENDIAN != 0)
60+
#define PG_SAMPLE_SIZE(sf) ((sf) & 0x0ffffu)
61+
#define PG_IS_SAMPLE_SIGNED(sf) ((sf) & PG_SAMPLE_SIGNED != 0)
62+
#define PG_IS_SAMPLE_NATIVE_ENDIAN(sf) ((sf) & PG_SAMPLE_NATIVE_ENDIAN != 0)
6363
#define PG_IS_SAMPLE_LITTLE_ENDIAN(sf) \
64-
((sf)&PG_SAMPLE_LITTLE_ENDIAN == PG_SAMPLE_LITTLE_ENDIAN)
64+
((sf) & PG_SAMPLE_LITTLE_ENDIAN == PG_SAMPLE_LITTLE_ENDIAN)
6565
#define PG_IS_SAMPLE_BIG_ENDIAN(sf) \
66-
((sf)&PG_SAMPLE_BIG_ENDIAN == PG_SAMPLE_BIG_ENDIAN)
66+
((sf) & PG_SAMPLE_BIG_ENDIAN == PG_SAMPLE_BIG_ENDIAN)
6767

6868
/* Since they are documented, the default init values are defined here
6969
rather than taken from SDL_mixer. It also means that the default

src_c/transform.c

Lines changed: 72 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,79 +1955,86 @@ clamp_4
19551955
19561956
*/
19571957

1958-
#define SURF_GET_AT(p_color, p_surf, p_x, p_y, p_pixels, p_format, p_pix) \
1959-
switch (p_format->BytesPerPixel) { \
1960-
case 1: \
1961-
p_color = (Uint32) * \
1962-
((Uint8 *)(p_pixels) + (p_y)*p_surf->pitch + (p_x)); \
1963-
break; \
1964-
case 2: \
1965-
p_color = (Uint32) * \
1966-
((Uint16 *)((p_pixels) + (p_y)*p_surf->pitch) + (p_x)); \
1967-
break; \
1968-
case 3: \
1969-
p_pix = ((Uint8 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)*3); \
1970-
p_color = (SDL_BYTEORDER == SDL_LIL_ENDIAN) \
1971-
? (p_pix[0]) + (p_pix[1] << 8) + (p_pix[2] << 16) \
1972-
: (p_pix[2]) + (p_pix[1] << 8) + (p_pix[0] << 16); \
1973-
break; \
1974-
default: /* case 4: */ \
1975-
p_color = *((Uint32 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)); \
1976-
break; \
1958+
#define SURF_GET_AT(p_color, p_surf, p_x, p_y, p_pixels, p_format, p_pix) \
1959+
switch (p_format->BytesPerPixel) { \
1960+
case 1: \
1961+
p_color = (Uint32) * \
1962+
((Uint8 *)(p_pixels) + (p_y) * p_surf->pitch + (p_x)); \
1963+
break; \
1964+
case 2: \
1965+
p_color = \
1966+
(Uint32) * \
1967+
((Uint16 *)((p_pixels) + (p_y) * p_surf->pitch) + (p_x)); \
1968+
break; \
1969+
case 3: \
1970+
p_pix = \
1971+
((Uint8 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x) * 3); \
1972+
p_color = (SDL_BYTEORDER == SDL_LIL_ENDIAN) \
1973+
? (p_pix[0]) + (p_pix[1] << 8) + (p_pix[2] << 16) \
1974+
: (p_pix[2]) + (p_pix[1] << 8) + (p_pix[0] << 16); \
1975+
break; \
1976+
default: /* case 4: */ \
1977+
p_color = \
1978+
*((Uint32 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x)); \
1979+
break; \
19771980
}
19781981

19791982
#if (SDL_BYTEORDER == SDL_LIL_ENDIAN)
19801983

1981-
#define SURF_SET_AT(p_color, p_surf, p_x, p_y, p_pixels, p_format, \
1982-
p_byte_buf) \
1983-
switch (p_format->BytesPerPixel) { \
1984-
case 1: \
1985-
*((Uint8 *)p_pixels + (p_y)*p_surf->pitch + (p_x)) = \
1986-
(Uint8)p_color; \
1987-
break; \
1988-
case 2: \
1989-
*((Uint16 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)) = \
1990-
(Uint16)p_color; \
1991-
break; \
1992-
case 3: \
1993-
p_byte_buf = (Uint8 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)*3; \
1994-
*(p_byte_buf + (p_format->Rshift >> 3)) = \
1995-
(Uint8)(p_color >> p_format->Rshift); \
1996-
*(p_byte_buf + (p_format->Gshift >> 3)) = \
1997-
(Uint8)(p_color >> p_format->Gshift); \
1998-
*(p_byte_buf + (p_format->Bshift >> 3)) = \
1999-
(Uint8)(p_color >> p_format->Bshift); \
2000-
break; \
2001-
default: \
2002-
*((Uint32 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)) = p_color; \
2003-
break; \
1984+
#define SURF_SET_AT(p_color, p_surf, p_x, p_y, p_pixels, p_format, \
1985+
p_byte_buf) \
1986+
switch (p_format->BytesPerPixel) { \
1987+
case 1: \
1988+
*((Uint8 *)p_pixels + (p_y) * p_surf->pitch + (p_x)) = \
1989+
(Uint8)p_color; \
1990+
break; \
1991+
case 2: \
1992+
*((Uint16 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x)) = \
1993+
(Uint16)p_color; \
1994+
break; \
1995+
case 3: \
1996+
p_byte_buf = \
1997+
(Uint8 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x) * 3; \
1998+
*(p_byte_buf + (p_format->Rshift >> 3)) = \
1999+
(Uint8)(p_color >> p_format->Rshift); \
2000+
*(p_byte_buf + (p_format->Gshift >> 3)) = \
2001+
(Uint8)(p_color >> p_format->Gshift); \
2002+
*(p_byte_buf + (p_format->Bshift >> 3)) = \
2003+
(Uint8)(p_color >> p_format->Bshift); \
2004+
break; \
2005+
default: \
2006+
*((Uint32 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x)) = \
2007+
p_color; \
2008+
break; \
20042009
}
20052010

20062011
#else
20072012

2008-
#define SURF_SET_AT(p_color, p_surf, p_x, p_y, p_pixels, p_format, \
2009-
p_byte_buf) \
2010-
switch (p_format->BytesPerPixel) { \
2011-
case 1: \
2012-
*((Uint8 *)p_pixels + (p_y)*p_surf->pitch + (p_x)) = \
2013-
(Uint8)p_color; \
2014-
break; \
2015-
case 2: \
2016-
*((Uint16 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)) = \
2017-
(Uint16)p_color; \
2018-
break; \
2019-
case 3: \
2020-
p_byte_buf = (Uint8 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)*3; \
2021-
*(p_byte_buf + 2 - (p_format->Rshift >> 3)) = \
2022-
(Uint8)(p_color >> p_format->Rshift); \
2023-
*(p_byte_buf + 2 - (p_format->Gshift >> 3)) = \
2024-
(Uint8)(p_color >> p_format->Gshift); \
2025-
*(p_byte_buf + 2 - (p_format->Bshift >> 3)) = \
2026-
(Uint8)(p_color >> p_format->Bshift); \
2027-
break; \
2028-
default: \
2029-
*((Uint32 *)(p_pixels + (p_y)*p_surf->pitch) + (p_x)) = p_color; \
2030-
break; \
2013+
#define SURF_SET_AT(p_color, p_surf, p_x, p_y, p_pixels, p_format, \
2014+
p_byte_buf) \
2015+
switch (p_format->BytesPerPixel) { \
2016+
case 1: \
2017+
*((Uint8 *)p_pixels + (p_y) * p_surf->pitch + (p_x)) = \
2018+
(Uint8)p_color; \
2019+
break; \
2020+
case 2: \
2021+
*((Uint16 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x)) = \
2022+
(Uint16)p_color; \
2023+
break; \
2024+
case 3: \
2025+
p_byte_buf = \
2026+
(Uint8 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x) * 3; \
2027+
*(p_byte_buf + 2 - (p_format->Rshift >> 3)) = \
2028+
(Uint8)(p_color >> p_format->Rshift); \
2029+
*(p_byte_buf + 2 - (p_format->Gshift >> 3)) = \
2030+
(Uint8)(p_color >> p_format->Gshift); \
2031+
*(p_byte_buf + 2 - (p_format->Bshift >> 3)) = \
2032+
(Uint8)(p_color >> p_format->Bshift); \
2033+
break; \
2034+
default: \
2035+
*((Uint32 *)(p_pixels + (p_y) * p_surf->pitch) + (p_x)) = \
2036+
p_color; \
2037+
break; \
20312038
}
20322039

20332040
#endif

0 commit comments

Comments
 (0)