Skip to content

Commit

Permalink
Modernise bhtree's C code to work with Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
LourensVeen committed Nov 25, 2024
1 parent c604d43 commit 3a387b0
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 155 deletions.
14 changes: 7 additions & 7 deletions src/amuse/community/bhtree/src/BHTC.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//
// Change in the calling format for apply_vf, from function name to
// add explicit address operator. This was necessary to pass g++ 2.8.1
//
//
// Version 1.1 Jun Makino : take parameters from command line argumensts
// Coding for 1.1 started on 1998/12/31
// Version 1.0 Jun Makino : First publisized version, parameters
Expand Down Expand Up @@ -50,7 +50,7 @@ int main(int argc, char ** argv)

extern char *poptarg;
int c;
char* param_string = "i:o:d:D:T:e:t:n:w:cx:v:s:S:h";
char const * param_string = "i:o:d:D:T:e:t:n:w:cx:v:s:S:h";
foname[0] = '?';
foname[1] = '\0';
real eps = 0.025;
Expand Down Expand Up @@ -103,7 +103,7 @@ int main(int argc, char ** argv)
break;
case 'S': vel_scale = atof(poptarg);
break;
case 'h':
case 'h':
cerr << "list of options\n";
cerr << "-i name of snapshot input file (no default)\n";
cerr << "-o name of snapshot output file (default: no output)\n";
Expand Down Expand Up @@ -141,7 +141,7 @@ int main(int argc, char ** argv)
cout << "n= " << pb.n << endl;
pb.use_self_gravity = 1;
fsnapin.close();
if (snapout) fsnapout.open(foname,ios::out);
if (snapout) fsnapout.open(foname,ios::out);
PR(eps); PR(theta); PR(ncrit);
cout << "eps= " << eps << " theta=" << theta << " ncrit=" <<ncrit <<endl;
pb.eps2_for_gravity = eps*eps;
Expand All @@ -165,7 +165,7 @@ int main(int argc, char ** argv)
}

cout << endl;
#ifdef GRAPHICS
#ifdef GRAPHICS
initgraph();
#endif
int nstep = (int)(tend/dt+0.1);
Expand Down Expand Up @@ -195,9 +195,9 @@ int main(int argc, char ** argv)
cout << "CPU sec = " <<cpusec() << endl <<endl;
}
if (snapout)fsnapout.close();

}


//#endif
//#endif

2 changes: 1 addition & 1 deletion src/amuse/community/bhtree/src/BHTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typedef nbody_RF_ptr real_RF_ptr;
typedef nbody_RRF_ptr real_RRF_ptr;

extern "C" double cpusec();
int pgetopt(int argc, char ** argv, char * optstr);
int pgetopt(int argc, char ** argv, char const * optstr);
void pskipopt();

//#endif //_MUSE_BHTC_
Loading

0 comments on commit 3a387b0

Please sign in to comment.