aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/eval.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-04 15:26:24 +0200
committermarha <marha@users.sourceforge.net>2012-09-04 15:26:24 +0200
commit67c4614f29188e4af86e1d88ee82759c896b70b5 (patch)
treed4f1c1d515dae1ead88d52d9c20369d8141de2f8 /mesalib/src/mesa/main/eval.c
parentb86e8562b1ddca2a8bc29f22a79451a041bf5293 (diff)
downloadvcxsrv-67c4614f29188e4af86e1d88ee82759c896b70b5.tar.gz
vcxsrv-67c4614f29188e4af86e1d88ee82759c896b70b5.tar.bz2
vcxsrv-67c4614f29188e4af86e1d88ee82759c896b70b5.zip
mesa git update 4 sep 2012
Diffstat (limited to 'mesalib/src/mesa/main/eval.c')
-rw-r--r--mesalib/src/mesa/main/eval.c70
1 files changed, 26 insertions, 44 deletions
diff --git a/mesalib/src/mesa/main/eval.c b/mesalib/src/mesa/main/eval.c
index 0ae349f2d..487c4ce04 100644
--- a/mesalib/src/mesa/main/eval.c
+++ b/mesalib/src/mesa/main/eval.c
@@ -384,6 +384,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
k = _mesa_evaluator_components( target );
if (k == 0) {
_mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
+ return;
}
if (ustride < k) {
@@ -415,8 +416,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
map->u1 = u1;
map->u2 = u2;
map->du = 1.0F / (u2 - u1);
- if (map->Points)
- free( map->Points );
+ free(map->Points);
map->Points = pnts;
}
@@ -474,6 +474,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
k = _mesa_evaluator_components( target );
if (k==0) {
_mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
+ return;
}
if (ustride < k) {
@@ -515,8 +516,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
map->v1 = v1;
map->v2 = v2;
map->dv = 1.0F / (v2 - v1);
- if (map->Points)
- free( map->Points );
+ free(map->Points);
map->Points = pnts;
}
@@ -1047,45 +1047,27 @@ void _mesa_free_eval_data( struct gl_context *ctx )
int i;
/* Free evaluator data */
- if (ctx->EvalMap.Map1Vertex3.Points)
- free( ctx->EvalMap.Map1Vertex3.Points );
- if (ctx->EvalMap.Map1Vertex4.Points)
- free( ctx->EvalMap.Map1Vertex4.Points );
- if (ctx->EvalMap.Map1Index.Points)
- free( ctx->EvalMap.Map1Index.Points );
- if (ctx->EvalMap.Map1Color4.Points)
- free( ctx->EvalMap.Map1Color4.Points );
- if (ctx->EvalMap.Map1Normal.Points)
- free( ctx->EvalMap.Map1Normal.Points );
- if (ctx->EvalMap.Map1Texture1.Points)
- free( ctx->EvalMap.Map1Texture1.Points );
- if (ctx->EvalMap.Map1Texture2.Points)
- free( ctx->EvalMap.Map1Texture2.Points );
- if (ctx->EvalMap.Map1Texture3.Points)
- free( ctx->EvalMap.Map1Texture3.Points );
- if (ctx->EvalMap.Map1Texture4.Points)
- free( ctx->EvalMap.Map1Texture4.Points );
- for (i = 0; i < 16; i++)
- free((ctx->EvalMap.Map1Attrib[i].Points));
-
- if (ctx->EvalMap.Map2Vertex3.Points)
- free( ctx->EvalMap.Map2Vertex3.Points );
- if (ctx->EvalMap.Map2Vertex4.Points)
- free( ctx->EvalMap.Map2Vertex4.Points );
- if (ctx->EvalMap.Map2Index.Points)
- free( ctx->EvalMap.Map2Index.Points );
- if (ctx->EvalMap.Map2Color4.Points)
- free( ctx->EvalMap.Map2Color4.Points );
- if (ctx->EvalMap.Map2Normal.Points)
- free( ctx->EvalMap.Map2Normal.Points );
- if (ctx->EvalMap.Map2Texture1.Points)
- free( ctx->EvalMap.Map2Texture1.Points );
- if (ctx->EvalMap.Map2Texture2.Points)
- free( ctx->EvalMap.Map2Texture2.Points );
- if (ctx->EvalMap.Map2Texture3.Points)
- free( ctx->EvalMap.Map2Texture3.Points );
- if (ctx->EvalMap.Map2Texture4.Points)
- free( ctx->EvalMap.Map2Texture4.Points );
- for (i = 0; i < 16; i++)
+ free(ctx->EvalMap.Map1Vertex3.Points);
+ free(ctx->EvalMap.Map1Vertex4.Points);
+ free(ctx->EvalMap.Map1Index.Points);
+ free(ctx->EvalMap.Map1Color4.Points);
+ free(ctx->EvalMap.Map1Normal.Points);
+ free(ctx->EvalMap.Map1Texture1.Points);
+ free(ctx->EvalMap.Map1Texture2.Points);
+ free(ctx->EvalMap.Map1Texture3.Points);
+ free(ctx->EvalMap.Map1Texture4.Points);
+ for (i = 0; i < Elements(ctx->EvalMap.Map1Attrib); i++)
+ free(ctx->EvalMap.Map1Attrib[i].Points);
+
+ free(ctx->EvalMap.Map2Vertex3.Points);
+ free(ctx->EvalMap.Map2Vertex4.Points);
+ free(ctx->EvalMap.Map2Index.Points);
+ free(ctx->EvalMap.Map2Color4.Points);
+ free(ctx->EvalMap.Map2Normal.Points);
+ free(ctx->EvalMap.Map2Texture1.Points);
+ free(ctx->EvalMap.Map2Texture2.Points);
+ free(ctx->EvalMap.Map2Texture3.Points);
+ free(ctx->EvalMap.Map2Texture4.Points);
+ for (i = 0; i < Elements(ctx->EvalMap.Map2Attrib); i++)
free((ctx->EvalMap.Map2Attrib[i].Points));
}