From 50bbd36b4a3971bc550cc9bb2ae3ee053a90f23d Mon Sep 17 00:00:00 2001 From: Stephen Gowen Date: Thu, 16 Nov 2017 16:35:26 -0500 Subject: [PATCH] Addressing Feedback --- src/cocoa_joystick.m | 2 -- src/cocoa_window.m | 6 +++--- src/input.c | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index 00ab8e4ae..0831809f8 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -399,9 +399,7 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode) const long delta = axis->maximum - axis->minimum; if (delta == 0) - { _glfwInputJoystickAxis(js, (int) i, 0.f); - } else { const float value = (2.f * (raw - axis->minimum) / delta) - 1.f; diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 7cc7117c7..68246342a 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -686,17 +686,17 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; [sender draggingLocation].x, contentRect.size.height - [sender draggingLocation].y); - const int count = (int) [files count]; + const NSUInteger count = [files count]; if (count) { NSEnumerator* e = [files objectEnumerator]; char** paths = calloc(count, sizeof(char*)); - int i; + NSUInteger i; for (i = 0; i < count; i++) paths[i] = strdup([[e nextObject] UTF8String]); - _glfwInputDrop(window, count, (const char**) paths); + _glfwInputDrop(window, (int) count, (const char**) paths); for (i = 0; i < count; i++) free(paths[i]); diff --git a/src/input.c b/src/input.c index 0747a23a8..cf043baf6 100644 --- a/src/input.c +++ b/src/input.c @@ -136,8 +136,8 @@ static GLFWbool parseMapping(_GLFWmapping* mapping, const char* string) if (fields[i].element->type == _GLFW_JOYSTICK_HATBIT) { - const unsigned int hat = (unsigned int) strtoul(c + 1, (char**) &c, 10); - const unsigned int bit = (unsigned int) strtoul(c + 1, (char**) &c, 10); + const unsigned long hat = strtoul(c + 1, (char**) &c, 10); + const unsigned long bit = strtoul(c + 1, (char**) &c, 10); fields[i].element->value = (hat << 4) | bit; } else