summaryrefslogtreecommitdiff
path: root/tests/conform
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-04-16 21:56:40 +0100
committerRobert Bragg <robert@linux.intel.com>2012-04-18 14:24:02 +0100
commit5967dad2400d32ca6319cef6cb572e81bf2c15f0 (patch)
treeeb41b182a0802cbe95fb2de0c018390f254222e4 /tests/conform
parent6ed3aaf4be21d605a1ed3176b3ea825933f85cf0 (diff)
downloadcogl-5967dad2400d32ca6319cef6cb572e81bf2c15f0.tar.gz
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib data types such as gint or gchar etc because we feel that they make the code look unnecessarily foreign to developers coming from outside of the Gnome developer community. Note: When we tried to find the historical rationale for the types we just found that they were apparently only added for consistent syntax highlighting which didn't seem that compelling. Up until now we have been continuing to use some of the platform specific type such as gint{8,16,32,64} and gsize but this patch switches us over to using the standard c99 equivalents instead so we can further ensure that our code looks familiar to the widest range of C developers who might potentially contribute to Cogl. So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this switches all Cogl code to instead use the int{8,16,32,64}_t and uint{8,16,32,64}_t c99 types instead. Instead of gsize we now use size_t For now we are not going to use the c99 _Bool type and instead we have introduced a new CoglBool type to use instead of gboolean. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'tests/conform')
-rw-r--r--tests/conform/test-atlas-migration.c4
-rw-r--r--tests/conform/test-backface-culling.c6
-rw-r--r--tests/conform/test-bitmask.c2
-rw-r--r--tests/conform/test-blend-strings.c62
-rw-r--r--tests/conform/test-color-mask.c2
-rw-r--r--tests/conform/test-custom-attributes.c8
-rw-r--r--tests/conform/test-depth-test.c24
-rw-r--r--tests/conform/test-just-vertex-shader.c2
-rw-r--r--tests/conform/test-materials.c12
-rw-r--r--tests/conform/test-multitexture.c18
-rw-r--r--tests/conform/test-npot-texture.c8
-rw-r--r--tests/conform/test-offscreen.c4
-rw-r--r--tests/conform/test-path.c6
-rw-r--r--tests/conform/test-pipeline-uniforms.c2
-rw-r--r--tests/conform/test-pipeline-user-matrix.c8
-rw-r--r--tests/conform/test-pixel-buffer.c8
-rw-r--r--tests/conform/test-point-size.c4
-rw-r--r--tests/conform/test-point-sprite.c4
-rw-r--r--tests/conform/test-premult.c16
-rw-r--r--tests/conform/test-primitive.c26
-rw-r--r--tests/conform/test-read-texture-formats.c30
-rw-r--r--tests/conform/test-readpixels.c8
-rw-r--r--tests/conform/test-snippets.c2
-rw-r--r--tests/conform/test-sub-texture.c22
-rw-r--r--tests/conform/test-texture-3d.c6
-rw-r--r--tests/conform/test-texture-get-set-data.c2
-rw-r--r--tests/conform/test-texture-mipmaps.c6
-rw-r--r--tests/conform/test-texture-pixmap-x11.c12
-rw-r--r--tests/conform/test-texture-rectangle.c12
-rw-r--r--tests/conform/test-utils.c24
-rw-r--r--tests/conform/test-utils.h10
-rw-r--r--tests/conform/test-viewport.c22
-rw-r--r--tests/conform/test-wrap-modes.c6
-rw-r--r--tests/conform/test-write-texture-formats.c30
34 files changed, 209 insertions, 209 deletions
diff --git a/tests/conform/test-atlas-migration.c b/tests/conform/test-atlas-migration.c
index 2e18b963..56be0605 100644
--- a/tests/conform/test-atlas-migration.c
+++ b/tests/conform/test-atlas-migration.c
@@ -20,7 +20,7 @@ create_texture (int size)
{
CoglHandle texture;
const ClutterColor *color;
- guint8 *data, *p;
+ uint8_t *data, *p;
int x, y;
/* Create a red, green or blue texture depending on the size */
@@ -67,7 +67,7 @@ create_texture (int size)
static void
verify_texture (CoglHandle texture, int size)
{
- guint8 *data, *p;
+ uint8_t *data, *p;
int x, y;
const ClutterColor *color;
diff --git a/tests/conform/test-backface-culling.c b/tests/conform/test-backface-culling.c
index 5f61a518..55b71927 100644
--- a/tests/conform/test-backface-culling.c
+++ b/tests/conform/test-backface-culling.c
@@ -25,7 +25,7 @@ typedef struct _TestState
static void
validate_part (CoglFramebuffer *framebuffer,
- int xnum, int ynum, gboolean shown)
+ int xnum, int ynum, CoglBool shown)
{
test_utils_check_region (framebuffer,
xnum * TEXTURE_RENDER_SIZE + TEST_INSET,
@@ -120,7 +120,7 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset)
for (draw_num = 0; draw_num < 8; draw_num++)
{
- gboolean cull_front, cull_back;
+ CoglBool cull_front, cull_back;
CoglPipelineCullFaceMode cull_mode;
cull_mode = CULL_FACE_MODE (draw_num);
@@ -150,7 +150,7 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset)
if (FRONT_WINDING (draw_num) == COGL_WINDING_CLOCKWISE)
{
- gboolean tmp = cull_front;
+ CoglBool tmp = cull_front;
cull_front = cull_back;
cull_back = tmp;
}
diff --git a/tests/conform/test-bitmask.c b/tests/conform/test-bitmask.c
index c8521802..33f08804 100644
--- a/tests/conform/test-bitmask.c
+++ b/tests/conform/test-bitmask.c
@@ -25,7 +25,7 @@ typedef struct
int *bits;
} CheckData;
-static gboolean
+static CoglBool
check_bit (int bit_num, void *user_data)
{
CheckData *data = user_data;
diff --git a/tests/conform/test-blend-strings.c b/tests/conform/test-blend-strings.c
index 84fa6d88..ad111090 100644
--- a/tests/conform/test-blend-strings.c
+++ b/tests/conform/test-blend-strings.c
@@ -29,31 +29,31 @@ static void
test_blend (TestState *state,
int x,
int y,
- guint32 src_color,
- guint32 dst_color,
+ uint32_t src_color,
+ uint32_t dst_color,
const char *blend_string,
- guint32 blend_constant,
- guint32 expected_result)
+ uint32_t blend_constant,
+ uint32_t expected_result)
{
/* src color */
- guint8 Sr = MASK_RED (src_color);
- guint8 Sg = MASK_GREEN (src_color);
- guint8 Sb = MASK_BLUE (src_color);
- guint8 Sa = MASK_ALPHA (src_color);
+ uint8_t Sr = MASK_RED (src_color);
+ uint8_t Sg = MASK_GREEN (src_color);
+ uint8_t Sb = MASK_BLUE (src_color);
+ uint8_t Sa = MASK_ALPHA (src_color);
/* dest color */
- guint8 Dr = MASK_RED (dst_color);
- guint8 Dg = MASK_GREEN (dst_color);
- guint8 Db = MASK_BLUE (dst_color);
- guint8 Da = MASK_ALPHA (dst_color);
+ uint8_t Dr = MASK_RED (dst_color);
+ uint8_t Dg = MASK_GREEN (dst_color);
+ uint8_t Db = MASK_BLUE (dst_color);
+ uint8_t Da = MASK_ALPHA (dst_color);
/* blend constant - when applicable */
- guint8 Br = MASK_RED (blend_constant);
- guint8 Bg = MASK_GREEN (blend_constant);
- guint8 Bb = MASK_BLUE (blend_constant);
- guint8 Ba = MASK_ALPHA (blend_constant);
+ uint8_t Br = MASK_RED (blend_constant);
+ uint8_t Bg = MASK_GREEN (blend_constant);
+ uint8_t Bb = MASK_BLUE (blend_constant);
+ uint8_t Ba = MASK_ALPHA (blend_constant);
CoglColor blend_const_color;
CoglPipeline *pipeline;
- gboolean status;
+ CoglBool status;
GError *error = NULL;
int y_off;
int x_off;
@@ -123,13 +123,13 @@ test_blend (TestState *state,
}
static CoglTexture *
-make_texture (guint32 color)
+make_texture (uint32_t color)
{
guchar *tex_data, *p;
- guint8 r = MASK_RED (color);
- guint8 g = MASK_GREEN (color);
- guint8 b = MASK_BLUE (color);
- guint8 a = MASK_ALPHA (color);
+ uint8_t r = MASK_RED (color);
+ uint8_t g = MASK_GREEN (color);
+ uint8_t b = MASK_BLUE (color);
+ uint8_t a = MASK_ALPHA (color);
CoglTexture *tex;
tex_data = g_malloc (QUAD_WIDTH * QUAD_WIDTH * 4);
@@ -161,23 +161,23 @@ static void
test_tex_combine (TestState *state,
int x,
int y,
- guint32 tex0_color,
- guint32 tex1_color,
- guint32 combine_constant,
+ uint32_t tex0_color,
+ uint32_t tex1_color,
+ uint32_t combine_constant,
const char *combine_string,
- guint32 expected_result)
+ uint32_t expected_result)
{
CoglTexture *tex0, *tex1;
/* combine constant - when applicable */
- guint8 Cr = MASK_RED (combine_constant);
- guint8 Cg = MASK_GREEN (combine_constant);
- guint8 Cb = MASK_BLUE (combine_constant);
- guint8 Ca = MASK_ALPHA (combine_constant);
+ uint8_t Cr = MASK_RED (combine_constant);
+ uint8_t Cg = MASK_GREEN (combine_constant);
+ uint8_t Cb = MASK_BLUE (combine_constant);
+ uint8_t Ca = MASK_ALPHA (combine_constant);
CoglColor combine_const_color;
CoglPipeline *pipeline;
- gboolean status;
+ CoglBool status;
GError *error = NULL;
int y_off;
int x_off;
diff --git a/tests/conform/test-color-mask.c b/tests/conform/test-color-mask.c
index f49d9dd5..9068363d 100644
--- a/tests/conform/test-color-mask.c
+++ b/tests/conform/test-color-mask.c
@@ -56,7 +56,7 @@ paint (TestState *state)
/* Verify all of the fbos drew the right color */
for (i = 0; i < NUM_FBOS; i++)
{
- guint8 expected_colors[NUM_FBOS][4] =
+ uint8_t expected_colors[NUM_FBOS][4] =
{ { 0xff, 0x00, 0x00, 0xff },
{ 0x00, 0xff, 0x00, 0xff },
{ 0x00, 0x00, 0xff, 0xff } };
diff --git a/tests/conform/test-custom-attributes.c b/tests/conform/test-custom-attributes.c
index 44327d3e..7c75149c 100644
--- a/tests/conform/test-custom-attributes.c
+++ b/tests/conform/test-custom-attributes.c
@@ -11,19 +11,19 @@ typedef struct _TestState
typedef struct
{
- gint16 x, y;
+ int16_t x, y;
float r, g, b, a;
} FloatVert;
typedef struct
{
- gint16 x, y;
- guint8 r, g, b, a;
+ int16_t x, y;
+ uint8_t r, g, b, a;
} ByteVert;
typedef struct
{
- gint16 x, y;
+ int16_t x, y;
} ShortVert;
static void
diff --git a/tests/conform/test-depth-test.c b/tests/conform/test-depth-test.c
index 41bdc58d..8efff4d7 100644
--- a/tests/conform/test-depth-test.c
+++ b/tests/conform/test-depth-test.c
@@ -23,26 +23,26 @@ typedef struct _TestState
typedef struct
{
- guint32 color;
+ uint32_t color;
float depth;
- gboolean test_enable;
+ CoglBool test_enable;
CoglDepthTestFunction test_function;
- gboolean write_enable;
+ CoglBool write_enable;
float range_near;
float range_far;
} TestDepthState;
-static gboolean
+static CoglBool
draw_rectangle (TestState *state,
int x,
int y,
TestDepthState *rect_state,
- gboolean legacy_mode)
+ CoglBool legacy_mode)
{
- guint8 Cr = MASK_RED (rect_state->color);
- guint8 Cg = MASK_GREEN (rect_state->color);
- guint8 Cb = MASK_BLUE (rect_state->color);
- guint8 Ca = MASK_ALPHA (rect_state->color);
+ uint8_t Cr = MASK_RED (rect_state->color);
+ uint8_t Cg = MASK_GREEN (rect_state->color);
+ uint8_t Cb = MASK_BLUE (rect_state->color);
+ uint8_t Ca = MASK_ALPHA (rect_state->color);
CoglPipeline *pipeline;
CoglDepthState depth_state;
@@ -101,10 +101,10 @@ test_depth (TestState *state,
TestDepthState *rect0_state,
TestDepthState *rect1_state,
TestDepthState *rect2_state,
- gboolean legacy_mode,
- guint32 expected_result)
+ CoglBool legacy_mode,
+ uint32_t expected_result)
{
- gboolean missing_feature = FALSE;
+ CoglBool missing_feature = FALSE;
if (rect0_state)
missing_feature |= !draw_rectangle (state, x, y, rect0_state, legacy_mode);
diff --git a/tests/conform/test-just-vertex-shader.c b/tests/conform/test-just-vertex-shader.c
index 0aa6f3ee..aa65996c 100644
--- a/tests/conform/test-just-vertex-shader.c
+++ b/tests/conform/test-just-vertex-shader.c
@@ -14,7 +14,7 @@ create_dummy_texture (void)
{
/* Create a dummy 1x1 green texture to replace the color from the
vertex shader */
- static const guint8 data[4] = { 0x00, 0xff, 0x00, 0xff };
+ static const uint8_t data[4] = { 0x00, 0xff, 0x00, 0xff };
return cogl_texture_new_from_data (1, 1, /* size */
COGL_TEXTURE_NONE,
diff --git a/tests/conform/test-materials.c b/tests/conform/test-materials.c
index ab483e85..7c1da2fc 100644
--- a/tests/conform/test-materials.c
+++ b/tests/conform/test-materials.c
@@ -26,7 +26,7 @@ typedef struct _TestState
} TestState;
static void
-check_quad (int quad_x, int quad_y, guint32 color)
+check_quad (int quad_x, int quad_y, uint32_t color)
{
test_utils_check_pixel (x * QUAD_WIDTH + (QUAD_WIDTH / 2),
y * QUAD_WIDTH + (QUAD_WIDTH / 2),
@@ -36,7 +36,7 @@ check_quad (int quad_x, int quad_y, guint32 color)
static void
test_material_with_primitives (TestState *state,
int x, int y,
- guint32 color)
+ uint32_t color)
{
CoglTextureVertex verts[4] = {
{ .x = 0, .y = 0, .z = 0 },
@@ -99,8 +99,8 @@ static void
test_using_all_layers (TestState *state, int x, int y)
{
CoglHandle material = cogl_material_new ();
- guint8 white_pixel[] = { 0xff, 0xff, 0xff, 0xff };
- guint8 red_pixel[] = { 0xff, 0x00, 0x00, 0xff };
+ uint8_t white_pixel[] = { 0xff, 0xff, 0xff, 0xff };
+ uint8_t red_pixel[] = { 0xff, 0x00, 0x00, 0xff };
CoglHandle white_texture;
CoglHandle red_texture;
GLint n_layers;
@@ -209,8 +209,8 @@ on_paint (ClutterActor *actor, TestState *state)
#endif
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-multitexture.c b/tests/conform/test-multitexture.c
index c0aa9c2b..aeb409cc 100644
--- a/tests/conform/test-multitexture.c
+++ b/tests/conform/test-multitexture.c
@@ -23,12 +23,12 @@ assert_region_color (int x,
int y,
int width,
int height,
- guint8 red,
- guint8 green,
- guint8 blue,
- guint8 alpha)
+ uint8_t red,
+ uint8_t green,
+ uint8_t blue,
+ uint8_t alpha)
{
- guint8 *data = g_malloc0 (width * height * 4);
+ uint8_t *data = g_malloc0 (width * height * 4);
cogl_read_pixels (x, y, width, height,
COGL_READ_PIXELS_COLOR_BUFFER,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
@@ -36,7 +36,7 @@ assert_region_color (int x,
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
{
- guint8 *pixel = &data[y * width * 4 + x * 4];
+ uint8_t *pixel = &data[y * width * 4 + x * 4];
#if 1
g_assert (pixel[RED] == red &&
pixel[GREEN] == green &&
@@ -103,7 +103,7 @@ on_paint (ClutterActor *actor, TestState *state)
{
CoglHandle tex0, tex1;
CoglHandle material;
- gboolean status;
+ CoglBool status;
GError *error = NULL;
float tex_coords[] = {
0, 0, 0.5, 0.5, /* tex0 */
@@ -164,8 +164,8 @@ on_paint (ClutterActor *actor, TestState *state)
#endif
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-npot-texture.c b/tests/conform/test-npot-texture.c
index 8687d632..8aca4df1 100644
--- a/tests/conform/test-npot-texture.c
+++ b/tests/conform/test-npot-texture.c
@@ -36,12 +36,12 @@ typedef struct _TestState
CoglHandle texture;
} TestState;
-static gboolean
+static CoglBool
validate_part (int xnum, int ynum, const ClutterColor *color)
{
guchar *pixels, *p;
ClutterActor *stage = clutter_stage_get_default ();
- gboolean ret = TRUE;
+ CoglBool ret = TRUE;
/* Read the appropriate part but skip out a few pixels around the
edges */
@@ -114,8 +114,8 @@ on_paint (ClutterActor *actor, TestState *state)
validate_result (state);
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-offscreen.c b/tests/conform/test-offscreen.c
index 6e7d3cc8..e75e9f33 100644
--- a/tests/conform/test-offscreen.c
+++ b/tests/conform/test-offscreen.c
@@ -16,7 +16,7 @@ static void
check_quadrant (TestState *state,
int qx,
int qy,
- guint32 expected_rgba)
+ uint32_t expected_rgba)
{
/* The quadrants are all stuffed into the top right corner of the
framebuffer */
@@ -150,7 +150,7 @@ test_flush (TestState *state)
1, 1, 15, 15, 0xff0000ff);
else if (i == 1)
{
- guint8 data[16 * 4 * 16];
+ uint8_t data[16 * 4 * 16];
int x, y;
/* Second time try reading back the texture contents */
diff --git a/tests/conform/test-path.c b/tests/conform/test-path.c
index b5f604e3..47dc3af8 100644
--- a/tests/conform/test-path.c
+++ b/tests/conform/test-path.c
@@ -31,7 +31,7 @@ draw_path_at (CoglPath *path, int x, int y)
static void
check_block (int block_x, int block_y, int block_mask)
{
- guint32 data[BLOCK_SIZE * BLOCK_SIZE];
+ uint32_t data[BLOCK_SIZE * BLOCK_SIZE];
int qx, qy;
/* Block mask represents which quarters of the block should be
@@ -43,7 +43,7 @@ check_block (int block_x, int block_y, int block_mask)
block_y * BLOCK_SIZE,
BLOCK_SIZE, BLOCK_SIZE,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- (guint8 *)data);
+ (uint8_t *)data);
for (qy = 0; qy < 2; qy++)
for (qx = 0; qx < 2; qx++)
@@ -55,7 +55,7 @@ check_block (int block_x, int block_y, int block_mask)
for (x = 0; x < BLOCK_SIZE / 2 - TEST_INSET * 2; x++)
for (y = 0; y < BLOCK_SIZE / 2 - TEST_INSET * 2; y++)
{
- const guint32 *p = data + (qx * BLOCK_SIZE / 2 +
+ const uint32_t *p = data + (qx * BLOCK_SIZE / 2 +
qy * BLOCK_SIZE * BLOCK_SIZE / 2 +
(x + TEST_INSET) +
(y + TEST_INSET) * BLOCK_SIZE);
diff --git a/tests/conform/test-pipeline-uniforms.c b/tests/conform/test-pipeline-uniforms.c
index 1f865695..c7aba236 100644
--- a/tests/conform/test-pipeline-uniforms.c
+++ b/tests/conform/test-pipeline-uniforms.c
@@ -340,7 +340,7 @@ paint (TestState *state)
}
static void
-check_pos (int pos, guint32 color)
+check_pos (int pos, uint32_t color)
{
test_utils_check_pixel (test_fb, pos * 10 + 5, 5, color);
}
diff --git a/tests/conform/test-pipeline-user-matrix.c b/tests/conform/test-pipeline-user-matrix.c
index 7b4199ad..6fe6187e 100644
--- a/tests/conform/test-pipeline-user-matrix.c
+++ b/tests/conform/test-pipeline-user-matrix.c
@@ -13,7 +13,7 @@ typedef struct _TestState
static void
validate_result (TestState *state)
{
- guint32 *pixels, *p;
+ uint32_t *pixels, *p;
char *screen_pixel;
const char *intended_pixel = "#ffffff";
@@ -25,7 +25,7 @@ validate_result (TestState *state)
cogl_framebuffer_read_pixels (test_fb,
0, 0, state->width, state->height,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- (guint8 *)pixels);
+ (uint8_t *)pixels);
for (p = pixels; p < pixels + state->width * state->height; p++)
{
@@ -39,14 +39,14 @@ static void
paint (TestState *state)
{
/* This texture is painted mirrored around the x-axis */
- guint8 data0[] = {
+ uint8_t data0[] = {
0xff, 0x00, 0x00, /* red -> becomes bottom left */
0x00, 0xff, 0x00, /* green -> becomes bottom right */
0x00, 0x00, 0xff, /* blue -> becomes top left */
0xff, 0x00, 0xff /* magenta -> becomes top right */
};
/* This texture is painted mirrored about the y-axis */
- guint8 data1[] = {
+ uint8_t data1[] = {
0x00, 0xff, 0x00, /* green -> becomes top right */
0xff, 0xff, 0x00, /* yellow -> becomes top left */
0xff, 0x00, 0xff, /* magenta -> becomes bottom right */
diff --git a/tests/conform/test-pixel-buffer.c b/tests/conform/test-pixel-buffer.c
index af4baef6..8d5550ac 100644
--- a/tests/conform/test-pixel-buffer.c
+++ b/tests/conform/test-pixel-buffer.c
@@ -15,7 +15,7 @@ enum
typedef struct test_tile
{
- guint8 color[4];
+ uint8_t color[4];
gfloat x, y;
CoglBuffer *buffer;
CoglTexture *texture;
@@ -51,7 +51,7 @@ create_map_tile (CoglContext *context,
guchar *map;
unsigned int i;
unsigned int stride;
- guint8 *line;
+ uint8_t *line;
bitmap = cogl_bitmap_new_with_size (context,
TILE_SIZE,
@@ -95,7 +95,7 @@ create_set_region_tile (CoglContext *context,
{
CoglBitmap *bitmap;
CoglBuffer *buffer;
- guint8 bottom_color[4];
+ uint8_t bottom_color[4];
unsigned int rowstride = 0;
guchar *data;
unsigned int i;
@@ -148,7 +148,7 @@ create_set_data_tile (CoglContext *context,
CoglBitmap *bitmap;
CoglBuffer *buffer;
unsigned int rowstride = 0;
- gboolean res;
+ CoglBool res;
guchar *data;
unsigned int i;
diff --git a/tests/conform/test-point-size.c b/tests/conform/test-point-size.c
index 84d5b321..01d126ee 100644
--- a/tests/conform/test-point-size.c
+++ b/tests/conform/test-point-size.c
@@ -34,8 +34,8 @@ verify_point_size (CoglFramebuffer *test_fb,
for (y = 0; y < 4; y++)
for (x = 0; x < 4; x++)
{
- gboolean in_point = x >= 1 && x <= 2 && y >= 1 && y <= 2;
- guint32 expected_pixel = in_point ? 0x00ff00ff : 0xff0000ff;
+ CoglBool in_point = x >= 1 && x <= 2 && y >= 1 && y <= 2;
+ uint32_t expected_pixel = in_point ? 0x00ff00ff : 0xff0000ff;
test_utils_check_pixel (test_fb,
calc_coord_offset (x_pos, x, point_size),
diff --git a/tests/conform/test-point-sprite.c b/tests/conform/test-point-sprite.c
index fd1b698e..c5effcdb 100644
--- a/tests/conform/test-point-sprite.c
+++ b/tests/conform/test-point-sprite.c
@@ -11,7 +11,7 @@ point =
0.0f, 0.0f
};
-static const guint8
+static const uint8_t
tex_data[3 * 2 * 2] =
{
0x00, 0x00, 0xff, 0x00, 0xff, 0x00,
@@ -27,7 +27,7 @@ test_point_sprite (void)
GError *error = NULL;
CoglTexture2D *tex_2d;
CoglPipeline *pipeline, *solid_pipeline;
- gboolean res;
+ CoglBool res;
cogl_framebuffer_orthographic (test_fb,
0, 0, /* x_1, y_1 */
diff --git a/tests/conform/test-premult.c b/tests/conform/test-premult.c
index 8344cfa0..fed93476 100644
--- a/tests/conform/test-premult.c
+++ b/tests/conform/test-premult.c
@@ -17,13 +17,13 @@
#define MASK_ALPHA(COLOR) (COLOR & 0xff)
static guchar *
-gen_tex_data (guint32 color)
+gen_tex_data (uint32_t color)
{
guchar *tex_data, *p;
- guint8 r = MASK_RED (color);
- guint8 g = MASK_GREEN (color);
- guint8 b = MASK_BLUE (color);
- guint8 a = MASK_ALPHA (color);
+ uint8_t r = MASK_RED (color);
+ uint8_t g = MASK_GREEN (color);
+ uint8_t b = MASK_BLUE (color);
+ uint8_t a = MASK_ALPHA (color);
tex_data = g_malloc (QUAD_WIDTH * QUAD_WIDTH * 4);
@@ -39,7 +39,7 @@ gen_tex_data (guint32 color)
}
static CoglTexture *
-make_texture (guint32 color,
+make_texture (uint32_t color,
CoglPixelFormat src_format,
CoglPixelFormat internal_format)
{
@@ -62,7 +62,7 @@ make_texture (guint32 color,
static void
set_region (CoglTexture *tex,
- guint32 color,
+ uint32_t color,
CoglPixelFormat format)
{
guchar *tex_data = gen_tex_data (color);
@@ -82,7 +82,7 @@ check_texture (CoglPipeline *pipeline,
int x,
int y,
CoglTexture *tex,
- guint32 expected_result)
+ uint32_t expected_result)
{
cogl_pipeline_set_layer_texture (pipeline, 0, COGL_TEXTURE (tex));
cogl_framebuffer_draw_rectangle (test_fb, pipeline,
diff --git a/tests/conform/test-primitive.c b/tests/conform/test-primitive.c
index 9b6eb2a2..bda6e41b 100644
--- a/tests/conform/test-primitive.c
+++ b/tests/conform/test-primitive.c
@@ -15,10 +15,10 @@ typedef struct _TestState
#define N_ATTRIBS 8
-typedef CoglPrimitive * (* TestPrimFunc) (CoglContext *ctx, guint32 *expected_color);
+typedef CoglPrimitive * (* TestPrimFunc) (CoglContext *ctx, uint32_t *expected_color);
static CoglPrimitive *
-test_prim_p2 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP2 verts[] =
{ { 0, 0 }, { 0, 10 }, { 10, 0 } };
@@ -30,7 +30,7 @@ test_prim_p2 (CoglContext *ctx, guint32 *expected_color)
}
static CoglPrimitive *
-test_prim_p3 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP3 verts[] =
{ { 0, 0, 0 }, { 0, 10, 0 }, { 10, 0, 0 } };
@@ -42,7 +42,7 @@ test_prim_p3 (CoglContext *ctx, guint32 *expected_color)
}
static CoglPrimitive *
-test_prim_p2c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2c4 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP2C4 verts[] =
{ { 0, 0, 255, 255, 0, 255 },
@@ -58,7 +58,7 @@ test_prim_p2c4 (CoglContext *ctx, guint32 *expected_color)
}
static CoglPrimitive *
-test_prim_p3c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3c4 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP3C4 verts[] =
{ { 0, 0, 0, 255, 255, 0, 255 },
@@ -74,7 +74,7 @@ test_prim_p3c4 (CoglContext *ctx, guint32 *expected_color)
}
static CoglPrimitive *
-test_prim_p2t2 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2t2 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP2T2 verts[] =
{ { 0, 0, 1, 0 },
@@ -90,7 +90,7 @@ test_prim_p2t2 (CoglContext *ctx, guint32 *expected_color)
}
static CoglPrimitive *
-test_prim_p3t2 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3t2 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP3T2 verts[] =
{ { 0, 0, 0, 1, 0 },
@@ -106,7 +106,7 @@ test_prim_p3t2 (CoglContext *ctx, guint32 *expected_color)
}
static CoglPrimitive *
-test_prim_p2t2c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2t2c4 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP2T2C4 verts[] =
{ { 0, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff },
@@ -123,7 +123,7 @@ test_prim_p2t2c4 (CoglContext *ctx, guint32 *expected_color)
}
static CoglPrimitive *
-test_prim_p3t2c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3t2c4 (CoglContext *ctx, uint32_t *expected_color)
{
static const CoglVertexP3T2C4 verts[] =
{ { 0, 0, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff },
@@ -157,7 +157,7 @@ test_paint (TestState *state)
{
CoglPipeline *pipeline;
CoglTexture *tex;
- guint8 tex_data[6];
+ uint8_t tex_data[6];
int i;
/* Create a two pixel texture. The first pixel is white and the
@@ -188,7 +188,7 @@ test_paint (TestState *state)
for (i = 0; i < G_N_ELEMENTS (test_prim_funcs); i++)
{
CoglPrimitive *prim;
- guint32 expected_color = PRIM_COLOR;
+ uint32_t expected_color = PRIM_COLOR;
prim = test_prim_funcs[i] (test_ctx, &expected_color);
@@ -205,7 +205,7 @@ test_paint (TestState *state)
cogl_object_unref (pipeline);
}
-static gboolean
+static CoglBool
get_attributes_cb (CoglPrimitive *prim,
CoglAttribute *attrib,
void *user_data)
@@ -232,7 +232,7 @@ compare_pointers (const void *a, const void *b)
static void
test_copy (TestState *state)
{
- static const guint16 indices_data[2] = { 1, 2 };
+ static const uint16_t indices_data[2] = { 1, 2 };
CoglAttributeBuffer *buffer =
cogl_attribute_buffer_new (test_ctx, 100, NULL);
CoglAttribute *attributes[N_ATTRIBS];
diff --git a/tests/conform/test-read-texture-formats.c b/tests/conform/test-read-texture-formats.c
index 92aa6d3e..c8d355a1 100644
--- a/tests/conform/test-read-texture-formats.c
+++ b/tests/conform/test-read-texture-formats.c
@@ -8,14 +8,14 @@
* pixel formats
*/
-static const guint8 tex_data[4] = { 0x12, 0x34, 0x56, 0x78 };
+static const uint8_t tex_data[4] = { 0x12, 0x34, 0x56, 0x78 };
static void
test_read_byte (CoglTexture2D *tex_2d,
CoglPixelFormat format,
- guint8 expected_byte)
+ uint8_t expected_byte)
{
- guint8 received_byte;
+ uint8_t received_byte;
cogl_texture_get_data (COGL_TEXTURE (tex_2d),
format,
@@ -32,8 +32,8 @@ test_read_short (CoglTexture2D *tex_2d,
{
va_list ap;
int bits;
- guint16 received_value;
- guint16 expected_value = 0;
+ uint16_t received_value;
+ uint16_t expected_value = 0;
char *received_value_str;
char *expected_value_str;
int bits_sum = 0;
@@ -41,7 +41,7 @@ test_read_short (CoglTexture2D *tex_2d,
cogl_texture_get_data (COGL_TEXTURE (tex_2d),
format,
2, /* rowstride */
- (guint8 *) &received_value);
+ (uint8_t *) &received_value);
va_start (ap, format);
@@ -67,9 +67,9 @@ test_read_short (CoglTexture2D *tex_2d,
static void
test_read_888 (CoglTexture2D *tex_2d,
CoglPixelFormat format,
- guint32 expected_pixel)
+ uint32_t expected_pixel)
{
- guint8 pixel[4];
+ uint8_t pixel[4];
cogl_texture_get_data (COGL_TEXTURE (tex_2d),
format,
@@ -82,16 +82,16 @@ test_read_888 (CoglTexture2D *tex_2d,
static void
test_read_8888 (CoglTexture2D *tex_2d,
CoglPixelFormat format,
- guint32 expected_pixel)
+ uint32_t expected_pixel)
{
- guint32 received_pixel;
+ uint32_t received_pixel;
char *received_value_str;
char *expected_value_str;
cogl_texture_get_data (COGL_TEXTURE (tex_2d),
format,
4, /* rowstride */
- (guint8 *) &received_pixel);
+ (uint8_t *) &received_pixel);
received_pixel = GUINT32_FROM_BE (received_pixel);
@@ -109,8 +109,8 @@ test_read_int (CoglTexture2D *tex_2d,
{
va_list ap;
int bits;
- guint32 received_value;
- guint32 expected_value = 0;
+ uint32_t received_value;
+ uint32_t expected_value = 0;
char *received_value_str;
char *expected_value_str;
int bits_sum = 0;
@@ -118,14 +118,14 @@ test_read_int (CoglTexture2D *tex_2d,
cogl_texture_get_data (COGL_TEXTURE (tex_2d),
format,
4, /* rowstride */
- (guint8 *) &received_value);
+ (uint8_t *) &received_value);
va_start (ap, format);
/* Convert the va args into a single 32-bit expected value */
while ((bits = va_arg (ap, int)) != -1)
{
- guint32 value = (va_arg (ap, int) * ((1 << bits) - 1) + 128) / 255;
+ uint32_t value = (va_arg (ap, int) * ((1 << bits) - 1) + 128) / 255;
bits_sum += bits;
diff --git a/tests/conform/test-readpixels.c b/tests/conform/test-readpixels.c
index c690a350..83a1712e 100644
--- a/tests/conform/test-readpixels.c
+++ b/tests/conform/test-readpixels.c
@@ -24,8 +24,8 @@ on_paint (ClutterActor *actor, void *state)
guchar *data;
CoglHandle tex;
CoglHandle offscreen;
- guint32 *pixels;
- guint8 *pixelsc;
+ uint32_t *pixels;
+ uint8_t *pixelsc;
/* Save the Clutter viewport/matrices and load identity matrices */
@@ -138,8 +138,8 @@ on_paint (ClutterActor *actor, void *state)
clutter_main_quit ();
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-snippets.c b/tests/conform/test-snippets.c
index ca80063d..072303f1 100644
--- a/tests/conform/test-snippets.c
+++ b/tests/conform/test-snippets.c
@@ -16,7 +16,7 @@ create_texture_pipeline (TestState *state)
{
CoglPipeline *pipeline;
CoglTexture *tex;
- static const guint8 tex_data[] =
+ static const uint8_t tex_data[] =
{
0xff, 0x00, 0x00, 0xff, /* red */ 0x00, 0xff, 0x00, 0xff, /* green */
0x00, 0x00, 0xff, 0xff, /* blue */ 0xff, 0xff, 0x00, 0xff, /* yellow */
diff --git a/tests/conform/test-sub-texture.c b/tests/conform/test-sub-texture.c
index ca2cca4a..22a88731 100644
--- a/tests/conform/test-sub-texture.c
+++ b/tests/conform/test-sub-texture.c
@@ -11,7 +11,7 @@
#define TEST_INSET 1
-static const guint32
+static const uint32_t
corner_colors[SOURCE_DIVISIONS_X * SOURCE_DIVISIONS_Y] =
{
0xff0000ff, /* red top left */
@@ -29,7 +29,7 @@ static CoglTexture2D *
create_source (TestState *state)
{
int dx, dy;
- guint8 *data = g_malloc (SOURCE_SIZE * SOURCE_SIZE * 4);
+ uint8_t *data = g_malloc (SOURCE_SIZE * SOURCE_SIZE * 4);
CoglTexture2D *tex;
GError *error = NULL;
@@ -38,7 +38,7 @@ create_source (TestState *state)
for (dy = 0; dy < SOURCE_DIVISIONS_Y; dy++)
for (dx = 0; dx < SOURCE_DIVISIONS_X; dx++)
{
- guint8 *p = (data + dy * DIVISION_HEIGHT * SOURCE_SIZE * 4 +
+ uint8_t *p = (data + dy * DIVISION_HEIGHT * SOURCE_SIZE * 4 +
dx * DIVISION_WIDTH * 4);
int x, y;
@@ -46,7 +46,7 @@ create_source (TestState *state)
{
for (x = 0; x < DIVISION_WIDTH; x++)
{
- guint32 color = GUINT32_FROM_BE (corner_colors[dx + dy * SOURCE_DIVISIONS_X]);
+ uint32_t color = GUINT32_FROM_BE (corner_colors[dx + dy * SOURCE_DIVISIONS_X]);
memcpy (p, &color, 4);
p += 4;
}
@@ -70,7 +70,7 @@ static CoglTexture2D *
create_test_texture (TestState *state)
{
CoglTexture2D *tex;
- guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+ uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
int x, y;
GError *error = NULL;
@@ -163,7 +163,7 @@ paint (TestState *state)
static void
validate_part (int xpos, int ypos,
int width, int height,
- guint32 color)
+ uint32_t color)
{
test_utils_check_region (test_fb,
xpos + TEST_INSET,
@@ -173,10 +173,10 @@ validate_part (int xpos, int ypos,
color);
}
-static guint8 *
+static uint8_t *
create_update_data (void)
{
- guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+ uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
int x, y;
/* Create some image data that is 256x256 where the blue component
@@ -201,7 +201,7 @@ validate_result (TestState *state)
int i, division_num, x, y;
CoglTexture2D *test_tex;
CoglSubTexture *sub_texture;
- guint8 *texture_data, *p;
+ uint8_t *texture_data, *p;
int tex_width, tex_height;
/* Sub texture of the bottom right corner of the texture */
@@ -255,8 +255,8 @@ validate_result (TestState *state)
DIVISION_WIDTH);
int div_y = ((y * SOURCE_SIZE / 2 / tex_height + SOURCE_SIZE / 4) /
DIVISION_HEIGHT);
- guint32 reference = corner_colors[div_x + div_y * SOURCE_DIVISIONS_X] >> 8;
- guint32 color = GUINT32_FROM_BE (*((guint32 *)p)) >> 8;
+ uint32_t reference = corner_colors[div_x + div_y * SOURCE_DIVISIONS_X] >> 8;
+ uint32_t color = GUINT32_FROM_BE (*((uint32_t *)p)) >> 8;
g_assert (color == reference);
p += 4;
}
diff --git a/tests/conform/test-texture-3d.c b/tests/conform/test-texture-3d.c
index fb9d3f55..c365dc7d 100644
--- a/tests/conform/test-texture-3d.c
+++ b/tests/conform/test-texture-3d.c
@@ -21,8 +21,8 @@ static CoglTexture3D *
create_texture_3d (CoglContext *context)
{
int x, y, z;
- guint8 *data = g_malloc (TEX_IMAGE_STRIDE * TEX_DEPTH);
- guint8 *p = data;
+ uint8_t *data = g_malloc (TEX_IMAGE_STRIDE * TEX_DEPTH);
+ uint8_t *p = data;
CoglTexture3D *tex;
GError *error = NULL;
@@ -199,7 +199,7 @@ test_multi_texture (TestState *state)
CoglPipeline *pipeline;
CoglTexture3D *tex_3d;
CoglTexture2D *tex_2d;
- guint8 tex_data[4];
+ uint8_t tex_data[4];
cogl_framebuffer_clear4f (test_fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1);
diff --git a/tests/conform/test-texture-get-set-data.c b/tests/conform/test-texture-get-set-data.c
index 94e53a99..6cb4f99c 100644
--- a/tests/conform/test-texture-get-set-data.c
+++ b/tests/conform/test-texture-get-set-data.c
@@ -8,7 +8,7 @@ static void
check_texture (int width, int height, CoglTextureFlags flags)
{
CoglHandle tex;
- guint8 *data, *p;
+ uint8_t *data, *p;
int y, x;
p = data = g_malloc (width * height * 4);
diff --git a/tests/conform/test-texture-mipmaps.c b/tests/conform/test-texture-mipmaps.c
index eda31ba0..b6cd421b 100644
--- a/tests/conform/test-texture-mipmaps.c
+++ b/tests/conform/test-texture-mipmaps.c
@@ -49,7 +49,7 @@ on_paint (ClutterActor *actor, TestState *state)
{
CoglHandle tex;
CoglHandle material;
- guint8 pixels[8];
+ uint8_t pixels[8];
tex = make_texture ();
material = cogl_material_new ();
@@ -94,8 +94,8 @@ on_paint (ClutterActor *actor, TestState *state)
#endif
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-texture-pixmap-x11.c b/tests/conform/test-texture-pixmap-x11.c
index 7f6d81c4..4e8d5505 100644
--- a/tests/conform/test-texture-pixmap-x11.c
+++ b/tests/conform/test-texture-pixmap-x11.c
@@ -83,10 +83,10 @@ update_pixmap (TestState *state)
XFreeGC (state->display, black_gc);
}
-static gboolean
+static CoglBool
check_paint (TestState *state, int x, int y, int scale)
{
- guint8 *data, *p, update_value = 0;
+ uint8_t *data, *p, update_value = 0;
p = data = g_malloc (PIXMAP_WIDTH * PIXMAP_HEIGHT * 4);
@@ -117,7 +117,7 @@ check_paint (TestState *state, int x, int y, int scale)
}
else
{
- guint8 value = ((grid_x ^ grid_y) & 1) ? 0x00 : 0xff;
+ uint8_t value = ((grid_x ^ grid_y) & 1) ? 0x00 : 0xff;
g_assert_cmpint (*(p++), ==, value);
g_assert_cmpint (*(p++), ==, value);
g_assert_cmpint (*(p++), ==, value);
@@ -167,7 +167,7 @@ on_paint (ClutterActor *actor, TestState *state)
if (state->frame_count >= 5)
{
- gboolean big_updated, small_updated;
+ CoglBool big_updated, small_updated;
big_updated = check_paint (state, 0, 0, 1);
small_updated = check_paint (state, 0, PIXMAP_HEIGHT, 4);
@@ -187,8 +187,8 @@ on_paint (ClutterActor *actor, TestState *state)
state->frame_count++;
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-texture-rectangle.c b/tests/conform/test-texture-rectangle.c
index 3aadd040..77662977 100644
--- a/tests/conform/test-texture-rectangle.c
+++ b/tests/conform/test-texture-rectangle.c
@@ -21,7 +21,7 @@ create_source_rect (void)
GLint prev_unpack_skip_rows;
GLint prev_unpack_skip_pixles;
GLint prev_rectangle_binding;
- guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+ uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
CoglHandle tex;
GLuint gl_tex;
@@ -87,7 +87,7 @@ static CoglHandle
create_source_2d (void)
{
int x, y;
- guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+ uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
CoglHandle tex;
for (y = 0; y < 256; y++)
@@ -160,7 +160,7 @@ draw_frame (TestState *state)
static void
validate_result (TestState *state)
{
- guint8 *data, *p;
+ uint8_t *data, *p;
int x, y;
p = data = g_malloc (512 * 384 * 4);
@@ -202,15 +202,15 @@ on_paint (ClutterActor *actor, TestState *state)
validate_result (state);
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
return TRUE;
}
-static gboolean
+static CoglBool
check_rectangle_extension (void)
{
static const char rect_extension[] = "GL_ARB_texture_rectangle";
diff --git a/tests/conform/test-utils.c b/tests/conform/test-utils.c
index 500ad23d..00ae9a39 100644
--- a/tests/conform/test-utils.c
+++ b/tests/conform/test-utils.c
@@ -6,7 +6,7 @@
#define FB_WIDTH 512
#define FB_HEIGHT 512
-static gboolean cogl_test_is_verbose;
+static CoglBool cogl_test_is_verbose;
CoglContext *test_ctx;
CoglFramebuffer *test_fb;
@@ -19,7 +19,7 @@ test_utils_init (TestFlags flags)
CoglOnscreen *onscreen = NULL;
CoglDisplay *display;
CoglRenderer *renderer;
- gboolean missing_requirement = FALSE;
+ CoglBool missing_requirement = FALSE;
if (counter != 0)
g_critical ("We don't support running more than one test at a time\n"
@@ -125,21 +125,21 @@ test_utils_fini (void)
cogl_object_unref (test_ctx);
}
-static gboolean
+static CoglBool
compare_component (int a, int b)
{
return ABS (a - b) <= 1;
}
void
-test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel)
+test_utils_compare_pixel (const uint8_t *screen_pixel, uint32_t expected_pixel)
{
/* Compare each component with a small fuzz factor */
if (!compare_component (screen_pixel[0], expected_pixel >> 24) ||
!compare_component (screen_pixel[1], (expected_pixel >> 16) & 0xff) ||
!compare_component (screen_pixel[2], (expected_pixel >> 8) & 0xff))
{
- guint32 screen_pixel_num = GUINT32_FROM_BE (*(guint32 *) screen_pixel);
+ uint32_t screen_pixel_num = GUINT32_FROM_BE (*(uint32_t *) screen_pixel);
char *screen_pixel_string =
g_strdup_printf ("#%06x", screen_pixel_num >> 8);
char *expected_pixel_string =
@@ -154,9 +154,9 @@ test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel)
void
test_utils_check_pixel (CoglFramebuffer *fb,
- int x, int y, guint32 expected_pixel)
+ int x, int y, uint32_t expected_pixel)
{
- guint8 pixel[4];
+ uint8_t pixel[4];
cogl_framebuffer_read_pixels (fb,
x, y, 1, 1,
@@ -177,9 +177,9 @@ void
test_utils_check_region (CoglFramebuffer *fb,
int x, int y,
int width, int height,
- guint32 expected_rgba)
+ uint32_t expected_rgba)
{
- guint8 *pixels, *p;
+ uint8_t *pixels, *p;
pixels = p = g_malloc (width * height * 4);
cogl_framebuffer_read_pixels (fb,
@@ -203,7 +203,7 @@ test_utils_check_region (CoglFramebuffer *fb,
CoglTexture *
test_utils_create_color_texture (CoglContext *context,
- guint32 color)
+ uint32_t color)
{
CoglTexture2D *tex_2d;
@@ -214,13 +214,13 @@ test_utils_create_color_texture (CoglContext *context,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
4, /* rowstride */
- (guint8 *) &color,
+ (uint8_t *) &color,
NULL);
return COGL_TEXTURE (tex_2d);
}
-gboolean
+CoglBool
cogl_test_verbose (void)
{
return cogl_test_is_verbose;
diff --git a/tests/conform/test-utils.h b/tests/conform/test-utils.h
index c6909d79..21141e76 100644
--- a/tests/conform/test-utils.h
+++ b/tests/conform/test-utils.h
@@ -41,7 +41,7 @@ test_utils_fini (void);
*/
void
test_utils_check_pixel (CoglFramebuffer *framebuffer,
- int x, int y, guint32 expected_pixel);
+ int x, int y, uint32_t expected_pixel);
/*
* test_utils_check_pixel:
@@ -79,7 +79,7 @@ void
test_utils_check_region (CoglFramebuffer *framebuffer,
int x, int y,
int width, int height,
- guint32 expected_rgba);
+ uint32_t expected_rgba);
/*
* test_utils_compare_pixel:
@@ -92,7 +92,7 @@ test_utils_check_region (CoglFramebuffer *framebuffer,
* message.
*/
void
-test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel);
+test_utils_compare_pixel (const uint8_t *screen_pixel, uint32_t expected_pixel);
/*
* test_utils_create_color_texture:
@@ -103,13 +103,13 @@ test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel);
*/
CoglTexture *
test_utils_create_color_texture (CoglContext *context,
- guint32 color);
+ uint32_t color);
/* cogl_test_verbose:
*
* Queries if the user asked for verbose output or not.
*/
-gboolean
+CoglBool
cogl_test_verbose (void);
#endif /* _TEST_UTILS_H_ */
diff --git a/tests/conform/test-viewport.c b/tests/conform/test-viewport.c
index ef22d69c..3e610e85 100644
--- a/tests/conform/test-viewport.c
+++ b/tests/conform/test-viewport.c
@@ -19,12 +19,12 @@ assert_region_color (int x,
int y,
int width,
int height,
- guint8 red,
- guint8 green,
- guint8 blue,
- guint8 alpha)
+ uint8_t red,
+ uint8_t green,
+ uint8_t blue,
+ uint8_t alpha)
{
- guint8 *data = g_malloc0 (width * height * 4);
+ uint8_t *data = g_malloc0 (width * height * 4);
cogl_read_pixels (x, y, width, height,
COGL_READ_PIXELS_COLOR_BUFFER,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
@@ -32,7 +32,7 @@ assert_region_color (int x,
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
{
- guint8 *pixel = &data[y*width*4 + x*4];
+ uint8_t *pixel = &data[y*width*4 + x*4];
#if 1
g_assert (pixel[RED] == red &&
pixel[GREEN] == green &&
@@ -48,9 +48,9 @@ assert_rectangle_color_and_black_border (int x,
int y,
int width,
int height,
- guint8 red,
- guint8 green,
- guint8 blue)
+ uint8_t red,
+ uint8_t green,
+ uint8_t blue)
{
/* check the rectangle itself... */
assert_region_color (x, y, width, height, red, green, blue, 0xff);
@@ -376,8 +376,8 @@ on_paint (ClutterActor *actor, void *state)
clutter_main_quit ();
}
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-wrap-modes.c b/tests/conform/test-wrap-modes.c
index b26a3ec3..903f0b85 100644
--- a/tests/conform/test-wrap-modes.c
+++ b/tests/conform/test-wrap-modes.c
@@ -15,7 +15,7 @@ typedef struct _TestState
static CoglTexture *
create_texture (CoglTextureFlags flags)
{
- guint8 *data = g_malloc (TEX_SIZE * TEX_SIZE * 4), *p = data;
+ uint8_t *data = g_malloc (TEX_SIZE * TEX_SIZE * 4), *p = data;
CoglTexture *tex;
int x, y;
@@ -116,7 +116,7 @@ static const CoglTextureVertex vertices[4] =
static void
validate_set (TestState *state, int offset)
{
- guint8 data[TEX_SIZE * 2 * TEX_SIZE * 2 * 4], *p;
+ uint8_t data[TEX_SIZE * 2 * TEX_SIZE * 2 * 4], *p;
int x, y, i;
for (i = 0; i < G_N_ELEMENTS (wrap_modes); i += 2)
@@ -136,7 +136,7 @@ validate_set (TestState *state, int offset)
for (y = 0; y < TEX_SIZE * 2; y++)
for (x = 0; x < TEX_SIZE * 2; x++)
{
- guint8 green, blue;
+ uint8_t green, blue;
if (x < TEX_SIZE ||
wrap_mode_s == COGL_PIPELINE_WRAP_MODE_REPEAT ||
diff --git a/tests/conform/test-write-texture-formats.c b/tests/conform/test-write-texture-formats.c
index de40af9e..aac32903 100644
--- a/tests/conform/test-write-texture-formats.c
+++ b/tests/conform/test-write-texture-formats.c
@@ -10,16 +10,16 @@
static void
test_color (CoglTexture *texture,
- guint32 expected_pixel)
+ uint32_t expected_pixel)
{
- guint32 received_pixel;
+ uint32_t received_pixel;
char *received_value_str;
char *expected_value_str;
cogl_texture_get_data (texture,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
4, /* rowstride */
- (guint8 *) &received_pixel);
+ (uint8_t *) &received_pixel);
received_pixel = GUINT32_FROM_BE (received_pixel);
@@ -32,8 +32,8 @@ test_color (CoglTexture *texture,
static void
test_write_byte (CoglPixelFormat format,
- guint8 byte,
- guint32 expected_pixel)
+ uint8_t byte,
+ uint32_t expected_pixel)
{
CoglTexture *texture = test_utils_create_color_texture (test_ctx, 0);
@@ -53,8 +53,8 @@ test_write_byte (CoglPixelFormat format,
static void
test_write_short (CoglPixelFormat format,
- guint16 value,
- guint32 expected_pixel)
+ uint16_t value,
+ uint32_t expected_pixel)
{
CoglTexture *texture = test_utils_create_color_texture (test_ctx, 0);
@@ -65,7 +65,7 @@ test_write_short (CoglPixelFormat format,
1, 1, /* width / height */
format,
2, /* rowstride */
- (guint8 *) &value);
+ (uint8_t *) &value);
test_color (texture, expected_pixel);
@@ -74,8 +74,8 @@ test_write_short (CoglPixelFormat format,
static void
test_write_bytes (CoglPixelFormat format,
- guint32 value,
- guint32 expected_pixel)
+ uint32_t value,
+ uint32_t expected_pixel)
{
CoglTexture *texture = test_utils_create_color_texture (test_ctx, 0);
@@ -88,7 +88,7 @@ test_write_bytes (CoglPixelFormat format,
1, 1, /* width / height */
format,
4, /* rowstride */
- (guint8 *) &value);
+ (uint8_t *) &value);
test_color (texture, expected_pixel);
@@ -97,12 +97,12 @@ test_write_bytes (CoglPixelFormat format,
static void
test_write_int (CoglPixelFormat format,
- guint32 expected_pixel,
+ uint32_t expected_pixel,
...)
{
va_list ap;
int bits;
- guint32 tex_data = 0;
+ uint32_t tex_data = 0;
int bits_sum = 0;
CoglTexture *texture = test_utils_create_color_texture (test_ctx, 0);
@@ -111,7 +111,7 @@ test_write_int (CoglPixelFormat format,
/* Convert the va args into a single 32-bit value */
while ((bits = va_arg (ap, int)) != -1)
{
- guint32 value = (va_arg (ap, int) * ((1 << bits) - 1) + 127) / 255;
+ uint32_t value = (va_arg (ap, int) * ((1 << bits) - 1) + 127) / 255;
bits_sum += bits;
@@ -127,7 +127,7 @@ test_write_int (CoglPixelFormat format,
1, 1, /* width / height */
format,
4, /* rowstride */
- (guint8 *) &tex_data);
+ (uint8_t *) &tex_data);
test_color (texture, expected_pixel);