Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007612opensim[REGION] Physics Enginespublic2015-06-14 03:322019-02-05 12:27
Reporteraiaustin 
Assigned ToRobert Adams 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformPCOSWindowsOS Version8.1
Product Versionmaster (dev code) 
Target Versionmaster (dev code)Fixed in Versionmaster (dev code) 
Summary0007612: [BULLETSIM] Tidy Compiler Warnings
DescriptionThere are two compiler warnings issued on a compile of r/26072 (12-Jun-2015) under Windows 8.1 for BulletSim related code ...

"D:\Temp\opensim-54c1659\opensim.sln" (default target) (1) ->
"D:\Temp\opensim-54c1659\OpenSim\Region\Physics\BulletSPlugin\OpenSim.Region.Physics.BulletSPlugin.csproj" (default target) (76) ->
  BSCharacter.cs(64,18): warning CS0169: The field 'OpenSim.Region.Physics.BulletSPlugin.BSCharacter._usePID' is never used [D:\Temp\opensim-54c1659\OpenSim\Region\Physics\BulletSPlugin\OpenSim.Region.Physics.BulletSPlugin.csproj]
  BSLinksetCompound.cs(335,24): warning CS0414: The field 'OpenSim.Region.Physics.BulletSPlugin.BSLinksetCompound.LinksetRebuildFailureLoopPrevention' is assigned but its value is never used [D:\Temp\opensim-54c1659\OpenSim\Region\Physics\BulletSPlugin\OpenSim.Region.Physics.BulletSPlugin.csproj]


"D:\Temp\opensim-54c1659\opensim.sln" (default target) (1) ->
"D:\Temp\opensim-54c1659\OpenSim\Region\Physics\BulletSPlugin\Tests\OpenSim.Region.Physics.BulletSPlugin.Tests.csproj" (default target) (79) ->
  HullCreation.cs(53,11): warning CS0414: The field 'OpenSim.Region.Physics.BulletSPlugin.Tests.HullCreation.simulationTimeStep' is assigned but its value is never used [D:\Temp\opensim-54c1659\OpenSim\Region\Physics\BulletSPlugin\Tests\OpenSim.Region.Physics.BulletSPlugin.Tests.csproj]
TagsNo tags attached.
Git Revision or version numberr/26072
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Environment.NET / Windows64
Mono VersionNone
ViewerN/A
Attached Filespatch file icon 0001-Fix-possible-typo-in-BulletS.patch [^] (3,190 bytes) 2019-02-04 11:06 [Show Content]

- Relationships

-  Notes
(0028731)
AliciaRaven (manager)
2015-06-15 01:35
edited on: 2015-06-15 01:44

Compiler warnings are nothing to worry about generally. I have however been looking into this myself as building under linux generates a lot of warnings from all over the opensim project. This is nothing new, the number of warnings generally fluctuates around 100 and has done so for as long as i have used opensim.

I have created patches to fix a lot of these warnings which i will submit at some point, i haven't yet as I feel I maybe being a bit pedantic and the core devs will think its a waste of time. They do no harm but i hate seeing warnings myself, especially when they are unused variables taking up memory.

Bullet is generating a lot of these warnings, I'm guessing because its a work in progress. I haven't created a patch for these as in some places it seems a bit strange as to why the unused variables are created. The code below is a good example, I have tried to contact misterblue on IRC to find out more about this. The code shows a method with two blocks of similar code. The first one calculates frame1 variables and assigns the result, then the second calculates frame2 variables which are never used because the value of frame1 is used again. Either frame2._origin should be set to frame2v or the frame2v variable removed if the code is correct to use the frame1v value. This is resulting in a compiler warning saying that frame2v is assigned but never used. These or similar calculations are made 5 times in the code, each time frame2v is calculated but frame1v is used instead. Is this correct? If so, why is frame2v created and not used?

