diff options
Diffstat (limited to 'include/compression')
-rw-r--r-- | include/compression/bwlzh.h | 26 | ||||
-rw-r--r-- | include/compression/bwt.h | 12 | ||||
-rw-r--r-- | include/compression/coder.h | 8 | ||||
-rw-r--r-- | include/compression/dict.h | 2 | ||||
-rw-r--r-- | include/compression/fixpoint.h | 8 | ||||
-rw-r--r-- | include/compression/huffman.h | 12 | ||||
-rw-r--r-- | include/compression/lz77.h | 10 | ||||
-rw-r--r-- | include/compression/merge_sort.h | 2 | ||||
-rw-r--r-- | include/compression/mtf.h | 16 | ||||
-rw-r--r-- | include/compression/rle.h | 8 | ||||
-rw-r--r-- | include/compression/tng_compress.h | 76 | ||||
-rw-r--r-- | include/compression/vals16.h | 8 | ||||
-rw-r--r-- | include/compression/warnmalloc.h | 4 |
13 files changed, 96 insertions, 96 deletions
diff --git a/include/compression/bwlzh.h b/include/compression/bwlzh.h index 70d586a..ce08f69 100644 --- a/include/compression/bwlzh.h +++ b/include/compression/bwlzh.h @@ -17,28 +17,28 @@ allocated to be able to hold worst case. You can obtain this length conveniently by calling comp_get_buflen() */ -void DECLSPECDLLEXPORT bwlzh_compress(unsigned int *vals, int nvals, +void DECLSPECDLLEXPORT bwlzh_compress(unsigned int *vals, const int nvals, unsigned char *output, int *output_len); -void DECLSPECDLLEXPORT bwlzh_compress_no_lz77(unsigned int *vals, int nvals, +void DECLSPECDLLEXPORT bwlzh_compress_no_lz77(unsigned int *vals, const int nvals, unsigned char *output, int *output_len); -int DECLSPECDLLEXPORT bwlzh_get_buflen(int nvals); +int DECLSPECDLLEXPORT bwlzh_get_buflen(const int nvals); -void DECLSPECDLLEXPORT bwlzh_decompress(unsigned char *input, int nvals, +void DECLSPECDLLEXPORT bwlzh_decompress(unsigned char *input, const int nvals, unsigned int *vals); /* The routines below are mostly useful for testing, and for internal use by the library. */ -void DECLSPECDLLEXPORT bwlzh_compress_verbose(unsigned int *vals, int nvals, +void DECLSPECDLLEXPORT bwlzh_compress_verbose(unsigned int *vals, const int nvals, unsigned char *output, int *output_len); -void DECLSPECDLLEXPORT bwlzh_compress_no_lz77_verbose(unsigned int *vals, int nvals, +void DECLSPECDLLEXPORT bwlzh_compress_no_lz77_verbose(unsigned int *vals, const int nvals, unsigned char *output, int *output_len); -void DECLSPECDLLEXPORT bwlzh_decompress_verbose(unsigned char *input, int nvals, +void DECLSPECDLLEXPORT bwlzh_decompress_verbose(unsigned char *input, const int nvals, unsigned int *vals); /* Compress the integers (positive, small integers are preferable) @@ -47,12 +47,12 @@ void DECLSPECDLLEXPORT bwlzh_decompress_verbose(unsigned char *input, int nvals, to be able to hold worst case. You can obtain this length conveniently by calling comp_huff_buflen() */ -void Ptngc_comp_huff_compress(unsigned int *vals, int nvals, +void Ptngc_comp_huff_compress(unsigned int *vals, const int nvals, unsigned char *huffman, int *huffman_len); -int Ptngc_comp_huff_buflen(int nvals); +int Ptngc_comp_huff_buflen(const int nvals); -void Ptngc_comp_huff_decompress(unsigned char *huffman, int huffman_len, +void Ptngc_comp_huff_decompress(unsigned char *huffman, const int huffman_len, unsigned int *vals); @@ -62,11 +62,11 @@ void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals, unsigned char *huffman, int *huffman_len, int *huffdatalen, int *huffman_lengths,int *chosen_algo, - int isvals16); + const int isvals16); #define N_HUFFMAN_ALGO 3 -char *Ptngc_comp_get_huff_algo_name(int algo); -char *Ptngc_comp_get_algo_name(int algo); +char *Ptngc_comp_get_huff_algo_name(const int algo); +char *Ptngc_comp_get_algo_name(const int algo); #endif diff --git a/include/compression/bwt.h b/include/compression/bwt.h index 9f927f8..fedfc3d 100644 --- a/include/compression/bwt.h +++ b/include/compression/bwt.h @@ -12,15 +12,15 @@ #ifndef BWT_H #define BWT_H -void Ptngc_comp_to_bwt(unsigned int *vals, int nvals, +void Ptngc_comp_to_bwt(unsigned int *vals, const int nvals, unsigned int *output, int *index); -void Ptngc_comp_from_bwt(unsigned int *input, int nvals, int index, +void Ptngc_comp_from_bwt(unsigned int *input, const int nvals, int index, unsigned int *vals); -void Ptngc_bwt_merge_sort_inner(int *indices, int nvals,unsigned int *vals, - int start, int end, - unsigned int *nrepeat, - int *workarray); +void Ptngc_bwt_merge_sort_inner(int *indices, const int nvals, unsigned int *vals, + const int start, const int end, + unsigned int *nrepeat, + int *workarray); #endif diff --git a/include/compression/coder.h b/include/compression/coder.h index 34b56c1..d714c82 100644 --- a/include/compression/coder.h +++ b/include/compression/coder.h @@ -29,10 +29,10 @@ struct coder struct coder DECLSPECDLLEXPORT *Ptngc_coder_init(void); void DECLSPECDLLEXPORT Ptngc_coder_deinit(struct coder *coder); -unsigned char DECLSPECDLLEXPORT *Ptngc_pack_array(struct coder *coder,int *input, int *length, int coding, int coding_parameter, int natoms, int speed); -int DECLSPECDLLEXPORT Ptngc_unpack_array(struct coder *coder,unsigned char *packed,int *output, int length, int coding, int coding_parameter, int natoms); +unsigned char DECLSPECDLLEXPORT *Ptngc_pack_array(struct coder *coder,int *input, int *length, const int coding, const int coding_parameter, const int natoms, const int speed); +int DECLSPECDLLEXPORT Ptngc_unpack_array(struct coder *coder,unsigned char *packed,int *output, const int length, const int coding, const int coding_parameter, const int natoms); unsigned char DECLSPECDLLEXPORT *Ptngc_pack_array_xtc2(struct coder *coder,int *input, int *length); -int DECLSPECDLLEXPORT Ptngc_unpack_array_xtc2(struct coder *coder,unsigned char *packed,int *output, int length); +int DECLSPECDLLEXPORT Ptngc_unpack_array_xtc2(struct coder *coder, unsigned char *packed, int *output, const int length); unsigned char DECLSPECDLLEXPORT *Ptngc_pack_array_xtc3(int *input, int *length, int natoms, int speed); int DECLSPECDLLEXPORT Ptngc_unpack_array_xtc3(unsigned char *packed,int *output, int length, int natoms); @@ -40,7 +40,7 @@ void DECLSPECDLLEXPORT Ptngc_out8bits(struct coder *coder, unsigned char **outpu void DECLSPECDLLEXPORT Ptngc_pack_flush(struct coder *coder,unsigned char **output); void DECLSPECDLLEXPORT Ptngc_write_pattern(struct coder *coder,unsigned int pattern, int nbits, unsigned char **output); -void DECLSPECDLLEXPORT Ptngc_writebits(struct coder *coder,unsigned int value,int nbits, unsigned char **output_ptr); +void DECLSPECDLLEXPORT Ptngc_writebits(struct coder *coder, unsigned int value, const int nbits, unsigned char **output_ptr); void DECLSPECDLLEXPORT Ptngc_write32bits(struct coder *coder,unsigned int value,int nbits, unsigned char **output_ptr); void DECLSPECDLLEXPORT Ptngc_writemanybits(struct coder *coder,unsigned char *value,int nbits, unsigned char **output_ptr); diff --git a/include/compression/dict.h b/include/compression/dict.h index d66dd23..26eed27 100644 --- a/include/compression/dict.h +++ b/include/compression/dict.h @@ -14,7 +14,7 @@ void Ptngc_comp_canonical_dict(unsigned int *dict, int *ndict); -void Ptngc_comp_make_dict_hist(unsigned int *vals, int nvals, +void Ptngc_comp_make_dict_hist(unsigned int *vals, const int nvals, unsigned int *dict, int *ndict, unsigned int *hist); diff --git a/include/compression/fixpoint.h b/include/compression/fixpoint.h index 6be7482..7b6a667 100644 --- a/include/compression/fixpoint.h +++ b/include/compression/fixpoint.h @@ -17,16 +17,16 @@ typedef unsigned long fix_t; /* Positive double to 32 bit fixed point value */ -fix_t Ptngc_ud_to_fix_t(double d,double max); +fix_t Ptngc_ud_to_fix_t(double d, const double max); /* double to signed 32 bit fixed point value */ -fix_t Ptngc_d_to_fix_t(double d,double max); +fix_t Ptngc_d_to_fix_t(double d, const double max); /* 32 bit fixed point value to positive double */ -double Ptngc_fix_t_to_ud(fix_t f, double max); +double Ptngc_fix_t_to_ud(fix_t f, const double max); /* signed 32 bit fixed point value to double */ -double Ptngc_fix_t_to_d(fix_t f, double max); +double Ptngc_fix_t_to_d(fix_t f, const double max); /* Convert a floating point variable to two 32 bit integers with range -2.1e9 to 2.1e9 and precision to somewhere around 1e-9. */ diff --git a/include/compression/huffman.h b/include/compression/huffman.h index 49347de..f2ce187 100644 --- a/include/compression/huffman.h +++ b/include/compression/huffman.h @@ -12,8 +12,8 @@ #ifndef HUFFMAN_H #define HUFFMAN_H -void Ptngc_comp_conv_to_huffman(unsigned int *vals, int nvals, - unsigned int *dict, int ndict, +void Ptngc_comp_conv_to_huffman(unsigned int *vals, const int nvals, + unsigned int *dict, const int ndict, unsigned int *prob, unsigned char *huffman, int *huffman_len, @@ -23,11 +23,11 @@ void Ptngc_comp_conv_to_huffman(unsigned int *vals, int nvals, int *huffman_dict_unpackedlen); void Ptngc_comp_conv_from_huffman(unsigned char *huffman, - unsigned int *vals, int nvals, - int ndict, + unsigned int *vals, const int nvals, + const int ndict, unsigned char *huffman_dict, - int huffman_dictlen, + const int huffman_dictlen, unsigned int *huffman_dict_unpacked, - int huffman_dict_unpackedlen); + const int huffman_dict_unpackedlen); #endif diff --git a/include/compression/lz77.h b/include/compression/lz77.h index ad37e5b..d4a4beb 100644 --- a/include/compression/lz77.h +++ b/include/compression/lz77.h @@ -12,14 +12,14 @@ #ifndef LZ77_H #define LZ77_H -void Ptngc_comp_to_lz77(unsigned int *vals, int nvals, +void Ptngc_comp_to_lz77(unsigned int *vals, const int nvals, unsigned int *data, int *ndata, unsigned int *len, int *nlens, unsigned int *offsets, int *noffsets); -void Ptngc_comp_from_lz77(unsigned int *data, int ndata, - unsigned int *len, int nlens, - unsigned int *offsets, int noffsets, - unsigned int *vals, int nvals); +void Ptngc_comp_from_lz77(unsigned int *data, const int ndata, + unsigned int *len, const int nlens, + unsigned int *offsets, const int noffsets, + unsigned int *vals, const int nvals); #endif diff --git a/include/compression/merge_sort.h b/include/compression/merge_sort.h index 48ab410..f8aaeb7 100644 --- a/include/compression/merge_sort.h +++ b/include/compression/merge_sort.h @@ -12,7 +12,7 @@ #ifndef MERGE_SORT_H #define MERGE_SORT_H -void Ptngc_merge_sort(void *base, size_t nmemb, size_t size, +void Ptngc_merge_sort(void *base, const size_t nmemb, const size_t size, int (*compar)(const void *v1,const void *v2,const void *private), void *private); diff --git a/include/compression/mtf.h b/include/compression/mtf.h index bc4b2c8..3dc9ace 100644 --- a/include/compression/mtf.h +++ b/include/compression/mtf.h @@ -12,24 +12,24 @@ #ifndef MTF_H #define MTF_H -void Ptngc_comp_conv_to_mtf(unsigned int *vals, int nvals, - unsigned int *dict, int ndict, +void Ptngc_comp_conv_to_mtf(unsigned int *vals, const int nvals, + unsigned int *dict, const int ndict, unsigned int *valsmtf); -void Ptngc_comp_conv_from_mtf(unsigned int *valsmtf, int nvals, - unsigned int *dict, int ndict, +void Ptngc_comp_conv_from_mtf(unsigned int *valsmtf, const int nvals, + unsigned int *dict, const int ndict, unsigned int *vals); -void Ptngc_comp_conv_to_mtf_partial(unsigned int *vals, int nvals, +void Ptngc_comp_conv_to_mtf_partial(unsigned int *vals, const int nvals, unsigned int *valsmtf); -void Ptngc_comp_conv_from_mtf_partial(unsigned int *valsmtf, int nvals, +void Ptngc_comp_conv_from_mtf_partial(unsigned int *valsmtf, const int nvals, unsigned int *vals); -void Ptngc_comp_conv_to_mtf_partial3(unsigned int *vals, int nvals, +void Ptngc_comp_conv_to_mtf_partial3(unsigned int *vals, const int nvals, unsigned char *valsmtf); -void Ptngc_comp_conv_from_mtf_partial3(unsigned char *valsmtf, int nvals, +void Ptngc_comp_conv_from_mtf_partial3(unsigned char *valsmtf, const int nvals, unsigned int *vals); #endif diff --git a/include/compression/rle.h b/include/compression/rle.h index c6d4706..3665dd0 100644 --- a/include/compression/rle.h +++ b/include/compression/rle.h @@ -12,11 +12,11 @@ #ifndef RLE_H #define RLE_H -void Ptngc_comp_conv_to_rle(unsigned int *vals, int nvals, - unsigned int *rle, int *nrle, - int min_rle); +void Ptngc_comp_conv_to_rle(unsigned int *vals, const int nvals, + unsigned int *rle, int *nrle, + const int min_rle); void Ptngc_comp_conv_from_rle(unsigned int *rle, - unsigned int *vals, int nvals); + unsigned int *vals, const int nvals); #endif diff --git a/include/compression/tng_compress.h b/include/compression/tng_compress.h index c8b8db1..0082ba3 100644 --- a/include/compression/tng_compress.h +++ b/include/compression/tng_compress.h @@ -50,18 +50,18 @@ If too large values are input (compared to the precision), NULL is returned. */ -char DECLSPECDLLEXPORT *tng_compress_pos(double *pos, int natoms, int nframes, - double desired_precision, - int speed, int *algo, +char DECLSPECDLLEXPORT *tng_compress_pos(double *pos, const int natoms, const int nframes, + const double desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_pos_float(float *pos, int natoms, int nframes, - float desired_precision, - int speed, int *algo, +char DECLSPECDLLEXPORT *tng_compress_pos_float(float *pos, const int natoms, const int nframes, + const float desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_pos_int(int *pos, int natoms, int nframes, - unsigned long prec_hi, unsigned long prec_lo, +char DECLSPECDLLEXPORT *tng_compress_pos_int(int *pos, const int natoms, const int nframes, + const unsigned long prec_hi, const unsigned long prec_lo, int speed,int *algo, int *nitems); @@ -90,21 +90,21 @@ char DECLSPECDLLEXPORT *tng_compress_pos_int(int *pos, int natoms, int nframes, by calling tng_compress_nalgo */ -char DECLSPECDLLEXPORT *tng_compress_pos_find_algo(double *pos, int natoms, int nframes, - double desired_precision, - int speed, +char DECLSPECDLLEXPORT *tng_compress_pos_find_algo(double *pos, const int natoms, const int nframes, + const double desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_pos_float_find_algo(float *pos, int natoms, int nframes, - float desired_precision, - int speed, +char DECLSPECDLLEXPORT *tng_compress_pos_float_find_algo(float *pos, const int natoms, const int nframes, + const float desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_pos_int_find_algo(int *pos, int natoms, int nframes, - unsigned long prec_hi, unsigned long prec_lo, - int speed,int *algo, +char DECLSPECDLLEXPORT *tng_compress_pos_int_find_algo(int *pos, const int natoms, const int nframes, + const unsigned long prec_hi, const unsigned long prec_lo, + const int speed, int *algo, int *nitems); /* This returns the number of integers required for the storage of the algorithm @@ -116,36 +116,36 @@ int DECLSPECDLLEXPORT tng_compress_nalgo(void); selection for velocities is different, so the position and velocities routines should not be mixed. */ -char DECLSPECDLLEXPORT *tng_compress_vel(double *vel, int natoms, int nframes, - double desired_precision, - int speed, int *algo, +char DECLSPECDLLEXPORT *tng_compress_vel(double *vel, const int natoms, const int nframes, + const double desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_vel_float(float *vel, int natoms, int nframes, - float desired_precision, - int speed, int *algo, +char DECLSPECDLLEXPORT *tng_compress_vel_float(float *vel, const int natoms, const int nframes, + const float desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_vel_int(int *vel, int natoms, int nframes, - unsigned long prec_hi, unsigned long prec_lo, +char DECLSPECDLLEXPORT *tng_compress_vel_int(int *vel, const int natoms, const int nframes, + const unsigned long prec_hi, const unsigned long prec_lo, int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_vel_find_algo(double *vel, int natoms, int nframes, - double desired_precision, - int speed, +char DECLSPECDLLEXPORT *tng_compress_vel_find_algo(double *vel, const int natoms, const int nframes, + const double desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_vel_float_find_algo(float *vel, int natoms, int nframes, - float desired_precision, - int speed, +char DECLSPECDLLEXPORT *tng_compress_vel_float_find_algo(float *vel, const int natoms, const int nframes, + const float desired_precision, + const int speed, int *algo, int *nitems); -char DECLSPECDLLEXPORT *tng_compress_vel_int_find_algo(int *vel, int natoms, int nframes, - unsigned long prec_hi, unsigned long prec_lo, - int speed, +char DECLSPECDLLEXPORT *tng_compress_vel_int_find_algo(int *vel, const int natoms, const int nframes, + const unsigned long prec_hi, const unsigned long prec_lo, + const int speed, int *algo, int *nitems); @@ -170,12 +170,12 @@ int DECLSPECDLLEXPORT tng_compress_uncompress_int(char *data,int *posvel, unsign /* This converts a block of integers, as obtained from tng_compress_uncompress_int, to floating point values either double precision or single precision. */ -void DECLSPECDLLEXPORT tng_compress_int_to_double(int *posvel_int,unsigned long prec_hi, unsigned long prec_lo, - int natoms,int nframes, +void DECLSPECDLLEXPORT tng_compress_int_to_double(int *posvel_int, const unsigned long prec_hi, const unsigned long prec_lo, + const int natoms, const int nframes, double *posvel_double); -void DECLSPECDLLEXPORT tng_compress_int_to_float(int *posvel_int,unsigned long prec_hi, unsigned long prec_lo, - int natoms,int nframes, +void DECLSPECDLLEXPORT tng_compress_int_to_float(int *posvel_int, const unsigned long prec_hi, const unsigned long prec_lo, + const int natoms, const int nframes, float *posvel_float); diff --git a/include/compression/vals16.h b/include/compression/vals16.h index 4585755..ba1b8fb 100644 --- a/include/compression/vals16.h +++ b/include/compression/vals16.h @@ -12,10 +12,10 @@ #ifndef VALS16_H #define VALS16_H -void Ptngc_comp_conv_to_vals16(unsigned int *vals,int nvals, - unsigned int *vals16, int *nvals16); +void Ptngc_comp_conv_to_vals16(unsigned int *vals, const int nvals, + unsigned int *vals16, int *nvals16); -void Ptngc_comp_conv_from_vals16(unsigned int *vals16,int nvals16, - unsigned int *vals, int *nvals); +void Ptngc_comp_conv_from_vals16(unsigned int *vals16, const int nvals16, + unsigned int *vals, int *nvals); #endif diff --git a/include/compression/warnmalloc.h b/include/compression/warnmalloc.h index 4444271..aa63111 100644 --- a/include/compression/warnmalloc.h +++ b/include/compression/warnmalloc.h @@ -14,11 +14,11 @@ #include "../compression/tng_compress.h" -void DECLSPECDLLEXPORT *Ptngc_warnmalloc_x(size_t size, char *file, int line); +void DECLSPECDLLEXPORT *Ptngc_warnmalloc_x(const size_t size, char *file, const int line); #define warnmalloc(size) Ptngc_warnmalloc_x(size,__FILE__,__LINE__) -void DECLSPECDLLEXPORT *Ptngc_warnrealloc_x(void *old, size_t size, char *file, int line); +void DECLSPECDLLEXPORT *Ptngc_warnrealloc_x(void *old, const size_t size, char *file, const int line); #define warnrealloc(old,size) Ptngc_warnrealloc_x(old,size,__FILE__,__LINE__) |