Fix warnings (#4251)

* Update rmodels.c

fix these warnings:

```
/src/rmodels.c:5744:17: warning: missing initializer for field 'w' of 'Vector4' [-Wmissing-field-initializers]
[build]  5744 |                 Vector4 outTangent1 = {tmp[0], tmp[1], tmp[2]};
[build]       |                 ^~~~~~~
```

* Update rcore_web.c

fix warnings
This commit is contained in:
Lázaro Albuquerque 2024-08-16 19:07:23 -04:00 committed by GitHub
parent f70d8a33cb
commit 308b77cd42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 13 deletions

View file

@ -129,7 +129,7 @@ static void CursorEnterCallback(GLFWwindow *window, int enter);
// Emscripten window callback events // Emscripten window callback events
static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData); static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData);
static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData); // static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData);
static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData); static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData);
// Emscripten input callback events // Emscripten input callback events
@ -981,7 +981,7 @@ void PollInputEvents(void)
default: break; default: break;
} }
if (button != -1) // Check for valid button if (button + 1 != 0) // Check for valid button
{ {
if (gamepadState.digitalButton[j] == 1) if (gamepadState.digitalButton[j] == 1)
{ {
@ -1572,12 +1572,12 @@ static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const Emscripte
} }
// Register window resize event // Register window resize event
static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData) // static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData)
{ // {
// TODO: Implement EmscriptenWindowResizedCallback()? // // TODO: Implement EmscriptenWindowResizedCallback()?
return 1; // The event was consumed by the callback handler // return 1; // The event was consumed by the callback handler
} // }
EM_JS(int, GetWindowInnerWidth, (), { return window.innerWidth; }); EM_JS(int, GetWindowInnerWidth, (), { return window.innerWidth; });
EM_JS(int, GetWindowInnerHeight, (), { return window.innerHeight; }); EM_JS(int, GetWindowInnerHeight, (), { return window.innerHeight; });
@ -1593,11 +1593,11 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *
int width = GetWindowInnerWidth(); int width = GetWindowInnerWidth();
int height = GetWindowInnerHeight(); int height = GetWindowInnerHeight();
if (width < CORE.Window.screenMin.width) width = CORE.Window.screenMin.width; if (width < (int)CORE.Window.screenMin.width) width = CORE.Window.screenMin.width;
else if (width > CORE.Window.screenMax.width && CORE.Window.screenMax.width > 0) width = CORE.Window.screenMax.width; else if (width > (int)CORE.Window.screenMax.width && CORE.Window.screenMax.width > 0) width = CORE.Window.screenMax.width;
if (height < CORE.Window.screenMin.height) height = CORE.Window.screenMin.height; if (height < (int)CORE.Window.screenMin.height) height = CORE.Window.screenMin.height;
else if (height > CORE.Window.screenMax.height && CORE.Window.screenMax.height > 0) height = CORE.Window.screenMax.height; else if (height > (int)CORE.Window.screenMax.height && CORE.Window.screenMax.height > 0) height = CORE.Window.screenMax.height;
emscripten_set_canvas_element_size("#canvas", width, height); emscripten_set_canvas_element_size("#canvas", width, height);

View file

@ -5741,11 +5741,11 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
cgltf_accessor_read_float(output, 3*keyframe+1, tmp, 4); cgltf_accessor_read_float(output, 3*keyframe+1, tmp, 4);
Vector4 v1 = {tmp[0], tmp[1], tmp[2], tmp[3]}; Vector4 v1 = {tmp[0], tmp[1], tmp[2], tmp[3]};
cgltf_accessor_read_float(output, 3*keyframe+2, tmp, 4); cgltf_accessor_read_float(output, 3*keyframe+2, tmp, 4);
Vector4 outTangent1 = {tmp[0], tmp[1], tmp[2]}; Vector4 outTangent1 = {tmp[0], tmp[1], tmp[2], 0.0f};
cgltf_accessor_read_float(output, 3*(keyframe+1)+1, tmp, 4); cgltf_accessor_read_float(output, 3*(keyframe+1)+1, tmp, 4);
Vector4 v2 = {tmp[0], tmp[1], tmp[2], tmp[3]}; Vector4 v2 = {tmp[0], tmp[1], tmp[2], tmp[3]};
cgltf_accessor_read_float(output, 3*(keyframe+1), tmp, 4); cgltf_accessor_read_float(output, 3*(keyframe+1), tmp, 4);
Vector4 inTangent2 = {tmp[0], tmp[1], tmp[2]}; Vector4 inTangent2 = {tmp[0], tmp[1], tmp[2], 0.0f};
Vector4 *r = data; Vector4 *r = data;
v1 = QuaternionNormalize(v1); v1 = QuaternionNormalize(v1);