Skip to content

Commit cffb75d

Browse files
committed
format
1 parent b43f0dd commit cffb75d

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

src_c/static.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import_pygame_surface(void)
4949
{
5050
}
5151

52-
5352
void
5453
import_pygame_window(void)
5554
{
@@ -75,7 +74,6 @@ import_pygame_freetype(void)
7574
{
7675
}
7776

78-
7977
void
8078
import_pygame_bufferproxy(void)
8179
{
@@ -115,8 +113,6 @@ import_pygame_pixelarray(void)
115113
{
116114
}
117115

118-
119-
120116
PyMODINIT_FUNC
121117
PyInit_base(void);
122118
PyMODINIT_FUNC
@@ -232,7 +228,8 @@ load_submodule(const char *parent, PyObject *mod, const char *alias)
232228
{
233229
char fqn[1024];
234230
if (!mod) {
235-
snprintf(fqn, sizeof(fqn), "ERROR: PyInit_%s failed for %s.%s", alias, parent, alias);
231+
snprintf(fqn, sizeof(fqn), "ERROR: PyInit_%s failed for %s.%s", alias,
232+
parent, alias);
236233
puts(fqn);
237234
PyErr_Print();
238235
PyErr_Clear();
@@ -244,9 +241,11 @@ load_submodule(const char *parent, PyObject *mod, const char *alias)
244241

245242
PyObject *pmod = PyDict_GetItemString(modules, parent);
246243
if (!pmod) {
247-
snprintf(fqn, sizeof(fqn), "ERROR: Parent %s not found for %s.%s", parent, parent, alias);
244+
snprintf(fqn, sizeof(fqn), "ERROR: Parent %s not found for %s.%s",
245+
parent, parent, alias);
248246
puts(fqn);
249-
} else {
247+
}
248+
else {
250249
PyDict_SetItemString(modules, fqn, mod);
251250
PyDict_SetItemString(PyModule_GetDict(mod), "__name__",
252251
PyUnicode_FromString(fqn));
@@ -262,7 +261,7 @@ load_submodule_mphase(const char *parent, PyObject *mdef, PyObject *spec,
262261
{
263262
char fqn[1024];
264263
snprintf(fqn, sizeof(fqn), "%s.%s", parent, alias);
265-
puts(fqn);
264+
puts(fqn);
266265
PyObject *modules = PyImport_GetModuleDict();
267266

268267
Py_DECREF(PyObject_GetAttrString(spec, "name"));
@@ -293,7 +292,7 @@ puts(fqn);
293292
static PyObject *
294293
mod_pygame_import_cython(PyObject *self, PyObject *spec)
295294
{
296-
#if 1 //PY_VERSION_HEX <= 0x030C0000
295+
#if 1 // PY_VERSION_HEX <= 0x030C0000
297296

298297
load_submodule_mphase("pygame._sdl2", PyInit_sdl2(), spec, "sdl2");
299298

@@ -372,14 +371,12 @@ PyInit_pygame_static()
372371
// base, event
373372
load_submodule("pygame", PyInit_pg_time(), "time");
374373

375-
376374
load_submodule("pygame", PyInit_transform(), "transform");
377375
load_submodule("pygame", PyInit_draw(), "draw");
378376

379377
load_submodule("pygame", PyInit_mask(), "mask");
380378
load_submodule("pygame", PyInit_mouse(), "mouse");
381379

382-
383380
load_submodule("pygame", PyInit_pg_mixer(), "mixer");
384381
load_submodule("pygame.mixer", PyInit_mixer_music(), "music");
385382

@@ -395,7 +392,7 @@ PyInit_pygame_static()
395392
// base, color, rect, bufferproxy, surflock, surface
396393
load_submodule("pygame", PyInit_gfxdraw(), "gfxdraw");
397394

398-
//load_submodule("pygame", PyInit_system(), "system");
395+
// load_submodule("pygame", PyInit_system(), "system");
399396

400397
return PyModule_Create(&mod_pygame_static);
401398
}

src_c/surface.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4721,11 +4721,13 @@ MODINIT_DEFINE(surface)
47214721
PyObject *apiobj;
47224722
static void *c_api[PYGAMEAPI_SURFACE_NUMSLOTS];
47234723

4724-
if (PyModule_AddObjectRef(module, "SurfaceType", (PyObject *)&pgSurface_Type)) {
4724+
if (PyModule_AddObjectRef(module, "SurfaceType",
4725+
(PyObject *)&pgSurface_Type)) {
47254726
return NULL;
47264727
}
47274728

4728-
if (PyModule_AddObjectRef(module, "Surface", (PyObject *)&pgSurface_Type)) {
4729+
if (PyModule_AddObjectRef(module, "Surface",
4730+
(PyObject *)&pgSurface_Type)) {
47294731
return NULL;
47304732
}
47314733

src_py/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,14 @@ def warn(self):
116116

117117
# pygame.Color = pygame.color.Color
118118

119-
#Vector2 = pygame.math.Vector2
120-
#Vector3 = pygame.math.Vector3
121-
#Rect = pygame.rect.Rect
122-
#BufferProxy = pygame.bufferproxy.BufferProxy
119+
# Vector2 = pygame.math.Vector2
120+
# Vector3 = pygame.math.Vector3
121+
# Rect = pygame.rect.Rect
122+
# BufferProxy = pygame.bufferproxy.BufferProxy
123123

124124
# for pygame.surface.Surface type in sprite.py ?
125125
# surface = sys.modules["pygame.surface"]
126126

127-
128127
# cython modules use multiphase initialisation when not in builtin Inittab.
129128

130129
from pygame import _sdl2
@@ -150,17 +149,21 @@ def warn(self):
150149

151150

152151
import pygame.rect
152+
153153
Rect = pygame.rect.Rect
154154
FRect = pygame.rect.FRect
155155

156156

157157
import pygame.color
158+
158159
Color = pygame.color.Color
159160

160161
import pygame.bufferproxy
162+
161163
BufferProxy = pygame.bufferproxy.BufferProxy
162164

163165
import pygame.math
166+
164167
Vector2 = pygame.math.Vector2
165168
Vector3 = pygame.math.Vector3
166169

@@ -215,6 +218,7 @@ def warn(self):
215218
def Cursor(*args): # pylint: disable=unused-argument
216219
_attribute_undefined("pygame.Cursor")
217220

221+
218222
try:
219223
import pygame.pixelcopy
220224
except (ImportError, OSError):

0 commit comments

Comments
 (0)