cogl: Avoid pointer arithmetic on void* pointers

Some code was doing pointer arithmetic on the return value from
cogl_buffer_map which is void* pointer. This is a GCC extension so we
should try to avoid it. This patch adds casts to guint8* where
appropriate.

Based on a patch by Fan, Chun-wei.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2561
This commit is contained in:
Neil Roberts 2011-02-15 12:43:26 +00:00
parent e52cc75f07
commit fb3321d4fe
2 changed files with 4 additions and 4 deletions

View File

@ -600,7 +600,7 @@ enable_gl_state (CoglDrawFlags flags,
CoglAttribute *attribute = attributes[i];
CoglVertexArray *vertex_array;
CoglBuffer *buffer;
void *base;
guint8 *base;
#ifdef HAVE_COGL_GLES2
int attrib_location;
#endif
@ -1186,7 +1186,7 @@ _cogl_draw_indexed_attributes_array (CoglVerticesMode mode,
ValidateLayerState state;
CoglPipeline *source;
CoglBuffer *buffer;
void *base;
guint8 *base;
size_t array_offset;
size_t index_size;
GLenum indices_gl_type = 0;

View File

@ -628,7 +628,7 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
/* Mapping a buffer for read is probably a really bad thing to
do but this will only happen during debugging so it probably
doesn't matter */
verts = (cogl_buffer_map (COGL_BUFFER (state->vertex_array),
verts = ((guint8 *) cogl_buffer_map (COGL_BUFFER (state->vertex_array),
COGL_BUFFER_ACCESS_READ, 0) +
state->array_offset);