From 646d70e93a5a049cb9f603c3b94ee1ba98c9161e Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 2 Apr 2024 09:38:06 +0200 Subject: [PATCH] Remove trailing spaces --- src/CMakeLists.txt | 2 +- src/platforms/rcore_desktop.c | 2 +- src/raudio.c | 8 ++++---- src/raymath.h | 8 ++++---- src/rcore.c | 12 ++++++------ src/rlgl.h | 6 +++--- src/rmodels.c | 4 ++-- src/utils.c | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 919efeb4..38766570 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() message(STATUS "Setting build type to '${default_build_type}' as none was specified.") - + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index e9d372f7..04b73355 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -1739,7 +1739,7 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int // but future releases may add more actions (i.e. GLFW_REPEAT) CORE.Input.Mouse.currentButtonState[button] = action; CORE.Input.Touch.currentTouchState[button] = action; - + #if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES) // Process mouse events as touches to be able to use mouse-gestures GestureEvent gestureEvent = { 0 }; diff --git a/src/raudio.c b/src/raudio.c index 4d0de45a..0e9e043d 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -942,13 +942,13 @@ Sound LoadSoundAlias(Sound source) if (source.stream.buffer->data != NULL) { AudioBuffer *audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, 0, AUDIO_BUFFER_USAGE_STATIC); - + if (audioBuffer == NULL) { TRACELOG(LOG_WARNING, "SOUND: Failed to create buffer"); return sound; // Early return to avoid dereferencing the audioBuffer null pointer } - + audioBuffer->sizeInFrames = source.stream.buffer->sizeInFrames; audioBuffer->volume = source.stream.buffer->volume; audioBuffer->data = source.stream.buffer->data; @@ -1081,7 +1081,7 @@ bool ExportWaveAsCode(Wave wave, const char *fileName) int waveDataSize = wave.frameCount*wave.channels*wave.sampleSize/8; // NOTE: Text data buffer size is estimated considering wave data size in bytes - // and requiring 12 char bytes for every byte; the actual size varies, but + // and requiring 12 char bytes for every byte; the actual size varies, but // the longest possible char being appended is "%.4ff,\n ", which is 12 bytes. char *txtData = (char *)RL_CALLOC(waveDataSize*12 + 2000, sizeof(char)); @@ -2752,7 +2752,7 @@ static bool SaveFileData(const char *fileName, void *data, int dataSize) return false; } } - else + else { TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid"); return false; diff --git a/src/raymath.h b/src/raymath.h index 52c11b21..96f2c2cd 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -777,7 +777,7 @@ RMAPI Vector3 Vector3Normalize(Vector3 v) RMAPI Vector3 Vector3Project(Vector3 v1, Vector3 v2) { Vector3 result = { 0 }; - + float v1dv2 = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z); float v2dv2 = (v2.x*v2.x + v2.y*v2.y + v2.z*v2.z); @@ -794,7 +794,7 @@ RMAPI Vector3 Vector3Project(Vector3 v1, Vector3 v2) RMAPI Vector3 Vector3Reject(Vector3 v1, Vector3 v2) { Vector3 result = { 0 }; - + float v1dv2 = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z); float v2dv2 = (v2.x*v2.x + v2.y*v2.y + v2.z*v2.z); @@ -1213,7 +1213,7 @@ RMAPI Vector3 Vector3Refract(Vector3 v, Vector3 n, float r) RMAPI Vector4 Vector4Zero(void) { Vector4 result = { 0.0f, 0.0f, 0.0f, 0.0f }; - return result; + return result; } RMAPI Vector4 Vector4One(void) @@ -1296,7 +1296,7 @@ RMAPI float Vector4Distance(Vector4 v1, Vector4 v2) // Calculate square distance between two vectors RMAPI float Vector4DistanceSqr(Vector4 v1, Vector4 v2) { - float result = + float result = (v1.x - v2.x)*(v1.x - v2.x) + (v1.y - v2.y)*(v1.y - v2.y) + (v1.z - v2.z)*(v1.z - v2.z) + (v1.w - v2.w)*(v1.w - v2.w); diff --git a/src/rcore.c b/src/rcore.c index aa9724cb..b7147745 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -118,12 +118,12 @@ #if defined(SUPPORT_GESTURES_SYSTEM) #define RGESTURES_IMPLEMENTATION - #include "rgestures.h" // Gestures detection functionality + #include "rgestures.h" // Gestures detection functionality #endif #if defined(SUPPORT_CAMERA_SYSTEM) #define RCAMERA_IMPLEMENTATION - #include "rcamera.h" // Camera system functionality + #include "rcamera.h" // Camera system functionality #endif #if defined(SUPPORT_GIF_RECORDING) @@ -1799,7 +1799,7 @@ void TakeScreenshot(const char *fileName) char path[512] = { 0 }; strcpy(path, TextFormat("%s/%s", CORE.Storage.basePath, GetFileName(fileName))); - + ExportImage(image, path); // WARNING: Module required: rtextures RL_FREE(imgData); @@ -1955,7 +1955,7 @@ const char *GetFileName(const char *filePath) const char *GetFileNameWithoutExt(const char *filePath) { #define MAX_FILENAME_LENGTH 256 - + static char fileName[MAX_FILENAME_LENGTH] = { 0 }; memset(fileName, 0, MAX_FILENAME_LENGTH); @@ -1963,7 +1963,7 @@ const char *GetFileNameWithoutExt(const char *filePath) { strcpy(fileName, GetFileName(filePath)); // Get filename.ext without path int size = (int)strlen(fileName); // Get size in bytes - + for (int i = size; i > 0; i--) // Reverse search '.' { if (fileName[i] == '.') @@ -1974,7 +1974,7 @@ const char *GetFileNameWithoutExt(const char *filePath) } } } - + return fileName; } diff --git a/src/rlgl.h b/src/rlgl.h index 0f784025..87cff4ef 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -623,7 +623,7 @@ RLAPI void rlDisableFramebuffer(void); // Disable render textur RLAPI unsigned int rlGetActiveFramebuffer(void); // Get the currently active render texture (fbo), 0 for default framebuffer RLAPI void rlActiveDrawBuffers(int count); // Activate multiple draw color buffers RLAPI void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask); // Blit active framebuffer to main framebuffer -RLAPI void rlBindFramebuffer(unsigned int target, unsigned int framebuffer); // Bind framebuffer (FBO) +RLAPI void rlBindFramebuffer(unsigned int target, unsigned int framebuffer); // Bind framebuffer (FBO) // General render state RLAPI void rlEnableColorBlend(void); // Enable color blending @@ -3828,8 +3828,8 @@ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool norma { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // NOTE: Data type could be: GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT - // Additional types (depends on OpenGL version or extensions): - // - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED, + // Additional types (depends on OpenGL version or extensions): + // - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED, // - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV glVertexAttribPointer(index, compSize, type, normalized, stride, pointer); #endif diff --git a/src/rmodels.c b/src/rmodels.c index d94754f1..77bb19aa 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5804,7 +5804,7 @@ static Model LoadM3D(const char *fileName) // If no map is provided, or we have colors defined, we allocate storage for vertex colors // M3D specs only consider vertex colors if no material is provided, however raylib uses both and mixes the colors if ((mi == M3D_UNDEF) || vcolor) model.meshes[k].colors = RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char)); - + // If no map is provided and we allocated vertex colors, set them to white if ((mi == M3D_UNDEF) && (model.meshes[k].colors != NULL)) { @@ -6076,7 +6076,7 @@ static ModelAnimation *LoadModelAnimationsM3D(const char *fileName, int *animCou animations[a].framePoses = RL_MALLOC(animations[a].frameCount*sizeof(Transform *)); strncpy(animations[a].name, m3d->action[a].name, sizeof(animations[a].name)); animations[a].name[sizeof(animations[a].name) - 1] = '\0'; - + TRACELOG(LOG_INFO, "MODEL: [%s] animation #%i: %i msec, %i frames", fileName, a, m3d->action[a].durationmsec, animations[a].frameCount); for (i = 0; i < (int)m3d->numbone; i++) diff --git a/src/utils.c b/src/utils.c index 2c26c114..895f7777 100644 --- a/src/utils.c +++ b/src/utils.c @@ -211,13 +211,13 @@ unsigned char *LoadFileData(const char *fileName, int *dataSize) { // NOTE: fread() returns number of read elements instead of bytes, so we read [1 byte, size elements] size_t count = fread(data, sizeof(unsigned char), size, file); - + // WARNING: fread() returns a size_t value, usually 'unsigned int' (32bit compilation) and 'unsigned long long' (64bit compilation) // dataSize is unified along raylib as a 'int' type, so, for file-sizes > INT_MAX (2147483647 bytes) we have a limitation if (count > 2147483647) { TRACELOG(LOG_WARNING, "FILEIO: [%s] File is bigger than 2147483647 bytes, avoid using LoadFileData()", fileName); - + RL_FREE(data); data = NULL; }