From b3ffe602a207edf14c69f05f6d1e0b892eb706b4 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 28 Jun 2010 15:25:19 +0100 Subject: [PATCH] cogl: Add const to some pointer arguments Some of the arguments to the material and path functions were taking a pointer to a CoglColor or an array of floats that was not intended to be written to but were not marked with const. --- clutter/cogl/cogl/cogl-material.c | 6 +++--- clutter/cogl/cogl/cogl-material.h | 14 +++++++------- clutter/cogl/cogl/cogl-path.c | 4 ++-- clutter/cogl/cogl/cogl-path.h | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/clutter/cogl/cogl/cogl-material.c b/clutter/cogl/cogl/cogl-material.c index 36716c3..a600e92 100644 --- a/clutter/cogl/cogl/cogl-material.c +++ b/clutter/cogl/cogl/cogl-material.c @@ -3899,7 +3899,7 @@ cogl_material_set_blend (CoglHandle handle, void cogl_material_set_blend_constant (CoglHandle handle, - CoglColor *constant_color) + const CoglColor *constant_color) { #ifndef HAVE_COGL_GLES CoglMaterial *material = COGL_MATERIAL (handle); @@ -4590,7 +4590,7 @@ changed: void cogl_material_set_layer_combine_constant (CoglHandle handle, int layer_index, - CoglColor *constant_color) + const CoglColor *constant_color) { CoglMaterial *material = COGL_MATERIAL (handle); CoglMaterialLayerState state = COGL_MATERIAL_LAYER_STATE_COMBINE_CONSTANT; @@ -4671,7 +4671,7 @@ changed: void cogl_material_set_layer_matrix (CoglHandle handle, int layer_index, - CoglMatrix *matrix) + const CoglMatrix *matrix) { CoglMaterial *material = COGL_MATERIAL (handle); CoglMaterialLayerState state = COGL_MATERIAL_LAYER_STATE_USER_MATRIX; diff --git a/clutter/cogl/cogl/cogl-material.h b/clutter/cogl/cogl/cogl-material.h index d3cf227..f233536 100644 --- a/clutter/cogl/cogl/cogl-material.h +++ b/clutter/cogl/cogl/cogl-material.h @@ -593,7 +593,7 @@ cogl_material_set_blend (CoglHandle material, */ void cogl_material_set_blend_constant (CoglHandle material, - CoglColor *constant_color); + const CoglColor *constant_color); /** * cogl_material_set_layer: @@ -742,9 +742,9 @@ cogl_material_set_layer_combine (CoglHandle material, * Since: 1.0 */ void -cogl_material_set_layer_combine_constant (CoglHandle material, - int layer_index, - CoglColor *constant); +cogl_material_set_layer_combine_constant (CoglHandle material, + int layer_index, + const CoglColor *constant); /** * cogl_material_set_layer_matrix: @@ -756,9 +756,9 @@ cogl_material_set_layer_combine_constant (CoglHandle material, * and rotate a single layer of a material used to fill your geometry. */ void -cogl_material_set_layer_matrix (CoglHandle material, - int layer_index, - CoglMatrix *matrix); +cogl_material_set_layer_matrix (CoglHandle material, + int layer_index, + const CoglMatrix *matrix); /** * cogl_material_get_layers: diff --git a/clutter/cogl/cogl/cogl-path.c b/clutter/cogl/cogl/cogl-path.c index aa64e0b..426e5ba 100644 --- a/clutter/cogl/cogl/cogl-path.c +++ b/clutter/cogl/cogl/cogl-path.c @@ -746,7 +746,7 @@ cogl_path_line (float x_1, } void -cogl_path_polyline (float *coords, +cogl_path_polyline (const float *coords, int num_points) { int c = 0; @@ -758,7 +758,7 @@ cogl_path_polyline (float *coords, } void -cogl_path_polygon (float *coords, +cogl_path_polygon (const float *coords, int num_points) { cogl_path_polyline (coords, num_points); diff --git a/clutter/cogl/cogl/cogl-path.h b/clutter/cogl/cogl/cogl-path.h index a0440f2..a4c74c0 100644 --- a/clutter/cogl/cogl/cogl-path.h +++ b/clutter/cogl/cogl/cogl-path.h @@ -303,8 +303,8 @@ cogl_path_line (float x_1, * be constructed. **/ void -cogl_path_polyline (float *coords, - int num_points); +cogl_path_polyline (const float *coords, + int num_points); /** @@ -322,8 +322,8 @@ cogl_path_polyline (float *coords, * fashion for the rest of the vertices. **/ void -cogl_path_polygon (float *coords, - int num_points); +cogl_path_polygon (const float *coords, + int num_points); /** -- 2.7.4