Mesa (master): glu/sgi: Move initialization of members to top of Curve constructor.
Vinson Lee
vlee at kemper.freedesktop.org
Mon Feb 15 06:29:36 UTC 2010
Module: Mesa
Branch: master
Commit: 026d4b5b9129beb463d5ffa4d2ab6b0f73506627
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=026d4b5b9129beb463d5ffa4d2ab6b0f73506627
Author: Vinson Lee <vlee at vmware.com>
Date: Sun Feb 14 22:26:30 2010 -0800
glu/sgi: Move initialization of members to top of Curve constructor.
This is a modification of commit 53d448657bd300ab68b2869b2fba76a627699baf.
The members cpts and spts are possibly used as arguments later in
the constructor.
---
src/glu/sgi/libnurbs/internals/curve.cc | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/glu/sgi/libnurbs/internals/curve.cc b/src/glu/sgi/libnurbs/internals/curve.cc
index 27e9e3c..b7c4d4a 100644
--- a/src/glu/sgi/libnurbs/internals/curve.cc
+++ b/src/glu/sgi/libnurbs/internals/curve.cc
@@ -60,6 +60,12 @@ Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c )
cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT;
order = geo->qspec[0].order;
stride = MAXCOORDS;
+ for( int i = 0; i < MAXORDER * MAXCOORDS; i++ ) {
+ cpts[i] = 0;
+ spts[i] = 0;
+ }
+ stepsize = 0;
+ minstepsize = 0;
REAL *ps = geo->cpts;
Quiltspec_ptr qs = geo->qspec;
@@ -85,14 +91,6 @@ Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c )
if( range[1] != ptb ) {
Curve lower( *this, ptb, 0 );
}
-
- for( int i = 0; i < MAXORDER * MAXCOORDS; i++ ) {
- cpts[i] = 0;
- spts[i] = 0;
- }
-
- stepsize = 0;
- minstepsize = 0;
}
/*--------------------------------------------------------------------------
More information about the mesa-commit
mailing list