Fixed compiler warnings

parent b8beb387
libcleri (0.9.3)
* Fixed compiler warnings.
-- Jeroen van der Heijden <jeroen@transceptor.technology> 01 Sep 2017
libcleri (0.9.2)
* Added __cplusplus macros for c++ compatibility.
......
......@@ -9,7 +9,7 @@
#define LIBCLERI_VERSION_MAJOR 0
#define LIBCLERI_VERSION_MINOR 9
#define LIBCLERI_VERSION_PATCH 2
#define LIBCLERI_VERSION_PATCH 3
#define LIBCLERI_STRINGIFY(num) #num
#define LIBCLERI_VERSION_STR(major,minor,patch) \
......
......@@ -49,7 +49,7 @@ cleri_t * cleri_new(
/*
* Increment reference counter on cleri object.
*/
inline void cleri_incref(cleri_t * cl_object)
void cleri_incref(cleri_t * cl_object)
{
cl_object->ref++;
}
......
......@@ -68,7 +68,7 @@ static cleri_node_t * KEYWORD_parse(
cleri_parse_t * pr,
cleri_node_t * parent,
cleri_t * cl_obj,
cleri_rule_store_t * rule)
cleri_rule_store_t * rule __attribute__((unused)))
{
ssize_t match_len;
cleri_node_t * node = NULL;
......@@ -80,7 +80,7 @@ static cleri_node_t * KEYWORD_parse(
return NULL;
}
if (match_len == cl_obj->via.keyword->len &&
if (match_len == (ssize_t) cl_obj->via.keyword->len &&
(
strncmp(cl_obj->via.keyword->keyword, str, match_len) == 0 ||
(
......
......@@ -80,7 +80,8 @@ cleri_parse_t * cleri_parse(cleri_grammar_t * grammar, const char * str)
}
pr->is_valid = at_end;
pr->pos = (pr->is_valid) ? pr->tree->len : pr->expecting->str - pr->str;
pr->pos = (pr->is_valid) ?
pr->tree->len : (size_t) (pr->expecting->str - pr->str);
if (!at_end && pr->expecting->required->cl_obj == NULL)
{
......
......@@ -55,7 +55,7 @@ void cleri_ref_set(cleri_t * ref, cleri_t * cl_obj)
/*
* Destroy ref object. (only used when ref is not set)
*/
static void REF_free(cleri_t * cl_object)
static void REF_free(cleri_t * cl_object __attribute__((unused)))
{
/* nothing todo */
}
......@@ -115,7 +115,7 @@ static cleri_node_t * REGEX_parse(
cleri_parse_t * pr,
cleri_node_t * parent,
cleri_t * cl_obj,
cleri_rule_store_t * rule)
cleri_rule_store_t * rule __attribute__((unused)))
{
int pcre_exec_ret;
int sub_str_vec[2];
......
......@@ -119,7 +119,7 @@ static cleri_node_t * RULE_parse(
cleri_parse_t * pr,
cleri_node_t * parent,
cleri_t * cl_obj,
cleri_rule_store_t * __rule)
cleri_rule_store_t * __rule __attribute__((unused)))
{
cleri_node_t * node;
cleri_node_t * rnode;
......
......@@ -70,7 +70,7 @@ static cleri_node_t * TOKEN_parse(
cleri_parse_t * pr,
cleri_node_t * parent,
cleri_t * cl_obj,
cleri_rule_store_t * rule)
cleri_rule_store_t * rule __attribute__((unused)))
{
cleri_node_t * node = NULL;
const char * str = parent->str + parent->len;
......
......@@ -136,7 +136,7 @@ static cleri_node_t * TOKENS_parse(
cleri_parse_t * pr,
cleri_node_t * parent,
cleri_t * cl_obj,
cleri_rule_store_t * rule)
cleri_rule_store_t * rule __attribute__((unused)))
{
cleri_node_t * node = NULL;
const char * str = parent->str + parent->len;
......
......@@ -6,7 +6,7 @@
#include <cleri/version.h>
inline const char * cleri_version(void)
const char * cleri_version(void)
{
return LIBCLERI_VERSION;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment