From 73692d10ff868bbe47ecdce598b452da30d18dc9 Mon Sep 17 00:00:00 2001 From: Marcel Zemp Date: Tue, 8 Jul 2014 17:15:55 +0800 Subject: [PATCH] Some code clean-up. --- iof.h | 2 +- iof_array.c | 4 ++-- iof_array.h | 8 ++++---- iof_art.c | 4 ++-- iof_art.h | 8 ++++---- iof_auxiliary.c | 10 +++++----- iof_auxiliary.h | 2 +- iof_gadget.c | 2 +- iof_gadget.h | 4 ++-- iof_tipsy.c | 10 +++++----- iof_tipsy.h | 2 +- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/iof.h b/iof.h index 0fcd38b..1038da8 100644 --- a/iof.h +++ b/iof.h @@ -18,7 +18,7 @@ extern "C" { #include <../iof/iof_array.h> #ifdef __cplusplus - } +} #endif #endif /* IOF_H */ diff --git a/iof_array.c b/iof_array.c index 00077f5..25a2567 100644 --- a/iof_array.c +++ b/iof_array.c @@ -1,5 +1,5 @@ /* -** array.c +** iof_array.c ** ** Various handling functions for arrays ** @@ -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); } diff --git a/iof_array.h b/iof_array.h index 3d5d76a..4aa28ff 100644 --- a/iof_array.h +++ b/iof_array.h @@ -1,5 +1,5 @@ /* -** array.c +** iof_array.h ** ** Various handling functions for arrays ** @@ -17,12 +17,12 @@ */ typedef struct array_header { - + int N[4]; } ARRAY_HEADER; typedef struct array_particle { - + int *ia; float *fa; double *da; @@ -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 *); diff --git a/iof_art.c b/iof_art.c index a0c6d7e..69a51d1 100644 --- a/iof_art.c +++ b/iof_art.c @@ -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); @@ -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); diff --git a/iof_art.h b/iof_art.h index 4611009..d04dad4 100644 --- a/iof_art.h +++ b/iof_art.h @@ -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; diff --git a/iof_auxiliary.c b/iof_auxiliary.c index c883255..c983856 100644 --- a/iof_auxiliary.c +++ b/iof_auxiliary.c @@ -1,5 +1,5 @@ /* -** auxiliary.c +** iof_auxiliary.c ** ** Various auxiliary functions and definitons ** @@ -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]; @@ -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; diff --git a/iof_auxiliary.h b/iof_auxiliary.h index 8ba35ea..dfe6efb 100644 --- a/iof_auxiliary.h +++ b/iof_auxiliary.h @@ -1,5 +1,5 @@ /* -** auxiliary.h +** iof_auxiliary.h ** ** Various auxiliary functions and definitions ** diff --git a/iof_gadget.c b/iof_gadget.c index 23ed9c6..1f12246 100644 --- a/iof_gadget.c +++ b/iof_gadget.c @@ -1,5 +1,5 @@ /* -** gadget.c +** iof_gadget.c ** ** Various handling functions for gadget format ** diff --git a/iof_gadget.h b/iof_gadget.h index d9e14d0..14ccd03 100644 --- a/iof_gadget.h +++ b/iof_gadget.h @@ -1,5 +1,5 @@ /* -** gadget.h +** iof_gadget.h ** ** Various handling functions for gadget format ** @@ -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 */ diff --git a/iof_tipsy.c b/iof_tipsy.c index 8ff3110..d5befa0 100644 --- a/iof_tipsy.c +++ b/iof_tipsy.c @@ -1,5 +1,5 @@ /* -** tipsy.c +** iof_tipsy.c ** ** Various handling functions for tipsy format ** @@ -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; @@ -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; @@ -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; @@ -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; diff --git a/iof_tipsy.h b/iof_tipsy.h index b8904ce..71e225f 100644 --- a/iof_tipsy.h +++ b/iof_tipsy.h @@ -1,5 +1,5 @@ /* -** tipsy.h +** iof_tipsy.h ** ** Various handling functions for tipsy format **