changeset 28:4541ca17975b

use __gshared as chipmunk heavily relies on globals and D would otherwise make them TLS
author Extrawurst
date Mon, 13 Dec 2010 21:40:56 +0100
parents b45f0b140d85
children 80058cee1a77
files trunk/chipmunkd/constraints/cpConstraint.d trunk/chipmunkd/constraints/cpDampedRotarySpring.d trunk/chipmunkd/constraints/cpDampedSpring.d trunk/chipmunkd/constraints/cpGearJoint.d trunk/chipmunkd/constraints/cpGrooveJoint.d trunk/chipmunkd/constraints/cpPinJoint.d trunk/chipmunkd/constraints/cpPivotJoint.d trunk/chipmunkd/constraints/cpRatchetJoint.d trunk/chipmunkd/constraints/cpRotaryLimitJoint.d trunk/chipmunkd/constraints/cpSimpleMotor.d trunk/chipmunkd/constraints/cpSlideJoint.d trunk/chipmunkd/cpArbiter.d trunk/chipmunkd/cpBody.d trunk/chipmunkd/cpCollision.d trunk/chipmunkd/cpPolyShape.d trunk/chipmunkd/cpShape.d trunk/chipmunkd/cpSpace.d
diffstat 17 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/chipmunkd/constraints/cpConstraint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpConstraint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -95,7 +95,7 @@
 public import chipmunkd.constraints.cpSimpleMotor;
 
 
-cpFloat cp_constraint_bias_coef = 0.1f;
+__gshared cpFloat cp_constraint_bias_coef = 0.1f;
 
 void cpConstraintDestroy(cpConstraint *constraint){}
 
