summaryrefslogtreecommitdiff
path: root/src/cr-om-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cr-om-parser.c')
-rw-r--r--src/cr-om-parser.c72
1 files changed, 48 insertions, 24 deletions
diff --git a/src/cr-om-parser.c b/src/cr-om-parser.c
index d1b85e3..4b0ab0b 100644
--- a/src/cr-om-parser.c
+++ b/src/cr-om-parser.c
@@ -216,11 +216,13 @@ start_font_face (CRDocHandler * a_this)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
g_return_if_fail (a_this);
g_return_if_fail (a_this);
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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 == NULL);
@@ -235,12 +237,14 @@ end_font_face (CRDocHandler * a_this)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
CRStatement *stmts = NULL;
g_return_if_fail (a_this);
g_return_if_fail (a_this);
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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
@@ -276,9 +280,11 @@ end_document (CRDocHandler * a_this)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
g_return_if_fail (a_this);
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ ctxtptr = &ctxt;
+ status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr);
g_return_if_fail (status == CR_OK && ctxt);
if (!ctxt->stylesheet || ctxt->cur_stmt)
@@ -308,10 +314,11 @@ charset (CRDocHandler * a_this, GString * a_charset)
GString *charset = NULL;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
g_return_if_fail (a_this);
-
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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);
@@ -342,10 +349,11 @@ start_page (CRDocHandler * a_this, GString * a_page, GString * a_pseudo)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
g_return_if_fail (a_this);
-
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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 == NULL);
@@ -384,11 +392,12 @@ end_page (CRDocHandler * a_this, GString * a_page, GString * a_pseudo_page)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
CRStatement *stmt = NULL;
g_return_if_fail (a_this);
-
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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
@@ -416,10 +425,12 @@ start_media (CRDocHandler * a_this, GList * a_media_list)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
GList *media_list = NULL;
g_return_if_fail (a_this);
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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
@@ -443,10 +454,12 @@ end_media (CRDocHandler * a_this, GList * a_media_list)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
CRStatement *stmts = NULL;
g_return_if_fail (a_this);
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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
@@ -475,11 +488,13 @@ import_style (CRDocHandler * a_this, GList * a_media_list,
CRStatement *stmt = NULL,
*stmt2 = NULL;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
GList *media_list = NULL,
*cur = NULL;
g_return_if_fail (a_this);
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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);
@@ -538,10 +553,11 @@ start_selector (CRDocHandler * a_this, CRSelector * a_selector_list)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
g_return_if_fail (a_this);
-
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ ctxtptr = &ctxt;
+ status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr);
g_return_if_fail (status == CR_OK && ctxt);
if (ctxt->cur_stmt) {
/*hmm, this should be NULL so free it */
@@ -558,10 +574,11 @@ end_selector (CRDocHandler * a_this, CRSelector * a_selector_list)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
g_return_if_fail (a_this);
-
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ 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);
@@ -611,12 +628,14 @@ property (CRDocHandler * a_this,
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
CRDeclaration *decl = NULL,
*decl2 = NULL;
GString *str = NULL;
g_return_if_fail (a_this);
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ ctxtptr = &ctxt;
+ status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr);
g_return_if_fail (status == CR_OK && ctxt);
/*
@@ -711,10 +730,11 @@ error (CRDocHandler * a_this)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
g_return_if_fail (a_this);
-
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ ctxtptr = &ctxt;
+ status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr);
g_return_if_fail (status == CR_OK && ctxt);
if (ctxt->cur_stmt) {
@@ -728,8 +748,10 @@ unrecoverable_error (CRDocHandler * a_this)
{
enum CRStatus status = CR_OK;
ParsingContext *ctxt = NULL;
+ ParsingContext **ctxtptr = NULL;
- status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt);
+ ctxtptr = &ctxt;
+ status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr);
g_return_if_fail (status == CR_OK);
if (ctxt) {
@@ -828,14 +850,15 @@ cr_om_parser_parse_buf (CROMParser * a_this,
if (status == CR_OK) {
CRStyleSheet *result = NULL;
+ CRStyleSheet **resultptr = NULL;
CRDocHandler *sac_handler = NULL;
cr_parser_get_sac_handler (PRIVATE (a_this)->parser,
&sac_handler);
g_return_val_if_fail (sac_handler, CR_ERROR);
-
+ resultptr = &result;
status = cr_doc_handler_get_result (sac_handler,
- (gpointer *) & result);
+ (gpointer *) resultptr);
g_return_val_if_fail (status == CR_OK, status);
if (result)
@@ -912,14 +935,15 @@ cr_om_parser_parse_file (CROMParser * a_this,
if (status == CR_OK) {
CRStyleSheet *result = NULL;
+ CRStyleSheet **resultptr = NULL;
CRDocHandler *sac_handler = NULL;
cr_parser_get_sac_handler (PRIVATE (a_this)->parser,
&sac_handler);
g_return_val_if_fail (sac_handler, CR_ERROR);
-
+ resultptr = &result;
status = cr_doc_handler_get_result
- (sac_handler, (gpointer *) & result);
+ (sac_handler, (gpointer *) resultptr);
g_return_val_if_fail (status == CR_OK, status);
if (result)
*a_result = result;