From 0463e196b408f49ff2a0fd722da430d7cc85d40d Mon Sep 17 00:00:00 2001 From: siavash Date: Mon, 15 Jul 2013 18:37:02 +0200 Subject: [PATCH] Cleanup of size_t use. --- src/cocoa_window.m | 2 +- src/egl_context.c | 2 +- src/glx_context.c | 2 +- src/wgl_context.c | 2 +- src/x11_clipboard.c | 4 ++-- src/x11_joystick.c | 3 ++- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 7cdb826b..f32d078e 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -668,7 +668,7 @@ static int translateKey(unsigned int key) // static NSString* findAppName(void) { - unsigned int i; + size_t i; NSDictionary* infoDictionary = [[NSBundle mainBundle] infoDictionary]; // Keys to search for as potential application names diff --git a/src/egl_context.c b/src/egl_context.c index f136b332..8fa9a949 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -246,7 +246,7 @@ void _glfwTerminateContextAPI(void) { \ attribs[index++] = attribName; \ attribs[index++] = attribValue; \ - assert(index < sizeof(attribs) / sizeof(attribs[0])); \ + assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \ } // Prepare for creation of the OpenGL context diff --git a/src/glx_context.c b/src/glx_context.c index d22d5f57..0774e093 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -344,7 +344,7 @@ void _glfwTerminateContextAPI(void) { \ attribs[index++] = attribName; \ attribs[index++] = attribValue; \ - assert(index < sizeof(attribs) / sizeof(attribs[0])); \ + assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \ } // Prepare for creation of the OpenGL context diff --git a/src/wgl_context.c b/src/wgl_context.c index 7bac477c..14ee9c6d 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -332,7 +332,7 @@ void _glfwTerminateContextAPI(void) { \ attribs[index++] = attribName; \ attribs[index++] = attribValue; \ - assert(index < sizeof(attribs) / sizeof(attribs[0])); \ + assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \ } // Prepare for creation of the OpenGL context diff --git a/src/x11_clipboard.c b/src/x11_clipboard.c index e8e2ca92..afa24746 100644 --- a/src/x11_clipboard.c +++ b/src/x11_clipboard.c @@ -273,11 +273,11 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) { - int i; + size_t i; const Atom formats[] = { _glfw.x11.UTF8_STRING, _glfw.x11.COMPOUND_STRING, XA_STRING }; - const int formatCount = sizeof(formats) / sizeof(formats[0]); + const size_t formatCount = sizeof(formats) / sizeof(formats[0]); if (_glfwFindWindowByHandle(XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD))) diff --git a/src/x11_joystick.c b/src/x11_joystick.c index 37bd56f2..25de938d 100644 --- a/src/x11_joystick.c +++ b/src/x11_joystick.c @@ -162,7 +162,8 @@ static void pollJoystickEvents(void) void _glfwInitJoysticks(void) { #ifdef __linux__ - int i, joy = 0; + int joy = 0; + size_t i; regex_t regex; DIR* dir; const char* dirs[] =