public override bool SetFrames(BulletConstraint pConstraint, Vector3 pframe1, Quaternion pframe1rot, Vector3 pframe2, Quaternion pframe2rot)
    {
        Generic6DofConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofConstraint;
        IndexedVector3 frame1v = new IndexedVector3(pframe1.X, pframe1.Y, pframe1.Z);
        IndexedQuaternion frame1rot = new IndexedQuaternion(pframe1rot.X, pframe1rot.Y, pframe1rot.Z, pframe1rot.W);
        IndexedMatrix frame1 = IndexedMatrix.CreateFromQuaternion(frame1rot);
        frame1._origin = frame1v;

        IndexedVector3 frame2v = new IndexedVector3(pframe2.X, pframe2.Y, pframe2.Z);
        IndexedQuaternion frame2rot = new IndexedQuaternion(pframe2rot.X, pframe2rot.Y, pframe2rot.Z, pframe2rot.W);
        IndexedMatrix frame2 = IndexedMatrix.CreateFromQuaternion(frame2rot);
        frame2._origin = frame1v;
        constraint.SetFrames(ref frame1, ref frame2);
        return true;
    }

(0028732)
aiaustin (developer)
2015-06-15 02:04
edited on: 2015-06-15 14:06

Alicia, as an old timer coder I just find warnings makes my eyebrows rise :-)

It sounds like you get more warnings on Linux than I see on compiling core on Windows 8.1 which as of today generates 19 warnings. It could even be the case that we see slightly different issues or warnings under different platforms, so they are all worth investigating.

There used to be a few hundred but the devs had a blitz to try to clear a lot and got it down to a smaller number. So I would very much encourage you to make the changes if you understand the code and warnings well enough to fix them.

Some relate to obsolete .NET methods that will have to be changed at some stage if .NET versions change anyway.

(0028818)
Robert Adams (administrator)
2015-06-25 22:03

I checked in fixes for these two compiler warnings. There aren't others on Windows.
(0028819)
AliciaRaven (manager)
2015-06-25 23:21

These are from my last xbuild logs, just physics ones and i dont think the first block is bullet. I would expect that some are unavoidable false warnings, I havnt looked in detail myself.

Robert, if you look at the code example i posted above, do you understand why it looks wrong to me? frame2._origin is set to frame1v so why does it calculate a frame2v?
 
---

