index c00da15465da9c2cb7ab66a7ef29e1ee0c7857a5..501741c375e8884a16678bf7fbbbaebdadf72c59 100644 (file)
static gchar *
cr_statement_ruleset_to_string (CRStatement * a_this, glong a_indent)
{
- GString *stringue = NULL;
gchar *tmp_str = NULL,
*result = NULL;
g_return_val_if_fail (a_this && a_this->type == RULESET_STMT, NULL);
- stringue = g_string_new (NULL);
+ GString *stringue = (GString *)g_string_new (NULL);
if (a_this->kind.ruleset->sel_list) {
if (a_indent)
cr_utils_dump_n_chars2 (' ', stringue, a_indent);
- tmp_str =
+ tmp_str = (gchar *)
cr_selector_to_string (a_this->kind.ruleset->
sel_list);
if (tmp_str) {
}
g_string_append (stringue, " {\n");
if (a_this->kind.ruleset->decl_list) {
- tmp_str = cr_declaration_list_to_string2
+ tmp_str = (gchar *)cr_declaration_list_to_string2
(a_this->kind.ruleset->decl_list,
a_indent + DECLARATION_INDENT_NB, TRUE);
if (tmp_str) {
NULL);
if (a_this->kind.font_face_rule->decl_list) {
- stringue = g_string_new (NULL) ;
+ stringue = (GString *)g_string_new (NULL) ;
g_return_val_if_fail (stringue, NULL) ;
if (a_indent)
cr_utils_dump_n_chars2 (' ', stringue,
a_indent);
g_string_append (stringue, "@font-face {\n");
- tmp_str = cr_declaration_list_to_string2
+ tmp_str = (gchar *)cr_declaration_list_to_string2
(a_this->kind.font_face_rule->decl_list,
a_indent + DECLARATION_INDENT_NB, TRUE) ;
if (tmp_str) {
cr_statement_at_page_rule_to_string (CRStatement *a_this,
gulong a_indent)
{
- GString *stringue = NULL;
gchar *result = NULL ;
- stringue = g_string_new (NULL) ;
+ GString *stringue = (GString *)g_string_new (NULL) ;
cr_utils_dump_n_chars2 (' ', stringue, a_indent) ;
g_string_append (stringue, "@page");
if (a_this->kind.page_rule->decl_list) {
gchar *str = NULL ;
g_string_append (stringue, " {\n");
- str = cr_declaration_list_to_string2
+ str = (gchar *)cr_declaration_list_to_string2
(a_this->kind.page_rule->decl_list,
a_indent + DECLARATION_INDENT_NB, TRUE) ;
if (str) {
NULL);
if (a_this->kind.media_rule) {
- stringue = g_string_new (NULL) ;
+ stringue = (GString *)g_string_new (NULL) ;
cr_utils_dump_n_chars2 (' ', stringue, a_indent);
g_string_append (stringue, "@media");
for (cur = a_this->kind.media_rule->media_list; cur;
cur = cur->next) {
if (cur->data) {
- guchar *str = cr_string_dup2
+ gchar *str = cr_string_dup2
((CRString *) cur->data);
if (str) {
gulong a_indent)
{
GString *stringue = NULL ;
- guchar *str = NULL;
+ gchar *str = NULL;
g_return_val_if_fail (a_this
&& a_this->type == AT_IMPORT_RULE_STMT
if (a_this->kind.import_rule->url
&& a_this->kind.import_rule->url->stryng) {
- stringue = g_string_new (NULL) ;
+ stringue = (GString *)g_string_new (NULL) ;
g_return_val_if_fail (stringue, NULL) ;
str = g_strndup (a_this->kind.import_rule->url->stryng->str,
a_this->kind.import_rule->url->stryng->len);
for (cur = a_this->kind.import_rule->media_list;
cur; cur = cur->next) {
if (cur->data) {
- CRString *crstr = cur->data;
+ CRString *crstr = (CRString *)cur->data;
if (cur->prev) {
g_string_append
enum CRStatus status = CR_OK;
gboolean result = FALSE;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf,
+ strlen ((char *)a_buf),
a_encoding, FALSE);
g_return_val_if_fail (parser, FALSE);
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf,
+ strlen ((char *)a_buf),
a_enc, FALSE);
g_return_val_if_fail (parser, NULL);
CRDeclaration * a_decl_list,
CRStatement * a_parent_media_rule)
{
- CRStatement *result = NULL;
-
g_return_val_if_fail (a_sel_list, NULL);
if (a_parent_media_rule) {
NULL);
}
- result = g_try_malloc (sizeof (CRStatement));
+ CRStatement *result = (CRStatement *)g_try_malloc (sizeof (CRStatement));
if (!result) {
cr_utils_trace_info ("Out of memory");
memset (result, 0, sizeof (CRStatement));
result->type = RULESET_STMT;
- result->kind.ruleset = g_try_malloc (sizeof (CRRuleSet));
+ result->kind.ruleset = (CRRuleSet *)g_try_malloc (sizeof (CRRuleSet));
if (!result->kind.ruleset) {
cr_utils_trace_info ("Out of memory");
CRDocHandler *sac_handler = NULL;
enum CRStatus status = CR_OK;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf,
+ strlen ((char *)a_buf),
a_enc, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of the parser failed");
cr_statement_new_at_media_rule (CRStyleSheet * a_sheet,
CRStatement * a_rulesets, GList * a_media)
{
- CRStatement *result = NULL,
- *cur = NULL;
+ CRStatement *cur = NULL;
if (a_rulesets)
g_return_val_if_fail (a_rulesets->type == RULESET_STMT, NULL);
- result = g_try_malloc (sizeof (CRStatement));
+ CRStatement *result = (CRStatement *)g_try_malloc (sizeof (CRStatement));
if (!result) {
cr_utils_trace_info ("Out of memory");
memset (result, 0, sizeof (CRStatement));
result->type = AT_MEDIA_RULE_STMT;
- result->kind.media_rule = g_try_malloc (sizeof (CRAtMediaRule));
+ result->kind.media_rule = (CRAtMediaRule *)g_try_malloc (sizeof (CRAtMediaRule));
if (!result->kind.media_rule) {
cr_utils_trace_info ("Out of memory");
g_free (result);
GList * a_media_list,
CRStyleSheet * a_imported_sheet)
{
- CRStatement *result = NULL;
-
- result = g_try_malloc (sizeof (CRStatement));
+ CRStatement *result = (CRStatement *)g_try_malloc (sizeof (CRStatement));
if (!result) {
cr_utils_trace_info ("Out of memory");
memset (result, 0, sizeof (CRStatement));
result->type = AT_IMPORT_RULE_STMT;
- result->kind.import_rule = g_try_malloc (sizeof (CRAtImportRule));
+ result->kind.import_rule = (CRAtImportRule *)g_try_malloc (sizeof (CRAtImportRule));
if (!result->kind.import_rule) {
cr_utils_trace_info ("Out of memory");
CRString *import_string = NULL;
CRParsingLocation location = {0,0,0} ;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf,
+ strlen ((char *)a_buf),
a_encoding, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of parser failed.");
CRDeclaration * a_decl_list,
CRString * a_name, CRString * a_pseudo)
{
- CRStatement *result = NULL;
-
- result = g_try_malloc (sizeof (CRStatement));
+ CRStatement *result = (CRStatement *)g_try_malloc (sizeof (CRStatement));
if (!result) {
cr_utils_trace_info ("Out of memory");
memset (result, 0, sizeof (CRStatement));
result->type = AT_PAGE_RULE_STMT;
- result->kind.page_rule = g_try_malloc (sizeof (CRAtPageRule));
+ result->kind.page_rule = (CRAtPageRule *)g_try_malloc (sizeof (CRAtPageRule));
if (!result->kind.page_rule) {
cr_utils_trace_info ("Out of memory");
enum CREncoding a_encoding)
{
enum CRStatus status = CR_OK;
- CRParser *parser = NULL;
CRDocHandler *sac_handler = NULL;
CRStatement *result = NULL;
CRStatement **resultptr = NULL;
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ CRParser *parser = cr_parser_new_from_buf ((guchar*)a_buf,
+ strlen ((char *)a_buf),
a_encoding, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of the parser failed.");
cr_statement_new_at_charset_rule (CRStyleSheet * a_sheet,
CRString * a_charset)
{
- CRStatement *result = NULL;
-
g_return_val_if_fail (a_charset, NULL);
- result = g_try_malloc (sizeof (CRStatement));
+ CRStatement *result = (CRStatement *)g_try_malloc (sizeof (CRStatement));
if (!result) {
cr_utils_trace_info ("Out of memory");
memset (result, 0, sizeof (CRStatement));
result->type = AT_CHARSET_RULE_STMT;
- result->kind.charset_rule = g_try_malloc (sizeof (CRAtCharsetRule));
+ result->kind.charset_rule = (CRAtCharsetRule *)g_try_malloc (sizeof (CRAtCharsetRule));
if (!result->kind.charset_rule) {
cr_utils_trace_info ("Out of memory");
enum CREncoding a_encoding)
{
enum CRStatus status = CR_OK;
- CRParser *parser = NULL;
CRStatement *result = NULL;
CRString *charset = NULL;
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ CRParser *parser = cr_parser_new_from_buf ((guchar*)a_buf,
+ strlen ((char *)a_buf),
a_encoding, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of the parser failed.");
cr_statement_new_at_font_face_rule (CRStyleSheet * a_sheet,
CRDeclaration * a_font_decls)
{
- CRStatement *result = NULL;
-
- result = g_try_malloc (sizeof (CRStatement));
+ CRStatement *result = (CRStatement *)g_try_malloc (sizeof (CRStatement));
if (!result) {
cr_utils_trace_info ("Out of memory");
memset (result, 0, sizeof (CRStatement));
result->type = AT_FONT_FACE_RULE_STMT;
- result->kind.font_face_rule = g_try_malloc
+ result->kind.font_face_rule = (CRAtFontFaceRule *)g_try_malloc
(sizeof (CRAtFontFaceRule));
if (!result->kind.font_face_rule) {
{
CRStatement *result = NULL;
CRStatement **resultptr = NULL;
- CRParser *parser = NULL;
CRDocHandler *sac_handler = NULL;
enum CRStatus status = CR_OK;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ CRParser *parser = (CRParser *)cr_parser_new_from_buf (
+ (guchar*)a_buf,
+ strlen ((char *)a_buf),
a_encoding, FALSE);
if (!parser)
goto cleanup;
void
cr_statement_dump_ruleset (CRStatement * a_this, FILE * a_fp, glong a_indent)
{
- guchar *str = NULL;
-
g_return_if_fail (a_fp && a_this);
- str = cr_statement_ruleset_to_string (a_this, a_indent);
+ gchar *str = cr_statement_ruleset_to_string (a_this, a_indent);
if (str) {
fprintf (a_fp, str);
g_free (str);
void
cr_statement_dump_charset (CRStatement * a_this, FILE * a_fp, gulong a_indent)
{
- guchar *str = NULL;
-
g_return_if_fail (a_this && a_this->type == AT_CHARSET_RULE_STMT);
- str = cr_statement_charset_to_string (a_this,
+ gchar *str = cr_statement_charset_to_string (a_this,
a_indent) ;
if (str) {
fprintf (a_fp, str) ;
@@ -2503,13 +2491,11 @@ cr_statement_dump_charset (CRStatement * a_this, FILE * a_fp, gulong a_indent)
void
cr_statement_dump_page (CRStatement * a_this, FILE * a_fp, gulong a_indent)
{
- guchar *str = NULL;
-
g_return_if_fail (a_this
&& a_this->type == AT_PAGE_RULE_STMT
&& a_this->kind.page_rule);
- str = cr_statement_at_page_rule_to_string (a_this, a_indent) ;
+ gchar *str = cr_statement_at_page_rule_to_string (a_this, a_indent) ;
if (str) {
fprintf (a_fp, str);
g_free (str) ;