From 47b06e1fdcdc70c9d69a4c2ce8e25c67bab0a421 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 23 May 2013 00:12:11 +0200 Subject: [PATCH] Removed C99-ism. --- src/cocoa_gamma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cocoa_gamma.c b/src/cocoa_gamma.c index d8d01e81..9e2e7b1d 100644 --- a/src/cocoa_gamma.c +++ b/src/cocoa_gamma.c @@ -42,7 +42,7 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) { - uint32_t size = CGDisplayGammaTableCapacity(monitor->ns.displayID); + uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID); CGGammaValue* values = (CGGammaValue*) malloc(size * 3 * sizeof(CGGammaValue)); CGGetDisplayTransferByTable(monitor->ns.displayID, @@ -54,7 +54,7 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) _glfwAllocGammaRamp(ramp, size); - for (int i = 0; i < size; i++) + for (i = 0; i < size; i++) { ramp->red[i] = (unsigned short) (values[i] * 65535); ramp->green[i] = (unsigned short) (values[i + size] * 65535); @@ -66,9 +66,10 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) { + int i; CGGammaValue* values = (CGGammaValue*) malloc(ramp->size * 3 * sizeof(CGGammaValue)); - for (int i = 0; i < ramp->size; i++) + for (i = 0; i < ramp->size; i++) { values[i] = ramp->red[i] / 65535.f; values[i + ramp->size] = ramp->green[i] / 65535.f;