--- a/trunk/chipmunkd/constraints/cpDampedRotarySpring.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpDampedRotarySpring.d	Mon Dec 13 21:40:56 2010 +0100
@@ -81,7 +81,7 @@
 	return 0.0f;
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpDampedSpring.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpDampedSpring.d	Mon Dec 13 21:40:56 2010 +0100
@@ -91,7 +91,7 @@
 	return 0.0f;
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpGearJoint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpGearJoint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -75,7 +75,7 @@
 	return cpfabs(joint.jAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpGrooveJoint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpGrooveJoint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -112,7 +112,7 @@
 	return cpvlength(joint.jAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpPinJoint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpPinJoint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -83,7 +83,7 @@
 	return cpfabs(joint.jnAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpPivotJoint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpPivotJoint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -77,7 +77,7 @@
 	return cpvlength((cast(cpPivotJoint *)joint).jAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpRatchetJoint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpRatchetJoint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -94,7 +94,7 @@
 	return cpfabs(joint.jAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpRotaryLimitJoint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpRotaryLimitJoint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -90,7 +90,7 @@
 	return cpfabs(joint.jAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpSimpleMotor.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpSimpleMotor.d	Mon Dec 13 21:40:56 2010 +0100
@@ -66,7 +66,7 @@
 	return cpfabs(joint.jAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/constraints/cpSlideJoint.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/constraints/cpSlideJoint.d	Mon Dec 13 21:40:56 2010 +0100
@@ -102,7 +102,7 @@
 	return cpfabs((cast(cpSlideJoint *)joint).jnAcc);
 }
 
-static /+const+/ cpConstraintClass klass = {
+__gshared /+const+/ cpConstraintClass klass = {
 	cast(cpConstraintPreStepFunction)&preStep,
 	cast(cpConstraintApplyImpulseFunction)&applyImpulse,
 	cast(cpConstraintGetImpulseFunction)&getImpulse,
--- a/trunk/chipmunkd/cpArbiter.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/cpArbiter.d	Mon Dec 13 21:40:56 2010 +0100
@@ -183,8 +183,8 @@
 
 // cpArbiter.c --------------------------
 
-cpFloat cp_bias_coef = 0.1f;
-cpFloat cp_collision_slop = 0.1f;
+__gshared cpFloat cp_bias_coef = 0.1f;
+__gshared cpFloat cp_collision_slop = 0.1f;
 
 cpContact*
 cpContactInit(cpContact *con, cpVect p, cpVect n, cpFloat dist, cpHashValue hash)
--- a/trunk/chipmunkd/cpBody.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/cpBody.d	Mon Dec 13 21:40:56 2010 +0100
@@ -220,7 +220,7 @@
 //void cpApplyDampedSpring(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat rlen, cpFloat k, cpFloat dmp, cpFloat dt);
 
 // initialized in cpInitChipmunk()
-cpBody cpStaticBodySingleton;
+__gshared cpBody cpStaticBodySingleton;
 
 cpBody*
 cpBodyAlloc()
@@ -228,8 +228,8 @@
 	return cast(cpBody *)cpmalloc(cpBody.sizeof);
 }
 
-cpBodyVelocityFunc cpBodyUpdateVelocityDefault = &cpBodyUpdateVelocity;
-cpBodyPositionFunc cpBodyUpdatePositionDefault = &cpBodyUpdatePosition;
+__gshared cpBodyVelocityFunc cpBodyUpdateVelocityDefault = &cpBodyUpdateVelocity;
+__gshared cpBodyPositionFunc cpBodyUpdatePositionDefault = &cpBodyUpdatePosition;
 
 cpBody*
 cpBodyInit(cpBody *_body, cpFloat m, cpFloat i)
--- a/trunk/chipmunkd/cpCollision.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/cpCollision.d	Mon Dec 13 21:40:56 2010 +0100
@@ -351,7 +351,7 @@
 	&poly2poly,
 ];
 
-static collisionFunc[cpShapeType.CP_NUM_SHAPES * cpShapeType.CP_NUM_SHAPES] colfuncs = builtinCollisionFuncs;
+__gshared collisionFunc[cpShapeType.CP_NUM_SHAPES * cpShapeType.CP_NUM_SHAPES] colfuncs = builtinCollisionFuncs;
 
 static void
 addColFunc(const cpShapeType a, const cpShapeType b, collisionFunc func)
--- a/trunk/chipmunkd/cpPolyShape.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/cpPolyShape.d	Mon Dec 13 21:40:56 2010 +0100
@@ -195,7 +195,7 @@
 	}
 }
 
-static /+const+/ cpShapeClass polyClass = {
+__gshared /+const+/ cpShapeClass polyClass = {
 	cpShapeType.CP_POLY_SHAPE,
 	&cpPolyShapeCacheData,
 	&cpPolyShapeDestroy,
--- a/trunk/chipmunkd/cpShape.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/cpShape.d	Mon Dec 13 21:40:56 2010 +0100
@@ -168,7 +168,7 @@
 	return cpvdist(start, end)*info.t;
 }
 
-cpHashValue SHAPE_ID_COUNTER = 0;
+__gshared cpHashValue SHAPE_ID_COUNTER = 0;
 
 void
 cpResetShapeIdCounter()
@@ -309,7 +309,7 @@
 	circleSegmentQuery(shape, circle.tc, circle.r, a, b, info);
 }
 
-static /+const+/ cpShapeClass cpCircleShapeClass = {
+__gshared /+const+/ cpShapeClass cpCircleShapeClass = {
 	cpShapeType.CP_CIRCLE_SHAPE,
 	&cpCircleShapeCacheData,
 	null,
@@ -459,7 +459,7 @@
 	}
 }
 
-static /+const+/ cpShapeClass cpSegmentShapeClass = {
+__gshared /+const+/ cpShapeClass cpSegmentShapeClass = {
 	cpShapeType.CP_SEGMENT_SHAPE,
 	&cpSegmentShapeCacheData,
 	null,
--- a/trunk/chipmunkd/cpSpace.d	Mon Dec 13 21:24:12 2010 +0100
+++ b/trunk/chipmunkd/cpSpace.d	Mon Dec 13 21:40:56 2010 +0100
@@ -185,7 +185,7 @@
 //void cpSpaceStep(cpSpace *space, cpFloat dt);
 
 
-cpTimestamp cp_contact_persistence = 3;
+__gshared cpTimestamp cp_contact_persistence = 3;
 
 // Equal function for contactSet.
 static cpBool
@@ -256,7 +256,7 @@
 enum DEFAULT_ITERATIONS				= 10;
 enum DEFAULT_ELASTIC_ITERATIONS		= 0;
 
-cpCollisionHandler defaultHandler = {0, 0, &alwaysCollide, &alwaysCollide, &nothing, &nothing, null};
+__gshared cpCollisionHandler defaultHandler = {0, 0, &alwaysCollide, &alwaysCollide, &nothing, &nothing, null};
 
 cpSpace*
 cpSpaceInit(cpSpace *space)