suppress all compiler warnings/ code-cleanup

pull/1/head
Thorsten Liebig 2010-04-13 18:51:44 +02:00
parent 86832d0d3a
commit ebff88207d
9 changed files with 19 additions and 36 deletions

View File

@ -129,7 +129,6 @@ void Engine::UpdateCurrents()
void Engine::ApplyCurrentExcite()
{
int exc_pos;
}
bool Engine::IterateTS(unsigned int iterTS)

View File

@ -190,9 +190,9 @@ bool Operator::SnapToMesh(double* dcoord, unsigned int* uicoord, bool lower, boo
struct Operator::Grid_Path Operator::FindPath(double start[], double stop[])
{
struct Grid_Path path;
double dV[] = {stop[0]-start[0],stop[1]-start[1],stop[2]-start[2]};
// double dV[] = {stop[0]-start[0],stop[1]-start[1],stop[2]-start[2]};
unsigned int uiStart[3],uiStop[3],currPos[3],pos[3];
unsigned int uiStart[3],uiStop[3],currPos[3];
SnapToMesh(start,uiStart);
SnapToMesh(stop,uiStop);
currPos[0]=uiStart[0];
@ -201,7 +201,7 @@ struct Operator::Grid_Path Operator::FindPath(double start[], double stop[])
double meshStart[] = {discLines[0][uiStart[0]], discLines[1][uiStart[1]], discLines[2][uiStart[2]]};
double meshStop[] = {discLines[0][uiStop[0]], discLines[1][uiStop[1]], discLines[2][uiStop[2]]};
bool UpDir;
bool UpDir = false;
double foot=0,dist=0,minFoot=0,minDist=0;
int minDir=0;
unsigned int minPos[3];
@ -401,7 +401,6 @@ unsigned int Operator::CalcSinusExcitation(double f0, int nTS)
void Operator::DumpOperator2File(string filename)
{
ofstream file(filename.c_str(),ios_base::out);
// file.open;
if (file.is_open()==false)
{
cerr << "Operator::DumpOperator2File: Can't open file: " << filename << endl;
@ -530,7 +529,6 @@ int Operator::CalcECOperator()
InitOperator();
unsigned int i=0;
unsigned int pos[3];
for (int n=0;n<3;++n)
@ -599,7 +597,6 @@ void Operator::ApplyMagneticBC(bool* dirs)
{
if (dirs==NULL) return;
unsigned int pos[3];
unsigned int ipos;
for (int n=0;n<3;++n)
{
int nP = (n+1)%3;
@ -636,7 +633,6 @@ bool Operator::Calc_ECPos(int n, unsigned int* pos, double* inEC)
coord[0] = discLines[0][pos[0]];
coord[1] = discLines[1][pos[1]];
coord[2] = discLines[2][pos[2]];
unsigned int ipos = MainOp->SetPos(pos[0],pos[1],pos[2]);
double delta=MainOp->GetIndexDelta(n,pos[n]);
double deltaP=MainOp->GetIndexDelta(nP,pos[nP]);
double deltaPP=MainOp->GetIndexDelta(nPP,pos[nPP]);
@ -766,7 +762,6 @@ bool Operator::Calc_EffMatPos(int n, unsigned int* pos, double* inMat)
int nP = (n+1)%3;
int nPP = (n+2)%3;
unsigned int ipos = MainOp->SetPos(pos[0],pos[1],pos[2]);
double delta=MainOp->GetIndexDelta(n,pos[n]);
double deltaP=MainOp->GetIndexDelta(nP,pos[nP]);
double deltaPP=MainOp->GetIndexDelta(nPP,pos[nPP]);
@ -879,7 +874,6 @@ bool Operator::CalcEFieldExcitation()
vector<FDTD_FLOAT> vExcit;
vector<unsigned int> vDelay;
vector<unsigned int> vDir;
unsigned int ipos;
unsigned int pos[3];
double coord[3];
double delta[3];
@ -935,7 +929,6 @@ bool Operator::CalcEFieldExcitation()
double p1[3];
double p2[3];
double deltaN=0.0;
int n;
struct Grid_Path path;
CSPropElectrode* elec=NULL;
CSProperties* prop=NULL;

View File

@ -216,7 +216,6 @@ bool Operator_Cylinder::Calc_ECPos(int n, unsigned int* pos, double* inEC)
coord[0] = discLines[0][pos[0]];
coord[1] = discLines[1][pos[1]];
coord[2] = discLines[2][pos[2]];
unsigned int ipos = MainOp->SetPos(pos[0],pos[1],pos[2]);
double delta=MainOp->GetIndexDelta(n,pos[n]);
double deltaP=MainOp->GetIndexDelta(nP,pos[nP]);
double deltaPP=MainOp->GetIndexDelta(nPP,pos[nPP]);
@ -422,7 +421,7 @@ bool Operator_Cylinder::Calc_ECPos(int n, unsigned int* pos, double* inEC)
return true;
}
bool Operator_Cylinder::Calc_EffMatPos(int n, unsigned int* pos, double* inMat)
bool Operator_Cylinder::Calc_EffMatPos(int /*n*/, unsigned int* /*pos*/, double* /*inMat*/)
{
cerr << "Operator_Cylinder::Calc_EffMatPos: Warning! method not implemented yet..." << endl;
return false;

View File

@ -50,11 +50,6 @@ int ProcessCurrent::Process()
if (Enabled==false) return -1;
if (CheckTimestep()==false) return GetNextInterval();
FDTD_FLOAT current=0;
// FDTD_FLOAT help=0;
double sign[3]={1,1,1};
unsigned int pos[3]={start[0],start[1],start[2]};
double loc_start[]={start[0],start[1],start[2]};
double loc_stop[]={stop[0],stop[1],stop[2]};
for (int n=0;n<3;++n)
{

View File

@ -285,8 +285,6 @@ int openEMS::SetupFDTD(const char* file)
}
}
time_t currTime = time(NULL);
//*************** setup processing ************//
cout << "Setting up processing..." << endl;
unsigned int Nyquist = FDTD_Op->GetNyquistNum();

View File

@ -20,16 +20,16 @@
AdrOp::AdrOp(unsigned int muiImax, unsigned int muiJmax, unsigned int muiKmax, unsigned int muiLmax)
{
//error-handling...
error = new ErrorMsg(9); if (error==NULL) { fprintf(stderr,"Memory allocation failed!! exiting... \0"); exit(1); }
error->SetMsg(1,"Adress Operator: Memory allocation failed!! exiting... \0");
error->SetMsg(2,"Adress Operator: Invalid Adress requested!! exiting... \0");
error->SetMsg(3,"Adress Operator: Invalid Position set!! exiting...\0");
error->SetMsg(4,"Adress Operator: Invalid jump or passing end of iteration!! exiting...\0");
error->SetMsg(5,"Adress Operator: 4D not yet implemented!! exiting... \0");
error->SetMsg(6,"Adress Operator: Position not set!! exiting... \0");
error->SetMsg(7,"Adress Operator: Cells not added to Adress Operator!! exiting... \0");
error->SetMsg(8,"Adress Operator: Invalid Node!! exiting... \0");
error->SetMsg(9,"Adress Operator: Grid invalid!! exiting... \0");
error = new ErrorMsg(9); if (error==NULL) { fprintf(stderr,"Memory allocation failed!! exiting..."); exit(1); }
error->SetMsg(1,"Adress Operator: Memory allocation failed!! exiting...");
error->SetMsg(2,"Adress Operator: Invalid Adress requested!! exiting...");
error->SetMsg(3,"Adress Operator: Invalid Position set!! exiting...");
error->SetMsg(4,"Adress Operator: Invalid jump or passing end of iteration!! exiting...");
error->SetMsg(5,"Adress Operator: 4D not yet implemented!! exiting...");
error->SetMsg(6,"Adress Operator: Position not set!! exiting...");
error->SetMsg(7,"Adress Operator: Cells not added to Adress Operator!! exiting...");
error->SetMsg(8,"Adress Operator: Invalid Node!! exiting...");
error->SetMsg(9,"Adress Operator: Grid invalid!! exiting...");
//if (muiImax<0) muiImax=0;
//if (muiJmax<0) muiJmax=0;
@ -168,7 +168,7 @@ bool AdrOp::CheckRelativePos(int muiIrel,int muiJrel,int muiKrel, int muiLrel)
return bPosSet;
}
unsigned int AdrOp::GetPos(int muiIrel, int muiJrel, int muiKrel, int muiLrel)
unsigned int AdrOp::GetPos(int muiIrel, int muiJrel, int muiKrel, int /*muiLrel*/)
{
if (bPosSet==false) error->Error(6);
if (reflect)

View File

@ -23,7 +23,7 @@
ErrorMsg::ErrorMsg(unsigned int NoMessage)
{
NoMsg=NoMessage;
if (NoMsg>0) Msg = new char*[NoMsg]; if (Msg==NULL) { fprintf(stderr,"Memory allocation failed!! exiting... \0"); exit(1); }
if (NoMsg>0) Msg = new char*[NoMsg]; if (Msg==NULL) { fprintf(stderr,"Memory allocation failed!! exiting..."); exit(1); }
for (unsigned int i=0;i<NoMsg;i++) Msg[i]=NULL;
}
@ -33,10 +33,10 @@ ErrorMsg::~ErrorMsg()
delete[] Msg; Msg=NULL;
}
void ErrorMsg::SetMsg(unsigned int nr, char *Message)
void ErrorMsg::SetMsg(unsigned int nr, const char *Message)
{
if ((nr<1) || (nr>NoMsg) || (Message==NULL)) ownError();
Msg[nr-1] = new char[strlen(Message)+1]; if (Msg[nr-1]==NULL) { fprintf(stderr,"Memory allocation failed!! exiting... \0"); exit(1); }
Msg[nr-1] = new char[strlen(Message)+1]; if (Msg[nr-1]==NULL) { fprintf(stderr,"Memory allocation failed!! exiting..."); exit(1); }
Msg[nr-1]=strcpy(Msg[nr-1],Message);
}

View File

@ -34,7 +34,7 @@ public:
virtual ~ErrorMsg();
///Methode for defining error messages
/*! \param nr Number of defining error message \param *Message Set error message string \sa Error */
void SetMsg(unsigned int nr, char *Message);
void SetMsg(unsigned int nr, const char *Message);
///Call an error message. Will exit the program!
/*! \param nr Number of called error message. default is 0 \sa SetMsg*/
void Error(unsigned int nr=0,char *chAddMsg=0);

View File

@ -67,7 +67,6 @@ FDTD_FLOAT**** Create_N_3DArray(const unsigned int* numLines)
void Delete_N_3DArray(FDTD_FLOAT**** array, const unsigned int* numLines)
{
if (array==NULL) return;
unsigned int pos[3];
for (int n=0;n<3;++n)
{
Delete3DArray(array[n],numLines);