diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-10-15 10:33:45 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-10-15 10:33:45 (GMT) |
commit | 8126a2234530d95d1d3854b50335b88478a6b824 (patch) | |
tree | 2d08a9dfdfe8304422eeb6801cd1b3d3b9607877 | |
parent | cb40bb630ca469426962b4056750716cd43f478d (diff) |
Fix some more compiler warnings
-rw-r--r-- | src/compression/huffman.c | 5 | ||||
-rw-r--r-- | src/lib/tng_io.c | 22 | ||||
-rw-r--r-- | src/tests/md_openmp.c | 2 | ||||
-rw-r--r-- | src/tests/md_openmp_util.c | 2 | ||||
-rw-r--r-- | src/tests/tng_io_testing.c | 2 |
5 files changed, 19 insertions, 14 deletions
diff --git a/src/compression/huffman.c b/src/compression/huffman.c index 77660fc..b8926ac 100644 --- a/src/compression/huffman.c +++ b/src/compression/huffman.c @@ -60,7 +60,7 @@ static int comp_htree(const void *leafptr1, const void *leafptr2, const void *pr const union htree_nodeleaf *leaf2=(union htree_nodeleaf *)leafptr2; int rval=0; (void)private; - + if (leaf1->leaf.prob<leaf2->leaf.prob) rval=1; else if (leaf1->leaf.prob>leaf2->leaf.prob) @@ -188,9 +188,8 @@ static int comp_codes(const void *codeptr1, const void *codeptr2, const void *pr { const struct codelength *code1=(struct codelength *)codeptr1; const struct codelength *code2=(struct codelength *)codeptr2; - (void)private; - int rval=0; /* It shouldn't be possible to get equal here, though. */ + (void)private; if (code1->length>code2->length) rval=1; else if (code1->length<code2->length) diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 35ed5eb..9292f5e 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -5359,7 +5359,9 @@ static tng_function_status tng_data_read(tng_trajectory_t tng_data, { int64_t i, j, n_frames_div; int size, len; +#ifdef USE_ZLIB unsigned long data_size; +#endif tng_non_particle_data_t data; tng_trajectory_frame_set_t frame_set = &tng_data->current_trajectory_frame_set; @@ -5556,7 +5558,10 @@ static tng_function_status tng_data_block_write(tng_trajectory_t tng_data, const char hash_mode) { int64_t n_frames, stride_length, frame_step; - int i, j, offset = 0, size, len, data_start_pos; + int i, j, offset = 0, size, len; +#ifdef USE_ZLIB + int data_start_pos; +#endif char temp, dependency, *temp_name; double multiplier; tng_trajectory_frame_set_t frame_set = @@ -8565,7 +8570,7 @@ tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_get } else { - end_32 = tng_data->endianness_32; + end_32 = (tng_endianness_32)tng_data->endianness_32; } if(tng_data->output_endianness_swap_func_64) @@ -8588,7 +8593,7 @@ tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_get } else { - end_64 = tng_data->endianness_64; + end_64 = (tng_endianness_64)tng_data->endianness_64; } if((int)end_32 != (int)end_64) @@ -10850,7 +10855,8 @@ tng_function_status DECLSPECDLLEXPORT tng_data_block_add } strncpy(first_dim_values[j], new_data_c, len); - new_data += len; + new_data_c += len; + new_data=new_data_c; } } } @@ -12780,7 +12786,7 @@ tng_function_status DECLSPECDLLEXPORT tng_data_vector_interval_get last_frame_pos / *stride_length; n_frames_div_2 = tng_max(1, n_frames_div_2); - memcpy(*values + n_frames_div * frame_size, + memcpy((char *)*values + n_frames_div * frame_size, current_values, n_frames_div_2 * frame_size); @@ -13128,9 +13134,9 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_vector_get for(j = *n_particles; j--;) { tng_particle_mapping_get_real_particle(frame_set, j, &mapping); - memcpy(*values + size * (i * i_step + mapping * + memcpy((char *)*values + size * (i * i_step + mapping * (*n_values_per_frame)), - data->values + size * + (char *)data->values + size * (i * i_step + j * (*n_values_per_frame)), size * (*n_values_per_frame)); } @@ -13551,7 +13557,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_vector_interval_get last_frame_pos / *stride_length; n_frames_div_2 = tng_max(1, n_frames_div_2); - memcpy(*values + n_frames_div * frame_size, + memcpy((char *)*values + n_frames_div * frame_size, current_values, n_frames_div_2 * frame_size); diff --git a/src/tests/md_openmp.c b/src/tests/md_openmp.c index 168092a..ff426c9 100644 --- a/src/tests/md_openmp.c +++ b/src/tests/md_openmp.c @@ -6,7 +6,7 @@ # include "tng_io.h" #include "tng_io_testing.h" -int main ( int argc, char *argv[] ); +int main (); void compute ( int np, int nd, double pos[], double vel[], double mass, double f[], double *pot, double *kin ); double dist ( int nd, double r1[], double r2[], double dr[] ); diff --git a/src/tests/md_openmp_util.c b/src/tests/md_openmp_util.c index d3504e4..815ca4f 100644 --- a/src/tests/md_openmp_util.c +++ b/src/tests/md_openmp_util.c @@ -6,7 +6,7 @@ # include "tng_io.h" #include "tng_io_testing.h" -int main ( int argc, char *argv[] ); +int main (); void compute ( int np, int nd, float pos[], float vel[], float mass, float f[], float *pot, float *kin ); float dist ( int nd, float r1[], float r2[], float dr[] ); diff --git a/src/tests/tng_io_testing.c b/src/tests/tng_io_testing.c index 61bdab0..5cd3461 100644 --- a/src/tests/tng_io_testing.c +++ b/src/tests/tng_io_testing.c @@ -706,4 +706,4 @@ int main() printf("Tests finished\n"); exit(0); -}
\ No newline at end of file +} |