No unsigned char's in public API (except for iconv)
[yaz-moved-to-github.git] / src / pquery.c
index 2cc285f..f2c39e8 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) 1995-2013 Index Data
  * See the file LICENSE for details.
  */
 /**
@@ -122,7 +122,7 @@ static int lex(struct yaz_pqf_parser *li)
     return li->query_look = query_token(li);
 }
 
-int escape_string(char *out_buf, const char *in, int len)
+static int escape_string(char *out_buf, const char *in, int len)
 {
 
     char *out = out_buf;
@@ -185,7 +185,7 @@ int escape_string(char *out_buf, const char *in, int len)
     return out - out_buf;
 }
 
-int p_query_parse_attr(struct yaz_pqf_parser *li, ODR o,
+static int p_query_parse_attr(struct yaz_pqf_parser *li, ODR o,
                               int num_attr, Odr_int *attr_list,
                               char **attr_clist, Odr_oid **attr_set)
 {
@@ -243,8 +243,9 @@ int p_query_parse_attr(struct yaz_pqf_parser *li, ODR o,
     return 1;
 }
 
-Z_AttributeList *get_attributeList(ODR o, int num_attr, Odr_int *attr_list,
-                                   char **attr_clist, Odr_oid **attr_set)
+static Z_AttributeList *get_attributeList(ODR o,
+                                          int num_attr, Odr_int *attr_list,
+                                          char **attr_clist, Odr_oid **attr_set)
 {
     int i, k = 0;
     Odr_int *attr_tmp;
@@ -310,10 +311,13 @@ Z_Term *z_Term_create(ODR o, int term_type, const char *buf, size_t len)
 {
     Z_Term *term = (Z_Term *)odr_malloc(o, sizeof(*term));
     Odr_oct *term_octet = (Odr_oct *)odr_malloc(o, sizeof(*term_octet));
-    term_octet->buf = (unsigned char *)odr_malloc(o, 1 + len);
+    term_octet->buf = (char *)odr_malloc(o, 1 + len);
     memcpy(term_octet->buf, buf, len);
-    term_octet->size = term_octet->len = len;
-    term_octet->buf[term_octet->size] = 0;  /* null terminate */
+    term_octet->len = len;
+#if OCT_SIZE
+    term_octet->size = len;
+#endif
+    term_octet->buf[term_octet->len] = 0;  /* null terminate */
 
     switch (term_type)
     {