[cig-commits] commit: Added a missing 'return self' line here; which fails on optimised build.
Mercurial
hg at geodynamics.org
Mon Feb 1 15:31:27 PST 2010
changeset: 357:7723fda3994a
branch: pcu_rejig
user: JericoRevote
date: Thu Dec 10 18:57:37 2009 +1100
files: Weights/src/ConstantWeights.c Weights/src/ConstantWeights.h Weights/src/IterativeWeights.c Weights/src/IterativeWeights.h
description:
Added a missing 'return self' line here; which fails on optimised build.
Thanks to John M's eagle eyes.
diff -r 0a59d0ad7ed2 -r 7723fda3994a Weights/src/ConstantWeights.c
--- a/Weights/src/ConstantWeights.c Wed Dec 09 14:21:33 2009 +1100
+++ b/Weights/src/ConstantWeights.c Thu Dec 10 18:57:37 2009 +1100
@@ -69,6 +69,8 @@ ConstantWeights* ConstantWeights_New( Na
self->isConstructed = True;
_WeightsCalculator_Init( self, dim );
_ConstantWeights_Init( self );
+
+ return self;
}
ConstantWeights* _ConstantWeights_New( CONSTANTWEIGHTS_DEFARGS ) {
diff -r 0a59d0ad7ed2 -r 7723fda3994a Weights/src/ConstantWeights.h
--- a/Weights/src/ConstantWeights.h Wed Dec 09 14:21:33 2009 +1100
+++ b/Weights/src/ConstantWeights.h Thu Dec 10 18:57:37 2009 +1100
@@ -53,27 +53,23 @@
#ifndef __PICellerator_Weights_ConstantWeightsClass_h__
#define __PICellerator_Weights_ConstantWeightsClass_h__
-/* Textual name of this class */
-extern const Type ConstantWeights_Type;
+ /* Textual name of this class */
+ extern const Type ConstantWeights_Type;
-/* ConstantWeights information */
-#define __ConstantWeights \
- /* General info */ \
- __WeightsCalculator \
- \
- /* Virtual Info */ \
- \
+ /* ConstantWeights information */
+ #define __ConstantWeights \
+ /* General info */ \
+ __WeightsCalculator \
+ \
+ /* Virtual Info */ \
-struct ConstantWeights { __ConstantWeights };
+ struct ConstantWeights { __ConstantWeights };
-
-/*---------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
+ /*---------------------------------------------------------------------------------------------------------------------
+ ** Constructors
+ */
-
-
-ConstantWeights* ConstantWeights_New( Name name, int dim );
+ ConstantWeights* ConstantWeights_New( Name name, int dim );
#ifndef ZERO
@@ -81,42 +77,48 @@ ConstantWeights* ConstantWeights_New( Na
#endif
#define CONSTANTWEIGHTS_DEFARGS \
- WEIGHTSCALCULATOR_DEFARGS
+ WEIGHTSCALCULATOR_DEFARGS
#define CONSTANTWEIGHTS_PASSARGS \
- WEIGHTSCALCULATOR_PASSARGS
+ WEIGHTSCALCULATOR_PASSARGS
-ConstantWeights* _ConstantWeights_New( CONSTANTWEIGHTS_DEFARGS );
+ ConstantWeights* _ConstantWeights_New( CONSTANTWEIGHTS_DEFARGS );
-void _ConstantWeights_Init( void* constantWeights );
+ void _ConstantWeights_Init( void* constantWeights );
+ /* Stg_Class_Delete ConstantWeights implementation */
+ void _ConstantWeights_Delete( void* constantWeights );
-/* Stg_Class_Delete ConstantWeights implementation */
-void _ConstantWeights_Delete( void* constantWeights );
-void _ConstantWeights_Print( void* constantWeights, Stream* stream );
-#define ConstantWeights_Copy( self ) \
- (ConstantWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define ConstantWeights_DeepCopy( self ) \
- (ConstantWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _ConstantWeights_Copy( void* constantWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+ void _ConstantWeights_Print( void* constantWeights, Stream* stream );
+
+ #define ConstantWeights_Copy( self ) \
+ (ConstantWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+ #define ConstantWeights_DeepCopy( self ) \
+ (ConstantWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+ void* _ConstantWeights_Copy( void* constantWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-void* _ConstantWeights_DefaultNew( Name name ) ;
-void _ConstantWeights_AssignFromXML( void* constantWeights, Stg_ComponentFactory* cf, void* data ) ;
-void _ConstantWeights_Build( void* constantWeights, void* data ) ;
-void _ConstantWeights_Destroy( void* constantWeights, void* data ) ;
-void _ConstantWeights_Initialise( void* constantWeights, void* data ) ;
-void _ConstantWeights_Execute( void* constantWeights, void* data );
+ void* _ConstantWeights_DefaultNew( Name name );
+
+ void _ConstantWeights_AssignFromXML( void* constantWeights, Stg_ComponentFactory* cf, void* data );
+
+ void _ConstantWeights_Build( void* constantWeights, void* data );
+
+ void _ConstantWeights_Destroy( void* constantWeights, void* data );
+
+ void _ConstantWeights_Initialise( void* constantWeights, void* data );
+
+ void _ConstantWeights_Execute( void* constantWeights, void* data );
-
-void _ConstantWeights_Calculate( void* constantWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
-/*---------------------------------------------------------------------------------------------------------------------
-** Private functions
-*/
+ void _ConstantWeights_Calculate( void* constantWeights, void* _swarm, Cell_LocalIndex lCell_I );
+
+ /*---------------------------------------------------------------------------------------------------------------------
+ ** Private functions
+ */
-/*---------------------------------------------------------------------------------------------------------------------
-** Public functions
-*/
-
+ /*---------------------------------------------------------------------------------------------------------------------
+ ** Public functions
+ */
#endif
diff -r 0a59d0ad7ed2 -r 7723fda3994a Weights/src/IterativeWeights.c
--- a/Weights/src/IterativeWeights.c Wed Dec 09 14:21:33 2009 +1100
+++ b/Weights/src/IterativeWeights.c Thu Dec 10 18:57:37 2009 +1100
@@ -98,10 +98,7 @@ void _IterativeWeights_Init( void* itera
self->tolerance = tolerance;
self->alpha = alpha;
- Journal_Firewall( self->dim == 2,
- Journal_Register( Error_Type, self->type ),
- "%s only works in 2D.\n", self->type );
-
+ Journal_Firewall( self->dim == 2, Journal_Register( Error_Type, self->type ), "%s only works in 2D.\n", self->type );
}
/*------------------------------------------------------------------------------------------------------------------------
diff -r 0a59d0ad7ed2 -r 7723fda3994a Weights/src/IterativeWeights.h
--- a/Weights/src/IterativeWeights.h Wed Dec 09 14:21:33 2009 +1100
+++ b/Weights/src/IterativeWeights.h Thu Dec 10 18:57:37 2009 +1100
@@ -53,69 +53,72 @@
#ifndef __PICellerator_Weights_IterativeWeightsClass_h__
#define __PICellerator_Weights_IterativeWeightsClass_h__
-/* Textual name of this class */
-extern const Type IterativeWeights_Type;
+ /* Textual name of this class */
+ extern const Type IterativeWeights_Type;
-/* IterativeWeights information */
-#define __IterativeWeights \
- /* General info */ \
- __ConstantWeights \
- \
- /* Virtual Info */ \
- WeightsCalculator* initialWeights; \
- Iteration_Index maxIterations; \
- double tolerance; \
- double alpha; \
- Bool freeInitialWeights; \
- \
+ /* IterativeWeights information */
+ #define __IterativeWeights \
+ /* General info */ \
+ __ConstantWeights \
+ \
+ /* Virtual Info */ \
+ WeightsCalculator* initialWeights; \
+ Iteration_Index maxIterations; \
+ double tolerance; \
+ double alpha; \
+ Bool freeInitialWeights;
+
+ struct IterativeWeights { __IterativeWeights };
-struct IterativeWeights { __IterativeWeights };
+ /*---------------------------------------------------------------------------------------------------------------------
+ ** Constructors
+ */
-/*---------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
-
-
-
-
#ifndef ZERO
#define ZERO 0
#endif
#define ITERATIVEWEIGHTS_DEFARGS \
- CONSTANTWEIGHTS_DEFARGS
+ CONSTANTWEIGHTS_DEFARGS
#define ITERATIVEWEIGHTS_PASSARGS \
- CONSTANTWEIGHTS_PASSARGS
+ CONSTANTWEIGHTS_PASSARGS
-IterativeWeights* _IterativeWeights_New( ITERATIVEWEIGHTS_DEFARGS );
+ IterativeWeights* _IterativeWeights_New( ITERATIVEWEIGHTS_DEFARGS );
-/* Stg_Class_Delete IterativeWeights implementation */
-void _IterativeWeights_Delete( void* iterativeWeights );
-void _IterativeWeights_Print( void* iterativeWeights, Stream* stream );
-#define IterativeWeights_Copy( self ) \
- (IterativeWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define IterativeWeights_DeepCopy( self ) \
- (IterativeWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _IterativeWeights_Copy( void* iterativeWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+ /* Stg_Class_Delete IterativeWeights implementation */
+ void _IterativeWeights_Delete( void* iterativeWeights );
+
+ void _IterativeWeights_Print( void* iterativeWeights, Stream* stream );
+
+ #define IterativeWeights_Copy( self ) \
+ (IterativeWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+ #define IterativeWeights_DeepCopy( self ) \
+ (IterativeWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+ void* _IterativeWeights_Copy( void* iterativeWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-void* _IterativeWeights_DefaultNew( Name name ) ;
-void _IterativeWeights_AssignFromXML( void* iterativeWeights, Stg_ComponentFactory* cf, void* data ) ;
-void _IterativeWeights_Build( void* iterativeWeights, void* data ) ;
-void _IterativeWeights_Initialise( void* iterativeWeights, void* data ) ;
-void _IterativeWeights_Execute( void* iterativeWeights, void* data );
-void _IterativeWeights_Destroy( void* iterativeWeights, void* data );
+ void* _IterativeWeights_DefaultNew( Name name );
+
+ void _IterativeWeights_AssignFromXML( void* iterativeWeights, Stg_ComponentFactory* cf, void* data );
+
+ void _IterativeWeights_Build( void* iterativeWeights, void* data );
+
+ void _IterativeWeights_Initialise( void* iterativeWeights, void* data );
+
+ void _IterativeWeights_Execute( void* iterativeWeights, void* data );
+
+ void _IterativeWeights_Destroy( void* iterativeWeights, void* data );
-void _IterativeWeights_Calculate( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
-/*---------------------------------------------------------------------------------------------------------------------
-** Private functions
-*/
+ void _IterativeWeights_Calculate( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I );
+ /*---------------------------------------------------------------------------------------------------------------------
+ ** Private functions
+ */
-/*---------------------------------------------------------------------------------------------------------------------
-** Public functions
-*/
-void IterativeWeights_ScaleForConstantConstraint( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
-
+ /*---------------------------------------------------------------------------------------------------------------------
+ ** Public functions
+ */
+ void IterativeWeights_ScaleForConstantConstraint( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
#endif
More information about the CIG-COMMITS
mailing list