cogl-material: Don't use the symbol 'near'
authorNeil Roberts <neil@linux.intel.com>
Fri, 18 Jun 2010 14:33:03 +0000 (15:33 +0100)
committerNeil Roberts <neil@linux.intel.com>
Fri, 18 Jun 2010 14:34:48 +0000 (15:34 +0100)
The window headers contain the line

 #define near

so it's not possible to use the symbol 'near' in code that's portable
to Windows. This replaces it with 'near_val'.

I think the define is meant to improve compatibility with code written
for Windows 3.1 where near would be a keyword to make it a smaller
pointer size.

clutter/cogl/cogl/cogl-material.c
clutter/cogl/cogl/cogl-material.h

index 7212860..7e6e2e9 100644 (file)
@@ -4129,8 +4129,8 @@ cogl_material_get_depth_test_function (CoglHandle handle)
 
 gboolean
 cogl_material_set_depth_range (CoglHandle handle,
-                               float near,
-                               float far,
+                               float near_val,
+                               float far_val,
                                GError **error)
 {
 #ifndef COGL_HAS_GLES
@@ -4144,8 +4144,8 @@ cogl_material_set_depth_range (CoglHandle handle,
   authority = _cogl_material_get_authority (material, state);
 
   depth_state = &authority->big_state->depth_state;
-  if (depth_state->depth_range_near == near &&
-      depth_state->depth_range_far == far)
+  if (depth_state->depth_range_near == near_val &&
+      depth_state->depth_range_far == far_val)
     return TRUE;
 
   /* - Flush journal primitives referencing the current state.
@@ -4155,8 +4155,8 @@ cogl_material_set_depth_range (CoglHandle handle,
    */
   _cogl_material_pre_change_notify (material, state, NULL);
 
-  material->big_state->depth_state.depth_range_near = near;
-  material->big_state->depth_state.depth_range_far = far;
+  material->big_state->depth_state.depth_range_near = near_val;
+  material->big_state->depth_state.depth_range_far = far_val;
 
   _cogl_material_update_authority (material, authority, state,
                                    _cogl_material_depth_state_equal);
@@ -4172,8 +4172,8 @@ cogl_material_set_depth_range (CoglHandle handle,
 
 void
 cogl_material_get_depth_range (CoglHandle handle,
-                               float *near,
-                               float *far)
+                               float *near_val,
+                               float *far_val)
 {
   CoglMaterial *material = COGL_MATERIAL (handle);
   CoglMaterial *authority;
@@ -4183,8 +4183,8 @@ cogl_material_get_depth_range (CoglHandle handle,
   authority =
     _cogl_material_get_authority (material, COGL_MATERIAL_STATE_DEPTH);
 
-  *near = authority->big_state->depth_state.depth_range_near;
-  *far = authority->big_state->depth_state.depth_range_far;
+  *near_val = authority->big_state->depth_state.depth_range_near;
+  *far_val = authority->big_state->depth_state.depth_range_far;
 }
 
 unsigned long
index 0071dc3..d3cf227 100644 (file)
@@ -1094,9 +1094,9 @@ cogl_material_get_depth_test_function (CoglHandle handle);
 /**
  * cogl_material_set_depth_range:
  * @handle: A CoglMaterial handle
- * @near: The near component of the desired depth range which will be
+ * @near_val: The near component of the desired depth range which will be
  * clamped to the range [0, 1]
- * @far: The far component of the desired depth range which will be
+ * @far_val: The far component of the desired depth range which will be
  * clamped to the range [0, 1]
  * @error: location to store an error of type #CoglError
  *
@@ -1128,15 +1128,15 @@ cogl_material_get_depth_test_function (CoglHandle handle);
  */
 gboolean
 cogl_material_set_depth_range (CoglHandle handle,
-                               float near,
-                               float far,
+                               float near_val,
+                               float far_val,
                                GError **error);
 
 /**
  * cogl_material_get_depth_range_mapping:
  * @handle: A CoglMaterial handle
- * @near: A pointer to store the near component of the depth range
- * @far: A pointer to store the far component of the depth range
+ * @near_val: A pointer to store the near component of the depth range
+ * @far_val: A pointer to store the far component of the depth range
  *
  * Gets the current range to which normalized depth values are mapped
  * before writing to the depth buffer. This corresponds to the range
@@ -1146,8 +1146,8 @@ cogl_material_set_depth_range (CoglHandle handle,
  */
 void
 cogl_material_get_depth_range (CoglHandle handle,
-                               float *near,
-                               float *far);
+                               float *near_val,
+                               float *far_val);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */