Cocoa: Fix Xcode Warnings

Closes #1132.
This commit is contained in:
Stephen Gowen 2017-11-16 14:10:51 -05:00 committed by Camilla Löwy
parent 9c513346ad
commit bb13275b72
4 changed files with 14 additions and 14 deletions

View File

@ -247,9 +247,9 @@ static void matchCallback(void* context,
compareElements, NULL); compareElements, NULL);
js = _glfwAllocJoystick(name, guid, js = _glfwAllocJoystick(name, guid,
CFArrayGetCount(axes), (int) CFArrayGetCount(axes),
CFArrayGetCount(buttons), (int) CFArrayGetCount(buttons),
CFArrayGetCount(hats)); (int) CFArrayGetCount(hats));
js->ns.device = device; js->ns.device = device;
js->ns.axes = axes; js->ns.axes = axes;
@ -399,11 +399,11 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
const long delta = axis->maximum - axis->minimum; const long delta = axis->maximum - axis->minimum;
if (delta == 0) if (delta == 0)
_glfwInputJoystickAxis(js, i, 0.f); _glfwInputJoystickAxis(js, (int) i, 0.f);
else else
{ {
const float value = (2.f * (raw - axis->minimum) / delta) - 1.f; const float value = (2.f * (raw - axis->minimum) / delta) - 1.f;
_glfwInputJoystickAxis(js, i, value); _glfwInputJoystickAxis(js, (int) i, value);
} }
} }
} }
@ -417,7 +417,7 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
_GLFWjoyelementNS* button = (_GLFWjoyelementNS*) _GLFWjoyelementNS* button = (_GLFWjoyelementNS*)
CFArrayGetValueAtIndex(js->ns.buttons, i); CFArrayGetValueAtIndex(js->ns.buttons, i);
const char value = getElementValue(js, button) - button->minimum; const char value = getElementValue(js, button) - button->minimum;
_glfwInputJoystickButton(js, i, value); _glfwInputJoystickButton(js, (int) i, value);
} }
for (i = 0; i < CFArrayGetCount(js->ns.hats); i++) for (i = 0; i < CFArrayGetCount(js->ns.hats); i++)
@ -441,7 +441,7 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
if (state < 0 || state > 8) if (state < 0 || state > 8)
state = 8; state = 8;
_glfwInputJoystickHat(js, i, states[state]); _glfwInputJoystickHat(js, (int) i, states[state]);
} }
} }

View File

@ -686,17 +686,17 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
[sender draggingLocation].x, [sender draggingLocation].x,
contentRect.size.height - [sender draggingLocation].y); contentRect.size.height - [sender draggingLocation].y);
const int count = [files count]; const NSUInteger count = [files count];
if (count) if (count)
{ {
NSEnumerator* e = [files objectEnumerator]; NSEnumerator* e = [files objectEnumerator];
char** paths = calloc(count, sizeof(char*)); char** paths = calloc(count, sizeof(char*));
int i; NSUInteger i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
paths[i] = strdup([[e nextObject] UTF8String]); 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++) for (i = 0; i < count; i++)
free(paths[i]); free(paths[i]);

View File

@ -136,9 +136,9 @@ static GLFWbool parseMapping(_GLFWmapping* mapping, const char* string)
if (fields[i].element->type == _GLFW_JOYSTICK_HATBIT) if (fields[i].element->type == _GLFW_JOYSTICK_HATBIT)
{ {
const unsigned int hat = strtoul(c + 1, (char**) &c, 10); const unsigned long hat = strtoul(c + 1, (char**) &c, 10);
const unsigned int bit = strtoul(c + 1, (char**) &c, 10); const unsigned long bit = strtoul(c + 1, (char**) &c, 10);
fields[i].element->value = (hat << 4) | bit; fields[i].element->value = (uint8_t) ((hat << 4) | bit);
} }
else else
fields[i].element->value = (uint8_t) strtoul(c + 1, (char**) &c, 10); fields[i].element->value = (uint8_t) strtoul(c + 1, (char**) &c, 10);

View File

@ -37,7 +37,7 @@
#define OSMESA_CONTEXT_MINOR_VERSION 0x37 #define OSMESA_CONTEXT_MINOR_VERSION 0x37
typedef void* OSMesaContext; typedef void* OSMesaContext;
typedef void (*OSMESAproc)(); typedef void (*OSMESAproc)(void);
typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum,GLint,GLint,GLint,OSMesaContext); typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum,GLint,GLint,GLint,OSMesaContext);
typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int*,OSMesaContext); typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int*,OSMesaContext);