From e4eed92177e6720b9713227ca4b1ecd0f5ce8c0b Mon Sep 17 00:00:00 2001 From: Haakon Sporsheim Date: Tue, 31 Mar 2009 14:37:07 +0200 Subject: [PATCH] Reposition variable declarations to avoid C99. --- clutter/cogl/common/cogl-material.c | 3 ++- clutter/cogl/common/cogl-matrix.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clutter/cogl/common/cogl-material.c b/clutter/cogl/common/cogl-material.c index 49688d4f4..86189b93a 100644 --- a/clutter/cogl/common/cogl-material.c +++ b/clutter/cogl/common/cogl-material.c @@ -1914,9 +1914,10 @@ cogl_set_source (CoglHandle material_handle) void cogl_set_source_texture (CoglHandle texture_handle) { - _COGL_GET_CONTEXT (ctx, NO_RETVAL); CoglColor white; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + g_return_if_fail (texture_handle != COGL_INVALID_HANDLE); cogl_material_set_layer (ctx->default_material, 0, texture_handle); diff --git a/clutter/cogl/common/cogl-matrix.c b/clutter/cogl/common/cogl-matrix.c index d4cacaedd..1de2a6146 100644 --- a/clutter/cogl/common/cogl-matrix.c +++ b/clutter/cogl/common/cogl-matrix.c @@ -88,9 +88,11 @@ cogl_matrix_rotate (CoglMatrix *matrix, { CoglMatrix rotation; CoglMatrix result; + float c, s; + angle *= G_PI / 180.0f; - float c = cosf (angle); - float s = sinf (angle); + c = cosf (angle); + s = sinf (angle); rotation.xx = x * x * (1.0f - c) + c; rotation.yx = y * x * (1.0f - c) + z * s;