Skip to content

Commit

Permalink
Some code clean-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzemp committed Jul 8, 2014
1 parent fcbc76a commit 73692d1
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion iof.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern "C" {
#include <../iof/iof_array.h>

#ifdef __cplusplus
}
}
#endif

#endif /* IOF_H */
4 changes: 2 additions & 2 deletions iof_array.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** array.c
** iof_array.c
**
** Various handling functions for arrays
**
Expand Down Expand Up @@ -70,7 +70,7 @@ void read_array_xdr_particle(XDR *xdrs, const ARRAY_HEADER *ah, ARRAY_PARTICLE *
void write_array_xdr_header(XDR *xdrs, ARRAY_HEADER *ah) {

int i;

for (i = 0; i < 4; i++) {
assert(xdr_int(xdrs,&ah->N[i]) == 1);
}
Expand Down
8 changes: 4 additions & 4 deletions iof_array.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** array.c
** iof_array.h
**
** Various handling functions for arrays
**
Expand All @@ -17,12 +17,12 @@
*/

typedef struct array_header {

int N[4];
} ARRAY_HEADER;

typedef struct array_particle {

int *ia;
float *fa;
double *da;
Expand All @@ -33,7 +33,7 @@ typedef struct array_particle {
*/

void allocate_array_particle(const ARRAY_HEADER *, ARRAY_PARTICLE *);

void read_array_xdr_header(XDR *, ARRAY_HEADER *);
void read_array_xdr_particle(XDR *, const ARRAY_HEADER *, ARRAY_PARTICLE *);

Expand Down
4 changes: 2 additions & 2 deletions iof_art.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ void read_art_nb_star_properties(ART_DATA ad, ART_STAR_PROPERTIES *asp) {
void move_art_nb_gas_filepositions_level_begin(ART_DATA ad, int level) {

int header, trailer;

fread(&header,sizeof(int),1,ad.GasFile[0]);
if (ad.doswap) reorder(&header,sizeof(int),1);

Expand All @@ -714,7 +714,7 @@ void move_art_nb_gas_filepositions_level_begin(ART_DATA ad, int level) {
void move_art_nb_gas_filepositions_level_end(ART_DATA ad, int level) {

int header, trailer;

assert(fread(&trailer,sizeof(int),1,ad.GasFile[0]) == 1);
if (ad.doswap) reorder(&trailer,sizeof(int),1);

Expand Down
8 changes: 4 additions & 4 deletions iof_art.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ typedef struct art_header {
float ekin2;
float au0;
float aeu0;
int Nrow;
int Ngrid;
int Nspecies;
int Nseed;
int Nrow;
int Ngrid;
int Nspecies;
int Nseed;
float OmM0;
float OmL0;
float h100;
Expand Down
10 changes: 5 additions & 5 deletions iof_auxiliary.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** auxiliary.c
** iof_auxiliary.c
**
** Various auxiliary functions and definitons
**
Expand Down Expand Up @@ -50,12 +50,12 @@ const CONVERSION_FACTORS ConversionFactors = {
*/

void reorder(void *pointer, size_t size, size_t n){

unsigned char *buffer, tmp;
int i, j;

buffer = pointer;

for(i = 0; i < n; i++){
for (j = 0; j < (size/2); j++) {
tmp = buffer[i*size+j];
Expand Down Expand Up @@ -118,7 +118,7 @@ void set_default_values_coordinate_transformation(COORDINATE_TRANSFORMATION *ct)
*/

void calculate_units_transformation(UNIT_SYSTEM fromus, UNIT_SYSTEM tous, COORDINATE_TRANSFORMATION *ct) {

ct->L_usf = tous.LBox/fromus.LBox;
ct->T_usf = fromus.Hubble0/tous.Hubble0;
ct->V_usf = ct->L_usf/ct->T_usf;
Expand Down
2 changes: 1 addition & 1 deletion iof_auxiliary.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** auxiliary.h
** iof_auxiliary.h
**
** Various auxiliary functions and definitions
**
Expand Down
2 changes: 1 addition & 1 deletion iof_gadget.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** gadget.c
** iof_gadget.c
**
** Various handling functions for gadget format
**
Expand Down
4 changes: 2 additions & 2 deletions iof_gadget.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** gadget.h
** iof_gadget.h
**
** Various handling functions for gadget format
**
Expand All @@ -14,7 +14,7 @@
*/

typedef struct io_header {

int npart[6]; /*!< number of particles of each type in this file */
double mass[6]; /*!< mass of particles of each type. If 0, then the masses are explicitly
stored in the mass-block of the snapshot file, otherwise they are omitted */
Expand Down
10 changes: 5 additions & 5 deletions iof_tipsy.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** tipsy.c
** iof_tipsy.c
**
** Various handling functions for tipsy format
**
Expand Down Expand Up @@ -809,7 +809,7 @@ void read_tipsy_ascii(FILE *fp, TIPSY_STRUCTURE *ts) {
TIPSY_GAS_PARTICLE *tgp;
TIPSY_DARK_PARTICLE *tdp;
TIPSY_STAR_PARTICLE *tsp;

th = ts->th;
tgp = ts->tgp;
tdp = ts->tdp;
Expand Down Expand Up @@ -948,7 +948,7 @@ void read_tipsy_ascii_dpp(FILE *fp, TIPSY_STRUCTURE_DPP *tsdpp) {
TIPSY_GAS_PARTICLE_DPP *tgpdpp;
TIPSY_DARK_PARTICLE_DPP *tdpdpp;
TIPSY_STAR_PARTICLE_DPP *tspdpp;

th = tsdpp->th;
tgpdpp = tsdpp->tgpdpp;
tdpdpp = tsdpp->tdpdpp;
Expand Down Expand Up @@ -1087,7 +1087,7 @@ void write_tipsy_ascii(FILE *fp, const TIPSY_STRUCTURE *ts) {
TIPSY_GAS_PARTICLE *tgp;
TIPSY_DARK_PARTICLE *tdp;
TIPSY_STAR_PARTICLE *tsp;

th = ts->th;
tgp = ts->tgp;
tdp = ts->tdp;
Expand Down Expand Up @@ -1192,7 +1192,7 @@ void write_tipsy_ascii_dpp(FILE *fp, const TIPSY_STRUCTURE_DPP *tsdpp) {
TIPSY_GAS_PARTICLE_DPP *tgpdpp;
TIPSY_DARK_PARTICLE_DPP *tdpdpp;
TIPSY_STAR_PARTICLE_DPP *tspdpp;

th = tsdpp->th;
tgpdpp = tsdpp->tgpdpp;
tdpdpp = tsdpp->tdpdpp;
Expand Down
2 changes: 1 addition & 1 deletion iof_tipsy.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** tipsy.h
** iof_tipsy.h
**
** Various handling functions for tipsy format
**
Expand Down

0 comments on commit 73692d1

Please sign in to comment.