makes g++ happy again

Thu, 21 Jun 2018 16:10:19 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 21 Jun 2018 16:10:19 +0200
changeset 328
2bf1da3c411e
parent 327
fbc33813265b
child 329
71e9a60abfb4

makes g++ happy again

src/logging.c file | annotate | diff | comparison | revisions
src/map.c file | annotate | diff | comparison | revisions
src/ucx/string.h file | annotate | diff | comparison | revisions
src/ucx/utils.h file | annotate | diff | comparison | revisions
     1.1 --- a/src/logging.c	Thu Jun 21 16:00:37 2018 +0200
     1.2 +++ b/src/logging.c	Thu Jun 21 16:10:19 2018 +0200
     1.3 @@ -71,12 +71,12 @@
     1.4          const unsigned int line, const char *format, ...) {
     1.5      if (level <= logger->level) {
     1.6          char msg[UCX_LOGGER_MSGMAX];
     1.7 -        char *text;
     1.8 +        const char *text;
     1.9          size_t k = 0;
    1.10          size_t n;
    1.11          
    1.12          if ((logger->mask & UCX_LOGGER_LEVEL) > 0) {
    1.13 -            text = (char*) ucx_map_int_get(logger->levels, level);
    1.14 +            text = (const char*) ucx_map_int_get(logger->levels, level);
    1.15              if (!text) {
    1.16                  text = "[UNKNOWN]";
    1.17              }
     2.1 --- a/src/map.c	Thu Jun 21 16:00:37 2018 +0200
     2.2 +++ b/src/map.c	Thu Jun 21 16:10:19 2018 +0200
     2.3 @@ -154,7 +154,7 @@
     2.4      UcxAllocator *allocator = map->allocator;
     2.5      
     2.6      if (key.hash == 0) {
     2.7 -        key.hash = ucx_hash(key.data, key.len);
     2.8 +        key.hash = ucx_hash((const char*)key.data, key.len);
     2.9      }
    2.10      
    2.11      struct UcxMapKey mapkey;
    2.12 @@ -203,7 +203,7 @@
    2.13  
    2.14  static void* ucx_map_get_and_remove(UcxMap *map, UcxKey key, int remove) {
    2.15      if(key.hash == 0) {
    2.16 -        key.hash = ucx_hash((char*)key.data, key.len);
    2.17 +        key.hash = ucx_hash((const char*)key.data, key.len);
    2.18      }
    2.19      
    2.20      size_t slot = key.hash%map->size;
    2.21 @@ -247,7 +247,7 @@
    2.22      UcxKey key;
    2.23      key.data = data;
    2.24      key.len = len;
    2.25 -    key.hash = ucx_hash(data, len);
    2.26 +    key.hash = ucx_hash((const char*)data, len);
    2.27      return key;
    2.28  }
    2.29  
     3.1 --- a/src/ucx/string.h	Thu Jun 21 16:00:37 2018 +0200
     3.2 +++ b/src/ucx/string.h	Thu Jun 21 16:10:19 2018 +0200
     3.3 @@ -124,7 +124,7 @@
     3.4  inline scstr_t s2scstr(sstr_t s) {
     3.5      scstr_t c;
     3.6      c.ptr = s.ptr;
     3.7 -    c.length = s.ptr;
     3.8 +    c.length = s.length;
     3.9      return c;
    3.10  }
    3.11  
     4.1 --- a/src/ucx/utils.h	Thu Jun 21 16:00:37 2018 +0200
     4.2 +++ b/src/ucx/utils.h	Thu Jun 21 16:10:19 2018 +0200
     4.3 @@ -38,10 +38,6 @@
     4.4  #ifndef UCX_UTILS_H
     4.5  #define UCX_UTILS_H
     4.6  
     4.7 -#ifdef __cplusplus
     4.8 -extern "C" {
     4.9 -#endif
    4.10 -
    4.11  #include "ucx.h"
    4.12  #include "string.h"
    4.13  #include "allocator.h"
    4.14 @@ -49,6 +45,10 @@
    4.15  #include <string.h>
    4.16  #include <stdarg.h>
    4.17  
    4.18 +#ifdef __cplusplus
    4.19 +extern "C" {
    4.20 +#endif
    4.21 +
    4.22  /**
    4.23   * Default buffer size for ucx_stream_copy() and ucx_stream_ncopy().
    4.24   */

mercurial