From: westcott Date: Wed, 8 Jul 2009 17:06:42 +0000 (+0000) Subject: added stricter compilation requirements and fixed resulting errors X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=28d65de5f06f5b033109a3b8bbb6d3c4060914d3 added stricter compilation requirements and fixed resulting errors --- diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index 136b75f..7959c79 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -1194,11 +1194,20 @@ ); GCC_OPTIMIZATION_LEVEL = 3; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; - GCC_WARN_PEDANTIC = NO; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_PEDANTIC = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - OTHER_CPLUSPLUSFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = ( + "-ansi", + "-pedantic", + "-wall", + ); PREBINDING = NO; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; WARNING_CFLAGS = ""; diff --git a/blastalign.cpp b/blastalign.cpp index 0645fb0..624210f 100644 --- a/blastalign.cpp +++ b/blastalign.cpp @@ -82,13 +82,13 @@ void BlastAlignment::setPairwiseSeqs(){ // This method call assigns the blast ge string candidateName, templateName; - while(d=blastFile.get() != '='){} + while((d=blastFile.get()) != '='){} blastFile >> candidateName; // Get the candidate sequence name from flatfile - while(d=blastFile.get() != '('){} + while((d=blastFile.get()) != '('){} blastFile >> candidateLength; // Get the candidate sequence length from flatfile - while(d=blastFile.get()){ + while((d=blastFile.get())){ if(d == '>'){ blastFile >> templateName; // Get the template sequence name from flatfile break; @@ -114,10 +114,10 @@ void BlastAlignment::setPairwiseSeqs(){ // This method call assigns the blast ge } } - while(d=blastFile.get() != '='){} + while((d=blastFile.get()) != '='){} blastFile >> templateLength; // Get the template sequence length from flatfile - while(d=blastFile.get() != 'Q'){} // Suck up everything else until we get to the start of the alignment + while((d=blastFile.get()) != 'Q'){} // Suck up everything else until we get to the start of the alignment int queryStart, sbjctStart, queryEnd, sbjctEnd; string queryLabel, sbjctLabel, query, sbjct; @@ -127,7 +127,7 @@ void BlastAlignment::setPairwiseSeqs(){ // This method call assigns the blast ge while(queryLabel == "Query:"){ blastFile >> queryStart >> query >> queryEnd; - while(d=blastFile.get() != 'S'){}; + while((d=blastFile.get()) != 'S'){}; blastFile >> sbjctLabel >> sbjctStart >> sbjct >> sbjctEnd; diff --git a/chimeraseqscommand.cpp b/chimeraseqscommand.cpp index f19fe11..b451721 100644 --- a/chimeraseqscommand.cpp +++ b/chimeraseqscommand.cpp @@ -352,8 +352,7 @@ void ChimeraSeqsCommand::generatePreferences(vector left, vector pref[i].leftParent[1] = ""; pref[i].rightParent[1] = ""; } - -//cout << "in generate left.size() = " << left.size() << endl; + for (int i = 0; i < left.size(); i++) { SeqMap currentLeft = left[i]; //example i = 3; currentLeft is a map of 0 to the distance of sequence 3 to sequence 0, diff --git a/jackknife.cpp b/jackknife.cpp index 1082465..35f0910 100644 --- a/jackknife.cpp +++ b/jackknife.cpp @@ -122,7 +122,7 @@ EstOutput Jackknife::getValues(SAbundVector* rank){ } ci = 1.96 * sqrt(ci - jack); } - else if(k=1){ + else if(k==1){ jack = N[1]; ci = 1.96*sqrt(variance[1]); }else{ diff --git a/mothur.h b/mothur.h index 5d9dc96..2efdda8 100644 --- a/mothur.h +++ b/mothur.h @@ -60,7 +60,7 @@ using namespace std; #endif -typedef unsigned long long ull; +typedef unsigned long ull; struct IntNode { int lvalue; diff --git a/nameassignment.cpp b/nameassignment.cpp index 3bcf6f9..c31468c 100644 --- a/nameassignment.cpp +++ b/nameassignment.cpp @@ -52,8 +52,8 @@ ListVector NameAssignment::getListVector(void){ void NameAssignment::print(void){ try { - map::iterator it = (*this).begin(); - for(it;it!=(*this).end();it++){ + map::iterator it; + for(it = (*this).begin(); it!=(*this).end(); it++){ mothurOut(it->first + "\t" + toString(it->second)); mothurOutEndLine(); //prints out keys and values of the map this. } } diff --git a/shen.cpp b/shen.cpp index 2be566c..0d515eb 100644 --- a/shen.cpp +++ b/shen.cpp @@ -36,7 +36,7 @@ EstOutput Shen::getValues(SAbundVector* rank){ errorOut(e, "Shen", "getValues"); exit(1); } -}; +} /***********************************************************************/