From 97032aebb40c2a22d4333892dbb8a62ef72a0ceb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 20 Mar 2014 23:10:07 +0100 Subject: supress warnings (bzr r13173) --- src/libcroco/cr-om-parser.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/libcroco') diff --git a/src/libcroco/cr-om-parser.c b/src/libcroco/cr-om-parser.c index ea622e35c..c1acb855c 100644 --- a/src/libcroco/cr-om-parser.c +++ b/src/libcroco/cr-om-parser.c @@ -39,6 +39,9 @@ struct _CROMParserPriv { #define PRIVATE(a_this) ((a_this)->priv) +// Unfortunately, C does not allow unnamed function arguments, so use this macro instead... +#define UNUSED(x) (void)(x) + /* *Forward declaration of a type defined later *in this file. @@ -207,6 +210,8 @@ static void start_font_face (CRDocHandler * a_this, CRParsingLocation *a_location) { + UNUSED(a_location); + enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; ParsingContext **ctxtptr = NULL; @@ -302,6 +307,8 @@ static void charset (CRDocHandler * a_this, CRString * a_charset, CRParsingLocation *a_location) { + UNUSED(a_location); + enum CRStatus status = CR_OK; CRStatement *stmt = NULL, *stmt2 = NULL; @@ -340,6 +347,8 @@ start_page (CRDocHandler * a_this, CRString * a_pseudo, CRParsingLocation *a_location) { + UNUSED(a_location); + enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; ParsingContext **ctxtptr = NULL; @@ -381,6 +390,9 @@ end_page (CRDocHandler * a_this, CRString * a_page, CRString * a_pseudo_page) { + UNUSED(a_page); + UNUSED(a_pseudo_page); + enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; ParsingContext **ctxtptr = NULL; @@ -407,8 +419,6 @@ end_page (CRDocHandler * a_this, cr_statement_destroy (ctxt->cur_stmt); ctxt->cur_stmt = NULL; } - a_page = NULL; /*keep compiler happy */ - a_pseudo_page = NULL; /*keep compiler happy */ } static void @@ -416,6 +426,8 @@ start_media (CRDocHandler * a_this, GList * a_media_list, CRParsingLocation *a_location) { + UNUSED(a_location); + enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; ParsingContext **ctxtptr = NULL; @@ -444,6 +456,8 @@ start_media (CRDocHandler * a_this, static void end_media (CRDocHandler * a_this, GList * a_media_list) { + UNUSED(a_media_list); + enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; ParsingContext **ctxtptr = NULL; @@ -470,7 +484,6 @@ end_media (CRDocHandler * a_this, GList * a_media_list) ctxt->cur_stmt = NULL ; ctxt->cur_media_stmt = NULL ; - a_media_list = NULL; } static void @@ -480,6 +493,9 @@ import_style (CRDocHandler * a_this, CRString * a_uri_default_ns, CRParsingLocation *a_location) { + UNUSED(a_uri_default_ns); + UNUSED(a_location); + enum CRStatus status = CR_OK; CRString *uri = NULL; CRStatement *stmt = NULL, @@ -530,7 +546,6 @@ import_style (CRDocHandler * a_this, cr_statement_destroy (stmt); stmt = NULL; } - a_uri_default_ns = NULL; /*keep compiler happy */ } static void @@ -557,6 +572,8 @@ start_selector (CRDocHandler * a_this, CRSelector * a_selector_list) static void end_selector (CRDocHandler * a_this, CRSelector * a_selector_list) { + UNUSED(a_selector_list); + enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; ParsingContext **ctxtptr = NULL; @@ -604,7 +621,6 @@ end_selector (CRDocHandler * a_this, CRSelector * a_selector_list) } } - a_selector_list = NULL; /*keep compiler happy */ } static void -- cgit v1.2.3 From 5c8f302c230b5952da6bbbda14fe49399c9ee894 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 21 Mar 2014 18:46:09 +0100 Subject: libcroco: fix pointer signedness errors (bzr r13178) --- src/libcroco/cr-parser.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libcroco') diff --git a/src/libcroco/cr-parser.c b/src/libcroco/cr-parser.c index 41d3eab5a..f14f8a015 100644 --- a/src/libcroco/cr-parser.c +++ b/src/libcroco/cr-parser.c @@ -78,7 +78,7 @@ typedef struct _CRParserError CRParserError; *parsing routines. */ struct _CRParserError { - guchar *msg; + gchar *msg; enum CRStatus status; glong line; glong column; @@ -374,11 +374,11 @@ static enum CRStatus cr_parser_parse_simple_selector (CRParser * a_this, static enum CRStatus cr_parser_parse_simple_sels (CRParser * a_this, CRSimpleSel ** a_sel); -static CRParserError *cr_parser_error_new (const guchar * a_msg, +static CRParserError *cr_parser_error_new (const gchar * a_msg, enum CRStatus); static void cr_parser_error_set_msg (CRParserError * a_this, - const guchar * a_msg); + const gchar * a_msg); static void cr_parser_error_dump (CRParserError * a_this); @@ -392,7 +392,7 @@ static void cr_parser_error_destroy (CRParserError * a_this); static enum CRStatus cr_parser_push_error (CRParser * a_this, - const guchar * a_msg, + const gchar * a_msg, enum CRStatus a_status); static enum CRStatus cr_parser_dump_err_stack (CRParser * a_this, @@ -411,7 +411,7 @@ static enum CRStatus *@return the newly built instance of #CRParserError. */ static CRParserError * -cr_parser_error_new (const guchar * a_msg, enum CRStatus a_status) +cr_parser_error_new (const gchar * a_msg, enum CRStatus a_status) { CRParserError *result = NULL; @@ -436,7 +436,7 @@ cr_parser_error_new (const guchar * a_msg, enum CRStatus a_status) *@param a_msg the new message. */ static void -cr_parser_error_set_msg (CRParserError * a_this, const guchar * a_msg) +cr_parser_error_set_msg (CRParserError * a_this, const gchar * a_msg) { g_return_if_fail (a_this); @@ -515,7 +515,7 @@ cr_parser_error_destroy (CRParserError * a_this) */ static enum CRStatus cr_parser_push_error (CRParser * a_this, - const guchar * a_msg, enum CRStatus a_status) + const gchar * a_msg, enum CRStatus a_status) { enum CRStatus status = CR_OK; -- cgit v1.2.3 From 9ab9abf19bfa43ade88b449cd7631fbc5854caa3 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 22 Mar 2014 13:25:02 +0100 Subject: libcroco: don't write double parenthesis unnecessarily (interferes with the very useful clang parenthesis/assignment warning mechanism) (bzr r13184) --- src/libcroco/cr-parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libcroco') diff --git a/src/libcroco/cr-parser.c b/src/libcroco/cr-parser.c index f14f8a015..69b521496 100644 --- a/src/libcroco/cr-parser.c +++ b/src/libcroco/cr-parser.c @@ -2430,14 +2430,14 @@ cr_parser_parse_stylesheet (CRParser * a_this) import_string, NULL, &location) ; - if ((PRIVATE (a_this)->sac_handler->resolve_import == TRUE)) { + if (PRIVATE (a_this)->sac_handler->resolve_import == TRUE) { /* *TODO: resolve the *import rule. */ } - if ((PRIVATE (a_this)->sac_handler->import_style_result)) { + if (PRIVATE (a_this)->sac_handler->import_style_result) { PRIVATE (a_this)->sac_handler->import_style_result (PRIVATE (a_this)->sac_handler, media_list, import_string, -- cgit v1.2.3