Hi,
I have cleaned up a bit my actual AmiDARK Engine source code but there are 2 warnings I cannot fix.
Warning #1:
AmiDE_Libs/Basic3D.c:212:warning:assignment makes integer from pointer without a case
Source Code :
void AddObjectToList( int ObjectID, Object3DType *ObjectPTR ){
int *ObjectPTR2;
ObjectPTR2 = (int *)ObjectPTR;
if ( ObjectID > 0 ){
// Si la liste des objets 3D ne contient pas assez d'elements on l'agrandit.
if (Basic3D.ObjectListAmount < ObjectID ){
ResizeObjectList( ObjectID );
}
// Add the object into the object list.
int *NewObjectListPTR;
NewObjectListPTR = Basic3D.ObjectList + ( ObjectID * sizeof( int ) );
*NewObjectListPTR = ObjectPTR2; // LINE 212 IS HERE //
++Basic3D.ObjectAmount;
}
}
Additionnal informations : Object3DType definition :
struct Object3DStruct{
BOOL Exist;
int ID;
int Type;
float XPos, YPos, ZPos;
float XRot, YRot, ZRot;
float XScale, YScale, ZScale;
int ImageIndex;
BOOL Hidden, Culling, Transparency, WireFrame, Fog, Ambient, Lights, Filtering;
float RGBRed, RGBGreen, RGBBlue;
BOOL IsGhost;
int GhostMode;
int Diffuse, Ambience, Specular, Emissive, SpecularPower;
int DetailMappingImage, Smoothing, AlphaMappingPercent;
int *MeshDataPtr;
int MeshMemorySize;
};
typedef struct Object3DStruct Object3DType;
Warning #2:
AmiDE_Libs/Basic3D.c:245: warning: "NewObjectPTR" may be used uninitialized in this function
AmiDE_Libs/Basic3D.c:245: note: "NewObjectPTR' was declared here
Source Code :
Object3DType *GetObjectPTR( int ObjectID ){
int *ObjectListPTR;
Object3DType *NewObjectPTR; // LINE 245 IS HERE
if ( ObjectID > 0 ){
if ( ObjectID <= Basic3D.ObjectAmount ){
ObjectListPTR = Basic3D.ObjectList;
ObjectListPTR = ObjectListPTR + ( sizeof( int ) * ObjectID );
NewObjectPTR = (Object3DType *)*ObjectListPTR;
}
}
return NewObjectPTR;
}
Does someone have a solution ?
Thank you.
Kindest Regards,
AmiDARK
Edited by freddix on 2009/9/17 1:53:23