summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tng_io.h2
-rw-r--r--src/compression/bwlzh.c4
-rw-r--r--src/compression/coder.c3
-rw-r--r--src/compression/huffman.c5
-rw-r--r--src/compression/huffmem.c1
-rw-r--r--src/compression/lz77.c3
-rw-r--r--src/compression/xtc2.c2
-rw-r--r--src/compression/xtc3.c4
-rw-r--r--src/lib/tng_io.c81
9 files changed, 74 insertions, 31 deletions
diff --git a/include/tng_io.h b/include/tng_io.h
index 7ddae0e..30aa4fa 100644
--- a/include/tng_io.h
+++ b/include/tng_io.h
@@ -279,6 +279,7 @@
/* Visual Studio does not contain inttypes.h and stdint.h. Some defines and
* typedefs are used from the GNU C Library */
+#ifndef _STDINT_H
/* This first part is from stdint.h (GNU C Library) */
#ifndef __int8_t_defined
# define __int8_t_defined
@@ -309,6 +310,7 @@ __extension__
#endif
typedef unsigned long long int uint64_t;
#endif
+#endif
/* This is from inttypes.h (GNU C Library) */
/* The ISO C99 standard specifies that these macros must only be
diff --git a/src/compression/bwlzh.c b/src/compression/bwlzh.c
index 62a5939..e5eb499 100644
--- a/src/compression/bwlzh.c
+++ b/src/compression/bwlzh.c
@@ -81,7 +81,9 @@ static void bwlzh_compress_gen(unsigned int *vals, int nvals,
int huffdatalen;
int nhufflen[N_HUFFMAN_ALGO];
int huffalgo;
+#ifndef PARTIAL_MTF
int ndict;
+#endif
int bwt_index;
unsigned int *bwt=NULL;
#ifdef PARTIAL_MTF3
@@ -494,7 +496,9 @@ static void bwlzh_decompress_gen(unsigned char *input, int nvals,
{
unsigned int *vals16;
int nvals16;
+#ifndef PARTIAL_MTF
int ndict;
+#endif
int bwt_index;
unsigned int *bwt=NULL;
unsigned int *mtf=NULL;
diff --git a/src/compression/coder.c b/src/compression/coder.c
index a9a9117..be46c17 100644
--- a/src/compression/coder.c
+++ b/src/compression/coder.c
@@ -332,6 +332,7 @@ unsigned char *Ptngc_pack_array(struct coder *coder,int *input, int *length, int
static int unpack_array_stop_bits(struct coder *coder,unsigned char *packed,int *output, int length, int coding_parameter)
{
+ (void)coder;
int i,j;
unsigned int extract_mask=0x80;
unsigned char *ptr=packed;
@@ -384,6 +385,7 @@ static int unpack_array_stop_bits(struct coder *coder,unsigned char *packed,int
static int unpack_array_triplet(struct coder *coder,unsigned char *packed,int *output, int length, int coding_parameter)
{
+ (void)coder;
int i,j;
unsigned int extract_mask=0x80;
unsigned char *ptr=packed;
@@ -455,6 +457,7 @@ static int unpack_array_triplet(struct coder *coder,unsigned char *packed,int *o
static int unpack_array_bwlzh(struct coder *coder,unsigned char *packed,int *output, int length, int natoms)
{
+ (void)coder;
int i,j,k,n=length;
unsigned int *pval=warnmalloc(n*sizeof *pval);
int nframes=n/natoms/3;
diff --git a/src/compression/huffman.c b/src/compression/huffman.c
index 1272e46..b5cd3c7 100644
--- a/src/compression/huffman.c
+++ b/src/compression/huffman.c
@@ -56,6 +56,7 @@ struct codelength
static int comp_htree(const void *leafptr1, const void *leafptr2, const void *private)
{
+ (void)private;
const union htree_nodeleaf *leaf1=(union htree_nodeleaf *)leafptr1;
const union htree_nodeleaf *leaf2=(union htree_nodeleaf *)leafptr2;
@@ -185,6 +186,7 @@ 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;
@@ -202,6 +204,7 @@ 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;
@@ -470,6 +473,8 @@ 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;
diff --git a/src/compression/huffmem.c b/src/compression/huffmem.c
index 30ce2a7..d43bc19 100644
--- a/src/compression/huffmem.c
+++ b/src/compression/huffmem.c
@@ -242,6 +242,7 @@ void Ptngc_comp_huff_compress(unsigned int *vals, int nvals,
void Ptngc_comp_huff_decompress(unsigned char *huffman, int huffman_len,
unsigned int *vals)
{
+ (void)huffman_len;
int isvals16=(int)huffman[0];
unsigned int *vals16=NULL;
int algo=(int)huffman[1];
diff --git a/src/compression/lz77.c b/src/compression/lz77.c
index 705e89d..eb80a55 100644
--- a/src/compression/lz77.c
+++ b/src/compression/lz77.c
@@ -313,6 +313,9 @@ void Ptngc_comp_from_lz77(unsigned int *data, int ndata,
unsigned int *offsets, int noffsets,
unsigned int *vals, int nvals)
{
+ (void)ndata;
+ (void)nlens;
+ (void)noffsets;
int i=0;
int joff=0;
int jdat=0;
diff --git a/src/compression/xtc2.c b/src/compression/xtc2.c
index 76f6264..c78a9f0 100644
--- a/src/compression/xtc2.c
+++ b/src/compression/xtc2.c
@@ -363,6 +363,7 @@ static void swap_is_better(int *input, int *minint, int *sum_normal, int *sum_sw
static void swapdecide(struct coder *coder, int *input,int *swapatoms, int *large_index, int *minint, unsigned char **output_ptr)
{
+ (void)large_index;
int didswap=0;
int normal,swapped;
swap_is_better(input,minint,&normal,&swapped);
@@ -1270,6 +1271,7 @@ 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];
diff --git a/src/compression/xtc3.c b/src/compression/xtc3.c
index c26d7aa..197cc12 100644
--- a/src/compression/xtc3.c
+++ b/src/compression/xtc3.c
@@ -205,6 +205,9 @@ static void insert_value_in_array(unsigned int **ptr, int *nele, int *nele_alloc
unsigned int value,
char *arrayname)
{
+#ifndef SHOWIT
+ (void)arrayname;
+#endif
allocate_enough_memory(ptr,nele,nele_alloc);
#ifdef SHOWIT
fprintf(stderr,"Inserting value %u into array %s @ %d\n",value,arrayname,(*nele)-1);
@@ -216,6 +219,7 @@ static void insert_value_in_array(unsigned int **ptr, int *nele, int *nele_alloc
static void swapdecide(struct xtc3_context *xtc3_context, int *input,int *swapatoms, int *large_index, int *minint)
{
+ (void)large_index;
int didswap=0;
int normal,swapped;
swap_is_better(input,minint,&normal,&swapped);
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 28bb9e6..ecfb4c5 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -976,37 +976,38 @@ static tng_function_status tng_block_header_read
* @return TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
* has occurred or TNG_CRITICAL (2) if a major error has occured.
*/
-static tng_function_status tng_block_verbatim_write(tng_trajectory_t tng_data,
- tng_gen_block_t block)
-{
- if(!block->header_contents)
- {
- printf("No contents to write. %s: %d\n", __FILE__, __LINE__);
- return(TNG_FAILURE);
- }
- if(fwrite(block->header_contents, block->header_contents_size, 1,
- tng_data->output_file) != 1)
- {
- printf("Could not write all header data. %s: %d\n",
- __FILE__, __LINE__);
- return(TNG_CRITICAL);
- }
-
- if(!block->block_contents)
- {
- printf("No block data to write. %s: %d\n",
- __FILE__, __LINE__);
- return(TNG_FAILURE);
- }
- if(fwrite(block->block_contents, block->block_contents_size, 1,
- tng_data->output_file) != 1)
- {
- printf("Could not write all block data. %s: %d\n",
- __FILE__, __LINE__);
- return(TNG_CRITICAL);
- }
- return(TNG_SUCCESS);
-}
+/* Disabled until it is used.*/
+// static tng_function_status tng_block_verbatim_write(tng_trajectory_t tng_data,
+// tng_gen_block_t block)
+// {
+// if(!block->header_contents)
+// {
+// printf("No contents to write. %s: %d\n", __FILE__, __LINE__);
+// return(TNG_FAILURE);
+// }
+// if(fwrite(block->header_contents, block->header_contents_size, 1,
+// tng_data->output_file) != 1)
+// {
+// printf("Could not write all header data. %s: %d\n",
+// __FILE__, __LINE__);
+// return(TNG_CRITICAL);
+// }
+//
+// if(!block->block_contents)
+// {
+// printf("No block data to write. %s: %d\n",
+// __FILE__, __LINE__);
+// return(TNG_FAILURE);
+// }
+// if(fwrite(block->block_contents, block->block_contents_size, 1,
+// tng_data->output_file) != 1)
+// {
+// printf("Could not write all block data. %s: %d\n",
+// __FILE__, __LINE__);
+// return(TNG_CRITICAL);
+// }
+// return(TNG_SUCCESS);
+// }
/** Write the header of a data block, regardless of its type
* @param tng_data is a trajectory data container.
@@ -3952,6 +3953,7 @@ static tng_function_status tng_uncompress(tng_trajectory_t tng_data,
void *start_pos,
const unsigned long uncompressed_len)
{
+ (void)tng_data;
char *temp;
double *d_dest = 0;
float *f_dest = 0;
@@ -4049,6 +4051,7 @@ 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;
@@ -5213,6 +5216,7 @@ 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;
@@ -6697,6 +6701,7 @@ 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;
len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN);
@@ -6728,6 +6733,7 @@ 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;
len = tng_min(strlen(new_type) + 1, TNG_MAX_STR_LEN);
@@ -6886,6 +6892,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_name_set
tng_molecule_t molecule,
const char *new_name)
{
+ (void)tng_data;
int len;
len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN);
@@ -6999,6 +7006,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_find
int64_t nr,
tng_chain_t *chain)
{
+ (void)tng_data;
int i, n_chains;
n_chains = molecule->n_chains;
@@ -7088,6 +7096,7 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_name_set
tng_chain_t chain,
const char *new_name)
{
+ (void)tng_data;
int len;
len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN);
@@ -7122,6 +7131,7 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_residue_find
int64_t id,
tng_residue_t *residue)
{
+ (void)tng_data;
int i, n_residues;
n_residues = chain->n_residues;
@@ -7249,6 +7259,7 @@ 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;
len = tng_min(strlen(new_name) + 1, TNG_MAX_STR_LEN);
@@ -7350,6 +7361,7 @@ tng_function_status DECLSPECDLLEXPORT tng_residue_atom_w_id_add
tng_function_status DECLSPECDLLEXPORT tng_molecule_init(const tng_trajectory_t tng_data,
tng_molecule_t molecule)
{
+ (void)tng_data;
molecule->quaternary_str = 1;
molecule->name = 0;
molecule->n_chains = 0;
@@ -7367,6 +7379,7 @@ 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;
if(molecule->name)
@@ -10048,6 +10061,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_next_frame_set_file_pos_get
const tng_trajectory_frame_set_t frame_set,
int64_t *pos)
{
+ (void)tng_data;
*pos = frame_set->next_frame_set_file_pos;
return(TNG_SUCCESS);
@@ -10058,6 +10072,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_prev_frame_set_file_pos_get
const tng_trajectory_frame_set_t frame_set,
int64_t *pos)
{
+ (void)tng_data;
*pos = frame_set->prev_frame_set_file_pos;
return(TNG_SUCCESS);
@@ -10069,6 +10084,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_frame_range_get
int64_t *first_frame,
int64_t *last_frame)
{
+ (void)tng_data;
*first_frame = frame_set->first_frame;
*last_frame = *first_frame + frame_set->n_frames - 1;
@@ -11970,6 +11986,7 @@ tng_function_status DECLSPECDLLEXPORT tng_data_values_free
const int64_t n_values_per_frame,
const char type)
{
+ (void)tng_data;
int i, j;
if(values)
@@ -12074,6 +12091,7 @@ 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;
if(values)
@@ -13543,6 +13561,7 @@ 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;
contact: Jan Huwald // Impressum