From 5694c92fbf646fe01abc87bde2af59e14a9a56b6 Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 5 Jan 2011 13:07:39 +0000 Subject: [PATCH] removed various build warnings --- clearcut.cpp | 4 ++-- clusterclassic.cpp | 2 ++ clustersplitcommand.cpp | 2 +- distancecommand.cpp | 2 ++ engine.cpp | 2 +- getgroupscommand.cpp | 2 ++ getotuscommand.cpp | 2 +- metastats2.c | 8 ++++---- parsimony.cpp | 1 - phylodiversitycommand.cpp | 2 +- phylosummary.cpp | 4 ++-- phylotree.cpp | 2 ++ pipelinepdscommand.cpp | 2 ++ rarefact.cpp | 2 +- removegroupscommand.cpp | 2 ++ removeotuscommand.cpp | 1 + shhhercommand.cpp | 4 ---- splitmatrix.cpp | 2 ++ subsamplecommand.cpp | 4 ++++ summarysharedcommand.cpp | 1 + trimflowscommand.cpp | 3 --- trimseqscommand.cpp | 4 +--- unifracweightedcommand.cpp | 1 - unweighted.cpp | 4 ---- weighted.cpp | 4 +--- 25 files changed, 35 insertions(+), 32 deletions(-) diff --git a/clearcut.cpp b/clearcut.cpp index b06aa5b..a4bd450 100644 --- a/clearcut.cpp +++ b/clearcut.cpp @@ -230,8 +230,8 @@ int clearcut_main(int argc, char *argv[]) { printf("Relaxed NJ tree(s) in %s\n", nj_args->outfilename); } } - - //exit(0); + + return 0; } diff --git a/clusterclassic.cpp b/clusterclassic.cpp index 287332a..7f6e97e 100644 --- a/clusterclassic.cpp +++ b/clusterclassic.cpp @@ -215,6 +215,8 @@ int ClusterClassic::readPhylipFile(string filename, NameAssignment* nameMap) { rabund = new RAbundVector(list->getRAbundVector()); fileHandle.close(); + + return 0; } catch(exception& e) { m->errorOut(e, "ClusterClassic", "readPhylipFile"); diff --git a/clustersplitcommand.cpp b/clustersplitcommand.cpp index 5998726..0aceb8b 100644 --- a/clustersplitcommand.cpp +++ b/clustersplitcommand.cpp @@ -1112,7 +1112,7 @@ int ClusterSplitCommand::createMergedDistanceFile(vector< map > } #endif - + return 0; } diff --git a/distancecommand.cpp b/distancecommand.cpp index 3711a1d..a3cebe2 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -1151,6 +1151,8 @@ bool DistanceCommand::sanityCheck() { remove(outputFile.c_str()); //temp file is bad because file mismatch above } + return good; + } catch(exception& e) { m->errorOut(e, "DistanceCommand", "sanityCheck"); diff --git a/engine.cpp b/engine.cpp index a90bb7e..2b1c802 100644 --- a/engine.cpp +++ b/engine.cpp @@ -181,7 +181,7 @@ string Engine::getCommand() { if(nextCommand != NULL) { add_history(nextCommand); } else{ //^D causes null string and we want it to quit mothur - nextCommand = "quit"; + strcpy(nextCommand, "quit"); mout->mothurOut(nextCommand); } diff --git a/getgroupscommand.cpp b/getgroupscommand.cpp index 266fc52..1832f96 100644 --- a/getgroupscommand.cpp +++ b/getgroupscommand.cpp @@ -587,6 +587,8 @@ int GetGroupsCommand::fillNames(){ names.insert(seqs[i]); } } + + return 0; } catch(exception& e) { m->errorOut(e, "GetGroupsCommand", "fillNames"); diff --git a/getotuscommand.cpp b/getotuscommand.cpp index ba9a5e7..fd7c8d1 100644 --- a/getotuscommand.cpp +++ b/getotuscommand.cpp @@ -381,7 +381,7 @@ int GetOtusCommand::processList(ListVector*& list, GroupMap*& groupMap, ofstream m->mothurOut(newList.getLabel() + " - selected " + toString(numOtus) + " of the " + toString(list->getNumBins()) + " OTUs."); m->mothurOutEndLine(); - + return 0; } catch(exception& e) { m->errorOut(e, "GetOtusCommand", "processList"); diff --git a/metastats2.c b/metastats2.c index de2a930..6601b09 100644 --- a/metastats2.c +++ b/metastats2.c @@ -5,13 +5,13 @@ int metastat_main (char* outputFileName, int numRows, int numCols, double threshold, int numPermutations, double** data, int secondGroupingStart){ - int size,c=0,i=0,j=0,k,counter=0, bflag=0; + int size,c=0,i=0,j=0,counter=0, bflag=0; int B=numPermutations; int row = numRows; int col = numCols; int g = secondGroupingStart; double thresh=threshold; - double placeholder=0,min=0; + double min=0; char output[1024]; strcpy(output, outputFileName); @@ -24,7 +24,7 @@ int metastat_main (char* outputFileName, int numRows, int numCols, double thresh // Initialize the matrices size = row*col; double matrix[row][col]; - double pmatrix[size],pmatrix2[size],permuted[size]; + double pmatrix[size],permuted[size]; double storage[row][9]; for (i=0;i > namesOfGr try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; - int num = 0; vector processIDS; EstOutput results; diff --git a/phylodiversitycommand.cpp b/phylodiversitycommand.cpp index a97e095..80d9090 100644 --- a/phylodiversitycommand.cpp +++ b/phylodiversitycommand.cpp @@ -290,7 +290,7 @@ int PhyloDiversityCommand::createProcesses(vector& procIters, Tree* t, map< try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; - int num = 0; + vector processIDS; map< string, vector >::iterator itSum; diff --git a/phylosummary.cpp b/phylosummary.cpp index a9a170b..26ae3a8 100644 --- a/phylosummary.cpp +++ b/phylosummary.cpp @@ -200,7 +200,7 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){ for (int k = level; k < maxLevel; k++) { seqTaxonomy += "unclassified;"; } } } - + return 0; } catch(exception& e) { m->errorOut(e, "PhyloSummary", "addSeqToTree"); @@ -310,7 +310,7 @@ int PhyloSummary::addSeqToTree(string seqTaxonomy, vector names){ for (int k = level; k < maxLevel; k++) { seqTaxonomy += "unclassified;"; } } } - + return 0; } catch(exception& e) { m->errorOut(e, "PhyloSummary", "addSeqToTree"); diff --git a/phylotree.cpp b/phylotree.cpp index 1fd4e5d..891cca4 100644 --- a/phylotree.cpp +++ b/phylotree.cpp @@ -275,6 +275,8 @@ int PhyloTree::addSeqToTree(string seqName, string seqTaxonomy){ if (seqTaxonomy == "") { uniqueTaxonomies[currentNode] = currentNode; } } + + return 0; } catch(exception& e) { m->errorOut(e, "PhyloTree", "addSeqToTree"); diff --git a/pipelinepdscommand.cpp b/pipelinepdscommand.cpp index b7ba7d3..f95b928 100644 --- a/pipelinepdscommand.cpp +++ b/pipelinepdscommand.cpp @@ -525,6 +525,8 @@ int PipelineCommand::runUsersPipeline(){ } in.close(); + + return 0; } catch(exception& e) { m->errorOut(e, "PipelineCommand", "runUsersPipeline"); diff --git a/rarefact.cpp b/rarefact.cpp index ec77dd5..032cd93 100644 --- a/rarefact.cpp +++ b/rarefact.cpp @@ -116,7 +116,7 @@ int Rarefact::createProcesses(vector& procIters, RarefactionCurveData* rcd, try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; - int num = 0; + vector processIDS; EstOutput results; diff --git a/removegroupscommand.cpp b/removegroupscommand.cpp index 6042bbe..2c98e81 100644 --- a/removegroupscommand.cpp +++ b/removegroupscommand.cpp @@ -588,6 +588,8 @@ int RemoveGroupsCommand::fillNames(){ names.insert(seqs[i]); } } + + return 0; } catch(exception& e) { m->errorOut(e, "RemoveGroupsCommand", "fillNames"); diff --git a/removeotuscommand.cpp b/removeotuscommand.cpp index 0e7d302..1a7d3bd 100644 --- a/removeotuscommand.cpp +++ b/removeotuscommand.cpp @@ -388,6 +388,7 @@ int RemoveOtusCommand::processList(ListVector*& list, GroupMap*& groupMap, ofstr m->mothurOut(newList.getLabel() + " - removed " + toString(numOtus) + " of the " + toString(list->getNumBins()) + " OTUs."); m->mothurOutEndLine(); + return 0; } catch(exception& e) { diff --git a/shhhercommand.cpp b/shhhercommand.cpp index f9b3429..d1732cd 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -1160,7 +1160,6 @@ string ShhherCommand::cluster(string distFileName, string namesFileName){ double clusterCutoff = cutoff; while (matrix->getSmallDist() <= clusterCutoff && matrix->getNNodes() > 0){ cluster->update(clusterCutoff); - float dist = matrix->getSmallDist(); } list->setLabel(toString(cutoff)); @@ -1411,7 +1410,6 @@ void ShhherCommand::calcCentroidsDriver(int start, int finish){ for(int j=0;j otuCounts){ vector > qualities(numOTUs); vector pr(HOMOPS, 0); - int index = 0; for(int i=0;ierrorOut(e, "SubSampleCommand", "getNames"); @@ -559,6 +561,8 @@ int SubSampleCommand::readNames() { } in.close(); + return 0; + } catch(exception& e) { m->errorOut(e, "SubSampleCommand", "readNames"); diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index b3f7729..029ca26 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -665,6 +665,7 @@ int SummarySharedCommand::process(vector thisLookup, string outDist.close(); } } + return 0; } catch(exception& e) { m->errorOut(e, "SummarySharedCommand", "process"); diff --git a/trimflowscommand.cpp b/trimflowscommand.cpp index b098f8f..e4d0165 100644 --- a/trimflowscommand.cpp +++ b/trimflowscommand.cpp @@ -661,7 +661,6 @@ int TrimFlowsCommand::stripBarcode(Sequence& seq, int& group){ oligo = oligo.substr(0,alnLength); temp = temp.substr(0,alnLength); - int newStart=0; int numDiff = countDiffs(oligo, temp); if(numDiff < minDiff){ @@ -959,10 +958,8 @@ vector TrimFlowsCommand::getFlowFileBreaks() { m->openInputFile(flowFileName, in); in.seekg(spot); - unsigned long int newSpot = spot; string dummy = m->getline(in); - //there was not another sequence before the end of the file unsigned long int sanityPos = in.tellg(); diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 2000204..d5df473 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -455,7 +455,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string try { ofstream outFASTA; - int able = m->openOutputFile(trimFile, outFASTA); + m->openOutputFile(trimFile, outFASTA); ofstream scrapFASTA; m->openOutputFile(scrapFile, scrapFASTA); @@ -1095,7 +1095,6 @@ int TrimSeqsCommand::stripBarcode(Sequence& seq, QualityScores& qual, int& group oligo = oligo.substr(0,alnLength); temp = temp.substr(0,alnLength); - int newStart=0; int numDiff = countDiffs(oligo, temp); // cout << oligo << '\t' << temp << '\t' << numDiff << endl; @@ -1220,7 +1219,6 @@ int TrimSeqsCommand::stripForward(Sequence& seq, QualityScores& qual, int& group oligo = oligo.substr(0,alnLength); temp = temp.substr(0,alnLength); - int newStart=0; int numDiff = countDiffs(oligo, temp); // cout << oligo << '\t' << temp << '\t' << numDiff << endl; diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 4ded9c5..b2fd628 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -332,7 +332,6 @@ int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > na try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; - int num = 0; vector processIDS; EstOutput results; diff --git a/unweighted.cpp b/unweighted.cpp index ef9e521..24b41a1 100644 --- a/unweighted.cpp +++ b/unweighted.cpp @@ -87,7 +87,6 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector > namesOfG try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; - int num = 0; vector processIDS; EstOutput results; @@ -340,7 +339,6 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector > namesOfG try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; - int num = 0; vector processIDS; EstOutput results; @@ -423,8 +421,6 @@ EstOutput Unweighted::driver(Tree* t, vector< vector > namesOfGroupCombo EstOutput results; results.resize(num); int count = 0; - int total = num; - int twentyPercent = (total * 0.20); int numLeaves = t->getNumLeaves(); Tree* copyTree = new Tree; diff --git a/weighted.cpp b/weighted.cpp index 24adbba..30e4a76 100644 --- a/weighted.cpp +++ b/weighted.cpp @@ -294,9 +294,7 @@ EstOutput Weighted::getValues(Tree* t, string groupA, string groupB) { D += weightedSum; } - - int numLeaves = t->getNumLeaves(); - + //calculate u for the group comb for(int i=0;igetNumNodes();i++){ -- 2.39.2