From 025c9fbad02d5195e8679cb2657d150ef58446cc Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Sun, 9 Dec 2012 16:42:00 +0100 Subject: [PATCH] bit of cleanup in the ART plugin, avoid a few compiler warnings --- plugins/output_art.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/output_art.cc b/plugins/output_art.cc index 9c53801..b5455fe 100644 --- a/plugins/output_art.cc +++ b/plugins/output_art.cc @@ -46,7 +46,7 @@ protected: id_dm_pos, id_dm_vel, id_gas_pos, id_gas_vel }; - typedef struct io_header + struct header { char head[45]; float aexpN; // current expansion factor @@ -93,12 +93,12 @@ protected: //extras[60]= lux - level of luxury [do not apply in music use 0?] //extras[79]=Lbox (Mpc/h) - }header; + }; - typedef struct io_ptf + struct ptf { float astep; - }ptf; + }; header header_; ptf ptf_; @@ -166,11 +166,11 @@ protected: // non-public member functions void write_header_file( void ) //PMcrd.DAT { - char* fout; - if(do_baryons_){ - fout = "/PMcrdIC.DAT";} - else{ - fout = "/PMcrd.DAT";} + std::string fout; + if(do_baryons_) + fout = "/PMcrdIC.DAT"; + else + fout = "/PMcrd.DAT"; std::string partfname = fname_ + fout; std::ofstream ofs( partfname.c_str(), std::ios::trunc ); //ofs.open(fname_.c_str(), std::ios::binary|std::ios::trunc ); @@ -289,11 +289,11 @@ protected: void assemble_DM_file( void ) //PMcrs0.DAT { // file name - char* fout; - if(do_baryons_) { - fout = "/PMcrs0IC.DAT";} - else { - fout = "/PMcrs0.DAT";} + std::string fout; + if(do_baryons_) + fout = "/PMcrs0IC.DAT"; + else + fout = "/PMcrs0.DAT"; std::string partfname = fname_ + fout; std::ofstream ofs( partfname.c_str(), std::ios::trunc );