summaryrefslogtreecommitdiff
path: root/cogl/cogl-fixed.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2010-02-10 01:57:32 +0000
committerRobert Bragg <robert@linux.intel.com>2010-02-12 14:05:00 +0000
commit0f5f4e8645d12eb6c5ff99c13503f2380740bb10 (patch)
tree608ac1afdc5924f097bd6e140c6fc887070eb533 /cogl/cogl-fixed.h
parent10fa7c7ce9a69b733e4652a51e101a98911d5bb8 (diff)
downloadcogl-0f5f4e8645d12eb6c5ff99c13503f2380740bb10.tar.gz
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so this is a first pass at tidying things up by giving them some consistency. These changes are all consistent with how new code in Cogl is being written, but the style isn't consistently applied across all code yet. There are two parts to this patch; but since each one required a large amount of effort to maintain tidy indenting it made sense to combine the changes to reduce the time spent re indenting the same lines. The first change is to use a consistent style for declaring function prototypes in headers. Cogl headers now consistently use this style for prototypes: return_type cogl_function_name (CoglType arg0, CoglType arg1); Not everyone likes this style, but it seems that most of the currently active Cogl developers agree on it. The second change is to constrain the use of redundant glib data types in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all been replaced with int, unsigned int, float, long, unsigned long and char respectively. When talking about pixel data; use of guchar has been replaced with guint8, otherwise unsigned char can be used. The glib types that we continue to use for portability are gboolean, gint{8,16,32,64}, guint{8,16,32,64} and gsize. The general intention is that Cogl should look palatable to the widest range of C programmers including those outside the Gnome community so - especially for the public API - we want to minimize the number of foreign looking typedefs.
Diffstat (limited to 'cogl/cogl-fixed.h')
-rw-r--r--cogl/cogl-fixed.h72
1 files changed, 47 insertions, 25 deletions
diff --git a/cogl/cogl-fixed.h b/cogl/cogl-fixed.h
index 86843517..14ca419e 100644
--- a/cogl/cogl-fixed.h
+++ b/cogl/cogl-fixed.h
@@ -468,7 +468,8 @@ G_BEGIN_DECLS
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_sin (CoglFixed angle);
+CoglFixed
+cogl_fixed_sin (CoglFixed angle);
/**
* cogl_fixed_tan:
@@ -480,7 +481,8 @@ CoglFixed cogl_fixed_sin (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_tan (CoglFixed angle);
+CoglFixed
+cogl_fixed_tan (CoglFixed angle);
/**
* cogl_fixed_cos:
@@ -492,7 +494,7 @@ CoglFixed cogl_fixed_tan (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_cos (CoglFixed angle);
+CoglFixed cogl_fixed_cos (CoglFixed angle);
/**
* cogl_fixed_atani:
@@ -504,7 +506,8 @@ CoglFixed cogl_fixed_cos (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_atani (CoglFixed a);
+CoglFixed
+cogl_fixed_atani (CoglFixed a);
/**
* cogl_fixed_atan2:
@@ -519,19 +522,25 @@ CoglFixed cogl_fixed_atani (CoglFixed a);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_atan2 (CoglFixed a,
- CoglFixed b);
+CoglFixed
+cogl_fixed_atan2 (CoglFixed a,
+ CoglFixed b);
/*< public >*/
/* Fixed point math routines */
-G_INLINE_FUNC CoglFixed cogl_fixed_mul (CoglFixed a,
- CoglFixed b);
-G_INLINE_FUNC CoglFixed cogl_fixed_div (CoglFixed a,
- CoglFixed b);
-G_INLINE_FUNC CoglFixed cogl_fixed_mul_div (CoglFixed a,
- CoglFixed b,
- CoglFixed c);
+G_INLINE_FUNC CoglFixed
+cogl_fixed_mul (CoglFixed a,
+ CoglFixed b);
+
+G_INLINE_FUNC CoglFixed
+cogl_fixed_div (CoglFixed a,
+ CoglFixed b);
+
+G_INLINE_FUNC CoglFixed
+cogl_fixed_mul_div (CoglFixed a,
+ CoglFixed b,
+ CoglFixed c);
/**
* COGL_SQRTI_ARG_MAX:
@@ -585,7 +594,8 @@ G_INLINE_FUNC CoglFixed cogl_fixed_mul_div (CoglFixed a,
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_sqrt (CoglFixed x);
+CoglFixed
+cogl_fixed_sqrt (CoglFixed x);
/**
* cogl_fixed_log2:
@@ -600,7 +610,8 @@ CoglFixed cogl_fixed_sqrt (CoglFixed x);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_log2 (guint x);
+CoglFixed
+cogl_fixed_log2 (unsigned int x);
/**
* cogl_fixed_pow2:
@@ -615,7 +626,8 @@ CoglFixed cogl_fixed_log2 (guint x);
*
* Since: 1.0
*/
-guint cogl_fixed_pow2 (CoglFixed x);
+unsigned int
+cogl_fixed_pow2 (CoglFixed x);
/**
* cogl_fixed_pow:
@@ -628,8 +640,9 @@ guint cogl_fixed_pow2 (CoglFixed x);
*
* Since: 1.0
*/
-guint cogl_fixed_pow (guint x,
- CoglFixed y);
+unsigned int
+cogl_fixed_pow (unsigned int x,
+ CoglFixed y);
/**
* cogl_sqrti:
@@ -647,7 +660,8 @@ guint cogl_fixed_pow (guint x,
*
* Since: 1.0
*/
-gint cogl_sqrti (gint x);
+int
+cogl_sqrti (int x);
/**
* COGL_ANGLE_FROM_DEG:
@@ -700,7 +714,8 @@ gint cogl_sqrti (gint x);
*
* Since: 1.0
*/
-CoglFixed cogl_angle_sin (CoglAngle angle);
+CoglFixed
+cogl_angle_sin (CoglAngle angle);
/**
* cogl_angle_tan:
@@ -712,7 +727,8 @@ CoglFixed cogl_angle_sin (CoglAngle angle);
*
* Since: 1.0
*/
-CoglFixed cogl_angle_tan (CoglAngle angle);
+CoglFixed
+cogl_angle_tan (CoglAngle angle);
/**
* cogl_angle_cos:
@@ -724,7 +740,8 @@ CoglFixed cogl_angle_tan (CoglAngle angle);
*
* Since: 1.0
*/
-CoglFixed cogl_angle_cos (CoglAngle angle);
+CoglFixed
+cogl_angle_cos (CoglAngle angle);
/*< private >*/
@@ -773,9 +790,14 @@ cogl_fixed_mul_div (CoglFixed a,
}
#endif
-extern CoglFixed cogl_double_to_fixed (double value);
-extern gint cogl_double_to_int (double value);
-extern guint cogl_double_to_unit (double value);
+CoglFixed
+cogl_double_to_fixed (double value);
+
+int
+cogl_double_to_int (double value);
+
+unsigned int
+cogl_double_to_unit (double value);
G_END_DECLS