From 3df0b4478b32cf3fb4b525875bc2bac3629c025f Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 12 Jun 2013 20:36:43 +0200 Subject: [PATCH] Fixed VC++ warnings. --- examples/splitview.c | 12 ++++++------ examples/wave.c | 8 ++++---- src/win32_joystick.c | 2 +- tests/accuracy.c | 4 ++-- tests/reopen.c | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/splitview.c b/examples/splitview.c index cb082b7f..30b093b1 100644 --- a/examples/splitview.c +++ b/examples/splitview.c @@ -385,18 +385,18 @@ static void cursorPosFun(GLFWwindow* window, double x, double y) switch (active_view) { case 1: - rot_x += (int) y - ypos; - rot_z += (int) x - xpos; + rot_x += (int) (y - ypos); + rot_z += (int) (x - xpos); do_redraw = 1; break; case 3: - rot_x += (int) y - ypos; - rot_y += (int) x - xpos; + rot_x += (int) (y - ypos); + rot_y += (int) (x - xpos); do_redraw = 1; break; case 4: - rot_y += (int) x - xpos; - rot_z += (int) y - ypos; + rot_y += (int) (x - xpos); + rot_z += (int) (y - ypos); do_redraw = 1; break; default: diff --git a/examples/wave.c b/examples/wave.c index 5237a93f..6890e85c 100644 --- a/examples/wave.c +++ b/examples/wave.c @@ -339,12 +339,12 @@ void cursor_position_callback(GLFWwindow* window, double x, double y) { if (locked) { - alpha += (x - cursorX) / 10.f; - beta += (y - cursorY) / 10.f; + alpha += (GLfloat) (x - cursorX) / 10.f; + beta += (GLfloat) (y - cursorY) / 10.f; } - cursorX = x; - cursorY = y; + cursorX = (int) x; + cursorY = (int) y; } diff --git a/src/win32_joystick.c b/src/win32_joystick.c index fff747d0..1ff3a277 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -131,7 +131,7 @@ const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) if (_glfw_joyGetPosEx(joy, &ji) != JOYERR_NOERROR) return NULL; - while (*count < jc.wNumButtons) + while (*count < (int) jc.wNumButtons) { buttons[*count] = (unsigned char) (ji.dwButtons & (1UL << *count) ? GLFW_PRESS : GLFW_RELEASE); diff --git a/tests/accuracy.c b/tests/accuracy.c index a94e9188..01adbd1b 100644 --- a/tests/accuracy.c +++ b/tests/accuracy.c @@ -113,8 +113,8 @@ int main(void) glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINES); - glVertex2f(0.f, (GLfloat) window_height - cursor_y); - glVertex2f((GLfloat) window_width, (GLfloat) window_height - cursor_y); + glVertex2f(0.f, (GLfloat) (window_height - cursor_y)); + glVertex2f((GLfloat) window_width, (GLfloat) (window_height - cursor_y)); glVertex2f((GLfloat) cursor_x, 0.f); glVertex2f((GLfloat) cursor_x, (GLfloat) window_height); glEnd(); diff --git a/tests/reopen.c b/tests/reopen.c index edcbd717..6f69b901 100644 --- a/tests/reopen.c +++ b/tests/reopen.c @@ -113,7 +113,7 @@ int main(int argc, char** argv) int count = 0; GLFWwindow* window; - srand(time(NULL)); + srand((unsigned int) time(NULL)); glfwSetErrorCallback(error_callback);