diff --git a/GRRLIB/GRRLIB/GRRLIB_3D.c b/GRRLIB/GRRLIB/GRRLIB_3D.c index e7a8f5c..7109185 100644 --- a/GRRLIB/GRRLIB/GRRLIB_3D.c +++ b/GRRLIB/GRRLIB/GRRLIB_3D.c @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2022 The GRRLIB Team +Copyright (c) 2009-2024 The GRRLIB Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,12 +26,12 @@ THE SOFTWARE. // User should not directly modify these Mtx _GRR_view; // Should be static as soon as all light functions needing this var will be in this file ;) -static guVector _GRR_cam = {0.0f, 0.0f, 0.0f}, - _GRR_up = {0.0f, 1.0f, 0.0f}, - _GRR_look = {0.0f, 0.0f, -100.0f}; -static guVector _GRRaxisx = (guVector){1, 0, 0}; // DO NOT MODIFY!!! -static guVector _GRRaxisy = (guVector){0, 1, 0}; // Even at runtime -static guVector _GRRaxisz = (guVector){0, 0, 1}; // NOT ever! +static guVector _GRR_cam = {0.0f, 0.0f, 0.0f}; +static guVector _GRR_up = {0.0f, 1.0f, 0.0f}; +static guVector _GRR_look = {0.0f, 0.0f, -100.0f}; +static guVector _GRRaxisx = (guVector){1.0f, 0.0f, 0.0f}; // DO NOT MODIFY!!! +static guVector _GRRaxisy = (guVector){0.0f, 1.0f, 0.0f}; // Even at runtime +static guVector _GRRaxisz = (guVector){0.0f, 0.0f, 1.0f}; // NOT ever! static Mtx _ObjTransformationMtx; /** @@ -122,7 +122,7 @@ void GRRLIB_3dMode(f32 minDist, f32 maxDist, f32 fov, bool texturemode, bool nor /** * Go back to 2D mode (contributed by chris_c aka DaShAmAn). */ -void GRRLIB_2dMode() { +void GRRLIB_2dMode(void) { Mtx view; Mtx44 m; diff --git a/GRRLIB/GRRLIB/GRRLIB_gecko.c b/GRRLIB/GRRLIB/GRRLIB_gecko.c index 8e004e4..3351379 100644 --- a/GRRLIB/GRRLIB/GRRLIB_gecko.c +++ b/GRRLIB/GRRLIB/GRRLIB_gecko.c @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2019 The GRRLIB Team +Copyright (c) 2009-2024 The GRRLIB Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -30,8 +30,8 @@ static bool geckoinit = false; * Initialize USB Gecko. * @return Returns @c true if everything worked, @c false if problems occurred. */ -bool GRRLIB_GeckoInit() { - s32 geckoattached = usb_isgeckoalive(EXI_CHANNEL_1); +bool GRRLIB_GeckoInit(void) { + const s32 geckoattached = usb_isgeckoalive(EXI_CHANNEL_1); if (geckoattached) { usb_flush(EXI_CHANNEL_1); geckoinit = true; diff --git a/GRRLIB/GRRLIB/GRRLIB_texEdit.c b/GRRLIB/GRRLIB/GRRLIB_texEdit.c index c0a8472..7b7c607 100644 --- a/GRRLIB/GRRLIB/GRRLIB_texEdit.c +++ b/GRRLIB/GRRLIB/GRRLIB_texEdit.c @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2022 The GRRLIB Team +Copyright (c) 2009-2024 The GRRLIB Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -377,7 +377,7 @@ GRRLIB_texImg* GRRLIB_LoadTextureJPGEx (const u8 *my_jpg, const u32 my_size) { jpeg_create_decompress(&cinfo); cinfo.err = jpeg_std_error(&jerr); cinfo.progress = NULL; - jpeg_mem_src(&cinfo, (unsigned char *)my_jpg, my_size); + jpeg_mem_src(&cinfo, (const unsigned char *)my_jpg, my_size); jpeg_read_header(&cinfo, TRUE); if (cinfo.jpeg_color_space == JCS_GRAYSCALE) { cinfo.out_color_space = JCS_RGB; diff --git a/GRRLIB/GRRLIB/GRRLIB_ttf.c b/GRRLIB/GRRLIB/GRRLIB_ttf.c index 5977383..df56d29 100644 --- a/GRRLIB/GRRLIB/GRRLIB_ttf.c +++ b/GRRLIB/GRRLIB/GRRLIB_ttf.c @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2023 The GRRLIB Team +Copyright (c) 2009-2024 The GRRLIB Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ static void DrawBitmap(FT_Bitmap *bitmap, int offset, int top, const u8 cR, cons * Initialize FreeType library. * @return int 0=OK; -1=Failed */ -int GRRLIB_InitTTF () { +int GRRLIB_InitTTF (void) { if (FT_Init_FreeType(&ftLibrary) != 0) { return -1; } diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h index f02a996..ad30218 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2022 The GRRLIB Team +Copyright (c) 2009-2024 The GRRLIB Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -144,7 +144,7 @@ GRRLIB_texImg* GRRLIB_LoadTextureBMP (const u8 *my_bmp); //------------------------------------------------------------------------------ // GRRLIB_gecko.c - USB_Gecko output facilities -bool GRRLIB_GeckoInit(); +bool GRRLIB_GeckoInit(void); void GRRLIB_GeckoPrintf (const char *text, ...); //------------------------------------------------------------------------------ @@ -152,7 +152,7 @@ void GRRLIB_GeckoPrintf (const char *text, ...); void GRRLIB_SetBackgroundColour(u8 r, u8 g, u8 b, u8 a); void GRRLIB_Camera3dSettings(f32 posx, f32 posy, f32 posz, f32 upx, f32 upy, f32 upz, f32 lookx, f32 looky, f32 lookz); void GRRLIB_3dMode(f32 minDist, f32 maxDist, f32 fov, bool texturemode, bool normalmode); -void GRRLIB_2dMode(); +void GRRLIB_2dMode(void); void GRRLIB_ObjectViewBegin(void); void GRRLIB_ObjectViewScale(f32 scalx, f32 scaly, f32 scalz); void GRRLIB_ObjectViewRotate(f32 angx, f32 angy, f32 angz); diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB_private.h b/GRRLIB/GRRLIB/grrlib/GRRLIB_private.h index cfd4720..d2013e5 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB_private.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB_private.h @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2017 The GRRLIB Team +Copyright (c) 2009-2024 The GRRLIB Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -44,7 +44,7 @@ THE SOFTWARE. //------------------------------------------------------------------------------ // GRRLIB_ttf.c - FreeType function for GRRLIB -int GRRLIB_InitTTF(); -void GRRLIB_ExitTTF(); +int GRRLIB_InitTTF(void); +void GRRLIB_ExitTTF(void); #endif // __GRRLIB_PRIVATE_H__ diff --git a/examples/basic_drawing/source/main.c b/examples/basic_drawing/source/main.c index e5ed91a..e5dcbcf 100644 --- a/examples/basic_drawing/source/main.c +++ b/examples/basic_drawing/source/main.c @@ -51,7 +51,7 @@ #define GRRLIB_AQUA 0x00FFFFFF #define GRRLIB_WHITE 0xFFFFFFFF -static u8 CalculateFrameRate(); +static u8 CalculateFrameRate(void); int main() { s32 left = 0, top = 0, page = 0, frame = TILE_DOWN + 1; @@ -59,7 +59,6 @@ int main() { u8 FPS = 0; ir_t ir1; - u32 wpaddown, wpadheld; guVector triangle[] = {{400,200,0.0f}, {500,400,0.0f}, {300,400,0.0f}}; u32 trianglecolor[] = {GRRLIB_GREEN, GRRLIB_RED, GRRLIB_BLUE}; @@ -95,8 +94,8 @@ int main() { while(1) { WPAD_SetVRes(0, 640, 480); WPAD_ScanPads(); - wpaddown = WPAD_ButtonsDown(0); - wpadheld = WPAD_ButtonsHeld(0); + const u32 wpaddown = WPAD_ButtonsDown(0); + const u32 wpadheld = WPAD_ButtonsHeld(0); WPAD_IR(WPAD_CHAN_0, &ir1); @@ -241,7 +240,7 @@ int main() { * This function calculates the number of frames we render each second. * @return The number of frames per second. */ -static u8 CalculateFrameRate() { +static u8 CalculateFrameRate(void) { static u8 frameCount = 0; static u32 lastTime; static u8 FPS = 0; diff --git a/examples/bitmap_fx/source/main.c b/examples/bitmap_fx/source/main.c index 7bf57b6..6c12b9d 100644 --- a/examples/bitmap_fx/source/main.c +++ b/examples/bitmap_fx/source/main.c @@ -14,7 +14,6 @@ int main() { - u32 wpaddown; s8 page = 0; // Font texture @@ -115,7 +114,7 @@ int main() { while(1) { WPAD_ScanPads(); - wpaddown = WPAD_ButtonsDown(0); + const u32 wpaddown = WPAD_ButtonsDown(0); GRRLIB_FillScreen(0xFFFFFFFF); diff --git a/examples/blending/source/main.c b/examples/blending/source/main.c index f4d5a2f..84825cd 100644 --- a/examples/blending/source/main.c +++ b/examples/blending/source/main.c @@ -19,7 +19,7 @@ #include "RGFX_Font_png.h" // Declare Static Functions -static void ExitGame(); +static void ExitGame(void); // Prepare Graphics GRRLIB_texImg *GFX_Background; @@ -160,7 +160,7 @@ int main() { return 0; } -static void ExitGame() { +static void ExitGame(void) { // Free all memory used by textures. GRRLIB_FreeTexture(GFX_Background); GRRLIB_FreeTexture(GFX_Blob[0]); diff --git a/examples/gamecube/basic_drawing/source/main.c b/examples/gamecube/basic_drawing/source/main.c index be86c89..8fa7caf 100644 --- a/examples/gamecube/basic_drawing/source/main.c +++ b/examples/gamecube/basic_drawing/source/main.c @@ -50,7 +50,7 @@ #define GRRLIB_AQUA 0x00FFFFFF #define GRRLIB_WHITE 0xFFFFFFFF -static u8 CalculateFrameRate(); +static u8 CalculateFrameRate(void); int main() { s32 left = 0, top = 0, page = 0, frame = TILE_DOWN + 1; @@ -217,7 +217,7 @@ int main() { * This function calculates the number of frames we render each second. * @return The number of frames per second. */ -static u8 CalculateFrameRate() { +static u8 CalculateFrameRate(void) { static u8 frameCount = 0; static u32 lastTime; static u8 FPS = 0; diff --git a/examples/gamecube/ttf/source/main.c b/examples/gamecube/ttf/source/main.c index f838320..eda4c93 100644 --- a/examples/gamecube/ttf/source/main.c +++ b/examples/gamecube/ttf/source/main.c @@ -12,7 +12,7 @@ #include "FreeMonoBold_ttf.h" // Prototype -static u8 CalculateFrameRate(); +static u8 CalculateFrameRate(void); int main(int argc, char **argv) { bool ShowFPS = false; @@ -98,7 +98,7 @@ int main(int argc, char **argv) { * This function calculates the number of frames we render each second. * @return The number of frames per second. */ -static u8 CalculateFrameRate() { +static u8 CalculateFrameRate(void) { static u8 frameCount = 0; static u32 lastTime; static u8 FPS = 0; diff --git a/examples/ttf/source/main.c b/examples/ttf/source/main.c index 0a7f7d6..03fbf7b 100644 --- a/examples/ttf/source/main.c +++ b/examples/ttf/source/main.c @@ -12,8 +12,8 @@ #include "FreeMonoBold_ttf.h" // Prototype -static u8 CalculateFrameRate(); -static bool ScreenShot(); +static u8 CalculateFrameRate(void); +static bool ScreenShot(void); int main(int argc, char **argv) { bool ShowFPS = false; @@ -104,7 +104,7 @@ int main(int argc, char **argv) { * This function calculates the number of frames we render each second. * @return The number of frames per second. */ -static u8 CalculateFrameRate() { +static u8 CalculateFrameRate(void) { static u8 frameCount = 0; static u32 lastTime; static u8 FPS = 0; @@ -123,7 +123,7 @@ static u8 CalculateFrameRate() { * Create a PNG screenshot on the root of the SD card with a timestamp. * @return bool true=everything worked, false=problems occurred. */ -static bool ScreenShot() { +static bool ScreenShot(void) { char path[255]; time_t now = time(NULL); struct tm *ti = localtime(&now);