[mutter/wip/nielsdg/cleanup-cogl-util: 5/5] cogl: Drop _COGL_RETURN_VAL_IF_FAIL macro
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/nielsdg/cleanup-cogl-util: 5/5] cogl: Drop _COGL_RETURN_VAL_IF_FAIL macro
- Date: Wed, 19 Jun 2019 18:56:13 +0000 (UTC)
commit 666390129361c9fb5f920f045b10896128c43ec6
Author: Niels De Graef <nielsdegraef gmail com>
Date: Mon Jun 17 23:42:01 2019 +0200
cogl: Drop _COGL_RETURN_VAL_IF_FAIL macro
This was introduced when the Cogl maintainers tried to move away from
GLib. Since we always require it, we can just use
`g_return_val_if_fail()` immediately.
cogl/cogl-pango/cogl-pango-fontmap.c | 2 +-
cogl/cogl-path/cogl-path.c | 4 ++--
cogl/cogl/cogl-atlas-texture.c | 14 ++++++------
cogl/cogl/cogl-attribute.c | 10 ++++-----
cogl/cogl/cogl-bitmap-conversion.c | 6 ++---
cogl/cogl/cogl-bitmap-pixbuf.c | 2 +-
cogl/cogl/cogl-bitmap.c | 18 +++++++--------
cogl/cogl/cogl-buffer.c | 14 ++++++------
cogl/cogl/cogl-clip-stack.c | 2 +-
cogl/cogl/cogl-color.c | 4 ++--
cogl/cogl/cogl-depth-state.c | 6 ++---
cogl/cogl/cogl-euler.c | 4 ++--
cogl/cogl/cogl-framebuffer.c | 10 ++++-----
cogl/cogl/cogl-gles2-context.c | 2 +-
cogl/cogl/cogl-indices.c | 6 ++---
cogl/cogl/cogl-matrix.c | 4 ++--
cogl/cogl/cogl-object.c | 2 +-
cogl/cogl/cogl-onscreen.c | 4 ++--
cogl/cogl/cogl-pipeline-layer-state.c | 26 +++++++++++-----------
cogl/cogl/cogl-pipeline-layer.c | 2 +-
cogl/cogl/cogl-pipeline-state.c | 28 ++++++++++++------------
cogl/cogl/cogl-pipeline.c | 10 ++++-----
cogl/cogl/cogl-poll.c | 8 +++----
cogl/cogl/cogl-primitive.c | 10 ++++-----
cogl/cogl/cogl-quaternion.c | 4 ++--
cogl/cogl/cogl-rectangle-map.c | 2 +-
cogl/cogl/cogl-renderer.c | 6 ++---
cogl/cogl/cogl-snippet.c | 10 ++++-----
cogl/cogl/cogl-sub-texture.c | 12 +++++-----
cogl/cogl/cogl-texture-2d-sliced.c | 20 ++++++++---------
cogl/cogl/cogl-texture-2d.c | 18 +++++++--------
cogl/cogl/cogl-texture.c | 12 +++++-----
cogl/cogl/cogl-util.h | 2 --
cogl/cogl/cogl-vector.c | 12 +++++-----
cogl/cogl/cogl-xlib-renderer.c | 4 ++--
cogl/cogl/cogl.c | 4 ++--
cogl/cogl/deprecated/cogl-auto-texture.c | 6 ++---
cogl/cogl/deprecated/cogl-clutter.c | 4 ++--
cogl/cogl/deprecated/cogl-program.c | 8 +++----
cogl/cogl/driver/gl/cogl-attribute-gl.c | 8 +++----
cogl/cogl/driver/gl/cogl-buffer-gl.c | 10 ++++-----
cogl/cogl/driver/gl/cogl-framebuffer-gl.c | 8 +++----
cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c | 6 ++---
cogl/cogl/driver/gl/cogl-texture-2d-gl.c | 18 +++++++--------
cogl/cogl/winsys/cogl-winsys-egl.c | 12 +++++-----
cogl/cogl/winsys/cogl-winsys-glx.c | 8 +++----
src/backends/native/meta-renderer-native.c | 2 +-
47 files changed, 195 insertions(+), 199 deletions(-)
---
diff --git a/cogl/cogl-pango/cogl-pango-fontmap.c b/cogl/cogl-pango/cogl-pango-fontmap.c
index f9f5d3b8c..0c43909c7 100644
--- a/cogl/cogl-pango/cogl-pango-fontmap.c
+++ b/cogl/cogl-pango/cogl-pango-fontmap.c
@@ -94,7 +94,7 @@ cogl_pango_font_map_new (void)
PangoContext *
cogl_pango_font_map_create_context (CoglPangoFontMap *fm)
{
- _COGL_RETURN_VAL_IF_FAIL (COGL_PANGO_IS_FONT_MAP (fm), NULL);
+ g_return_val_if_fail (COGL_PANGO_IS_FONT_MAP (fm), NULL);
#if PANGO_VERSION_CHECK (1, 22, 0)
/* We can just directly use the pango context from the Cairo font
diff --git a/cogl/cogl-path/cogl-path.c b/cogl/cogl-path/cogl-path.c
index 7d5088868..91e78aa09 100644
--- a/cogl/cogl-path/cogl-path.c
+++ b/cogl/cogl-path/cogl-path.c
@@ -162,7 +162,7 @@ cogl2_path_set_fill_rule (CoglPath *path,
CoglPathFillRule
cogl2_path_get_fill_rule (CoglPath *path)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_path (path), COGL_PATH_FILL_RULE_NON_ZERO);
+ g_return_val_if_fail (cogl_is_path (path), COGL_PATH_FILL_RULE_NON_ZERO);
return path->data->fill_rule;
}
@@ -932,7 +932,7 @@ cogl_path_copy (CoglPath *old_path)
{
CoglPath *new_path;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_path (old_path), NULL);
+ g_return_val_if_fail (cogl_is_path (old_path), NULL);
new_path = g_slice_new (CoglPath);
new_path->data = old_path->data;
diff --git a/cogl/cogl/cogl-atlas-texture.c b/cogl/cogl/cogl-atlas-texture.c
index ea7b5f13d..f73c2b9b0 100644
--- a/cogl/cogl/cogl-atlas-texture.c
+++ b/cogl/cogl/cogl-atlas-texture.c
@@ -694,7 +694,7 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
/* We can't atlas zero-sized textures because it breaks the atlas
* data structure */
- _COGL_RETURN_VAL_IF_FAIL (width > 0 && height > 0, NULL);
+ g_return_val_if_fail (width > 0 && height > 0, NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_SIZED;
@@ -831,7 +831,7 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
CoglPixelFormat internal_format;
CoglBitmap *upload_bmp;
- _COGL_RETURN_VAL_IF_FAIL (atlas_tex->atlas == NULL, FALSE);
+ g_return_val_if_fail (atlas_tex->atlas == NULL, FALSE);
internal_format = _cogl_texture_determine_internal_format (tex, bmp_format);
@@ -885,7 +885,7 @@ _cogl_atlas_texture_allocate (CoglTexture *tex,
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
CoglTextureLoader *loader = tex->loader;
- _COGL_RETURN_VAL_IF_FAIL (loader, FALSE);
+ g_return_val_if_fail (loader, FALSE);
switch (loader->src_type)
{
@@ -906,7 +906,7 @@ _cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp,
{
CoglTextureLoader *loader;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_bitmap (bmp), NULL);
+ g_return_val_if_fail (cogl_is_bitmap (bmp), NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
@@ -938,8 +938,8 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
CoglBitmap *bmp;
CoglAtlasTexture *atlas_tex;
- _COGL_RETURN_VAL_IF_FAIL (format != COGL_PIXEL_FORMAT_ANY, NULL);
- _COGL_RETURN_VAL_IF_FAIL (data != NULL, NULL);
+ g_return_val_if_fail (format != COGL_PIXEL_FORMAT_ANY, NULL);
+ g_return_val_if_fail (data != NULL, NULL);
/* Rowstride from width if not given */
if (rowstride == 0)
@@ -974,7 +974,7 @@ cogl_atlas_texture_new_from_file (CoglContext *ctx,
CoglBitmap *bmp;
CoglAtlasTexture *atlas_tex = NULL;
- _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
bmp = cogl_bitmap_new_from_file (filename, error);
if (bmp == NULL)
diff --git a/cogl/cogl/cogl-attribute.c b/cogl/cogl/cogl-attribute.c
index ac46901f7..e92546285 100644
--- a/cogl/cogl/cogl-attribute.c
+++ b/cogl/cogl/cogl-attribute.c
@@ -309,7 +309,7 @@ _cogl_attribute_new_const (CoglContext *context,
/* FIXME: Up until GL[ES] 3 only square matrices were supported
* and we don't currently expose non-square matrices in Cogl.
*/
- _COGL_RETURN_VAL_IF_FAIL (n_columns == n_components, NULL);
+ g_return_val_if_fail (n_columns == n_components, NULL);
_cogl_boxed_value_set_matrix (&attribute->d.constant.boxed,
n_columns,
1,
@@ -469,7 +469,7 @@ cogl_attribute_new_const_4x4fv (CoglContext *context,
gboolean
cogl_attribute_get_normalized (CoglAttribute *attribute)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), FALSE);
+ g_return_val_if_fail (cogl_is_attribute (attribute), FALSE);
return attribute->normalized;
}
@@ -501,8 +501,8 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
CoglAttributeBuffer *
cogl_attribute_get_buffer (CoglAttribute *attribute)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), NULL);
- _COGL_RETURN_VAL_IF_FAIL (attribute->is_buffered, NULL);
+ g_return_val_if_fail (cogl_is_attribute (attribute), NULL);
+ g_return_val_if_fail (attribute->is_buffered, NULL);
return attribute->d.buffered.attribute_buffer;
}
@@ -528,7 +528,7 @@ _cogl_attribute_immutable_ref (CoglAttribute *attribute)
{
CoglBuffer *buffer = COGL_BUFFER (attribute->d.buffered.attribute_buffer);
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), NULL);
+ g_return_val_if_fail (cogl_is_attribute (attribute), NULL);
attribute->immutable_ref++;
_cogl_buffer_immutable_ref (buffer);
diff --git a/cogl/cogl/cogl-bitmap-conversion.c b/cogl/cogl/cogl-bitmap-conversion.c
index 73cf3153e..fe71e4c71 100644
--- a/cogl/cogl/cogl-bitmap-conversion.c
+++ b/cogl/cogl/cogl-bitmap-conversion.c
@@ -384,8 +384,8 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
width = cogl_bitmap_get_width (src_bmp);
height = cogl_bitmap_get_height (src_bmp);
- _COGL_RETURN_VAL_IF_FAIL (width == cogl_bitmap_get_width (dst_bmp), FALSE);
- _COGL_RETURN_VAL_IF_FAIL (height == cogl_bitmap_get_height (dst_bmp), FALSE);
+ g_return_val_if_fail (width == cogl_bitmap_get_width (dst_bmp), FALSE);
+ g_return_val_if_fail (height == cogl_bitmap_get_height (dst_bmp), FALSE);
need_premult
= ((src_format & COGL_PREMULT_BIT) != (dst_format & COGL_PREMULT_BIT) &&
@@ -553,7 +553,7 @@ _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
CoglPixelFormat src_format = cogl_bitmap_get_format (src_bmp);
CoglBitmap *dst_bmp;
- _COGL_RETURN_VAL_IF_FAIL (internal_format != COGL_PIXEL_FORMAT_ANY, NULL);
+ g_return_val_if_fail (internal_format != COGL_PIXEL_FORMAT_ANY, NULL);
/* OpenGL supports specifying a different format for the internal
format when uploading texture data. We should use this to convert
diff --git a/cogl/cogl/cogl-bitmap-pixbuf.c b/cogl/cogl/cogl-bitmap-pixbuf.c
index e135d1ce6..a47da9317 100644
--- a/cogl/cogl/cogl-bitmap-pixbuf.c
+++ b/cogl/cogl/cogl-bitmap-pixbuf.c
@@ -45,7 +45,7 @@ _cogl_bitmap_get_size_from_file (const char *filename,
int *width,
int *height)
{
- _COGL_RETURN_VAL_IF_FAIL (filename != NULL, FALSE);
+ g_return_val_if_fail (filename != NULL, FALSE);
if (gdk_pixbuf_get_file_info (filename, width, height) != NULL)
return TRUE;
diff --git a/cogl/cogl/cogl-bitmap.c b/cogl/cogl/cogl-bitmap.c
index 5d992768a..bc3ef36af 100644
--- a/cogl/cogl/cogl-bitmap.c
+++ b/cogl/cogl/cogl-bitmap.c
@@ -133,9 +133,9 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
gboolean succeeded = FALSE;
/* Intended only for fast copies when format is equal! */
- _COGL_RETURN_VAL_IF_FAIL ((src->format & ~COGL_PREMULT_BIT) ==
- (dst->format & ~COGL_PREMULT_BIT),
- FALSE);
+ g_return_val_if_fail ((src->format & ~COGL_PREMULT_BIT) ==
+ (dst->format & ~COGL_PREMULT_BIT),
+ FALSE);
bpp = _cogl_pixel_format_get_bytes_per_pixel (src->format);
@@ -265,8 +265,8 @@ cogl_bitmap_new_from_file (const char *filename,
{
_COGL_GET_CONTEXT (ctx, NULL);
- _COGL_RETURN_VAL_IF_FAIL (filename != NULL, NULL);
- _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);
+ g_return_val_if_fail (filename != NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
return _cogl_bitmap_from_file (ctx, filename, error);
}
@@ -281,7 +281,7 @@ cogl_bitmap_new_from_buffer (CoglBuffer *buffer,
{
CoglBitmap *bmp;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), NULL);
+ g_return_val_if_fail (cogl_is_buffer (buffer), NULL);
bmp = cogl_bitmap_new_for_data (buffer->context,
width, height,
@@ -306,7 +306,7 @@ cogl_bitmap_new_with_size (CoglContext *context,
unsigned int rowstride;
/* creating a buffer to store "any" format does not make sense */
- _COGL_RETURN_VAL_IF_FAIL (format != COGL_PIXEL_FORMAT_ANY, NULL);
+ g_return_val_if_fail (format != COGL_PIXEL_FORMAT_ANY, NULL);
/* for now we fallback to cogl_pixel_buffer_new, later, we could ask
* libdrm a tiled buffer for instance */
@@ -317,7 +317,7 @@ cogl_bitmap_new_with_size (CoglContext *context,
height * rowstride,
NULL); /* data */
- _COGL_RETURN_VAL_IF_FAIL (pixel_buffer != NULL, NULL);
+ g_return_val_if_fail (pixel_buffer != NULL, NULL);
bitmap = cogl_bitmap_new_from_buffer (COGL_BUFFER (pixel_buffer),
format,
@@ -450,7 +450,7 @@ _cogl_bitmap_gl_bind (CoglBitmap *bitmap,
if (bitmap->shared_bmp)
return _cogl_bitmap_gl_bind (bitmap->shared_bmp, access, hints, error);
- _COGL_RETURN_VAL_IF_FAIL (!bitmap->bound, NULL);
+ g_return_val_if_fail (!bitmap->bound, NULL);
/* If the bitmap wasn't created from a buffer then the
implementation of bind is the same as map */
diff --git a/cogl/cogl/cogl-buffer.c b/cogl/cogl/cogl-buffer.c
index ff2b0300e..5df579076 100644
--- a/cogl/cogl/cogl-buffer.c
+++ b/cogl/cogl/cogl-buffer.c
@@ -225,7 +225,7 @@ _cogl_buffer_map (CoglBuffer *buffer,
CoglBufferMapHint hints,
CoglError **error)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), NULL);
+ g_return_val_if_fail (cogl_is_buffer (buffer), NULL);
return cogl_buffer_map_range (buffer, 0, buffer->size, access, hints, error);
}
@@ -252,8 +252,8 @@ cogl_buffer_map_range (CoglBuffer *buffer,
CoglBufferMapHint hints,
CoglError **error)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), NULL);
- _COGL_RETURN_VAL_IF_FAIL (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED), NULL);
+ g_return_val_if_fail (cogl_is_buffer (buffer), NULL);
+ g_return_val_if_fail (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED), NULL);
if (G_UNLIKELY (buffer->immutable_ref))
warn_about_midscene_changes ();
@@ -295,7 +295,7 @@ _cogl_buffer_map_range_for_fill_or_fallback (CoglBuffer *buffer,
void *ret;
CoglError *ignore_error = NULL;
- _COGL_RETURN_VAL_IF_FAIL (!ctx->buffer_map_fallback_in_use, NULL);
+ g_return_val_if_fail (!ctx->buffer_map_fallback_in_use, NULL);
ctx->buffer_map_fallback_in_use = TRUE;
@@ -366,8 +366,8 @@ _cogl_buffer_set_data (CoglBuffer *buffer,
size_t size,
CoglError **error)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), FALSE);
- _COGL_RETURN_VAL_IF_FAIL ((offset + size) <= buffer->size, FALSE);
+ g_return_val_if_fail (cogl_is_buffer (buffer), FALSE);
+ g_return_val_if_fail ((offset + size) <= buffer->size, FALSE);
if (G_UNLIKELY (buffer->immutable_ref))
warn_about_midscene_changes ();
@@ -392,7 +392,7 @@ cogl_buffer_set_data (CoglBuffer *buffer,
CoglBuffer *
_cogl_buffer_immutable_ref (CoglBuffer *buffer)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), NULL);
+ g_return_val_if_fail (cogl_is_buffer (buffer), NULL);
buffer->immutable_ref++;
return buffer;
diff --git a/cogl/cogl/cogl-clip-stack.c b/cogl/cogl/cogl-clip-stack.c
index 3dbd2e573..0461687e7 100644
--- a/cogl/cogl/cogl-clip-stack.c
+++ b/cogl/cogl/cogl-clip-stack.c
@@ -350,7 +350,7 @@ _cogl_clip_stack_pop (CoglClipStack *stack)
{
CoglClipStack *new_top;
- _COGL_RETURN_VAL_IF_FAIL (stack != NULL, NULL);
+ g_return_val_if_fail (stack != NULL, NULL);
/* To pop we are moving the top of the stack to the old top's parent
node. The stack always needs to have a reference to the top entry
diff --git a/cogl/cogl/cogl-color.c b/cogl/cogl/cogl-color.c
index d51b18f31..b4e148267 100644
--- a/cogl/cogl/cogl-color.c
+++ b/cogl/cogl/cogl-color.c
@@ -305,8 +305,8 @@ cogl_color_equal (const void *v1, const void *v2)
{
const uint32_t *c1 = v1, *c2 = v2;
- _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
+ g_return_val_if_fail (v1 != NULL, FALSE);
+ g_return_val_if_fail (v2 != NULL, FALSE);
/* XXX: We don't compare the padding */
return *c1 == *c2 ? TRUE : FALSE;
diff --git a/cogl/cogl/cogl-depth-state.c b/cogl/cogl/cogl-depth-state.c
index 96be122d4..a8b141d49 100644
--- a/cogl/cogl/cogl-depth-state.c
+++ b/cogl/cogl/cogl-depth-state.c
@@ -59,7 +59,7 @@ cogl_depth_state_set_test_enabled (CoglDepthState *state,
gboolean
cogl_depth_state_get_test_enabled (CoglDepthState *state)
{
- _COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
+ g_return_val_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
return state->test_enabled;
}
@@ -74,7 +74,7 @@ cogl_depth_state_set_write_enabled (CoglDepthState *state,
gboolean
cogl_depth_state_get_write_enabled (CoglDepthState *state)
{
- _COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
+ g_return_val_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
return state->write_enabled;
}
@@ -89,7 +89,7 @@ cogl_depth_state_set_test_function (CoglDepthState *state,
CoglDepthTestFunction
cogl_depth_state_get_test_function (CoglDepthState *state)
{
- _COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
+ g_return_val_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
return state->test_function;
}
diff --git a/cogl/cogl/cogl-euler.c b/cogl/cogl/cogl-euler.c
index 6dad1d24d..016aaa6c5 100644
--- a/cogl/cogl/cogl-euler.c
+++ b/cogl/cogl/cogl-euler.c
@@ -164,8 +164,8 @@ cogl_euler_equal (const void *v1, const void *v2)
const CoglEuler *a = v1;
const CoglEuler *b = v2;
- _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
+ g_return_val_if_fail (v1 != NULL, FALSE);
+ g_return_val_if_fail (v2 != NULL, FALSE);
if (v1 == v2)
return TRUE;
diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c
index eeb7e004d..67f04a737 100644
--- a/cogl/cogl/cogl-framebuffer.c
+++ b/cogl/cogl/cogl-framebuffer.c
@@ -618,7 +618,7 @@ _cogl_offscreen_new_with_texture_full (CoglTexture *texture,
CoglFramebuffer *fb;
CoglOffscreen *ret;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_texture (texture), NULL);
+ g_return_val_if_fail (cogl_is_texture (texture), NULL);
offscreen = g_new0 (CoglOffscreen, 1);
offscreen->texture = cogl_object_ref (texture);
@@ -1087,7 +1087,7 @@ cogl_framebuffer_get_depth_texture (CoglFramebuffer *framebuffer)
if (!cogl_framebuffer_allocate (framebuffer, NULL))
return NULL;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_offscreen (framebuffer), NULL);
+ g_return_val_if_fail (cogl_is_offscreen (framebuffer), NULL);
return COGL_OFFSCREEN(framebuffer)->depth_texture;
}
@@ -1158,7 +1158,7 @@ cogl_framebuffer_resolve_samples_region (CoglFramebuffer *framebuffer,
CoglContext *
cogl_framebuffer_get_context (CoglFramebuffer *framebuffer)
{
- _COGL_RETURN_VAL_IF_FAIL (framebuffer != NULL, NULL);
+ g_return_val_if_fail (framebuffer != NULL, NULL);
return framebuffer->context;
}
@@ -1254,8 +1254,8 @@ _cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int width;
int height;
- _COGL_RETURN_VAL_IF_FAIL (source & COGL_READ_PIXELS_COLOR_BUFFER, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_framebuffer (framebuffer), FALSE);
+ g_return_val_if_fail (source & COGL_READ_PIXELS_COLOR_BUFFER, FALSE);
+ g_return_val_if_fail (cogl_is_framebuffer (framebuffer), FALSE);
if (!cogl_framebuffer_allocate (framebuffer, error))
return FALSE;
diff --git a/cogl/cogl/cogl-gles2-context.c b/cogl/cogl/cogl-gles2-context.c
index f2442f05b..79d77a9bf 100644
--- a/cogl/cogl/cogl-gles2-context.c
+++ b/cogl/cogl/cogl-gles2-context.c
@@ -1786,7 +1786,7 @@ cogl_push_gles2_context (CoglContext *ctx,
const CoglWinsysVtable *winsys = ctx->display->renderer->winsys_vtable;
CoglError *internal_error = NULL;
- _COGL_RETURN_VAL_IF_FAIL (gles2_ctx != NULL, FALSE);
+ g_return_val_if_fail (gles2_ctx != NULL, FALSE);
/* The read/write buffers are properties of the gles2 context and we
* don't currently track the read/write buffers as part of the stack
diff --git a/cogl/cogl/cogl-indices.c b/cogl/cogl/cogl-indices.c
index edfcd1ba1..91be4ad9e 100644
--- a/cogl/cogl/cogl-indices.c
+++ b/cogl/cogl/cogl-indices.c
@@ -120,7 +120,7 @@ cogl_indices_get_buffer (CoglIndices *indices)
CoglIndicesType
cogl_indices_get_type (CoglIndices *indices)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_indices (indices),
+ g_return_val_if_fail (cogl_is_indices (indices),
COGL_INDICES_TYPE_UNSIGNED_BYTE);
return indices->type;
}
@@ -128,7 +128,7 @@ cogl_indices_get_type (CoglIndices *indices)
size_t
cogl_indices_get_offset (CoglIndices *indices)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_indices (indices), 0);
+ g_return_val_if_fail (cogl_is_indices (indices), 0);
return indices->offset;
}
@@ -167,7 +167,7 @@ _cogl_indices_free (CoglIndices *indices)
CoglIndices *
_cogl_indices_immutable_ref (CoglIndices *indices)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_indices (indices), NULL);
+ g_return_val_if_fail (cogl_is_indices (indices), NULL);
indices->immutable_ref++;
_cogl_buffer_immutable_ref (COGL_BUFFER (indices->buffer));
diff --git a/cogl/cogl/cogl-matrix.c b/cogl/cogl/cogl-matrix.c
index 5369bc238..af5591357 100644
--- a/cogl/cogl/cogl-matrix.c
+++ b/cogl/cogl/cogl-matrix.c
@@ -1942,8 +1942,8 @@ cogl_matrix_equal (const void *v1, const void *v2)
const CoglMatrix *a = v1;
const CoglMatrix *b = v2;
- _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
+ g_return_val_if_fail (v1 != NULL, FALSE);
+ g_return_val_if_fail (v2 != NULL, FALSE);
/* We want to avoid having a fuzzy _equal() function (e.g. that uses
* an arbitrary epsilon value) since this function noteably conforms
diff --git a/cogl/cogl/cogl-object.c b/cogl/cogl/cogl-object.c
index 87d2f7cd0..301254548 100644
--- a/cogl/cogl/cogl-object.c
+++ b/cogl/cogl/cogl-object.c
@@ -46,7 +46,7 @@ cogl_object_ref (void *object)
{
CoglObject *obj = object;
- _COGL_RETURN_VAL_IF_FAIL (object != NULL, NULL);
+ g_return_val_if_fail (object != NULL, NULL);
obj->ref_count++;
return object;
diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c
index d7a900dd4..b06eea2a4 100644
--- a/cogl/cogl/cogl-onscreen.c
+++ b/cogl/cogl/cogl-onscreen.c
@@ -402,7 +402,7 @@ cogl_onscreen_get_buffer_age (CoglOnscreen *onscreen)
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
const CoglWinsysVtable *winsys;
- _COGL_RETURN_VAL_IF_FAIL (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN, 0);
+ g_return_val_if_fail (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN, 0);
winsys = _cogl_framebuffer_get_winsys (framebuffer);
@@ -440,7 +440,7 @@ cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
/* This should only be called for x11 onscreens */
- _COGL_RETURN_VAL_IF_FAIL (winsys->onscreen_x11_get_window_xid != NULL, 0);
+ g_return_val_if_fail (winsys->onscreen_x11_get_window_xid != NULL, 0);
return winsys->onscreen_x11_get_window_xid (onscreen);
}
diff --git a/cogl/cogl/cogl-pipeline-layer-state.c b/cogl/cogl/cogl-pipeline-layer-state.c
index 26bbabea5..f10c405da 100644
--- a/cogl/cogl/cogl-pipeline-layer-state.c
+++ b/cogl/cogl/cogl-pipeline-layer-state.c
@@ -293,7 +293,7 @@ public_to_internal_wrap_mode (CoglPipelineWrapMode mode)
static CoglPipelineWrapMode
internal_to_public_wrap_mode (CoglSamplerCacheWrapMode internal_mode)
{
- _COGL_RETURN_VAL_IF_FAIL (internal_mode !=
+ g_return_val_if_fail (internal_mode !=
COGL_SAMPLER_CACHE_WRAP_MODE_CLAMP_TO_BORDER,
COGL_PIPELINE_WRAP_MODE_AUTOMATIC);
return (CoglPipelineWrapMode)internal_mode;
@@ -487,7 +487,7 @@ _cogl_pipeline_layer_get_wrap_mode_s (CoglPipelineLayer *layer)
CoglPipelineLayer *authority;
const CoglSamplerCacheEntry *sampler_state;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_is_pipeline_layer (layer), FALSE);
+ g_return_val_if_fail (_cogl_is_pipeline_layer (layer), FALSE);
/* Now find the ancestor of the layer that is the authority for the
* state we want to change */
@@ -502,7 +502,7 @@ cogl_pipeline_get_layer_wrap_mode_s (CoglPipeline *pipeline, int layer_index)
{
CoglPipelineLayer *layer;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
/* Note: this will ensure that the layer exists, creating one if it
* doesn't already.
@@ -524,7 +524,7 @@ _cogl_pipeline_layer_get_wrap_mode_t (CoglPipelineLayer *layer)
CoglPipelineLayer *authority;
const CoglSamplerCacheEntry *sampler_state;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_is_pipeline_layer (layer), FALSE);
+ g_return_val_if_fail (_cogl_is_pipeline_layer (layer), FALSE);
/* Now find the ancestor of the layer that is the authority for the
* state we want to change */
@@ -539,7 +539,7 @@ cogl_pipeline_get_layer_wrap_mode_t (CoglPipeline *pipeline, int layer_index)
{
CoglPipelineLayer *layer;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
/* Note: this will ensure that the layer exists, creating one if it
* doesn't already.
@@ -570,7 +570,7 @@ cogl_pipeline_get_layer_wrap_mode_p (CoglPipeline *pipeline, int layer_index)
{
CoglPipelineLayer *layer;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
/* Note: this will ensure that the layer exists, creating one if it
* doesn't already.
@@ -612,7 +612,7 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
_COGL_GET_CONTEXT (ctx, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
/* Don't allow point sprite coordinates to be enabled if the driver
doesn't support it */
@@ -706,7 +706,7 @@ cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
CoglPipelineLayer *layer;
CoglPipelineLayer *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
/* Note: this will ensure that the layer exists, creating one if it
* doesn't already.
@@ -1040,7 +1040,7 @@ cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
CoglBlendStringStatement *a;
int count;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
/* Note: this will ensure that the layer exists, creating one if it
* doesn't already.
@@ -1250,7 +1250,7 @@ _cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline, int layer_index)
CoglPipelineLayer *layer;
CoglPipelineLayer *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), NULL);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), NULL);
layer = _cogl_pipeline_get_layer (pipeline, layer_index);
@@ -1330,7 +1330,7 @@ cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
CoglTexture *
_cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer)
{
- _COGL_RETURN_VAL_IF_FAIL (_cogl_is_pipeline_layer (layer), NULL);
+ g_return_val_if_fail (_cogl_is_pipeline_layer (layer), NULL);
return _cogl_pipeline_layer_get_texture_real (layer);
}
@@ -1415,7 +1415,7 @@ _cogl_pipeline_layer_get_min_filter (CoglPipelineLayer *layer)
{
CoglPipelineLayer *authority;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_is_pipeline_layer (layer), 0);
+ g_return_val_if_fail (_cogl_is_pipeline_layer (layer), 0);
authority =
_cogl_pipeline_layer_get_authority (layer,
@@ -1429,7 +1429,7 @@ _cogl_pipeline_layer_get_mag_filter (CoglPipelineLayer *layer)
{
CoglPipelineLayer *authority;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_is_pipeline_layer (layer), 0);
+ g_return_val_if_fail (_cogl_is_pipeline_layer (layer), 0);
authority =
_cogl_pipeline_layer_get_authority (layer,
diff --git a/cogl/cogl/cogl-pipeline-layer.c b/cogl/cogl/cogl-pipeline-layer.c
index 85ce34788..457614d5c 100644
--- a/cogl/cogl/cogl-pipeline-layer.c
+++ b/cogl/cogl/cogl-pipeline-layer.c
@@ -351,7 +351,7 @@ _cogl_pipeline_layer_pre_change_notify (CoglPipeline *required_owner,
goto init_layer_state;
/* We only allow a NULL required_owner for new layers */
- _COGL_RETURN_VAL_IF_FAIL (required_owner != NULL, layer);
+ g_return_val_if_fail (required_owner != NULL, layer);
/* Chain up:
* A modification of a layer is indirectly also a modification of
diff --git a/cogl/cogl/cogl-pipeline-state.c b/cogl/cogl/cogl-pipeline-state.c
index 1a2d78723..35e249521 100644
--- a/cogl/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl/cogl-pipeline-state.c
@@ -55,7 +55,7 @@ _cogl_pipeline_get_user_program (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), NULL);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), NULL);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_USER_SHADER);
@@ -452,7 +452,7 @@ _cogl_pipeline_get_blend_enabled (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_BLEND_ENABLE);
@@ -660,7 +660,7 @@ cogl_pipeline_get_shininess (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), 0);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), 0);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
@@ -830,7 +830,7 @@ cogl_pipeline_get_alpha_test_function (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), 0);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), 0);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_ALPHA_FUNC);
@@ -843,7 +843,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), 0.0f);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), 0.0f);
authority =
_cogl_pipeline_get_authority (pipeline,
@@ -958,7 +958,7 @@ cogl_pipeline_set_blend (CoglPipeline *pipeline,
_COGL_GET_CONTEXT (ctx, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
count =
_cogl_blend_string_compile (blend_description,
@@ -1071,7 +1071,7 @@ cogl_pipeline_get_user_program (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), COGL_INVALID_HANDLE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), COGL_INVALID_HANDLE);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_USER_SHADER);
@@ -1152,8 +1152,8 @@ cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
_COGL_GET_CONTEXT (ctx, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
- _COGL_RETURN_VAL_IF_FAIL (depth_state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (depth_state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
authority = _cogl_pipeline_get_authority (pipeline, state);
@@ -1294,7 +1294,7 @@ cogl_pipeline_get_cull_face_mode (CoglPipeline *pipeline)
CoglPipelineState state = COGL_PIPELINE_STATE_CULL_FACE;
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline),
+ g_return_val_if_fail (cogl_is_pipeline (pipeline),
COGL_PIPELINE_CULL_FACE_MODE_NONE);
authority = _cogl_pipeline_get_authority (pipeline, state);
@@ -1308,7 +1308,7 @@ cogl_pipeline_get_front_face_winding (CoglPipeline *pipeline)
CoglPipelineState state = COGL_PIPELINE_STATE_CULL_FACE;
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline),
+ g_return_val_if_fail (cogl_is_pipeline (pipeline),
COGL_PIPELINE_CULL_FACE_MODE_NONE);
authority = _cogl_pipeline_get_authority (pipeline, state);
@@ -1321,7 +1321,7 @@ cogl_pipeline_get_point_size (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_POINT_SIZE);
@@ -1395,7 +1395,7 @@ cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
CoglPipeline *authority;
_COGL_GET_CONTEXT (ctx, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
authority = _cogl_pipeline_get_authority (pipeline, state);
@@ -1434,7 +1434,7 @@ cogl_pipeline_get_per_vertex_point_size (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
authority =
_cogl_pipeline_get_authority (pipeline,
diff --git a/cogl/cogl/cogl-pipeline.c b/cogl/cogl/cogl-pipeline.c
index 3c60cb8c1..68f5e3471 100644
--- a/cogl/cogl/cogl-pipeline.c
+++ b/cogl/cogl/cogl-pipeline.c
@@ -474,7 +474,7 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
gboolean
_cogl_pipeline_get_real_blend_enabled (CoglPipeline *pipeline)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
return pipeline->real_blend_enable;
}
@@ -2401,7 +2401,7 @@ _cogl_pipeline_get_fog_enabled (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_FOG);
@@ -2411,7 +2411,7 @@ _cogl_pipeline_get_fog_enabled (CoglPipeline *pipeline)
unsigned long
_cogl_pipeline_get_age (CoglPipeline *pipeline)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), 0);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), 0);
return pipeline->age;
}
@@ -2486,7 +2486,7 @@ prepend_layer_to_list_cb (CoglPipelineLayer *layer,
const GList *
_cogl_pipeline_get_layers (CoglPipeline *pipeline)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), NULL);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), NULL);
if (!pipeline->deprecated_get_layers_list_dirty)
g_list_free (pipeline->deprecated_get_layers_list);
@@ -2509,7 +2509,7 @@ cogl_pipeline_get_n_layers (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), 0);
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), 0);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LAYERS);
diff --git a/cogl/cogl/cogl-poll.c b/cogl/cogl/cogl-poll.c
index 18e9fd5fd..c736e48b3 100644
--- a/cogl/cogl/cogl-poll.c
+++ b/cogl/cogl/cogl-poll.c
@@ -53,10 +53,10 @@ cogl_poll_renderer_get_info (CoglRenderer *renderer,
{
GList *l, *next;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), 0);
- _COGL_RETURN_VAL_IF_FAIL (poll_fds != NULL, 0);
- _COGL_RETURN_VAL_IF_FAIL (n_poll_fds != NULL, 0);
- _COGL_RETURN_VAL_IF_FAIL (timeout != NULL, 0);
+ g_return_val_if_fail (cogl_is_renderer (renderer), 0);
+ g_return_val_if_fail (poll_fds != NULL, 0);
+ g_return_val_if_fail (n_poll_fds != NULL, 0);
+ g_return_val_if_fail (timeout != NULL, 0);
*timeout = -1;
diff --git a/cogl/cogl/cogl-primitive.c b/cogl/cogl/cogl-primitive.c
index 04d89c609..ff547387f 100644
--- a/cogl/cogl/cogl-primitive.c
+++ b/cogl/cogl/cogl-primitive.c
@@ -74,7 +74,7 @@ cogl_primitive_new_with_attributes (CoglVerticesMode mode,
CoglAttribute *attribute = attributes[i];
cogl_object_ref (attribute);
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), NULL);
+ g_return_val_if_fail (cogl_is_attribute (attribute), NULL);
primitive->attributes[i] = attribute;
}
@@ -463,7 +463,7 @@ cogl_primitive_set_attributes (CoglPrimitive *primitive,
int
cogl_primitive_get_first_vertex (CoglPrimitive *primitive)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_primitive (primitive), 0);
+ g_return_val_if_fail (cogl_is_primitive (primitive), 0);
return primitive->first_vertex;
}
@@ -486,7 +486,7 @@ cogl_primitive_set_first_vertex (CoglPrimitive *primitive,
int
cogl_primitive_get_n_vertices (CoglPrimitive *primitive)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_primitive (primitive), 0);
+ g_return_val_if_fail (cogl_is_primitive (primitive), 0);
return primitive->n_vertices;
}
@@ -503,7 +503,7 @@ cogl_primitive_set_n_vertices (CoglPrimitive *primitive,
CoglVerticesMode
cogl_primitive_get_mode (CoglPrimitive *primitive)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_primitive (primitive), 0);
+ g_return_val_if_fail (cogl_is_primitive (primitive), 0);
return primitive->mode;
}
@@ -571,7 +571,7 @@ _cogl_primitive_immutable_ref (CoglPrimitive *primitive)
{
int i;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_primitive (primitive), NULL);
+ g_return_val_if_fail (cogl_is_primitive (primitive), NULL);
primitive->immutable_ref++;
diff --git a/cogl/cogl/cogl-quaternion.c b/cogl/cogl/cogl-quaternion.c
index 3fb8648c1..20bd2ad6c 100644
--- a/cogl/cogl/cogl-quaternion.c
+++ b/cogl/cogl/cogl-quaternion.c
@@ -330,8 +330,8 @@ cogl_quaternion_equal (const void *v1, const void *v2)
const CoglQuaternion *a = v1;
const CoglQuaternion *b = v2;
- _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
+ g_return_val_if_fail (v1 != NULL, FALSE);
+ g_return_val_if_fail (v2 != NULL, FALSE);
if (v1 == v2)
return TRUE;
diff --git a/cogl/cogl/cogl-rectangle-map.c b/cogl/cogl/cogl-rectangle-map.c
index 056d68006..b966d802e 100644
--- a/cogl/cogl/cogl-rectangle-map.c
+++ b/cogl/cogl/cogl-rectangle-map.c
@@ -360,7 +360,7 @@ _cogl_rectangle_map_add (CoglRectangleMap *map,
/* Zero-sized rectangles break the algorithm for removing rectangles
so we'll disallow them */
- _COGL_RETURN_VAL_IF_FAIL (width > 0 && height > 0, FALSE);
+ g_return_val_if_fail (width > 0 && height > 0, FALSE);
/* Start with the root node */
g_array_set_size (stack, 0);
diff --git a/cogl/cogl/cogl-renderer.c b/cogl/cogl/cogl-renderer.c
index ad3858953..af1054b05 100644
--- a/cogl/cogl/cogl-renderer.c
+++ b/cogl/cogl/cogl-renderer.c
@@ -243,7 +243,7 @@ cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
Display *
cogl_xlib_renderer_get_foreign_display (CoglRenderer *renderer)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), NULL);
+ g_return_val_if_fail (cogl_is_renderer (renderer), NULL);
return renderer->foreign_xdpy;
}
@@ -759,7 +759,7 @@ cogl_renderer_set_winsys_id (CoglRenderer *renderer,
CoglWinsysID
cogl_renderer_get_winsys_id (CoglRenderer *renderer)
{
- _COGL_RETURN_VAL_IF_FAIL (renderer->connected, 0);
+ g_return_val_if_fail (renderer->connected, 0);
return renderer->winsys_vtable->id;
}
@@ -817,7 +817,7 @@ cogl_renderer_set_driver (CoglRenderer *renderer,
CoglDriver
cogl_renderer_get_driver (CoglRenderer *renderer)
{
- _COGL_RETURN_VAL_IF_FAIL (renderer->connected, 0);
+ g_return_val_if_fail (renderer->connected, 0);
return renderer->driver;
}
diff --git a/cogl/cogl/cogl-snippet.c b/cogl/cogl/cogl-snippet.c
index 85ce1146a..9b5ed7c23 100644
--- a/cogl/cogl/cogl-snippet.c
+++ b/cogl/cogl/cogl-snippet.c
@@ -64,7 +64,7 @@ cogl_snippet_new (CoglSnippetHook hook,
CoglSnippetHook
cogl_snippet_get_hook (CoglSnippet *snippet)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_snippet (snippet), 0);
+ g_return_val_if_fail (cogl_is_snippet (snippet), 0);
return snippet->hook;
}
@@ -100,7 +100,7 @@ cogl_snippet_set_declarations (CoglSnippet *snippet,
const char *
cogl_snippet_get_declarations (CoglSnippet *snippet)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_snippet (snippet), NULL);
+ g_return_val_if_fail (cogl_is_snippet (snippet), NULL);
return snippet->declarations;
}
@@ -121,7 +121,7 @@ cogl_snippet_set_pre (CoglSnippet *snippet,
const char *
cogl_snippet_get_pre (CoglSnippet *snippet)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_snippet (snippet), NULL);
+ g_return_val_if_fail (cogl_is_snippet (snippet), NULL);
return snippet->pre;
}
@@ -142,7 +142,7 @@ cogl_snippet_set_replace (CoglSnippet *snippet,
const char *
cogl_snippet_get_replace (CoglSnippet *snippet)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_snippet (snippet), NULL);
+ g_return_val_if_fail (cogl_is_snippet (snippet), NULL);
return snippet->replace;
}
@@ -163,7 +163,7 @@ cogl_snippet_set_post (CoglSnippet *snippet,
const char *
cogl_snippet_get_post (CoglSnippet *snippet)
{
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_snippet (snippet), NULL);
+ g_return_val_if_fail (cogl_is_snippet (snippet), NULL);
return snippet->post;
}
diff --git a/cogl/cogl/cogl-sub-texture.c b/cogl/cogl/cogl-sub-texture.c
index dc5cf2a2d..2ec691320 100644
--- a/cogl/cogl/cogl-sub-texture.c
+++ b/cogl/cogl/cogl-sub-texture.c
@@ -195,10 +195,10 @@ cogl_sub_texture_new (CoglContext *ctx,
next_height = cogl_texture_get_height (next_texture);
/* The region must specify a non-zero subset of the full texture */
- _COGL_RETURN_VAL_IF_FAIL (sub_x >= 0 && sub_y >= 0, NULL);
- _COGL_RETURN_VAL_IF_FAIL (sub_width > 0 && sub_height > 0, NULL);
- _COGL_RETURN_VAL_IF_FAIL (sub_x + sub_width <= next_width, NULL);
- _COGL_RETURN_VAL_IF_FAIL (sub_y + sub_height <= next_height, NULL);
+ g_return_val_if_fail (sub_x >= 0 && sub_y >= 0, NULL);
+ g_return_val_if_fail (sub_width > 0 && sub_height > 0, NULL);
+ g_return_val_if_fail (sub_x + sub_width <= next_width, NULL);
+ g_return_val_if_fail (sub_y + sub_height <= next_height, NULL);
sub_tex = g_new (CoglSubTexture, 1);
@@ -373,10 +373,10 @@ _cogl_sub_texture_set_region (CoglTexture *tex,
int full_width = cogl_texture_get_width (sub_tex->full_texture);
int full_height = cogl_texture_get_width (sub_tex->full_texture);
- _COGL_RETURN_VAL_IF_FAIL (sub_tex->sub_x == 0 &&
+ g_return_val_if_fail (sub_tex->sub_x == 0 &&
cogl_texture_get_width (tex) == full_width,
FALSE);
- _COGL_RETURN_VAL_IF_FAIL (sub_tex->sub_y == 0 &&
+ g_return_val_if_fail (sub_tex->sub_y == 0 &&
cogl_texture_get_height (tex) == full_height,
FALSE);
}
diff --git a/cogl/cogl/cogl-texture-2d-sliced.c b/cogl/cogl/cogl-texture-2d-sliced.c
index 8b7d37d42..a5cd57b0b 100644
--- a/cogl/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl/cogl-texture-2d-sliced.c
@@ -891,7 +891,7 @@ _cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
{
CoglTextureLoader *loader;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_bitmap (bmp), NULL);
+ g_return_val_if_fail (cogl_is_bitmap (bmp), NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
@@ -932,16 +932,16 @@ _cogl_texture_2d_sliced_new_from_foreign (CoglContext *ctx,
*/
/* This should only be called when the texture target is 2D. */
- _COGL_RETURN_VAL_IF_FAIL (gl_target == GL_TEXTURE_2D, NULL);
+ g_return_val_if_fail (gl_target == GL_TEXTURE_2D, NULL);
/* Assert it is a valid GL texture object */
- _COGL_RETURN_VAL_IF_FAIL (ctx->glIsTexture (gl_handle), FALSE);
+ g_return_val_if_fail (ctx->glIsTexture (gl_handle), FALSE);
/* Validate width and height */
- _COGL_RETURN_VAL_IF_FAIL (width > 0 && height > 0, NULL);
+ g_return_val_if_fail (width > 0 && height > 0, NULL);
/* Validate pot waste */
- _COGL_RETURN_VAL_IF_FAIL (x_pot_waste >= 0 && x_pot_waste < width &&
+ g_return_val_if_fail (x_pot_waste >= 0 && x_pot_waste < width &&
y_pot_waste >= 0 && y_pot_waste < height,
NULL);
@@ -972,8 +972,8 @@ cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
CoglBitmap *bmp;
CoglTexture2DSliced *tex_2ds;
- _COGL_RETURN_VAL_IF_FAIL (format != COGL_PIXEL_FORMAT_ANY, NULL);
- _COGL_RETURN_VAL_IF_FAIL (data != NULL, NULL);
+ g_return_val_if_fail (format != COGL_PIXEL_FORMAT_ANY, NULL);
+ g_return_val_if_fail (data != NULL, NULL);
/* Rowstride from width if not given */
if (rowstride == 0)
@@ -1009,7 +1009,7 @@ cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
CoglBitmap *bmp;
CoglTexture2DSliced *tex_2ds = NULL;
- _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
bmp = _cogl_bitmap_from_file (ctx, filename, error);
if (bmp == NULL)
@@ -1063,7 +1063,7 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds,
CoglPixelFormat internal_format;
CoglBitmap *upload_bmp;
- _COGL_RETURN_VAL_IF_FAIL (tex_2ds->slice_textures == NULL, FALSE);
+ g_return_val_if_fail (tex_2ds->slice_textures == NULL, FALSE);
internal_format =
_cogl_texture_determine_internal_format (tex,
@@ -1175,7 +1175,7 @@ _cogl_texture_2d_sliced_allocate (CoglTexture *tex,
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
CoglTextureLoader *loader = tex->loader;
- _COGL_RETURN_VAL_IF_FAIL (loader, FALSE);
+ g_return_val_if_fail (loader, FALSE);
switch (loader->src_type)
{
diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c
index 73bf7a91f..ee4a5a02f 100644
--- a/cogl/cogl/cogl-texture-2d.c
+++ b/cogl/cogl/cogl-texture-2d.c
@@ -148,7 +148,7 @@ _cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp,
{
CoglTextureLoader *loader;
- _COGL_RETURN_VAL_IF_FAIL (bmp != NULL, NULL);
+ g_return_val_if_fail (bmp != NULL, NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
@@ -177,7 +177,7 @@ cogl_texture_2d_new_from_file (CoglContext *ctx,
CoglBitmap *bmp;
CoglTexture2D *tex_2d = NULL;
- _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
bmp = _cogl_bitmap_from_file (ctx, filename, error);
if (bmp == NULL)
@@ -203,8 +203,8 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
CoglBitmap *bmp;
CoglTexture2D *tex_2d;
- _COGL_RETURN_VAL_IF_FAIL (format != COGL_PIXEL_FORMAT_ANY, NULL);
- _COGL_RETURN_VAL_IF_FAIL (data != NULL, NULL);
+ g_return_val_if_fail (format != COGL_PIXEL_FORMAT_ANY, NULL);
+ g_return_val_if_fail (data != NULL, NULL);
/* Rowstride from width if not given */
if (rowstride == 0)
@@ -246,14 +246,14 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
CoglTextureLoader *loader;
CoglTexture2D *tex;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_context_get_winsys (ctx)->constraints &
- COGL_RENDERER_CONSTRAINT_USES_EGL,
- NULL);
+ g_return_val_if_fail (_cogl_context_get_winsys (ctx)->constraints &
+ COGL_RENDERER_CONSTRAINT_USES_EGL,
+ NULL);
- _COGL_RETURN_VAL_IF_FAIL (_cogl_has_private_feature
+ g_return_val_if_fail (_cogl_has_private_feature
(ctx,
COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE),
- NULL);
+ NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE;
diff --git a/cogl/cogl/cogl-texture.c b/cogl/cogl/cogl-texture.c
index e4d32d7b5..7b5e860ca 100644
--- a/cogl/cogl/cogl-texture.c
+++ b/cogl/cogl/cogl-texture.c
@@ -365,12 +365,10 @@ _cogl_texture_set_region_from_bitmap (CoglTexture *texture,
int level,
CoglError **error)
{
- _COGL_RETURN_VAL_IF_FAIL ((cogl_bitmap_get_width (bmp) - src_x)
- >= width, FALSE);
- _COGL_RETURN_VAL_IF_FAIL ((cogl_bitmap_get_height (bmp) - src_y)
- >= height, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (width > 0, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (height > 0, FALSE);
+ g_return_val_if_fail (cogl_bitmap_get_width (bmp) - src_x >= width, FALSE);
+ g_return_val_if_fail (cogl_bitmap_get_height (bmp) - src_y >= height, FALSE);
+ g_return_val_if_fail (width > 0, FALSE);
+ g_return_val_if_fail (height > 0, FALSE);
/* Assert that the storage for this texture has been allocated */
if (!cogl_texture_allocate (texture, error))
@@ -433,7 +431,7 @@ _cogl_texture_set_region (CoglTexture *texture,
CoglBitmap *source_bmp;
gboolean ret;
- _COGL_RETURN_VAL_IF_FAIL (format != COGL_PIXEL_FORMAT_ANY, FALSE);
+ g_return_val_if_fail (format != COGL_PIXEL_FORMAT_ANY, FALSE);
/* Rowstride from width if none specified */
if (rowstride == 0)
diff --git a/cogl/cogl/cogl-util.h b/cogl/cogl/cogl-util.h
index cb05e0e03..8ebf01bb9 100644
--- a/cogl/cogl/cogl-util.h
+++ b/cogl/cogl/cogl-util.h
@@ -124,8 +124,6 @@ _cogl_util_fls (unsigned int n)
#define _cogl_util_popcountl __builtin_popcountl
-#define _COGL_RETURN_VAL_IF_FAIL(EXPR, VAL) g_return_val_if_fail(EXPR, VAL)
-
/* Match a CoglPixelFormat according to channel masks, color depth,
* bits per pixel and byte order. These information are provided by
* the Visual and XImage structures.
diff --git a/cogl/cogl/cogl-vector.c b/cogl/cogl/cogl-vector.c
index a2f3deca7..4a9da42c4 100644
--- a/cogl/cogl/cogl-vector.c
+++ b/cogl/cogl/cogl-vector.c
@@ -63,8 +63,8 @@ cogl_vector3_equal (const void *v1, const void *v2)
float *vector0 = (float *)v1;
float *vector1 = (float *)v2;
- _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
+ g_return_val_if_fail (v1 != NULL, FALSE);
+ g_return_val_if_fail (v2 != NULL, FALSE);
/* There's no point picking an arbitrary epsilon that's appropriate
* for comparing the components so we just use == that will at least
@@ -80,8 +80,8 @@ cogl_vector3_equal_with_epsilon (const float *vector0,
const float *vector1,
float epsilon)
{
- _COGL_RETURN_VAL_IF_FAIL (vector0 != NULL, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (vector1 != NULL, FALSE);
+ g_return_val_if_fail (vector0 != NULL, FALSE);
+ g_return_val_if_fail (vector1 != NULL, FALSE);
if (fabsf (vector0[X] - vector1[X]) < epsilon &&
fabsf (vector0[Y] - vector1[Y]) < epsilon &&
@@ -233,8 +233,8 @@ cogl_vector4_init_from_vector4 (float *vector, float *src)
gboolean
cogl_vector4_equal (const void *v0, const void *v1)
{
- _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
+ g_return_val_if_fail (v1 != NULL, FALSE);
+ g_return_val_if_fail (v2 != NULL, FALSE);
return memcmp (v1, v2, sizeof (float) * 4) == 0 ? TRUE : FALSE;
}
diff --git a/cogl/cogl/cogl-xlib-renderer.c b/cogl/cogl/cogl-xlib-renderer.c
index ea1a47e46..2e88b5522 100644
--- a/cogl/cogl/cogl-xlib-renderer.c
+++ b/cogl/cogl/cogl-xlib-renderer.c
@@ -566,7 +566,7 @@ cogl_xlib_renderer_get_display (CoglRenderer *renderer)
{
CoglXlibRenderer *xlib_renderer;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), NULL);
+ g_return_val_if_fail (cogl_is_renderer (renderer), NULL);
xlib_renderer = _cogl_xlib_renderer_get_data (renderer);
@@ -655,7 +655,7 @@ cogl_xlib_renderer_get_visual_info (CoglRenderer *renderer)
{
CoglXlibRenderer *xlib_renderer;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), NULL);
+ g_return_val_if_fail (cogl_is_renderer (renderer), NULL);
xlib_renderer = _cogl_xlib_renderer_get_data (renderer);
diff --git a/cogl/cogl/cogl.c b/cogl/cogl/cogl.c
index 617da6ea2..bf46ea055 100644
--- a/cogl/cogl/cogl.c
+++ b/cogl/cogl/cogl.c
@@ -617,7 +617,7 @@ cogl_get_source (void)
_COGL_GET_CONTEXT (ctx, NULL);
- _COGL_RETURN_VAL_IF_FAIL (ctx->source_stack, NULL);
+ g_return_val_if_fail (ctx->source_stack, NULL);
top = ctx->source_stack->data;
return top->pipeline;
@@ -630,7 +630,7 @@ _cogl_get_enable_legacy_state (void)
_COGL_GET_CONTEXT (ctx, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (ctx->source_stack, FALSE);
+ g_return_val_if_fail (ctx->source_stack, FALSE);
top = ctx->source_stack->data;
return top->enable_legacy;
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.c b/cogl/cogl/deprecated/cogl-auto-texture.c
index ea5fedcc2..e24409dc1 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.c
+++ b/cogl/cogl/deprecated/cogl-auto-texture.c
@@ -144,8 +144,8 @@ _cogl_texture_new_from_data (CoglContext *ctx,
CoglBitmap *bmp;
CoglTexture *tex;
- _COGL_RETURN_VAL_IF_FAIL (format != COGL_PIXEL_FORMAT_ANY, NULL);
- _COGL_RETURN_VAL_IF_FAIL (data != NULL, NULL);
+ g_return_val_if_fail (format != COGL_PIXEL_FORMAT_ANY, NULL);
+ g_return_val_if_fail (data != NULL, NULL);
/* Rowstride from width if not given */
if (rowstride == 0)
@@ -297,7 +297,7 @@ cogl_texture_new_from_file (const char *filename,
_COGL_GET_CONTEXT (ctx, NULL);
- _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
bmp = cogl_bitmap_new_from_file (filename, error);
if (bmp == NULL)
diff --git a/cogl/cogl/deprecated/cogl-clutter.c b/cogl/cogl/deprecated/cogl-clutter.c
index abe59862a..21c7affdc 100644
--- a/cogl/cogl/deprecated/cogl-clutter.c
+++ b/cogl/cogl/deprecated/cogl-clutter.c
@@ -102,10 +102,10 @@ cogl_clutter_winsys_xlib_get_visual_info (void)
_COGL_GET_CONTEXT (ctx, NULL);
- _COGL_RETURN_VAL_IF_FAIL (ctx->display != NULL, NULL);
+ g_return_val_if_fail (ctx->display != NULL, NULL);
renderer = cogl_display_get_renderer (ctx->display);
- _COGL_RETURN_VAL_IF_FAIL (renderer != NULL, NULL);
+ g_return_val_if_fail (renderer != NULL, NULL);
return cogl_xlib_renderer_get_visual_info (renderer);
}
diff --git a/cogl/cogl/deprecated/cogl-program.c b/cogl/cogl/deprecated/cogl-program.c
index 29935fc63..ecd54d7e1 100644
--- a/cogl/cogl/deprecated/cogl-program.c
+++ b/cogl/cogl/deprecated/cogl-program.c
@@ -193,10 +193,10 @@ cogl_program_modify_uniform (CoglProgram *program,
{
CoglProgramUniform *uniform;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_program (program), NULL);
- _COGL_RETURN_VAL_IF_FAIL (uniform_no >= 0 &&
- uniform_no < program->custom_uniforms->len,
- NULL);
+ g_return_val_if_fail (cogl_is_program (program), NULL);
+ g_return_val_if_fail (uniform_no >= 0 &&
+ uniform_no < program->custom_uniforms->len,
+ NULL);
uniform = &g_array_index (program->custom_uniforms,
CoglProgramUniform, uniform_no);
diff --git a/cogl/cogl/driver/gl/cogl-attribute-gl.c b/cogl/cogl/driver/gl/cogl-attribute-gl.c
index 8b160bbd9..18a4ef4c9 100644
--- a/cogl/cogl/driver/gl/cogl-attribute-gl.c
+++ b/cogl/cogl/driver/gl/cogl-attribute-gl.c
@@ -60,9 +60,9 @@ toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
ForeachChangedBitState *state = user_data;
CoglContext *context = state->context;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_has_private_feature
- (context, COGL_PRIVATE_FEATURE_GL_FIXED),
- FALSE);
+ g_return_val_if_fail (_cogl_has_private_feature
+ (context, COGL_PRIVATE_FEATURE_GL_FIXED),
+ FALSE);
#ifdef HAVE_COGL_GL
{
@@ -99,7 +99,7 @@ toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
ForeachChangedBitState *state = user_data;
CoglContext *context = state->context;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_has_private_feature
+ g_return_val_if_fail (_cogl_has_private_feature
(context, COGL_PRIVATE_FEATURE_GL_FIXED),
FALSE);
diff --git a/cogl/cogl/driver/gl/cogl-buffer-gl.c b/cogl/cogl/driver/gl/cogl-buffer-gl.c
index 6bbff8d99..a75730988 100644
--- a/cogl/cogl/driver/gl/cogl-buffer-gl.c
+++ b/cogl/cogl/driver/gl/cogl-buffer-gl.c
@@ -178,14 +178,14 @@ _cogl_buffer_bind_no_create (CoglBuffer *buffer,
{
CoglContext *ctx = buffer->context;
- _COGL_RETURN_VAL_IF_FAIL (buffer != NULL, NULL);
+ g_return_val_if_fail (buffer != NULL, NULL);
/* Don't allow binding the buffer to multiple targets at the same time */
- _COGL_RETURN_VAL_IF_FAIL (ctx->current_buffer[buffer->last_target] != buffer,
+ g_return_val_if_fail (ctx->current_buffer[buffer->last_target] != buffer,
NULL);
/* Don't allow nesting binds to the same target */
- _COGL_RETURN_VAL_IF_FAIL (ctx->current_buffer[target] == NULL, NULL);
+ g_return_val_if_fail (ctx->current_buffer[target] == NULL, NULL);
buffer->last_target = target;
ctx->current_buffer[target] = buffer;
@@ -290,7 +290,7 @@ _cogl_buffer_gl_map_range (CoglBuffer *buffer,
return NULL;
}
- _COGL_RETURN_VAL_IF_FAIL (data != NULL, NULL);
+ g_return_val_if_fail (data != NULL, NULL);
}
else
{
@@ -319,7 +319,7 @@ _cogl_buffer_gl_map_range (CoglBuffer *buffer,
return NULL;
}
- _COGL_RETURN_VAL_IF_FAIL (data != NULL, NULL);
+ g_return_val_if_fail (data != NULL, NULL);
data += offset;
}
diff --git a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
index 845a1757b..325541408 100644
--- a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
+++ b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
@@ -529,7 +529,7 @@ try_creating_renderbuffers (CoglContext *ctx,
format = GL_DEPTH_STENCIL;
else
{
- _COGL_RETURN_VAL_IF_FAIL (
+ g_return_val_if_fail (
_cogl_has_private_feature (ctx,
COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL),
NULL);
@@ -779,9 +779,9 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
int level_width;
int level_height;
- _COGL_RETURN_VAL_IF_FAIL (offscreen->texture_level <
- _cogl_texture_get_n_levels (offscreen->texture),
- FALSE);
+ g_return_val_if_fail (offscreen->texture_level <
+ _cogl_texture_get_n_levels (offscreen->texture),
+ FALSE);
_cogl_texture_get_level_size (offscreen->texture,
offscreen->texture_level,
diff --git a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
index 25a64e8d8..dfcd8ce8f 100644
--- a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
+++ b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
@@ -180,8 +180,8 @@ _cogl_pipeline_progend_glsl_get_attrib_location (CoglPipeline *pipeline,
_COGL_GET_CONTEXT (ctx, -1);
- _COGL_RETURN_VAL_IF_FAIL (program_state != NULL, -1);
- _COGL_RETURN_VAL_IF_FAIL (program_state->program != 0, -1);
+ g_return_val_if_fail (program_state != NULL, -1);
+ g_return_val_if_fail (program_state->program != 0, -1);
if (G_UNLIKELY (program_state->attribute_locations == NULL))
program_state->attribute_locations =
@@ -204,7 +204,7 @@ _cogl_pipeline_progend_glsl_get_attrib_location (CoglPipeline *pipeline,
g_array_index (ctx->attribute_name_index_map,
CoglAttributeNameState *, name_index);
- _COGL_RETURN_VAL_IF_FAIL (name_state != NULL, 0);
+ g_return_val_if_fail (name_state != NULL, 0);
GE_RET( locations[name_index],
ctx, glGetAttribLocation (program_state->program,
diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
index 2f9e3424c..cc9c7eb73 100644
--- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
+++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
@@ -524,13 +524,13 @@ cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
CoglTexture2D *tex_2d;
CoglPixelFormat internal_format = COGL_PIXEL_FORMAT_ANY;
- _COGL_RETURN_VAL_IF_FAIL (_cogl_context_get_winsys (ctx)->constraints &
- COGL_RENDERER_CONSTRAINT_USES_EGL,
- NULL);
+ g_return_val_if_fail (_cogl_context_get_winsys (ctx)->constraints &
+ COGL_RENDERER_CONSTRAINT_USES_EGL,
+ NULL);
- _COGL_RETURN_VAL_IF_FAIL (cogl_has_feature (ctx,
- COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL),
- NULL);
+ g_return_val_if_fail (cogl_has_feature (ctx,
+ COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL),
+ NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE_EXTERNAL;
@@ -557,7 +557,7 @@ _cogl_texture_2d_gl_allocate (CoglTexture *tex,
CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
CoglTextureLoader *loader = tex->loader;
- _COGL_RETURN_VAL_IF_FAIL (loader, FALSE);
+ g_return_val_if_fail (loader, FALSE);
switch (loader->src_type)
{
@@ -659,10 +659,10 @@ cogl_texture_2d_gl_new_from_foreign (CoglContext *ctx,
*/
/* Assert it is a valid GL texture object */
- _COGL_RETURN_VAL_IF_FAIL (ctx->glIsTexture (gl_handle), FALSE);
+ g_return_val_if_fail (ctx->glIsTexture (gl_handle), FALSE);
/* Validate width and height */
- _COGL_RETURN_VAL_IF_FAIL (width > 0 && height > 0, NULL);
+ g_return_val_if_fail (width > 0 && height > 0, NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_GL_FOREIGN;
diff --git a/cogl/cogl/winsys/cogl-winsys-egl.c b/cogl/cogl/winsys/cogl-winsys-egl.c
index f151bef6f..b9a484bfa 100644
--- a/cogl/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/cogl/winsys/cogl-winsys-egl.c
@@ -359,7 +359,7 @@ try_create_context (CoglDisplay *display,
const char *error_message;
int i = 0;
- _COGL_RETURN_VAL_IF_FAIL (egl_display->egl_context == NULL, TRUE);
+ g_return_val_if_fail (egl_display->egl_context == NULL, TRUE);
if (renderer->driver == COGL_DRIVER_GL ||
renderer->driver == COGL_DRIVER_GL3)
@@ -486,7 +486,7 @@ _cogl_winsys_display_setup (CoglDisplay *display,
CoglRenderer *renderer = display->renderer;
CoglRendererEGL *egl_renderer = renderer->winsys;
- _COGL_RETURN_VAL_IF_FAIL (display->winsys == NULL, FALSE);
+ g_return_val_if_fail (display->winsys == NULL, FALSE);
egl_display = g_slice_new0 (CoglDisplayEGL);
display->winsys = egl_display;
@@ -528,7 +528,7 @@ _cogl_winsys_context_init (CoglContext *context, CoglError **error)
context->winsys = g_new0 (CoglContextEGL, 1);
- _COGL_RETURN_VAL_IF_FAIL (egl_display->egl_context, FALSE);
+ g_return_val_if_fail (egl_display->egl_context, FALSE);
memset (context->winsys_features, 0, sizeof (context->winsys_features));
@@ -647,7 +647,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
EGLint config_count = 0;
EGLBoolean status;
- _COGL_RETURN_VAL_IF_FAIL (egl_display->egl_context, FALSE);
+ g_return_val_if_fail (egl_display->egl_context, FALSE);
egl_attributes_from_framebuffer_config (display,
&framebuffer->config,
@@ -1034,7 +1034,7 @@ _cogl_egl_create_image (CoglContext *ctx,
CoglRendererEGL *egl_renderer = ctx->display->renderer->winsys;
EGLContext egl_ctx;
- _COGL_RETURN_VAL_IF_FAIL (egl_renderer->pf_eglCreateImage, EGL_NO_IMAGE_KHR);
+ g_return_val_if_fail (egl_renderer->pf_eglCreateImage, EGL_NO_IMAGE_KHR);
/* The EGL_KHR_image_pixmap spec explicitly states that EGL_NO_CONTEXT must
* always be used in conjunction with the EGL_NATIVE_PIXMAP_KHR target */
@@ -1080,7 +1080,7 @@ _cogl_egl_query_wayland_buffer (CoglContext *ctx,
{
CoglRendererEGL *egl_renderer = ctx->display->renderer->winsys;
- _COGL_RETURN_VAL_IF_FAIL (egl_renderer->pf_eglQueryWaylandBuffer, FALSE);
+ g_return_val_if_fail (egl_renderer->pf_eglQueryWaylandBuffer, FALSE);
return egl_renderer->pf_eglQueryWaylandBuffer (egl_renderer->edpy,
buffer,
diff --git a/cogl/cogl/winsys/cogl-winsys-glx.c b/cogl/cogl/winsys/cogl-winsys-glx.c
index 8a92bee39..cc4a5e3ca 100644
--- a/cogl/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/cogl/winsys/cogl-winsys-glx.c
@@ -830,7 +830,7 @@ update_winsys_features (CoglContext *context, CoglError **error)
CoglGLXDisplay *glx_display = context->display->winsys;
CoglGLXRenderer *glx_renderer = context->display->renderer->winsys;
- _COGL_RETURN_VAL_IF_FAIL (glx_display->glx_context, FALSE);
+ g_return_val_if_fail (glx_display->glx_context, FALSE);
if (!_cogl_context_update_features (context, error))
return FALSE;
@@ -1137,7 +1137,7 @@ create_context (CoglDisplay *display, CoglError **error)
GLXDrawable dummy_drawable;
CoglXlibTrapState old_state;
- _COGL_RETURN_VAL_IF_FAIL (glx_display->glx_context == NULL, TRUE);
+ g_return_val_if_fail (glx_display->glx_context == NULL, TRUE);
glx_display->found_fbconfig =
find_fbconfig (display, &display->onscreen_template->config, &config,
@@ -1303,7 +1303,7 @@ _cogl_winsys_display_setup (CoglDisplay *display,
CoglGLXDisplay *glx_display;
int i;
- _COGL_RETURN_VAL_IF_FAIL (display->winsys == NULL, FALSE);
+ g_return_val_if_fail (display->winsys == NULL, FALSE);
glx_display = g_slice_new0 (CoglGLXDisplay);
display->winsys = glx_display;
@@ -1358,7 +1358,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
GLXFBConfig fbconfig;
CoglError *fbconfig_error = NULL;
- _COGL_RETURN_VAL_IF_FAIL (glx_display->glx_context, FALSE);
+ g_return_val_if_fail (glx_display->glx_context, FALSE);
if (!find_fbconfig (display, &framebuffer->config,
&fbconfig,
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 4fee4756c..29a997c0f 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -2810,7 +2810,7 @@ meta_renderer_native_init_onscreen (CoglOnscreen *onscreen,
CoglOnscreenEGL *onscreen_egl;
MetaOnscreenNative *onscreen_native;
- _COGL_RETURN_VAL_IF_FAIL (cogl_display_egl->egl_context, FALSE);
+ g_return_val_if_fail (cogl_display_egl->egl_context, FALSE);
onscreen->winsys = g_slice_new0 (CoglOnscreenEGL);
onscreen_egl = onscreen->winsys;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]