← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3793: Prevent returning a reference to local temp object.

 

------------------------------------------------------------
revno: 3793
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2014-01-20 17:13:36 +0100
message:
  Prevent returning a reference to local temp object.
  
  The warning was raised up by CLANG, what, seems, makes sense.
modified:
  core/ForceContainer.hpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'core/ForceContainer.hpp'
--- core/ForceContainer.hpp	2013-09-24 06:14:29 +0000
+++ core/ForceContainer.hpp	2014-01-20 16:13:36 +0000
@@ -234,7 +234,7 @@
 		const Vector3r& getPermForce(Body::id_t id) { ensureSize(id); return _permForce[id]; }
 		const Vector3r& getPermTorque(Body::id_t id) { ensureSize(id); return _permTorque[id]; }
 		// single getters do the same as globally synced ones in the non-parallel flavor
-		const Vector3r& getForceSingle (Body::id_t id){ 
+		const Vector3r getForceSingle (Body::id_t id){ 
 			ensureSize(id); 
 			if (permForceUsed) {
 				return _force [id] + _permForce[id];
@@ -242,7 +242,7 @@
 				return _force [id];
 			}
 		}
-		const Vector3r& getTorqueSingle(Body::id_t id){ 
+		const Vector3r getTorqueSingle(Body::id_t id){ 
 			ensureSize(id); 
 			if (permForceUsed) {
 				return _torque[id] + _permTorque[id];