Commit b2af189b authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

add support clang

parent de43dfe1
......@@ -193,7 +193,7 @@ template <class T> int CAmr::loadData(uns::CParticles<T> * particles,
try {
// loop on all cpus/files
for (int icpu=0; icpu<ncpu; icpu++) {
std::ostringstream osf;
std::stringstream osf("");
osf << std::fixed << std::setw(5) << std::setfill('0') <<icpu+1;
infile = indir + "/amr_" + s_run_index + ".out" + osf.str();
if (verbose) std::cerr << "CAmr::loadData infile-> ["<<infile << "]\n";
......
......@@ -57,7 +57,7 @@ int ComponentRange::computeN()
// ============================================================================
void ComponentRange::buildRange()
{
std::ostringstream stm1,stm2;
std::ostringstream stm1(""),stm2("");
stm1 << first;
stm2 << last;
range = stm1.str()+":"+stm2.str();
......
......@@ -105,7 +105,7 @@ template <class T> int CPart::loadData(uns::CParticles<T> * particles,
{
int offset=0;
for (int i=0; i<ncpu; i++) {
std::ostringstream osf;
std::ostringstream osf("");
osf << std::fixed << std::setw(5) << std::setfill('0') <<i+1;
std::string infile = indir + "/part_" + s_run_index + ".out" + osf.str();
if (verbose) std::cerr << "reading file : " << infile << "\n";
......
......@@ -130,7 +130,7 @@ std::string Ctools::toupper(std::string s)
template <class T> bool Ctools::isStringANumber(const std::string mystring, T &data)
{
bool status=true;
std::stringstream stream;
std::stringstream stream("");
stream << mystring;
stream >> data;
if (! stream.eof()) {
......
......@@ -78,7 +78,7 @@ CSnapshotGadgetIn<T>::CSnapshotGadgetIn(const std::string _name,
int fail = open(filename);
if (!fail) {
this->valid=true;
std::ostringstream stm;
std::stringstream stm("");
stm << getVersion();
this->interface_type = "Gadget" + stm.str();
this->interface_index=1;
......@@ -322,7 +322,7 @@ int CSnapshotGadgetIn<T>::readStreamBlock(const std::string req_blockname, std::
for (int i=0; i<header.num_files || (i==0 && header.num_files==0);i++) {
std::string infile;
if (header.num_files > 0 ) { // more than one file
std::ostringstream stm;
std::stringstream stm("");
stm << "." << i; // add ".XX" extension
infile = filename + stm.str(); // new filename
if (i>0) {
......@@ -433,7 +433,7 @@ int CSnapshotGadgetIn<T>::read(uns::UserSelection &user_select)
for (int i=0; i<header.num_files || (i==0 && header.num_files==0);i++) {
std::string infile;
if (header.num_files > 0 ) { // more than one file
std::ostringstream stm;
std::stringstream stm("");
stm << "." << i; // add ".XX" extension
infile = filename + stm.str(); // new filename
if (i>0) {
......@@ -1555,7 +1555,7 @@ CSnapshotGadgetOut<T>::CSnapshotGadgetOut(const std::string _n, const std::strin
<< "aborting .....\n";
std::exit(1);
}
std::ostringstream stm;
std::stringstream stm("");
stm << version;
this->interface_type = "Gadget" + stm.str();
this->file_structure = "component"; // "component" like file
......
......@@ -525,7 +525,7 @@ bool CSnapshotGadgetH5In<T>::loadCommonDataset(std::string tag, std::vector<U> &
std::map<std::string,int>::iterator it;
it = compo_indx.find((*crv)[i].type);
if (it != compo_indx.end()) { // key exist
std::ostringstream myid;
std::stringstream myid("");
myid << (*it).second;
std::string dataset="/PartType"+myid.str()+"/"+tag;
if (this->verbose) std::cerr << dataset << "\n";
......@@ -926,7 +926,7 @@ bool CSnapshotGadgetH5Out<T>::saveCommonDataset(std::string comp,std::string tag
save=checkMasses(n,data,(*it).second);
}
if (save) {
std::ostringstream myid;
std::stringstream myid("");
myid << (*it).second;
std::string dataset="/PartType"+myid.str()+"/"+tag;
if (this->verbose) std::cerr << dataset << "\n";
......
......@@ -190,7 +190,7 @@ template <class T> bool CSnapshotSimIn<T>::readSqlEps()
if (status) {
if (this->verbose) sql->display();
assert(sql->vdata[0]==sim_filename);
std::stringstream str;
std::stringstream str("");
for (unsigned int i=1; i< sql->vdata.size(); i++) {
str << sql->vdata[i]; // convert string to stream string
str >> this->eps[i-1]; // convert to float
......@@ -484,7 +484,7 @@ template <class T> int CSnapshotSimIn<T>::addNemoComponent(int& offset, std::str
if (parse!="") { // there is something for the component
std::size_t found = parse.find(":");
std::istringstream ss;
std::istringstream ss("");
//std::cerr << "substr=[" << parse.substr(0,found-1) << "]\n";
ss.str(parse.substr(0,found));
int start;
......@@ -574,7 +574,7 @@ template <class T> bool CSnapshotSimIn<T>::buildAllGadgetFile()
// dirname+basename+nframe
// ex : gas001_0 gas001_00 gas001_000
while (!force_stop && !stop && cpt<=5) {
std::ostringstream ss;
std::stringstream ss("");
ss << std::setw(cpt) << std::setfill('0') << nframe;
std::string myfile = dirname+'/'+basename+'_'+ss.str();
PRINT("CSnapshotSimIn<T>::buildGadgetFile() myfile=["<<myfile<<"]\n";)
......@@ -686,7 +686,7 @@ template <class T> int CSnapshotSimIn<T>::getCod(const std::string select,
int cpt=0;
// get time
str >> parse; // read time
std::stringstream str2; // convert to stream
std::stringstream str2(""); // convert to stream
str2 << parse;
str2 >> tcod[cpt++]; // convert to float
if (tcod[0]-0.00001 < time && tcod[0]+0.00001 > time) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment