cogl: resolves some low hanging issues flagged by clang

An initial pass over the Cogl source code using the Clang static
analysis tool flagged a few low hanging issues such as un-used variables
or redundant initializing of variables which this patch fixes.
This commit is contained in:
Robert Bragg 2010-02-11 16:12:26 +00:00
parent 18305cbd98
commit 22c33b2fea
2 changed files with 6 additions and 11 deletions

View File

@ -998,7 +998,6 @@ _cogl_texture_2d_sliced_new_with_size (unsigned int width,
CoglPixelFormat internal_format)
{
CoglTexture2DSliced *tex_2ds;
CoglTexture *tex;
CoglBitmap bmp;
/* Since no data, we need some internal format */
@ -1008,8 +1007,6 @@ _cogl_texture_2d_sliced_new_with_size (unsigned int width,
/* Init texture with empty bitmap */
tex_2ds = g_new (CoglTexture2DSliced, 1);
tex = COGL_TEXTURE (tex_2ds);
bmp.width = width;
bmp.height = height;
bmp.data = NULL;
@ -1037,7 +1034,6 @@ _cogl_texture_2d_sliced_new_from_bitmap (CoglHandle bmp_handle,
CoglPixelFormat internal_format)
{
CoglTexture2DSliced *tex_2ds;
CoglTexture *tex;
CoglBitmap *bmp = (CoglBitmap *)bmp_handle;
g_return_val_if_fail (bmp_handle != COGL_INVALID_HANDLE, COGL_INVALID_HANDLE);
@ -1045,8 +1041,6 @@ _cogl_texture_2d_sliced_new_from_bitmap (CoglHandle bmp_handle,
/* Create new texture and fill with loaded data */
tex_2ds = g_new0 (CoglTexture2DSliced, 1);
tex = COGL_TEXTURE (tex_2ds);
if (flags & COGL_TEXTURE_NO_SLICING)
tex_2ds->max_waste = -1;
else
@ -1121,7 +1115,8 @@ _cogl_texture_2d_sliced_new_from_foreign (GLuint gl_handle,
return COGL_INVALID_HANDLE;
/* Make sure binding succeeds */
gl_error = glGetError ();
while ((gl_error = glGetError ()) != GL_NO_ERROR)
;
glBindTexture (gl_target, gl_handle);
if (glGetError () != GL_NO_ERROR)
return COGL_INVALID_HANDLE;

View File

@ -800,8 +800,8 @@ do_texture_draw_and_read (CoglHandle handle,
tex_width = cogl_texture_get_width (handle);
tex_height = cogl_texture_get_height (handle);
ry1 = 0; ry2 = 0;
ty1 = 0; ty2 = 0;
ry2 = 0;
ty2 = 0;
/* Walk Y axis until whole bitmap height consumed */
for (bh = tex_height; bh > 0; bh -= viewport[3])
@ -814,8 +814,8 @@ do_texture_draw_and_read (CoglHandle handle,
ty1 = ty2;
ty2 = (ry2 / (float) tex_height);
rx1 = 0; rx2 = 0;
tx1 = 0; tx2 = 0;
rx2 = 0;
tx2 = 0;
/* Walk X axis until whole bitmap width consumed */
for (bw = tex_width; bw > 0; bw-=viewport[2])