1.1 --- a/ucx/utils.h Sat Jul 15 19:20:06 2017 +0200 1.2 +++ b/ucx/utils.h Sat Jul 15 20:46:18 2017 +0200 1.3 @@ -60,7 +60,7 @@ 1.4 * @param data omitted 1.5 * @return a pointer to a copy of s1 that can be passed to free(void*) 1.6 */ 1.7 -void *ucx_strcpy(void *s, void *data); 1.8 +void *ucx_strcpy(const void *s, void *data); 1.9 1.10 /** 1.11 * Copies a memory area. 1.12 @@ -69,7 +69,7 @@ 1.13 * @return a pointer to a copy of the specified memory area that can 1.14 * be passed to free(void*) 1.15 */ 1.16 -void *ucx_memcpy(void *m, void *n); 1.17 +void *ucx_memcpy(const void *m, void *n); 1.18 1.19 1.20 /** 1.21 @@ -144,7 +144,7 @@ 1.22 * @param data omitted 1.23 * @return the result of strcmp(s1, s2) 1.24 */ 1.25 -int ucx_strcmp(void *s1, void *s2, void *data); 1.26 +int ucx_strcmp(const void *s1, const void *s2, void *data); 1.27 1.28 /** 1.29 * Wraps the strncmp function. 1.30 @@ -153,7 +153,7 @@ 1.31 * @param n a pointer to the size_t containing the third strncmp parameter 1.32 * @return the result of strncmp(s1, s2, *n) 1.33 */ 1.34 -int ucx_strncmp(void *s1, void *s2, void *n); 1.35 +int ucx_strncmp(const void *s1, const void *s2, void *n); 1.36 1.37 /** 1.38 * Compares two integers of type int. 1.39 @@ -163,7 +163,7 @@ 1.40 * @return -1, if *i1 is less than *i2, 0 if both are equal, 1.41 * 1 if *i1 is greater than *i2 1.42 */ 1.43 -int ucx_intcmp(void *i1, void *i2, void *data); 1.44 +int ucx_intcmp(const void *i1, const void *i2, void *data); 1.45 1.46 /** 1.47 * Compares two real numbers of type float. 1.48 @@ -174,7 +174,7 @@ 1.49 * 1 if *f1 is greater than *f2 1.50 */ 1.51 1.52 -int ucx_floatcmp(void *f1, void *f2, void *data); 1.53 +int ucx_floatcmp(const void *f1, const void *f2, void *data); 1.54 1.55 /** 1.56 * Compares two real numbers of type double. 1.57 @@ -184,7 +184,7 @@ 1.58 * @return -1, if *d1 is less than *d2, 0 if both are equal, 1.59 * 1 if *d1 is greater than *d2 1.60 */ 1.61 -int ucx_doublecmp(void *d1, void *d2, void *data); 1.62 +int ucx_doublecmp(const void *d1, const void *d2, void *data); 1.63 1.64 /** 1.65 * Compares two pointers. 1.66 @@ -194,7 +194,7 @@ 1.67 * @return -1 if ptr1 is less than ptr2, 0 if both are equal, 1.68 * 1 if ptr1 is greater than ptr2 1.69 */ 1.70 -int ucx_ptrcmp(void *ptr1, void *ptr2, void *data); 1.71 +int ucx_ptrcmp(const void *ptr1, const void *ptr2, void *data); 1.72 1.73 /** 1.74 * Compares two memory areas. 1.75 @@ -203,7 +203,7 @@ 1.76 * @param n a pointer to the size_t containing the third parameter for memcmp 1.77 * @return the result of memcmp(ptr1, ptr2, *n) 1.78 */ 1.79 -int ucx_memcmp(void *ptr1, void *ptr2, void *n); 1.80 +int ucx_memcmp(const void *ptr1, const void *ptr2, void *n); 1.81 1.82 /** 1.83 * A <code>printf()</code> like function which writes the output to a stream by