ConvexBuilder.cs(227,17): warning CS0219: The variable `vcount' is assigned but its value is never used
ConvexDecomposition.cs(175,21): warning CS0219: The variable `vcount' is assigned but its value is never used
ConvexDecomposition.cs(179,21): warning CS0219: The variable `tcount' is assigned but its value is never used
ConvexDecomposition.cs(189,21): warning CS0219: The variable `vcount' is assigned but its value is never used
ConvexDecomposition.cs(191,21): warning CS0219: The variable `tcount' is assigned but its value is never used
HullUtils.cs(674,23): warning CS0219: The variable `vertscoplanar' is assigned but its value is never used
HullUtils.cs(675,23): warning CS0219: The variable `edgesplit' is assigned but its value is never used
HullUtils.cs(1253,22): warning CS0219: The variable `ti' is assigned but its value is never used
SplitPlane.cs(112,19): warning CS0219: The variable `laxis' is assigned but its value is never used

BSAPIXNA.cs(588,24): warning CS0219: The variable `frame2v' is assigned but its value is never used
BSAPIXNA.cs(658,24): warning CS0219: The variable `frame2v' is assigned but its value is never used
BSAPIXNA.cs(1184,24): warning CS0219: The variable `world' is assigned but its value is never used
BSAPIXNA.cs(1194,35): warning CS0219: The variable `constructionInfo' is assigned but its value is never used
BSAPIXNA.cs(1383,42): warning CS0219: The variable `ccci' is assigned but its value is never used
BSAPIXNA.cs(1612,31): warning CS0219: The variable `world' is assigned but its value is never used
BSAPIXNA.cs(1633,31): warning CS0219: The variable `world' is assigned but its value is never used
BSAPIXNA.cs(1882,28): warning CS0219: The variable `frame2v' is assigned but its value is never used
BSAPIXNA.cs(1932,28): warning CS0219: The variable `frame2v' is assigned but its value is never used
BSAPIXNA.cs(1959,28): warning CS0219: The variable `frame2v' is assigned but its value is never used
BSAPIXNA.cs(2410,31): warning CS0219: The variable `world' is assigned but its value is never used
BSAPIXNA.cs(2454,40): warning CS0219: The variable `hitLocation' is assigned but its value is never used
BSScene.cs(958,15): warning CS0219: The variable `pathTaperX' is assigned but its value is never used
BSScene.cs(959,15): warning CS0219: The variable `pathTaperY' is assigned but its value is never used
BSScene.cs(1235,16): warning CS0219: The variable `xval' is assigned but its value is never used
BSApiTemplate.cs(57,10): warning CS0169: The private field `OpenSim.Region.Physics.BulletSPlugin.ConvexHull.Offset' is never used
BSApiTemplate.cs(58,6): warning CS0169: The private field `OpenSim.Region.Physics.BulletSPlugin.ConvexHull.VertexCount' is never used
BSApiTemplate.cs(59,12): warning CS0169: The private field `OpenSim.Region.Physics.BulletSPlugin.ConvexHull.Vertices' is never used
BSCharacter.cs(44,18): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSCharacter._grabbed' is assigned but its value is never used
BSCharacter.cs(63,25): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSCharacter._PIDTarget' is assigned but its value is never used
BSCharacter.cs(64,18): warning CS0169: The private field `OpenSim.Region.Physics.BulletSPlugin.BSCharacter._usePID' is never used
BSCharacter.cs(65,19): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSCharacter._PIDTau' is assigned but its value is never used
BSConstraintCollection.cs(44,25): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSConstraintCollection.m_world' is assigned but its value is never used
BSDynamics.cs(77,25): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSDynamics.m_linearMotorDirectionLASTSET' is assigned but its value is never used
BSDynamics.cs(81,25): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSDynamics.m_lastLinearVelocityVector' is assigned but its value is never used
BSDynamics.cs(90,25): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSDynamics.m_angularMotorVelocity' is assigned but its value is never used
BSDynamics.cs(94,25): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSDynamics.m_lastAngularVelocity' is assigned but its value is never used
BSDynamics.cs(95,25): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSDynamics.m_lastVertAttractor' is assigned but its value is never used
BSDynamics.cs(98,26): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSDynamics.m_angularDeflectionMotor' is assigned but its value is never used
BSDynamics.cs(110,26): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSDynamics.m_hoverMotor' is assigned but its value is never used
BSLinksetCompound.cs(335,24): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSLinksetCompound.LinksetRebuildFailureLoopPrevention' is assigned but its value is never used
BSPrim.cs(51,18): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSPrim._grabbed' is assigned but its value is never used
BSScene.cs(185,38): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSScene._postStepOperations' is assigned but its value is never used
BSShapes.cs(1391,27): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSShapeAvatar.avatarVertices' is assigned but its value is never used
BSShapes.cs(1431,19): warning CS0414: The private field `OpenSim.Region.Physics.BulletSPlugin.BSShapeAvatar.avatarIndices' is assigned but its value is never used
(0028932)
aiaustin (developer)
2015-07-21 08:49

Robert Adams fixed the two Windows compile warnings reported.
(0028933)
AliciaRaven (manager)
2015-07-21 12:31

aiaustin. I am reopening this because as you can see from comments above, there are a lot more compiler warnings outstanding. I don't mind if robert chooses to ignore them as they are only warnings.

The main reason I wanted to re-open is that I have an open question about how frame2._origin is assigned in the code which looks like a typo maybe. As I am hoping for an answer to this at some point when he has time to investigate i would appreciate it if you would keep this mantis open. Thanks
(0034121)
tampa (reporter)
2019-02-04 11:07

In BSAPIXNA.cs line 586ff

IndexedVector3 frame1v = new IndexedVector3(pframe1.X, pframe1.Y, pframe1.Z);
IndexedQuaternion frame1rot = new IndexedQuaternion(pframe1rot.X, pframe1rot.Y, pframe1rot.Z, pframe1rot.W);
IndexedMatrix frame1 = IndexedMatrix.CreateFromQuaternion(frame1rot);
frame1._origin = frame1v;

IndexedVector3 frame2v = new IndexedVector3(pframe2.X, pframe2.Y, pframe2.Z);
IndexedQuaternion frame2rot = new IndexedQuaternion(pframe2rot.X, pframe2rot.Y, pframe2rot.Z, pframe2rot.W);
IndexedMatrix frame2 = IndexedMatrix.CreateFromQuaternion(frame2rot);
frame2._origin = frame1v;

Indeed seems like a typo, shouldn't it be frame2._origin = frame2v; ?

Same happens again line 1877ff

Line 661 actually defines frame2._origin = frame2v; so I am guessing that this was either a rollback or a typo.

I'll add a patch regardless so others can test :) (Since I have no clue what this does)
(0034125)
aiaustin (developer)
2019-02-04 12:38

Resolved. No compiler warnings on Windows platform at the present time. Some warnings are reported to still be present on Linux.
(0034298)
BillBlight (developer)
2019-02-05 12:27

Old Issues, closed, can be reopened if they still exist

- Issue History
Date Modified Username Field Change
2015-06-14 03:32 aiaustin New Issue
2015-06-14 03:32 aiaustin Status new => assigned
2015-06-14 03:32 aiaustin Assigned To => Robert Adams
2015-06-14 03:33 aiaustin Summary [BULETSIM] Tidy Compiler Comments => [BULETSIM] Tidy Compiler Warning Comments
2015-06-14 03:40 aiaustin Summary [BULETSIM] Tidy Compiler Warning Comments => [BULETSIM] Tidy Compiler Warnings
2015-06-15 01:02 aiaustin Summary [BULETSIM] Tidy Compiler Warnings => [BULLETSIM] Tidy Compiler Warnings
2015-06-15 01:35 AliciaRaven Note Added: 0028731
2015-06-15 01:44 AliciaRaven Note Edited: 0028731 View Revisions
2015-06-15 02:04 aiaustin Note Added: 0028732
2015-06-15 02:06 aiaustin Note Edited: 0028732 View Revisions
2015-06-15 02:08 aiaustin Note Edited: 0028732 View Revisions
2015-06-15 02:08 aiaustin Note Edited: 0028732 View Revisions
2015-06-15 02:18 aiaustin Note Edited: 0028732 View Revisions
2015-06-15 07:54 aiaustin Note Edited: 0028732 View Revisions
2015-06-15 10:41 aiaustin Note Edited: 0028732 View Revisions
2015-06-15 14:05 aiaustin Note Edited: 0028732 View Revisions
2015-06-15 14:06 aiaustin Note Edited: 0028732 View Revisions
2015-06-25 22:03 Robert Adams Note Added: 0028818
2015-06-25 23:21 AliciaRaven Note Added: 0028819
2015-07-21 08:49 aiaustin Note Added: 0028932
2015-07-21 08:49 aiaustin Status assigned => resolved
2015-07-21 08:49 aiaustin Fixed in Version => master (dev code)
2015-07-21 08:49 aiaustin Resolution open => fixed
2015-07-21 08:49 aiaustin Status resolved => closed
2015-07-21 12:31 AliciaRaven Note Added: 0028933
2015-07-21 12:31 AliciaRaven Status closed => feedback
2015-07-21 12:31 AliciaRaven Resolution fixed => reopened
2015-07-21 12:31 AliciaRaven Status feedback => assigned
2019-02-04 11:06 tampa File Added: 0001-Fix-possible-typo-in-BulletS.patch
2019-02-04 11:07 tampa Note Added: 0034121
2019-02-04 12:37 aiaustin Note Added: 0034124
2019-02-04 12:37 aiaustin Note Deleted: 0034124
2019-02-04 12:38 aiaustin Note Added: 0034125
2019-02-04 12:38 aiaustin Status assigned => resolved
2019-02-04 12:38 aiaustin Resolution reopened => fixed
2019-02-05 12:27 BillBlight Note Added: 0034298
2019-02-05 12:27 BillBlight Status resolved => closed


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker