Skip to content

Commit 6b220f2

Browse files
committed
Review formating
1 parent b747eee commit 6b220f2

File tree

7 files changed

+23
-26
lines changed

7 files changed

+23
-26
lines changed

src/platforms/rcore_android.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ void PollInputEvents(void)
699699

700700
// Poll Events (registered events) until we reach TIMEOUT which indicates there are no events left to poll
701701
// NOTE: Activity is paused if not enabled (platform.appEnabled)
702-
while ((pollResult = ALooper_pollOnce(platform.appEnabled? 0 : -1, NULL, &pollEvents, (void**)&platform.source)) > ALOOPER_POLL_TIMEOUT)
702+
while ((pollResult = ALooper_pollOnce(platform.appEnabled? 0 : -1, NULL, &pollEvents, ((void **)&platform.source)) > ALOOPER_POLL_TIMEOUT))
703703
{
704704
// Process this event
705705
if (platform.source != NULL) platform.source->process(platform.app, platform.source);
@@ -786,7 +786,7 @@ int InitPlatform(void)
786786
while (!CORE.Window.ready)
787787
{
788788
// Process events until we reach TIMEOUT, which indicates no more events queued.
789-
while ((pollResult = ALooper_pollOnce(0, NULL, &pollEvents, (void**)&platform.source)) > ALOOPER_POLL_TIMEOUT)
789+
while ((pollResult = ALooper_pollOnce(0, NULL, &pollEvents, ((void **)&platform.source)) > ALOOPER_POLL_TIMEOUT))
790790
{
791791
// Process this event
792792
if (platform.source != NULL) platform.source->process(platform.app, platform.source);
@@ -1226,7 +1226,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
12261226
return 1; // Handled gamepad button
12271227
}
12281228

1229-
KeyboardKey key = (keycode > 0 && keycode < KEYCODE_MAP_SIZE)? mapKeycode[keycode] : KEY_NULL;
1229+
KeyboardKey key = ((keycode > 0) && (keycode < KEYCODE_MAP_SIZE))? mapKeycode[keycode] : KEY_NULL;
12301230
if (key != KEY_NULL)
12311231
{
12321232
// Save current key and its state

src/platforms/rcore_desktop_rgfw.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ void SetWindowIcons(Image *images, int count)
485485
// Set title for window
486486
void SetWindowTitle(const char *title)
487487
{
488-
RGFW_window_setName(platform.window, (char*)title);
488+
RGFW_window_setName(platform.window, (char *)title);
489489
CORE.Window.title = title;
490490
}
491491

@@ -542,9 +542,9 @@ void SetWindowFocused(void)
542542
void *GetWindowHandle(void)
543543
{
544544
#ifdef RGFW_WEBASM
545-
return (void*)platform.window->src.ctx;
545+
return (void *)platform.window->src.ctx;
546546
#else
547-
return (void*)platform.window->src.window;
547+
return (void *)platform.window->src.window;
548548
#endif
549549
}
550550

@@ -587,7 +587,7 @@ Vector2 GetMonitorPosition(int monitor)
587587
{
588588
RGFW_monitor *mons = RGFW_getMonitors();
589589

590-
return (Vector2){(float)mons[monitor].rect.x, (float)mons[monitor].rect.y};
590+
return (Vector2){ (float)mons[monitor].rect.x, (float)mons[monitor].rect.y };
591591
}
592592

593593
// Get selected monitor width (currently used by monitor)
@@ -609,7 +609,7 @@ int GetMonitorHeight(int monitor)
609609
// Get selected monitor physical width in millimetres
610610
int GetMonitorPhysicalWidth(int monitor)
611611
{
612-
RGFW_monitor* mons = RGFW_getMonitors();
612+
RGFW_monitor *mons = RGFW_getMonitors();
613613

614614
return (int)mons[monitor].physW;
615615
}
@@ -654,7 +654,7 @@ Vector2 GetWindowScaleDPI(void)
654654
// Set clipboard text content
655655
void SetClipboardText(const char *text)
656656
{
657-
RGFW_writeClipboard(text, (u32)strlen(text));
657+
RGFW_writeClipboard(text, strlen(text));
658658
}
659659

660660
// Get clipboard text content
@@ -1336,7 +1336,7 @@ int InitPlatform(void)
13361336
// Load OpenGL extensions
13371337
// NOTE: GL procedures address loader is required to load extensions
13381338
//----------------------------------------------------------------------------
1339-
rlLoadExtensions((void*)RGFW_getProcAddress);
1339+
rlLoadExtensions((void *)RGFW_getProcAddress);
13401340
//----------------------------------------------------------------------------
13411341

13421342
// TODO: Initialize input events system

src/platforms/rcore_desktop_sdl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#define MAX_CLIPBOARD_BUFFER_LENGTH 1024 // Size of the clipboard buffer used on GetClipboardText()
6969
#endif
7070

71-
#if ((defined(SDL_MAJOR_VERSION) && SDL_MAJOR_VERSION == 3) && (defined(SDL_MINOR_VERSION) && SDL_MINOR_VERSION >= 1))
71+
#if ((defined(SDL_MAJOR_VERSION) && (SDL_MAJOR_VERSION == 3)) && (defined(SDL_MINOR_VERSION) && (SDL_MINOR_VERSION >= 1)))
7272
#ifndef PLATFORM_DESKTOP_SDL3
7373
#define PLATFORM_DESKTOP_SDL3
7474
#endif
@@ -405,7 +405,7 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID)
405405

406406
// Since SDL2 doesn't have this function we leave a stub
407407
// SDL_GetClipboardData function is available since SDL 3.1.3. (e.g. SDL3)
408-
void* SDL_GetClipboardData(const char *mime_type, size_t *size)
408+
void *SDL_GetClipboardData(const char *mime_type, size_t *size)
409409
{
410410
TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3");
411411

@@ -1971,7 +1971,7 @@ void ClosePlatform(void)
19711971
// Scancode to keycode mapping
19721972
static KeyboardKey ConvertScancodeToKey(SDL_Scancode sdlScancode)
19731973
{
1974-
if (sdlScancode >= 0 && sdlScancode < SCANCODE_MAPPED_NUM)
1974+
if ((sdlScancode >= 0) && (sdlScancode < SCANCODE_MAPPED_NUM))
19751975
{
19761976
return mapScancodeToKey[sdlScancode];
19771977
}

src/platforms/rcore_drm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ static void ConfigureEvdevDevice(char *device)
15291529
platform.absRange.height = absinfo[ABS_Y].info.maximum - absinfo[ABS_Y].info.minimum;
15301530
}
15311531
}
1532-
else if (isGamepad && !isMouse && !isKeyboard && platform.gamepadCount < MAX_GAMEPADS)
1532+
else if (isGamepad && !isMouse && !isKeyboard && (platform.gamepadCount < MAX_GAMEPADS))
15331533
{
15341534
deviceKindStr = "gamepad";
15351535
int index = platform.gamepadCount++;
@@ -1893,7 +1893,7 @@ static int FindExactConnectorMode(const drmModeConnector *connector, uint width,
18931893

18941894
TRACELOG(LOG_TRACE, "DISPLAY: DRM Mode %d %ux%u@%u %s", i, mode->hdisplay, mode->vdisplay, mode->vrefresh, (mode->flags & DRM_MODE_FLAG_INTERLACE)? "interlaced" : "progressive");
18951895

1896-
if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && (!allowInterlaced)) continue;
1896+
if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && !allowInterlaced) continue;
18971897

18981898
if ((mode->hdisplay == width) && (mode->vdisplay == height) && (mode->vrefresh == fps)) return i;
18991899
}
@@ -1923,7 +1923,7 @@ static int FindNearestConnectorMode(const drmModeConnector *connector, uint widt
19231923
continue;
19241924
}
19251925

1926-
if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && (!allowInterlaced))
1926+
if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && !allowInterlaced)
19271927
{
19281928
TRACELOG(LOG_TRACE, "DISPLAY: DRM shouldn't choose an interlaced mode");
19291929
continue;

src/platforms/rcore_web.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ void ToggleBorderlessWindowed(void)
319319
// Set window state: maximized, if resizable
320320
void MaximizeWindow(void)
321321
{
322-
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE && !(CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
322+
if ((glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE) && !(CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
323323
{
324324
platform.unmaximizedWidth = CORE.Window.screen.width;
325325
platform.unmaximizedHeight = CORE.Window.screen.height;
@@ -342,7 +342,7 @@ void MinimizeWindow(void)
342342
// Set window state: not minimized/maximized
343343
void RestoreWindow(void)
344344
{
345-
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE && (CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
345+
if ((glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE) && (CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
346346
{
347347
if (platform.unmaximizedWidth && platform.unmaximizedHeight) glfwSetWindowSize(platform.handle, platform.unmaximizedWidth, platform.unmaximizedHeight);
348348

@@ -1664,10 +1664,10 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *
16641664
int height = EM_ASM_INT( return window.innerHeight; );
16651665

16661666
if (width < (int)CORE.Window.screenMin.width) width = CORE.Window.screenMin.width;
1667-
else if (width > (int)CORE.Window.screenMax.width && CORE.Window.screenMax.width > 0) width = CORE.Window.screenMax.width;
1667+
else if ((width > (int)CORE.Window.screenMax.width) && (CORE.Window.screenMax.width > 0)) width = CORE.Window.screenMax.width;
16681668

16691669
if (height < (int)CORE.Window.screenMin.height) height = CORE.Window.screenMin.height;
1670-
else if (height > (int)CORE.Window.screenMax.height && CORE.Window.screenMax.height > 0) height = CORE.Window.screenMax.height;
1670+
else if ((height > (int)CORE.Window.screenMax.height) && (CORE.Window.screenMax.height > 0)) height = CORE.Window.screenMax.height;
16711671

16721672
emscripten_set_canvas_element_size("#canvas", width, height);
16731673

@@ -1722,7 +1722,7 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE
17221722
for (int i = 0; i < gamepadEvent->numButtons; ++i) TRACELOGD("Button %d: Digital: %d, Analog: %g", i, gamepadEvent->digitalButton[i], gamepadEvent->analogButton[i]);
17231723
*/
17241724

1725-
if ((gamepadEvent->connected) && (gamepadEvent->index < MAX_GAMEPADS))
1725+
if (gamepadEvent->connected && (gamepadEvent->index < MAX_GAMEPADS))
17261726
{
17271727
CORE.Input.Gamepad.ready[gamepadEvent->index] = true;
17281728
sprintf(CORE.Input.Gamepad.name[gamepadEvent->index], "%s", gamepadEvent->id);

src/rcore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,7 @@ const char *GetDirectoryPath(const char *filePath)
20632063

20642064
// In case provided path does not contain a root drive letter (C:\, D:\) nor leading path separator (\, /),
20652065
// we add the current directory path to dirPath
2066-
if (filePath[1] != ':' && filePath[0] != '\\' && filePath[0] != '/')
2066+
if ((filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/'))
20672067
{
20682068
// For security, we set starting path to current directory,
20692069
// obtained path will be concatenated to this

src/rtextures.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,7 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start,
833833
// bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient
834834
// (i.e. the pixel which should become one of the gradient's ends color); while for
835835
// directions that lie in the second or fourth quadrant, that point is pixel (width, 0).
836-
float maxPosValue =
837-
((signbit(sinDir) != 0) == (signbit(cosDir) != 0))
838-
? fabsf(startingPos)
839-
: fabsf(startingPos+width*cosDir);
836+
float maxPosValue = ((signbit(sinDir) != 0) == (signbit(cosDir) != 0))? fabsf(startingPos) : fabsf(startingPos + width*cosDir);
840837
for (int i = 0; i < width; i++)
841838
{
842839
for (int j = 0; j < height; j++)

0 commit comments

Comments
 (0)