Skip to content

Commit

Permalink
Fixed compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van der Heijden committed Sep 1, 2017
1 parent b8beb38 commit 0a2d8ae
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 11 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
libcleri (0.9.3)

* Fixed compiler warnings.

-- Jeroen van der Heijden <[email protected]> 01 Sep 2017

libcleri (0.9.2)

* Added __cplusplus macros for c++ compatibility.
Expand Down
2 changes: 1 addition & 1 deletion inc/cleri/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion src/cleri.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/keyword.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ||
(
Expand Down
3 changes: 2 additions & 1 deletion src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
2 changes: 1 addition & 1 deletion src/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/token.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/tokens.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <cleri/version.h>

inline const char * cleri_version(void)
const char * cleri_version(void)
{
return LIBCLERI_VERSION;
}

0 comments on commit 0a2d8ae

Please sign in to comment.