summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_save_api.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-01-15 00:29:51 +0000
committerBrian Paul <[email protected]>2004-01-15 00:29:51 +0000
commit3663c0f82527d972a7e5b85937d8da60253eb6f3 (patch)
tree6a571530e63a97a1ffb643af83474e63d7ea7229 /src/mesa/tnl/t_save_api.c
parent5bae6b90f93bb1bc2d85efe3de963fb49a38fed1 (diff)
Cosmetic changes.
Added a bunch of const qualifiers. Use _mesa_memcpy() instead of memcpy(), etc.
Diffstat (limited to 'src/mesa/tnl/t_save_api.c')
-rw-r--r--src/mesa/tnl/t_save_api.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
index 8901741ffe5..9bf884e0478 100644
--- a/src/mesa/tnl/t_save_api.c
+++ b/src/mesa/tnl/t_save_api.c
@@ -83,13 +83,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* wrong-footed on replay.
*/
static GLuint _save_copy_vertices( GLcontext *ctx,
- struct tnl_vertex_list *node )
+ const struct tnl_vertex_list *node )
{
TNLcontext *tnl = TNL_CONTEXT( ctx );
- struct tnl_prim *prim = &node->prim[node->prim_count-1];
+ const struct tnl_prim *prim = &node->prim[node->prim_count-1];
GLuint nr = prim->count;
GLuint sz = tnl->save.vertex_size;
- GLfloat *src = node->buffer + prim->start * sz;
+ const GLfloat *src = node->buffer + prim->start * sz;
GLfloat *dst = tnl->save.copied.buffer;
GLuint ovf, i;
@@ -103,23 +103,23 @@ static GLuint _save_copy_vertices( GLcontext *ctx,
case GL_LINES:
ovf = nr&1;
for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
return i;
case GL_TRIANGLES:
ovf = nr%3;
for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
return i;
case GL_QUADS:
ovf = nr&3;
for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
return i;
case GL_LINE_STRIP:
if (nr == 0)
return 0;
else {
- memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) );
return 1;
}
case GL_LINE_LOOP:
@@ -128,11 +128,11 @@ static GLuint _save_copy_vertices( GLcontext *ctx,
if (nr == 0)
return 0;
else if (nr == 1) {
- memcpy( dst, src+0, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) );
return 1;
} else {
- memcpy( dst, src+0, sz*sizeof(GLfloat) );
- memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) );
return 2;
}
case GL_TRIANGLE_STRIP:
@@ -143,7 +143,7 @@ static GLuint _save_copy_vertices( GLcontext *ctx,
default: ovf = 2 + (nr&1); break;
}
for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
return i;
default:
assert(0);
@@ -237,7 +237,7 @@ static void _save_compile_vertex_list( GLcontext *ctx )
/* Duplicate our template, increment refcounts to the storage structs:
*/
- memcpy(node->attrsz, tnl->save.attrsz, sizeof(node->attrsz));
+ _mesa_memcpy(node->attrsz, tnl->save.attrsz, sizeof(node->attrsz));
node->vertex_size = tnl->save.vertex_size;
node->buffer = tnl->save.buffer;
node->wrap_count = tnl->save.copied.nr;
@@ -295,7 +295,7 @@ static void _save_compile_vertex_list( GLcontext *ctx )
/* Deal with GL_COMPILE_AND_EXECUTE:
*/
if (ctx->ExecuteFlag) {
- _tnl_playback_vertex_list( ctx, (void *)node );
+ _tnl_playback_vertex_list( ctx, (void *) node );
}
}
@@ -350,7 +350,7 @@ static void _save_wrap_filled_vertex( GLcontext *ctx )
assert(tnl->save.counter > tnl->save.copied.nr);
for (i = 0 ; i < tnl->save.copied.nr ; i++) {
- memcpy( tnl->save.vbptr, data, tnl->save.vertex_size * sizeof(GLfloat));
+ _mesa_memcpy( tnl->save.vbptr, data, tnl->save.vertex_size * sizeof(GLfloat));
data += tnl->save.vertex_size;
tnl->save.vbptr += tnl->save.vertex_size;
tnl->save.counter--;