From cf5a1611319de27b365175a7202c2bbd4730846c Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Tue, 15 Oct 2013 09:17:51 +0200 Subject: Fix some MSVC and Inter C Compiler warnings. diff --git a/src/compression/coder.c b/src/compression/coder.c index 8d8b5bd..c12042c 100644 --- a/src/compression/coder.c +++ b/src/compression/coder.c @@ -61,7 +61,8 @@ TNG_INLINE void Ptngc_out8bits(struct coder *coder_inst, unsigned char **output) coder_inst->pack_temporary=pack_temporary; } -void Ptngc_write_pattern(struct coder *coder_inst,unsigned int pattern, int nbits, unsigned char **output) +void Ptngc_write_pattern(struct coder *coder_inst, unsigned int pattern, + int nbits, unsigned char **output) { unsigned int mask1,mask2; mask1=1; @@ -80,7 +81,9 @@ void Ptngc_write_pattern(struct coder *coder_inst,unsigned int pattern, int nbit } /* Write up to 24 bits */ -TNG_INLINE void Ptngc_writebits(struct coder *coder_inst,unsigned int value,int nbits, unsigned char **output_ptr) +TNG_INLINE void Ptngc_writebits(struct coder *coder_inst, + unsigned int value, int nbits, + unsigned char **output_ptr) { /* Make room for the bits. */ coder_inst->pack_temporary<<=nbits; @@ -90,7 +93,8 @@ TNG_INLINE void Ptngc_writebits(struct coder *coder_inst,unsigned int value,int } /* Write up to 32 bits */ -void Ptngc_write32bits(struct coder *coder_inst,unsigned int value,int nbits, unsigned char **output_ptr) +void Ptngc_write32bits(struct coder *coder_inst,unsigned int value, + int nbits, unsigned char **output_ptr) { unsigned int mask; if (nbits>=8) @@ -112,7 +116,8 @@ void Ptngc_write32bits(struct coder *coder_inst,unsigned int value,int nbits, un } /* Write "arbitrary" number of bits */ -void Ptngc_writemanybits(struct coder *coder_inst,unsigned char *value,int nbits, unsigned char **output_ptr) +void Ptngc_writemanybits(struct coder *coder_inst, unsigned char *value, + int nbits, unsigned char **output_ptr) { int vptr=0; while (nbits>=24) @@ -136,7 +141,9 @@ void Ptngc_writemanybits(struct coder *coder_inst,unsigned char *value,int nbits } } -static int write_stop_bit_code(struct coder *coder_inst, unsigned int s,unsigned int coding_parameter, unsigned char **output) +static int write_stop_bit_code(struct coder *coder_inst, unsigned int s, + unsigned int coding_parameter, + unsigned char **output) { do { unsigned int extract=~(0xffffffffU<pack_temporary_bits,output); } -unsigned char *Ptngc_pack_array(struct coder *coder_inst,int *input, int *length, int coding, int coding_parameter,int natoms, int speed) +unsigned char *Ptngc_pack_array(struct coder *coder_inst, + int *input, int *length, int coding, + int coding_parameter, int natoms, int speed) { if ((coding==TNG_COMPRESS_ALGO_BWLZH1) || (coding==TNG_COMPRESS_ALGO_BWLZH2)) { @@ -307,7 +318,8 @@ unsigned char *Ptngc_pack_array(struct coder *coder_inst,int *input, int *length else if (item<0) s[j]=2+(-item-1)*2; } - if (pack_triplet(coder_inst,s,&output_ptr,coding_parameter,max_base,maxbits)) + if (pack_triplet(coder_inst, s, &output_ptr, + coding_parameter, max_base,maxbits)) { free(output); return NULL; @@ -332,10 +344,10 @@ static int unpack_array_stop_bits(struct coder *coder_inst, unsigned char *packed,int *output, int length, int coding_parameter) { - (void) coder_inst; int i,j; unsigned int extract_mask=0x80; unsigned char *ptr=packed; + (void) coder_inst; for (i=0; ileaf.probleaf.prob) rval=1; @@ -71,7 +71,7 @@ static int comp_htree(const void *leafptr1, const void *leafptr2, const void *pr static void assign_codes(union htree_nodeleaf *htree, struct codelength *codelength, unsigned int code, - int length, + int length, int top) { #if 0 @@ -130,7 +130,7 @@ static void flush_8bits(unsigned int *combine, unsigned char **output, int *bitp (*output)++; (*bitptr)-=8; (*combine)&=mask; - } + } } static void writebits(unsigned int value,int length, unsigned char **output, int *bitptr) @@ -186,10 +186,10 @@ static unsigned int readbits(int length, unsigned char **input, int *bitptr) static int comp_codes(const void *codeptr1, const void *codeptr2, const void *private) { - (void)private; 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. */ if (code1->length>code2->length) rval=1; @@ -204,11 +204,11 @@ static int comp_codes(const void *codeptr1, const void *codeptr2, const void *pr static int comp_codes_value(const void *codeptr1, const void *codeptr2, const void *private) { - (void)private; const struct codelength *code1=(struct codelength *)codeptr1; const struct codelength *code2=(struct codelength *)codeptr2; - + int rval=0; /* It shouldn't be possible to get equal here, though. */ + (void)private; if (code1->dict>code2->dict) rval=1; else @@ -253,7 +253,7 @@ void Ptngc_comp_conv_to_huffman(unsigned int *vals, int nvals, } /* Sort the leafs wrt probability. */ Ptngc_merge_sort(htree,ndict,sizeof *htree,comp_htree,NULL); - + #if 0 for (i=0; i1) @@ -473,14 +473,14 @@ void Ptngc_comp_conv_from_huffman(unsigned char *huffman, unsigned int *huffman_dict_unpacked, int huffman_dict_unpackedlen) { - (void)huffman_dictlen; - (void)huffman_dict_unpackedlen; struct codelength *codelength=warnmalloc(ndict*sizeof *codelength); int i,j; int maxdict; int code; unsigned char *huffman_ptr; int bitptr; + (void)huffman_dictlen; + (void)huffman_dict_unpackedlen; if (huffman_dict_unpacked) { maxdict=huffman_dict_unpacked[0]|(huffman_dict_unpacked[1]<<8)|(huffman_dict_unpacked[2]<<16); diff --git a/src/compression/huffmem.c b/src/compression/huffmem.c index eec8646..2232b7e 100644 --- a/src/compression/huffmem.c +++ b/src/compression/huffmem.c @@ -72,7 +72,7 @@ void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals, huffdict,&nhuffdict, huffdictunpack,&nhuffdictunpack); *huffdatalen=nhuff; - + /* Algorithm 0 stores the huffman dictionary directly (+ a code for the algorithm) + lengths of the huffman buffer (4) and the huffman dictionary (3). */ huffman_lengths[0]=nhuff+nhuffdict+1*2+3*4+3+3; @@ -92,7 +92,7 @@ void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals, /* ... and rle + huffman coding ... (algorithm 2) Pack any repetetitive patterns. */ Ptngc_comp_conv_to_rle(huffdictunpack,nhuffdictunpack, huffdictrle,&nhuffrle,1); - + /* Determine probabilities. */ Ptngc_comp_make_dict_hist(huffdictrle,nhuffrle,dict,&ndict2,hist); /* Pack huffman dictionary */ @@ -102,10 +102,10 @@ void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals, huffdict2,&nhuffdict2, huffdictunpack2,&nhuffdictunpack2); huffman_lengths[2]=nhuff+nhuff2+nhuffdict2+1*2+3*4+3+3+3+3+3+3; - + /* Choose the best algorithm and output the data. */ if ((*chosen_algo==0) || ((*chosen_algo==-1) && - (((huffman_lengths[0]=0; i--) { @@ -514,7 +514,7 @@ static void trajcoder_base_decompress(unsigned char *input, int n, int *index, i fprintf(stderr,"Remainder: %u\n",remainder); #endif #endif -#if 0 +#if 0 for (j=0; j<19; j++) largeint[j]=largeint_tmp[j]; #endif @@ -552,7 +552,7 @@ int nvalues_sum; static void write_three_large(struct coder *coder, int *encode_ints, int *large_index, int nbits, unsigned char *compress_buffer, unsigned char **output_ptr) { trajcoder_base_compress(encode_ints,3,large_index,compress_buffer); - Ptngc_writemanybits(coder,compress_buffer,nbits,output_ptr); + Ptngc_writemanybits(coder,compress_buffer,nbits,output_ptr); #ifdef SHOWIT fprintf(stderr,"nbits=%d (%g)\n",nbits,nbits/3.); nbits_sum+=nbits; @@ -565,7 +565,7 @@ static void insert_batch(int *input_ptr, int ntriplets_left, int *prevcoord,int { int nencode=startenc*3; int tmp_prevcoord[3]; - + tmp_prevcoord[0]=prevcoord[0]; tmp_prevcoord[1]=prevcoord[1]; tmp_prevcoord[2]=prevcoord[2]; @@ -587,13 +587,13 @@ static void insert_batch(int *input_ptr, int ntriplets_left, int *prevcoord,int positive_int(encode_ints[i*3]), positive_int(encode_ints[i*3+1]), positive_int(encode_ints[i*3+2])); -#endif +#endif } } #ifdef SHOWIT fprintf(stderr,"New batch\n"); -#endif +#endif while ((nencode<21) && (nencode=%g?\n",change,isum,(double)magic[small_index+change]*(double)magic[small_index+change]); -#endif +#endif if (isum>(double)magic[small_index+change]*(double)magic[small_index+change]) { #ifdef SHOWIT fprintf(stderr,"Rejected decrease %d of index due to length of vector: %g>=%g\n",change,isum,(double)magic[small_index+change]*(double)magic[small_index+change]); -#endif +#endif rejected=1; change++; } @@ -1155,10 +1155,10 @@ unsigned char *Ptngc_pack_array_xtc2(struct coder *coder,int *input, int *length #ifdef SHOWIT else fprintf(stderr,"Rejected base change due to only change==-1\n"); -#endif +#endif #ifdef SHOWIT fprintf(stderr,"Current small index: %d Base=%d\n",small_index,magic[small_index]); -#endif +#endif } /* If we have a large previous integer we can combine it with a sequence of small ints. */ if (has_large) @@ -1183,7 +1183,7 @@ unsigned char *Ptngc_pack_array_xtc2(struct coder *coder,int *input, int *length } else { - + #ifdef SHOWIT fprintf(stderr,"Sequence of one large and small integers (good compression).\n"); #endif @@ -1239,7 +1239,7 @@ unsigned char *Ptngc_pack_array_xtc2(struct coder *coder,int *input, int *length fprintf(stderr,"Prevcoord in packing: %d %d %d\n", prevcoord[0],prevcoord[1],prevcoord[2]); #endif - + input_ptr+=3*runlength; ntriplets_left-=runlength; } @@ -1248,13 +1248,13 @@ unsigned char *Ptngc_pack_array_xtc2(struct coder *coder,int *input, int *length #ifdef SHOWIT fprintf(stderr,"Refused value: %d old is %d max is %d\n",new_small_index,small_index,max_large_index); fflush(stderr); -#endif +#endif refused=1; } } #ifdef SHOWIT fprintf(stderr,"Number of triplets left is %d\n",ntriplets_left); -#endif +#endif } /* If we have large previous integers we must flush them now. */ if (has_large) @@ -1271,7 +1271,6 @@ unsigned char *Ptngc_pack_array_xtc2(struct coder *coder,int *input, int *length int Ptngc_unpack_array_xtc2(struct coder *coder,unsigned char *packed,int *output, int length) { - (void)coder; unsigned char *ptr=packed; int bitptr=0; int minint[3]; @@ -1284,6 +1283,7 @@ int Ptngc_unpack_array_xtc2(struct coder *coder,unsigned char *packed,int *outpu int large_nbits; unsigned char compress_buffer[18*4]; /* Holds compressed result for 3 large ints or up to 18 small ints. */ int encode_ints[21]; /* Up to 3 large + 18 small ints can be encoded at once */ + (void)coder; /* Read min integers. */ minint[0]=unpositive_int(readbits(&ptr,&bitptr,32)); @@ -1297,7 +1297,7 @@ int Ptngc_unpack_array_xtc2(struct coder *coder,unsigned char *packed,int *outpu small_index=readbits(&ptr,&bitptr,8); large_nbits=compute_magic_bits(large_index); - + #ifdef SHOWIT fprintf(stderr,"Minimum integers: %d %d %d\n",minint[0],minint[1],minint[2]); fprintf(stderr,"Large indices: %d %d %d\n",large_index[0],large_index[1],large_index[2]); @@ -1316,7 +1316,7 @@ int Ptngc_unpack_array_xtc2(struct coder *coder,unsigned char *packed,int *outpu #ifdef SHOWIT if ((instr>=0) && (instrid != TNG_TRAJ_POSITIONS && block->id != TNG_TRAJ_VELOCITIES) @@ -4027,7 +4027,7 @@ static tng_function_status tng_uncompress(tng_trajectory_t tng_data, return(TNG_FAILURE); } - offset = start_pos - (void *)block->block_contents; + offset = (char *)start_pos - (char *)block->block_contents; block->block_contents_size = uncompressed_len + offset; @@ -4076,10 +4076,10 @@ static tng_function_status tng_gzip_compress(tng_trajectory_t tng_data, tng_gen_block_t block, void *start_pos, const int len) { - (void)tng_data; Bytef *dest; char *temp; uLong max_len, stat; + (void)tng_data; max_len = compressBound(len); dest = malloc(max_len); @@ -4125,11 +4125,11 @@ static tng_function_status tng_gzip_uncompress(tng_trajectory_t tng_data, void *start_pos, unsigned long uncompressed_len) { - (void)tng_data; Bytef *dest; char *temp; unsigned long stat; int offset; + (void)tng_data; offset = start_pos - (void *)block->block_contents; @@ -4200,9 +4200,9 @@ static tng_function_status tng_allocate_particle_data_mem const int64_t n_particles, const int64_t n_values_per_frame) { - (void)tng_data; void ***values; int64_t i, j, k, size, frame_alloc; + (void)tng_data; if(n_particles == 0 || n_values_per_frame == 0) { @@ -4629,7 +4629,8 @@ static tng_function_status tng_particle_data_read } else { - memcpy(data->values + n_frames_div * size * n_values * num_first_particle, + memcpy((char *)data->values + n_frames_div * size * n_values * + num_first_particle, block->block_contents + *offset, block->block_contents_size - *offset); switch(datatype) @@ -4640,7 +4641,7 @@ static tng_function_status tng_particle_data_read for(i = 0; i < (block->block_contents_size - *offset); i+=size) { if(tng_data->input_endianness_swap_func_32(tng_data, - (int32_t *)(data->values + i)) + (int32_t *)((char *)data->values + i)) != TNG_SUCCESS) { printf("Cannot swap byte order. %s: %d\n", @@ -4656,7 +4657,7 @@ static tng_function_status tng_particle_data_read for(i = 0; i < (block->block_contents_size - *offset); i+=size) { if(tng_data->input_endianness_swap_func_64(tng_data, - (int64_t *)(data->values + i)) + (int64_t *)((char *)data->values + i)) != TNG_SUCCESS) { printf("Cannot swap byte order. %s: %d\n", @@ -5246,9 +5247,9 @@ static tng_function_status tng_allocate_data_mem int64_t stride_length, const int64_t n_values_per_frame) { - (void)tng_data; void **values; int64_t i, j, size, frame_alloc; + (void)tng_data; if(data->strings && data->datatype == TNG_CHAR_DATA) { @@ -5507,7 +5508,7 @@ static tng_function_status tng_data_read(tng_trajectory_t tng_data, for(i = 0; i < (block->block_contents_size - *offset); i+=size) { if(tng_data->input_endianness_swap_func_32(tng_data, - (int32_t *)(data->values + i)) + (int32_t *)((char *)data->values + i)) != TNG_SUCCESS) { printf("Cannot swap byte order. %s: %d\n", @@ -5523,7 +5524,7 @@ static tng_function_status tng_data_read(tng_trajectory_t tng_data, for(i = 0; i < (block->block_contents_size - *offset); i+=size) { if(tng_data->input_endianness_swap_func_64(tng_data, - (int64_t *)(data->values + i)) + (int64_t *)((char *)data->values + i)) != TNG_SUCCESS) { printf("Cannot swap byte order. %s: %d\n", @@ -6732,8 +6733,8 @@ tng_function_status tng_atom_name_set(tng_trajectory_t tng_data, tng_atom_t atom, const char *new_name) { - (void)tng_data; int len; + (void)tng_data; len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN); @@ -6764,8 +6765,8 @@ tng_function_status tng_atom_type_set(tng_trajectory_t tng_data, tng_atom_t atom, const char *new_type) { - (void)tng_data; int len; + (void)tng_data; len = tng_min(strlen(new_type) + 1, TNG_MAX_STR_LEN); @@ -6924,8 +6925,8 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_name_set tng_molecule_t molecule, const char *new_name) { - (void)tng_data; int len; + (void)tng_data; len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN); @@ -7038,8 +7039,8 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_find int64_t nr, tng_chain_t *chain) { - (void)tng_data; int i, n_chains; + (void)tng_data; n_chains = molecule->n_chains; @@ -7128,8 +7129,8 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_name_set tng_chain_t chain, const char *new_name) { - (void)tng_data; int len; + (void)tng_data; len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN); @@ -7163,8 +7164,8 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_residue_find int64_t id, tng_residue_t *residue) { - (void)tng_data; int i, n_residues; + (void)tng_data; n_residues = chain->n_residues; @@ -7291,8 +7292,8 @@ tng_function_status DECLSPECDLLEXPORT tng_residue_name_set(tng_trajectory_t tng_ tng_residue_t residue, const char *new_name) { - (void)tng_data; int len; + (void)tng_data; len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN); @@ -7411,8 +7412,8 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_init(const tng_trajectory_t t tng_function_status DECLSPECDLLEXPORT tng_molecule_destroy(const tng_trajectory_t tng_data, tng_molecule_t molecule) { - (void)tng_data; int i; + (void)tng_data; if(molecule->name) { @@ -12024,8 +12025,8 @@ tng_function_status DECLSPECDLLEXPORT tng_data_values_free const int64_t n_values_per_frame, const char type) { - (void)tng_data; int i, j; + (void)tng_data; if(values) { @@ -12134,8 +12135,8 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_values_free const int64_t n_values_per_frame, const char type) { - (void)tng_data; int i, j, k; + (void)tng_data; if(values) { @@ -12269,7 +12270,7 @@ tng_function_status DECLSPECDLLEXPORT tng_data_get { for(j=*n_values_per_frame; j--;) { - (*values)[i][j].i = *(int *)(data->values + size * + (*values)[i][j].i = *(int *)((char *)data->values + size * (i*(*n_values_per_frame) + j)); } } @@ -12280,7 +12281,7 @@ tng_function_status DECLSPECDLLEXPORT tng_data_get { for(j=*n_values_per_frame; j--;) { - (*values)[i][j].f = *(float *)(data->values + size * + (*values)[i][j].f = *(float *)((char *)data->values + size * (i*(*n_values_per_frame) + j)); } } @@ -12292,7 +12293,7 @@ tng_function_status DECLSPECDLLEXPORT tng_data_get { for(j=*n_values_per_frame; j--;) { - (*values)[i][j].d = *(double *)(data->values + size * + (*values)[i][j].d = *(double *)((char *)data->values + size * (i*(*n_values_per_frame) + j)); } } @@ -12546,9 +12547,9 @@ tng_function_status DECLSPECDLLEXPORT tng_data_interval_get } for(j=*n_values_per_frame; j--;) { - (*values)[i][j].i = *(int *)(data->values + size * - (current_frame_pos * - (*n_values_per_frame) + j)); + (*values)[i][j].i = *(int *)((char *)data->values + size * + (current_frame_pos * + (*n_values_per_frame) + j)); } current_frame_pos++; } @@ -12568,7 +12569,7 @@ tng_function_status DECLSPECDLLEXPORT tng_data_interval_get } for(j=*n_values_per_frame; j--;) { - (*values)[i][j].f = *(float *)(data->values + size * + (*values)[i][j].f = *(float *)((char *)data->values + size * (current_frame_pos * (*n_values_per_frame) + j)); } @@ -12591,7 +12592,7 @@ tng_function_status DECLSPECDLLEXPORT tng_data_interval_get } for(j=*n_values_per_frame; j--;) { - (*values)[i][j].d = *(double *)(data->values + size * + (*values)[i][j].d = *(double *)((char *)data->values + size * (current_frame_pos * (*n_values_per_frame) + j)); } @@ -12735,7 +12736,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, current_values + n_frames_div * frame_size, + memcpy(*values, (char *)current_values + n_frames_div * frame_size, n_frames_div_2 * frame_size); current_frame_pos += n_frames - frame_set->first_frame - @@ -12940,7 +12941,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_get for(k=*n_values_per_frame; k--;) { (*values)[i][mapping][k].i = *(int *) - (data->values + size * + ((char *)data->values + size * (i * i_step + j * (*n_values_per_frame) + k)); } @@ -12958,7 +12959,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_get for(k=*n_values_per_frame; k--;) { (*values)[i][mapping][k].f = *(float *) - (data->values + size * + ((char *)data->values + size * (i * i_step + j * (*n_values_per_frame) + k)); } @@ -12977,7 +12978,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_get for(k=*n_values_per_frame; k--;) { (*values)[i][mapping][k].d = *(double *) - (data->values + size * + ((char *)data->values + size * (i * i_step + j * (*n_values_per_frame) + k)); } @@ -13298,7 +13299,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get for(k=*n_values_per_frame; k--;) { (*values)[i][mapping][k].i = *(int *) - (data->values + size * + ((char *)data->values + size * (current_frame_pos * i_step + j * (*n_values_per_frame) + k)); @@ -13327,7 +13328,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get for(k=*n_values_per_frame; k--;) { (*values)[i][mapping][k].f = *(float *) - (data->values + size * + ((char *)data->values + size * (current_frame_pos * i_step + j * (*n_values_per_frame) + k)); @@ -13357,7 +13358,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get for(k=*n_values_per_frame; k--;) { (*values)[i][mapping][k].d = *(double *) - (data->values + size * + ((char *)data->values + size * (current_frame_pos * i_step + j * (*n_values_per_frame) + k)); @@ -13506,7 +13507,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, current_values + n_frames_div * frame_size, + memcpy(*values, (char *)current_values + n_frames_div * frame_size, n_frames_div_2 * frame_size); current_frame_pos += n_frames - frame_set->first_frame - @@ -13676,11 +13677,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_molecule_particles_get char ***chain_names, int64_t **chain_ids) { - (void)tng_data; tng_atom_t atom; tng_residue_t res; tng_chain_t chain; int64_t i; + (void)tng_data; *n_particles = mol->n_atoms; @@ -14207,7 +14208,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write frame_pos = (frame_nr - frame_set->first_frame) / stride_length; - memcpy(p_data->values + sizeof(float) * frame_pos * n_particles * + memcpy((char *)p_data->values + sizeof(float) * frame_pos * n_particles * n_values_per_frame, values, sizeof(float) * n_particles * n_values_per_frame); } @@ -14257,7 +14258,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write frame_pos = (frame_nr - frame_set->first_frame) / stride_length; - memcpy(np_data->values + sizeof(float) * frame_pos * + memcpy((char *)np_data->values + sizeof(float) * frame_pos * n_values_per_frame, values, sizeof(float) * n_values_per_frame); } -- cgit v0.10.1