[Genabel-commits] r1483 - pkg/GenABEL/src/GAlib
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Dec 18 13:33:47 CET 2013
Author: maksim
Date: 2013-12-18 13:33:47 +0100 (Wed, 18 Dec 2013)
New Revision: 1483
Modified:
pkg/GenABEL/src/GAlib/convert.snp.affymetrix.cpp
Log:
Fixed warning generted by clang (Ubuntu clang version 3.4-1~exp1 (trunk) (based on LLVM 3.4)).
Modified: pkg/GenABEL/src/GAlib/convert.snp.affymetrix.cpp
===================================================================
--- pkg/GenABEL/src/GAlib/convert.snp.affymetrix.cpp 2013-12-18 08:27:53 UTC (rev 1482)
+++ pkg/GenABEL/src/GAlib/convert.snp.affymetrix.cpp 2013-12-18 12:33:47 UTC (rev 1483)
@@ -39,7 +39,6 @@
extern "C" {
-std::string replace(std::string val, char what, char replace);
@@ -101,10 +100,21 @@
//save IDs
Rprintf("saving Id names...\n");
+
+std::string filelist_str;
for(unsigned id=0 ; id<files_amount ; id++)
{
- outfile<<replace(std::string(filelist[id]), ' ', '_')<<" ";
+ filelist_str = filelist[id];
+ for(unsigned i=0 ; i<filelist_str.length() ; i++)
+ {
+ if(filelist_str[i]==' ') filelist_str[i]='_';
+ }
+
+ outfile<<filelist_str<<" ";
}
+
+
+
outfile<<"\n";
std::string snpname;
@@ -249,17 +259,17 @@
+////_________________________________________________________________
+//std::string replace(std::string val, char what, char replace='_')
+//{
+//unsigned length = val.length();
+//
+//for(unsigned i=0 ; i<length ; i++)
+// {
+// if(val[i]==what) val[i]=replace;
+// }
+//return val;
+//}
//_________________________________________________________________
-std::string replace(std::string val, char what, char replace='_')
-{
-unsigned length = val.length();
-for(unsigned i=0 ; i<length ; i++)
- {
- if(val[i]==what) val[i]=replace;
- }
-return val;
-}
-//_________________________________________________________________
-
}//end of externl C
More information about the Genabel-commits
mailing list