diff options
author | Руслан Ижбулатов <lrn1986@gmail.com> | 2014-08-05 12:14:13 +0000 |
---|---|---|
committer | Руслан Ижбулатов <lrn1986@gmail.com> | 2014-08-05 12:14:13 +0000 |
commit | 563fe9a38e19cd63d3181d9c3773875a0cdb4c2c (patch) | |
tree | 652f729a4fe0e9730d923925800c14f3f209cfad | |
parent | 06e15e28d24f1f4cfbf9de2d3224a076ae3b3b4c (diff) | |
download | libcroco-563fe9a38e19cd63d3181d9c3773875a0cdb4c2c.tar.gz |
Canonicalize the spacing around if statements and g_return_* invocations
-rw-r--r-- | src/cr-om-parser.c | 17 | ||||
-rw-r--r-- | tests/test2-main.c | 1 | ||||
-rw-r--r-- | tests/test3-main.c | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/cr-om-parser.c b/src/cr-om-parser.c index a19e06a..36a6697 100644 --- a/src/cr-om-parser.c +++ b/src/cr-om-parser.c @@ -390,9 +390,12 @@ end_page (CRDocHandler * a_this, (void) a_pseudo_page; g_return_if_fail (a_this); + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); + g_return_if_fail (status == CR_OK && ctxt); + g_return_if_fail (ctxt->cur_stmt && ctxt->cur_stmt->type == AT_PAGE_RULE_STMT && ctxt->stylesheet); @@ -455,9 +458,12 @@ end_media (CRDocHandler * a_this, GList * a_media_list) (void) a_media_list; g_return_if_fail (a_this); + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); + g_return_if_fail (status == CR_OK && ctxt); + g_return_if_fail (ctxt && ctxt->cur_media_stmt && ctxt->cur_media_stmt->type == AT_MEDIA_RULE_STMT @@ -465,6 +471,7 @@ end_media (CRDocHandler * a_this, GList * a_media_list) stmts = cr_statement_append (ctxt->stylesheet->statements, ctxt->cur_media_stmt); + if (!stmts) { cr_statement_destroy (ctxt->cur_media_stmt); ctxt->cur_media_stmt = NULL; @@ -496,16 +503,22 @@ import_style (CRDocHandler * a_this, (void) a_uri_default_ns; g_return_if_fail (a_this); + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); + g_return_if_fail (status == CR_OK && ctxt); + g_return_if_fail (ctxt->stylesheet); uri = cr_string_dup (a_uri) ; + if (a_media_list) media_list = cr_utils_dup_glist_of_cr_string (a_media_list) ; + stmt = cr_statement_new_at_import_rule (ctxt->stylesheet, uri, media_list, NULL); + if (!stmt) goto error; @@ -571,9 +584,12 @@ end_selector (CRDocHandler * a_this, CRSelector * a_selector_list) (void) a_selector_list; g_return_if_fail (a_this); + ctxtptr = &ctxt; status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); + g_return_if_fail (status == CR_OK && ctxt); + g_return_if_fail (ctxt->cur_stmt && ctxt->stylesheet); if (ctxt->cur_stmt) { @@ -613,6 +629,7 @@ end_selector (CRDocHandler * a_this, CRSelector * a_selector_list) } } + a_selector_list = NULL; /*keep compiler happy */ } diff --git a/tests/test2-main.c b/tests/test2-main.c index 9ce5cc9..2b3ef29 100644 --- a/tests/test2-main.c +++ b/tests/test2-main.c @@ -152,6 +152,7 @@ test_import_style (CRDocHandler * a_handler, } } } + fprintf (stdout, "******************\n\n"); a_uri = NULL; /*keep compiler happy */ } diff --git a/tests/test3-main.c b/tests/test3-main.c index e730e06..db52595 100644 --- a/tests/test3-main.c +++ b/tests/test3-main.c @@ -143,6 +143,7 @@ test_import_style (CRDocHandler * a_handler, } } } + fprintf (stdout, "******************\n\n"); a_uri = NULL; /*keep compiler happy */ } |