summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b97c841)
raw | patch | inline | side by side (parent: b97c841)
author | ishmal <ishmal@users.sourceforge.net> | |
Wed, 15 Nov 2006 09:36:19 +0000 (09:36 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Wed, 15 Nov 2006 09:36:19 +0000 (09:36 +0000) |
27 files changed:
index 9f511af06a64ebbd22cefc498369cf0bbca82f4c..80a4767e0c89a3b64b4c0f8e9c7b7a0c66c23a84 100644 (file)
{
CRAdditionalSel *result = NULL;
- result = g_try_malloc (sizeof (CRAdditionalSel));
+ result = (CRAdditionalSel *)g_try_malloc (sizeof (CRAdditionalSel));
if (result == NULL) {
cr_utils_trace_debug ("Out of memory");
guchar *name = NULL;
if (cur->content.class_name) {
- name = g_strndup
+ name = (guchar *)g_strndup
(cur->content.class_name->stryng->str,
cur->content.class_name->stryng->len);
guchar *name = NULL;
if (cur->content.class_name) {
- name = g_strndup
+ name = (guchar *)g_strndup
(cur->content.id_name->stryng->str,
cur->content.id_name->stryng->len);
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
guchar *name = NULL;
if (a_this->content.class_name) {
- name = g_strndup
+ name = (guchar *)g_strndup
(a_this->content.class_name->stryng->str,
a_this->content.class_name->stryng->len);
guchar *name = NULL;
if (a_this->content.class_name) {
- name = g_strndup
+ name = (guchar *)g_strndup
(a_this->content.id_name->stryng->str,
a_this->content.id_name->stryng->len);
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
index cf048d10247047b94c2b8d2ca00c30af8faef099..3c4800e663cc2366a1b256b8643c4ea672a139c8 100644 (file)
CRAttrSel *
cr_attr_sel_new (void)
{
- CRAttrSel *result = NULL;
-
- result = g_malloc0 (sizeof (CRAttrSel));
+ CRAttrSel *result = (CRAttrSel *)g_malloc0 (sizeof (CRAttrSel));
return result;
}
}
if (cur->name) {
- guchar *name = NULL;
-
- name = g_strndup (cur->name->stryng->str,
+ gchar *name = g_strndup (cur->name->stryng->str,
cur->name->stryng->len);
if (name) {
g_string_append (str_buf, name);
}
if (cur->value) {
- guchar *value = NULL;
-
- value = g_strndup (cur->value->stryng->str,
+ gchar *value = g_strndup (cur->value->stryng->str,
cur->value->stryng->len);
if (value) {
switch (cur->match_way) {
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
}
index 51c6df5aca8d4338735e0815aa958b2e489424d7..f389fc746af756533f509cdfc098ad56dee7eaa5 100644 (file)
cr_cascade_new (CRStyleSheet * a_author_sheet,
CRStyleSheet * a_user_sheet, CRStyleSheet * a_ua_sheet)
{
- CRCascade *result = NULL;
-
- result = g_try_malloc (sizeof (CRCascade));
+ CRCascade *result = (CRCascade *)g_try_malloc (sizeof (CRCascade));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
memset (result, 0, sizeof (CRCascade));
- PRIVATE (result) = g_try_malloc (sizeof (CRCascadePriv));
+ PRIVATE (result) = (CRCascadePriv *)g_try_malloc (sizeof (CRCascadePriv));
if (!PRIVATE (result)) {
cr_utils_trace_info ("Out of memory");
return NULL;
index a1ff0d292335faa86f914fbd9c7eb60ab8af58b4..ba8e0c95fc53f4bf06d507b8c42ec9bc64f7a29d 100644 (file)
static void
dump (CRDeclaration * a_this, FILE * a_fp, glong a_indent)
{
- guchar *str = NULL;
-
g_return_if_fail (a_this);
- str = cr_declaration_to_string (a_this, a_indent);
+ gchar *str = cr_declaration_to_string (a_this, a_indent);
if (str) {
fprintf (a_fp, "%s", str);
g_free (str);
cr_declaration_new (CRStatement * a_statement,
CRString * a_property, CRTerm * a_value)
{
- CRDeclaration *result = NULL;
-
g_return_val_if_fail (a_property, NULL);
if (a_statement)
|| (a_statement->type
== AT_PAGE_RULE_STMT)), NULL);
- result = g_try_malloc (sizeof (CRDeclaration));
+ CRDeclaration * result = (CRDeclaration *)g_try_malloc (sizeof (CRDeclaration));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
CRTerm *value = NULL;
CRString *property = NULL;
CRDeclaration *result = NULL;
- CRParser *parser = NULL;
gboolean important = FALSE;
g_return_val_if_fail (a_str, NULL);
g_return_val_if_fail (a_statement->type == RULESET_STMT,
NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str), a_enc, FALSE);
+ CRParser *parser = (CRParser *)
+ cr_parser_new_from_buf ((guchar*)a_str,
+ strlen ((char *)a_str), a_enc, FALSE);
g_return_val_if_fail (parser, NULL);
status = cr_parser_try_to_skip_spaces_and_comments (parser);
CRString *property = NULL;
CRDeclaration *result = NULL,
*cur_decl = NULL;
- CRParser *parser = NULL;
CRTknzr *tokenizer = NULL;
gboolean important = FALSE;
g_return_val_if_fail (a_str, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str), a_enc, FALSE);
+ CRParser *parser = (CRParser *)cr_parser_new_from_buf
+ ((guchar*)a_str, strlen ((char *)a_str), a_enc, FALSE);
g_return_val_if_fail (parser, NULL);
status = cr_parser_get_tknzr (parser, &tokenizer);
if (status != CR_OK || !tokenizer) {
{
GString *stringue = NULL;
- guchar *str = NULL,
+ gchar *str = NULL,
*result = NULL;
g_return_val_if_fail (a_this, NULL);
{
CRDeclaration *cur = NULL;
GString *stringue = NULL;
- guchar *str = NULL,
+ gchar *str = NULL,
*result = NULL;
g_return_val_if_fail (a_this, NULL);
g_string_free (stringue, FALSE);
}
- return result;
+ return (guchar *)result;
}
/**
{
CRDeclaration *cur = NULL;
GString *stringue = NULL;
- guchar *str = NULL,
+ gchar *str = NULL,
*result = NULL;
g_return_val_if_fail (a_this, NULL);
g_string_free (stringue, FALSE);
}
- return result;
+ return (guchar *)result;
}
/**
&& cur->property->stryng
&& cur->property->stryng->str) {
if (!strcmp (cur->property->stryng->str,
- a_prop)) {
+ (char *)a_prop)) {
return cur;
}
}
index 2780b6a20d2abd4f46cf5e4ef18f8d6fbfded7ab..00357c0f096436eb3de5dfec416238c61ab1b170 100644 (file)
CRDocHandler *
cr_doc_handler_new (void)
{
- CRDocHandler *result = NULL;
-
- result = g_try_malloc (sizeof (CRDocHandler));
+ CRDocHandler *result = ( CRDocHandler *)g_try_malloc (sizeof (CRDocHandler));
g_return_val_if_fail (result, NULL);
memset (result, 0, sizeof (CRDocHandler));
- result->priv = g_try_malloc (sizeof (CRDocHandlerPriv));
+ result->priv = (CRDocHandlerPriv *)g_try_malloc (sizeof (CRDocHandlerPriv));
if (!result->priv) {
cr_utils_trace_info ("Out of memory exception");
g_free (result);
g_return_if_fail (a_this && PRIVATE (a_this)
&& a_parser) ;
- PRIVATE (a_this)->parser = a_parser ;
+ PRIVATE (a_this)->parser = (CRParser *)a_parser ;
}
index 509793ab789b1ccf6fc6b89be7713aa24cb255e2..456ac51fa3b848d9284ec4913054e5f8fdee17f1 100644 (file)
{"UCS-4", CR_UCS_4},
{"UCS_4", CR_UCS_4},
{"ASCII", CR_ASCII},
- {0, 0}
+ {(char *)0, (CREncoding)0}
};
static CREncHandler gv_default_enc_handlers[] = {
{CR_ASCII, cr_utils_ucs1_to_utf8, cr_utils_utf8_to_ucs1,
cr_utils_ucs1_str_len_as_utf8, cr_utils_utf8_str_len_as_ucs1},
- {0, NULL, NULL, NULL, NULL}
+ {(CREncoding)0, NULL, NULL, NULL, NULL}
};
/**
enum CREncoding *a_enc)
{
gulong i = 0;
- guchar *alias_name_up = NULL;
enum CRStatus status = CR_ENCODING_NOT_FOUND_ERROR;
g_return_val_if_fail (a_alias_name != NULL, CR_BAD_PARAM_ERROR);
- alias_name_up = g_strdup (a_alias_name);
+ gchar *alias_name_up = g_strdup ((gchar *)a_alias_name);
g_ascii_strup (alias_name_up, -1);
for (i = 0; gv_default_aliases[i].name; i++) {
*a_out_len = *a_in_len;
}
- *a_out = g_malloc0 (*a_out_len);
+ *a_out = (guchar *)g_malloc0 (*a_out_len);
status = a_this->decode_input (a_in, a_in_len, *a_out, a_out_len);
index 8c87aa2299dcc185cf35e69e40a21ab3d6ed514b..63d8412f256286fec2cf313812ba3c8eef56b86b 100644 (file)
--- a/src/libcroco/cr-fonts.c
+++ b/src/libcroco/cr-fonts.c
cr_font_family_to_string_real (CRFontFamily * a_this,
gboolean a_walk_list, GString ** a_string)
{
- guchar *name = NULL;
+ gchar *name = NULL;
enum CRStatus result = CR_OK;
if (!*a_string) {
switch (a_this->type) {
case FONT_FAMILY_SANS_SERIF:
- name = (guchar *) "sans-serif";
+ name = (gchar *) "sans-serif";
break;
case FONT_FAMILY_SERIF:
- name = (guchar *) "sans-serif";
+ name = (gchar *) "sans-serif";
break;
case FONT_FAMILY_CURSIVE:
- name = (guchar *) "cursive";
+ name = (gchar *) "cursive";
break;
case FONT_FAMILY_FANTASY:
- name = (guchar *) "fantasy";
+ name = (gchar *) "fantasy";
break;
case FONT_FAMILY_MONOSPACE:
- name = (guchar *) "monospace";
+ name = (gchar *) "monospace";
break;
case FONT_FAMILY_NON_GENERIC:
- name = (guchar *) a_this->name;
+ name = (gchar *) a_this->name;
break;
default:
- name = (guchar *) NULL;
+ name = (gchar *) NULL;
break;
}
CRFontFamily *
cr_font_family_new (enum CRFontFamilyType a_type, guchar * a_name)
{
- CRFontFamily *result = NULL;
-
- result = g_try_malloc (sizeof (CRFontFamily));
+ CRFontFamily *result = (CRFontFamily *)g_try_malloc (sizeof (CRFontFamily));
if (!result) {
cr_utils_trace_info ("Out of memory");
gboolean a_walk_font_family_list)
{
enum CRStatus status = CR_OK;
- guchar *result = NULL;
+ gchar *result = NULL;
GString *stringue = NULL;
if (!a_this) {
result = g_strdup ("NULL");
g_return_val_if_fail (result, NULL);
- return result;
+ return (guchar *)result;
}
status = cr_font_family_to_string_real (a_this,
a_walk_font_family_list,
}
}
- return result;
+ return (guchar *)result;
}
enum CRStatus
cr_font_family_set_name (CRFontFamily * a_this, guchar * a_name)
a_family_to_prepend->next = a_this;
a_this->prev = a_family_to_prepend;
- return CR_OK;
+ return a_family_to_prepend;
}
enum CRStatus
CRFontSize *
cr_font_size_new (void)
{
- CRFontSize *result = NULL;
-
- result = g_try_malloc (sizeof (CRFontSize));
+ CRFontSize *result = (CRFontSize *)g_try_malloc (sizeof (CRFontSize));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
(a_this->value.predefined));
break;
case ABSOLUTE_FONT_SIZE:
- str = cr_num_to_string (&a_this->value.absolute);
+ str = (gchar *)cr_num_to_string (&a_this->value.absolute);
break;
case RELATIVE_FONT_SIZE:
str = g_strdup (cr_relative_font_size_to_string
break;
case FONT_SIZE_ADJUST_NUMBER:
if (a_this->num)
- str = cr_num_to_string (a_this->num);
+ str = (gchar *)cr_num_to_string (a_this->num);
else
str = g_strdup ("unknow font-size-adjust property value"); // Should raise an error no?
break;
cr_utils_trace_info ("FONT_WEIGHT_BOLDER or FONT_WEIGHT_LIGHTER should not appear here") ;
return FONT_WEIGHT_NORMAL ;
} else {
- return a_weight << 1 ;
+ return (CRFontWeight)(a_weight << 1) ;
}
}
CRFontSizeAdjust *
cr_font_size_adjust_new (void)
{
- CRFontSizeAdjust *result = NULL;
-
- result = g_try_malloc (sizeof (CRFontSizeAdjust));
+ CRFontSizeAdjust *result =
+ (CRFontSizeAdjust *)g_try_malloc (sizeof (CRFontSizeAdjust));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
index 9485df3c59a12431bd886ba6007bcd1430b59353..861329227e3fb807aa730247ffde28ce9768d9cb 100644 (file)
--- a/src/libcroco/cr-input.c
+++ b/src/libcroco/cr-input.c
static CRInput *
cr_input_new_real (void)
{
- CRInput *result = NULL;
-
- result = g_try_malloc (sizeof (CRInput));
+ CRInput *result = (CRInput *)g_try_malloc (sizeof (CRInput));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
memset (result, 0, sizeof (CRInput));
- PRIVATE (result) = g_try_malloc (sizeof (CRInputPriv));
+ PRIVATE (result) = (CRInputPriv *)g_try_malloc (sizeof (CRInputPriv));
if (!PRIVATE (result)) {
cr_utils_trace_info ("Out of memory");
g_free (result);
if (status == CR_OK) {
/*read went well */
- buf = g_realloc (buf, len + CR_INPUT_MEM_CHUNK_SIZE);
+ buf = (guchar *)g_realloc (buf, len + CR_INPUT_MEM_CHUNK_SIZE);
memcpy (buf + len, tmp_buf, nb_read);
len += nb_read;
buf_size += CR_INPUT_MEM_CHUNK_SIZE;
status = cr_utils_read_char_from_utf8_buf
(PRIVATE (a_this)->in_buf +
PRIVATE (a_this)->next_byte_index,
- nb_bytes_left, a_char, &consumed);
+ nb_bytes_left, a_char, (gulong *)&consumed);
return status;
}
index fe785491b081f8f408148cc9b91a9a232f2f0e09..bc860f974bbc41e147bc07b7e96d3692c3d97aeb 100644 (file)
libxml_getLocalName(CRXMLNodePtr cnode)
{
xmlNode const *xnode = (xmlNode const *) cnode;
- return local_part(xnode->name);
+ return local_part((char *)xnode->name);
}
static char *
{
xmlNodePtr xnode = (xmlNodePtr) cnode;
xmlChar const *xprop = (xmlChar const *) cprop;
- return xmlGetProp(xnode, xprop);
+ return (char *)xmlGetProp(xnode, xprop);
}
static gboolean
index cb9bf27337832a79146a0a96bf8ef89b7aaaddfe..5da0d9ae35f5db8385085e30644d0f6369380cd5 100644 (file)
G_BEGIN_DECLS
-CRNodeIface const cr_libxml_node_iface;
+extern CRNodeIface const cr_libxml_node_iface;
G_END_DECLS
diff --git a/src/libcroco/cr-num.c b/src/libcroco/cr-num.c
index 45a63281b7d031fb52dc7f57a65fea55ba0e4140..c714894d68af799f76c9f0fe092e23bfe93703a5 100644 (file)
--- a/src/libcroco/cr-num.c
+++ b/src/libcroco/cr-num.c
CRNum *
cr_num_new (void)
{
- CRNum *result = NULL;
-
- result = g_try_malloc (sizeof (CRNum));
+ CRNum *result = (CRNum *)g_try_malloc (sizeof (CRNum));
if (result == NULL) {
cr_utils_trace_info ("Out of memory");
test_val = a_this->val - (glong) a_this->val;
if (!test_val) {
- tmp_char1 = g_strdup_printf ("%ld", (glong) a_this->val);
+ tmp_char1 = (guchar *)g_strdup_printf ("%ld", (glong) a_this->val);
} else {
/* We can't use g_ascii_dtostr, because that sometimes uses
e notation (which wouldn't be a valid number in CSS). */
size_t const buflen = 35; /* fairly arbitrary. */
- tmp_char1 = g_malloc (buflen);
- g_ascii_formatd (tmp_char1, buflen, "%.17f", a_this->val);
+ tmp_char1 = (guchar *)g_malloc (buflen);
+ g_ascii_formatd ((gchar *)tmp_char1, buflen, "%.17f", a_this->val);
}
g_return_val_if_fail (tmp_char1, NULL);
}
if (tmp_char2) {
- result = g_strconcat (tmp_char1, tmp_char2, NULL);
+ result = (guchar *)g_strconcat (
+ (gchar *)tmp_char1, (gchar *)tmp_char2, NULL);
g_free (tmp_char1);
} else {
result = tmp_char1;
index 245f2d82f26815ed9e9c0f4db4e6611f68a2e1c3..b8d70e35a8bd27f19001e2ec063fd5869b426eb6 100644 (file)
static ParsingContext *
new_parsing_context (void)
{
- ParsingContext *result = NULL;
-
- result = g_try_malloc (sizeof (ParsingContext));
+ ParsingContext *result =
+ (ParsingContext *)g_try_malloc (sizeof (ParsingContext));
if (!result) {
cr_utils_trace_info ("Out of Memory");
return NULL;
CROMParser *
cr_om_parser_new (CRInput * a_input)
{
- CROMParser *result = NULL;
enum CRStatus status = CR_OK;
- result = g_try_malloc (sizeof (CROMParser));
+ CROMParser *result = (CROMParser *)g_try_malloc (sizeof (CROMParser));
if (!result) {
cr_utils_trace_info ("Out of memory");
}
memset (result, 0, sizeof (CROMParser));
- PRIVATE (result) = g_try_malloc (sizeof (CROMParserPriv));
+ PRIVATE (result) = (CROMParserPriv *)g_try_malloc (sizeof (CROMParserPriv));
if (!PRIVATE (result)) {
cr_utils_trace_info ("Out of memory");
index 7e71b927d3beb2a4490f3e80d019daeaa0842a97..2b411a8d48283ca0e067df2e19781290c9ab41b7 100644 (file)
--- a/src/libcroco/cr-parser.c
+++ b/src/libcroco/cr-parser.c
static CRParserError *
cr_parser_error_new (const guchar * a_msg, enum CRStatus a_status)
{
- CRParserError *result = NULL;
-
- result = g_try_malloc (sizeof (CRParserError));
+ CRParserError *result = (CRParserError *)g_try_malloc (sizeof (CRParserError));
if (result == NULL) {
cr_utils_trace_info ("Out of memory");
g_free (a_this->msg);
}
- a_this->msg = g_strdup (a_msg);
+ a_this->msg = (guchar *)g_strdup ((gchar *)a_msg);
}
/**
error:
cr_parser_push_error
- (a_this, "could not recognize next production", CR_ERROR);
+ (a_this, (guchar *)"could not recognize next production", CR_ERROR);
cr_parser_dump_err_stack (a_this, TRUE);
if (token && token->type == DELIM_TK
&& token->u.unichar == '*') {
- sel->type_mask |= UNIVERSAL_SELECTOR;
+ int comb = (int)sel->type_mask | (int) UNIVERSAL_SELECTOR;
+ sel->type_mask = (SimpleSelectorType)comb;
+ //sel->type_mask |= UNIVERSAL_SELECTOR;
sel->name = cr_string_new_from_string ("*");
found_sel = TRUE;
} else if (token && token->type == IDENT_TK) {
sel->name = token->u.str;
- sel->type_mask |= TYPE_SELECTOR;
+ int comb = (int)sel->type_mask | (int) TYPE_SELECTOR;
+ sel->type_mask = (SimpleSelectorType)comb;
+ //sel->type_mask |= TYPE_SELECTOR;
token->u.str = NULL;
found_sel = TRUE;
} else {
for (;;) {
guint32 next_char = 0;
- enum Combinator comb = 0;
+ int comb = 0;
sel = NULL;
break;
if (comb && sel) {
- sel->combinator = comb;
+ sel->combinator = (Combinator)comb;
comb = 0;
}
if (sel) {
/*free the medium list */
for (cur = media_list; cur; cur = cur->next) {
if (cur->data) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
}
}
cr_parser_push_error
- (a_this, "could not recognize next production", CR_ERROR);
+ (a_this, (guchar *)"could not recognize next production", CR_ERROR);
if (PRIVATE (a_this)->sac_handler
&& PRIVATE (a_this)->sac_handler->unrecoverable_error) {
CRParser *
cr_parser_new (CRTknzr * a_tknzr)
{
- CRParser *result = NULL;
enum CRStatus status = CR_OK;
- result = g_malloc0 (sizeof (CRParser));
+ CRParser *result = (CRParser *)g_malloc0 (sizeof (CRParser));
- PRIVATE (result) = g_malloc0 (sizeof (CRParserPriv));
+ PRIVATE (result) = (CRParserPriv *)g_malloc0 (sizeof (CRParserPriv));
if (a_tknzr) {
status = cr_parser_set_tknzr (result, a_tknzr);
CHECK_PARSING_STATUS (status, FALSE);
for (;;) {
- guchar operator = 0;
+ guchar operatr = 0;
status = cr_tknzr_peek_byte (PRIVATE (a_this)->tknzr,
1, &next_byte);
}
if (next_byte == '/' || next_byte == ',') {
- READ_NEXT_BYTE (a_this, &operator);
+ READ_NEXT_BYTE (a_this, &operatr);
}
cr_parser_try_to_skip_spaces_and_comments (a_this);
break;
}
- switch (operator) {
+ switch (operatr) {
case '/':
expr2->the_operator = DIVIDE;
break;
expr = cr_term_append_term (expr, expr2);
expr2 = NULL;
- operator = 0;
+ operatr = 0;
nb_terms++;
}
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- "while parsing declaration: next property is malformed",
+ (guchar *)"while parsing declaration: next property is malformed",
CR_SYNTAX_ERROR);
READ_NEXT_CHAR (a_this, &cur_char);
status = CR_PARSING_ERROR;
cr_parser_push_error
(a_this,
- "while parsing declaration: this char must be ':'",
+ (guchar *)"while parsing declaration: this char must be ':'",
CR_SYNTAX_ERROR);
goto error;
}
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- "while parsing declaration: next expression is malformed",
+ (guchar *)"while parsing declaration: next expression is malformed",
CR_SYNTAX_ERROR);
cr_parser_try_to_skip_spaces_and_comments (a_this);
ENSURE_PARSING_COND_ERR
(a_this, cur_char == '{',
- "while parsing rulset: current char should be '{'",
+ (guchar *)"while parsing rulset: current char should be '{'",
CR_SYNTAX_ERROR);
if (PRIVATE (a_this)->sac_handler
}
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- "while parsing ruleset: next construction should be a declaration",
+ (guchar *)"while parsing ruleset: next construction should be a declaration",
CR_SYNTAX_ERROR);
for (;;) {
READ_NEXT_CHAR (a_this, &cur_char);
ENSURE_PARSING_COND_ERR
(a_this, cur_char == '}',
- "while parsing rulset: current char must be a '}'",
+ (guchar *)"while parsing rulset: current char must be a '}'",
CR_SYNTAX_ERROR);
if (PRIVATE (a_this)->sac_handler
*/
for (cur = *a_media_list; cur; cur = cur->next) {
if (cur->data) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
}
GList *cur = NULL;
for (cur = media_list; cur; cur = cur->next) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
g_list_free (media_list);
GList *cur = NULL;
for (cur = media_list; cur; cur = cur->next) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
g_list_free (media_list);
index 81b05f7c304cf3c72ad48fe61f1e199625b325b3..49e8a3ce967c7144ba6a36a152690aac3447338c 100644 (file)
CRParsingLocation *
cr_parsing_location_new (void)
{
- CRParsingLocation * result = NULL ;
-
- result = g_try_malloc (sizeof (CRParsingLocation)) ;
+ CRParsingLocation *result =
+ (CRParsingLocation *)g_try_malloc (sizeof (CRParsingLocation)) ;
if (!result) {
cr_utils_trace_info ("Out of memory error") ;
return NULL ;
cr_parsing_location_to_string (CRParsingLocation *a_this,
enum CRParsingLocationSerialisationMask a_mask)
{
- GString *result = NULL ;
gchar *str = NULL ;
g_return_val_if_fail (a_this, NULL) ;
if (!a_mask) {
- a_mask = DUMP_LINE | DUMP_COLUMN | DUMP_BYTE_OFFSET ;
+ a_mask = (CRParsingLocationSerialisationMask)
+ ((int)DUMP_LINE | (int)DUMP_COLUMN | (int)DUMP_BYTE_OFFSET) ;
}
- result =g_string_new (NULL) ;
+ GString *result = (GString *)g_string_new (NULL) ;
if (!result)
return NULL ;
if (a_mask & DUMP_LINE) {
index 4c56b9cd3ae5d0fd28603f2309c381f20117cf44..0768379059100b4e6f1eec2d85df929866199952 100644 (file)
static CRPropList *
cr_prop_list_allocate (void)
{
- CRPropList *result = NULL;
-
- result = g_try_malloc (sizeof (CRPropList));
+ CRPropList *result = (CRPropList *)g_try_malloc (sizeof (CRPropList));
if (!result) {
cr_utils_trace_info ("could not allocate CRPropList");
return NULL;
}
memset (result, 0, sizeof (CRPropList));
- PRIVATE (result) = g_try_malloc (sizeof (CRPropListPriv));
+ PRIVATE (result) = (CRPropListPriv *)g_try_malloc (sizeof (CRPropListPriv));
if (!result) {
cr_utils_trace_info ("could not allocate CRPropListPriv");
g_free (result);
index 8e036a30f523844bc37e370330b76536f0ec097a..abb4f9bd43bbc9dcb18950f2b63b744d4a67b0c6 100644 (file)
--- a/src/libcroco/cr-pseudo.c
+++ b/src/libcroco/cr-pseudo.c
CRPseudo *
cr_pseudo_new (void)
{
- CRPseudo *result = NULL;
-
- result = g_malloc0 (sizeof (CRPseudo));
+ CRPseudo *result = (CRPseudo *)g_malloc0 (sizeof (CRPseudo));
return result;
}
cr_pseudo_to_string (CRPseudo * a_this)
{
guchar *result = NULL;
- GString *str_buf = NULL;
g_return_val_if_fail (a_this, NULL);
- str_buf = g_string_new (NULL);
+ GString *str_buf = (GString *)g_string_new (NULL);
if (a_this->type == IDENT_PSEUDO) {
- guchar *name = NULL;
- if (a_this->name == NULL) {
+ if (a_this->name == NULL)
goto error;
- }
- name = g_strndup (a_this->name->stryng->str,
+ gchar *name = g_strndup (a_this->name->stryng->str,
a_this->name->stryng->len);
if (name) {
name = NULL;
}
} else if (a_this->type == FUNCTION_PSEUDO) {
- guchar *name = NULL,
- *arg = NULL;
+ gchar *arg = NULL;
if (a_this->name == NULL)
goto error;
- name = g_strndup (a_this->name->stryng->str,
+ gchar *name = g_strndup (a_this->name->stryng->str,
a_this->name->stryng->len);
if (a_this->extra) {
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
diff --git a/src/libcroco/cr-rgb.c b/src/libcroco/cr-rgb.c
index 4bda1968e25b5b45af3a2e614e2c40583f17bf4e..893c2080b6e27132306fa3fed9b5b754d455f1f5 100644 (file)
--- a/src/libcroco/cr-rgb.c
+++ b/src/libcroco/cr-rgb.c
CRRgb *
cr_rgb_new (void)
{
- CRRgb *result = NULL;
-
- result = g_try_malloc (sizeof (CRRgb));
+ CRRgb *result = (CRRgb *)g_try_malloc (sizeof (CRRgb));
if (result == NULL) {
cr_utils_trace_info ("No more memory");
guchar *
cr_rgb_to_string (CRRgb * a_this)
{
- guchar *result = NULL;
- GString *str_buf = NULL;
-
- str_buf = g_string_new (NULL);
+ gchar *result = NULL;
+ GString *str_buf = (GString *)g_string_new (NULL);
g_return_val_if_fail (str_buf, NULL);
if (a_this->is_percentage == 1) {
g_string_free (str_buf, FALSE);
}
- return result;
+ return (guchar *)result;
}
/**
g_return_val_if_fail (a_this && a_color_name, CR_BAD_PARAM_ERROR);
for (i = 0; i < sizeof (gv_standard_colors); i++) {
- if (!strcmp (a_color_name, gv_standard_colors[i].name)) {
+ if (!strcmp ((char *)a_color_name, gv_standard_colors[i].name)) {
cr_rgb_set_from_rgb (a_this, &gv_standard_colors[i]);
break;
}
g_return_val_if_fail (a_this && a_hex, CR_BAD_PARAM_ERROR);
- if (strlen (a_hex) == 3) {
+ if (strlen ((char *)a_hex) == 3) {
for (i = 0; i < 3; i++) {
if (a_hex[i] >= '0' && a_hex[i] <= '9') {
colors[i] = a_hex[i] - '0';
status = CR_UNKNOWN_TYPE_ERROR;
}
}
- } else if (strlen (a_hex) == 6) {
+ } else if (strlen ((char *)a_hex) == 6) {
for (i = 0; i < 6; i++) {
if (a_hex[i] >= '0' && a_hex[i] <= '9') {
colors[i / 2] <<= 4;
enum CRStatus
cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value)
{
- enum CRStatus status = CR_OK ;
- g_return_val_if_fail (a_this && a_value,
+ enum CRStatus status = CR_OK ;
+ g_return_val_if_fail (a_this && a_value,
CR_BAD_PARAM_ERROR) ;
switch(a_value->type) {
} else {
status = cr_rgb_set_from_name
(a_this,
- a_value->content.str->stryng->str) ;
+ (guchar *)a_value->content.str->stryng->str) ;
}
} else {
cr_utils_trace_info
&& a_value->content.str->stryng->str) {
status = cr_rgb_set_from_hex_str
(a_this,
- a_value->content.str->stryng->str) ;
+ (guchar *)a_value->content.str->stryng->str) ;
} else {
cr_utils_trace_info
("a_value has NULL string value") ;
g_return_val_if_fail (a_str, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str),
+ parser = cr_parser_new_from_buf ((guchar *)a_str, strlen ((char *)a_str),
a_enc, FALSE) ;
g_return_val_if_fail (parser, NULL);
diff --git a/src/libcroco/cr-rgb.h b/src/libcroco/cr-rgb.h
index f6b4e8aa17485d21160ca9416164e060820578ba..50cec94ecab7f04421e57ea09f9b094e3117faee 100644 (file)
--- a/src/libcroco/cr-rgb.h
+++ b/src/libcroco/cr-rgb.h
*Either NO_UNIT (integer) or
*UNIT_PERCENTAGE (percentage).
*/
- const guchar *name ;
+ const gchar *name ;
glong red ;
glong green ;
glong blue ;
gboolean is_percentage ;
- gboolean inherit ;
+ gboolean inherit ;
gboolean is_transparent ;
CRParsingLocation location ;
} ;
index 5f7316a005b436b4c0f5c7e79ddbd04c1d242940..d85b3effc3371df755dfcb61f1e4879ef32bd2b7 100644 (file)
CRSelector *
cr_selector_new (CRSimpleSel * a_simple_sel)
{
- CRSelector *result = NULL;
-
- result = g_try_malloc (sizeof (CRSelector));
+ CRSelector *result = (CRSelector *)g_try_malloc (sizeof (CRSelector));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
g_return_val_if_fail (a_char_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_char_buf, strlen (a_char_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_char_buf,
+ strlen ((char *)a_char_buf),
a_enc, FALSE);
g_return_val_if_fail (parser, NULL);
cr_selector_to_string (CRSelector * a_this)
{
guchar *result = NULL;
- GString *str_buf = NULL;
- str_buf = g_string_new (NULL);
+ GString *str_buf = (GString *)g_string_new (NULL);
g_return_val_if_fail (str_buf, NULL);
if (a_this) {
g_string_append (str_buf,
", ");
- g_string_append (str_buf, tmp_str);
+ g_string_append (str_buf, (gchar *)tmp_str);
g_free (tmp_str);
tmp_str = NULL;
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
index 1b941dab530d17456904e8d08dda5d8bffded6d5..18dd340d8ce622db85573a02d1d596c35c160039 100644 (file)
CRSimpleSel *
cr_simple_sel_new (void)
{
- CRSimpleSel *result = NULL;
-
- result = g_try_malloc (sizeof (CRSimpleSel));
+ CRSimpleSel *result = (CRSimpleSel *)g_try_malloc (sizeof (CRSimpleSel));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
str_buf = g_string_new (NULL);
for (cur = a_this; cur; cur = cur->next) {
if (cur->name) {
- guchar *str = g_strndup (cur->name->stryng->str,
+ gchar *str = g_strndup (cur->name->stryng->str,
cur->name->stryng->len);
if (str) {
}
if (cur->add_sel) {
- guchar *tmp_str = NULL;
- tmp_str = cr_additional_sel_to_string (cur->add_sel);
+ gchar *tmp_str = (gchar *)cr_additional_sel_to_string (cur->add_sel);
if (tmp_str) {
g_string_append (str_buf, tmp_str);
g_free (tmp_str);
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
str_buf = g_string_new (NULL);
if (a_this->name) {
- guchar *str = g_strndup (a_this->name->stryng->str,
+ gchar *str = g_strndup (a_this->name->stryng->str,
a_this->name->stryng->len);
if (str) {
}
if (a_this->add_sel) {
- guchar *tmp_str = NULL;
- tmp_str = cr_additional_sel_to_string (a_this->add_sel);
+ gchar *tmp_str = (gchar *)cr_additional_sel_to_string (a_this->add_sel);
if (tmp_str) {
g_string_append_printf
(str_buf, "%s", tmp_str);
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
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) ;
index 2529b72be72a9cd0a6d7960f5796abb4551da44b..7c656f54ddc72ce8d32311b59db1f59d4fce9a22 100644 (file)
--- a/src/libcroco/cr-string.c
+++ b/src/libcroco/cr-string.c
CRString *
cr_string_new (void)
{
- CRString *result = NULL ;
-
- result = g_try_malloc (sizeof (CRString)) ;
+ CRString *result = (CRString *)g_try_malloc (sizeof (CRString)) ;
if (!result) {
cr_utils_trace_info ("Out of memory") ;
return NULL ;
CRString *
cr_string_new_from_string (const gchar * a_string)
{
- CRString *result = NULL ;
-
- result = cr_string_new () ;
+ CRString *result = cr_string_new () ;
if (!result) {
cr_utils_trace_info ("Out of memory") ;
return NULL ;
CRString *
cr_string_new_from_gstring (GString *a_string)
{
- CRString *result = NULL ;
-
- result = cr_string_new () ;
+ CRString *result = cr_string_new () ;
if (!result) {
cr_utils_trace_info ("Out of memory") ;
return NULL ;
CRString *
cr_string_dup (CRString *a_this)
{
- CRString *result = NULL ;
g_return_val_if_fail (a_this, NULL) ;
- result = cr_string_new_from_gstring (a_this->stryng) ;
+ CRString *result = cr_string_new_from_gstring (a_this->stryng) ;
if (!result) {
cr_utils_trace_info ("Out of memory") ;
return NULL ;
index 789d68f42c34ea00bd9f6a65a3a1dc50160a90f8..82b2a2494658bee0af78ef1de7aa975818d996fc 100644 (file)
--- a/src/libcroco/cr-style.c
+++ b/src/libcroco/cr-style.c
typedef struct _CRPropertyDesc CRPropertyDesc;
struct _CRPropertyDesc {
- const guchar *name;
+ const gchar *name;
enum CRPropertyID prop_id;
};
{"font-size", PROP_ID_FONT_SIZE},
{"font-style", PROP_ID_FONT_STYLE},
{"font-weight", PROP_ID_FONT_WEIGHT},
- {"white-space", PROP_ID_WHITE_SPACE},
+ {"white-space", PROP_ID_WHITE_SPACE},
/*must be the last one */
- {NULL, 0}
+ {NULL, (CRPropertyID)0}
};
/**
{NUM_PROP_MARGIN_BOTTOM, "margin-bottom"},
{NUM_PROP_MARGIN_LEFT, "margin-left"},
{NUM_PROP_WIDTH, "width"},
- {0, NULL}
+ {(CRNumProp)0, NULL}
};
struct CRRgbPropEnumDumpInfo {
{RGB_PROP_BORDER_LEFT_COLOR, "left-color"},
{RGB_PROP_COLOR, "color"},
{RGB_PROP_BACKGROUND_COLOR, "background-color"},
- {0, NULL}
+ {(CRRgbProp)0, NULL}
};
struct CRBorderStylePropEnumDumpInfo {
{BORDER_STYLE_PROP_RIGHT, "border-style-right"},
{BORDER_STYLE_PROP_BOTTOM, "boder-style-bottom"},
{BORDER_STYLE_PROP_LEFT, "border-style-left"},
- {0, NULL}
+ {(CRBorderStyleProp)0, NULL}
};
static enum CRStatus
static const gchar *
num_prop_code_to_string (enum CRNumProp a_code)
{
- unsigned const len = sizeof (gv_num_props_dump_infos) /
+ int len = sizeof (gv_num_props_dump_infos) /
sizeof (struct CRNumPropEnumDumpInfo);
- if (a_code >= len) {
+ if ((int)a_code >= len) {
cr_utils_trace_info ("A field has been added "
"to 'enum CRNumProp' and no matching"
" entry has been "
static const gchar *
rgb_prop_code_to_string (enum CRRgbProp a_code)
{
- unsigned const len = sizeof (gv_rgb_props_dump_infos) /
+ int len = sizeof (gv_rgb_props_dump_infos) /
sizeof (struct CRRgbPropEnumDumpInfo);
- if (a_code >= len) {
+ if ((int)a_code >= len) {
cr_utils_trace_info ("A field has been added "
"to 'enum CRRgbProp' and no matching"
" entry has been "
static const gchar *
border_style_prop_code_to_string (enum CRBorderStyleProp a_code)
{
- unsigned const len = sizeof (gv_border_style_props_dump_infos) /
+ int len = sizeof (gv_border_style_props_dump_infos) /
sizeof (struct CRBorderStylePropEnumDumpInfo);
- if (a_code >= len) {
+ if ((int)a_code >= len) {
cr_utils_trace_info ("A field has been added "
"to 'enum CRBorderStyleProp' and no matching"
" entry has been "
cr_style_init_properties ();
}
- raw_id = g_hash_table_lookup (gv_prop_hash, a_prop);
+ raw_id = (gpointer *)g_hash_table_lookup (gv_prop_hash, a_prop);
if (!raw_id) {
return PROP_ID_NOT_KNOWN;
}
- return GPOINTER_TO_INT (raw_id);
+ return (CRPropertyID)GPOINTER_TO_INT (raw_id);
}
static enum CRStatus
if (a_value->content.str
&& a_value->content.str->stryng
&& a_value->content.str->stryng->str
- && !strncmp ((guchar *) "inherit",
+ && !strncmp ("inherit",
a_value->content.str->stryng->str,
sizeof ("inherit")-1)) {
status = cr_num_set (num_val, 0.0, NUM_INHERIT);
set_prop_border_width_from_value (CRStyle *a_style,
CRTerm *a_value)
{
- CRTerm *cur_term = NULL ;
- enum CRDirection direction = DIR_TOP ;
-
g_return_val_if_fail (a_style && a_value,
CR_BAD_PARAM_ERROR) ;
- cur_term = a_value ;
+ CRTerm *cur_term = a_value ;
if (!cur_term)
return CR_ERROR ;
- for (direction = DIR_TOP ;
- direction < NB_DIRS ; direction ++) {
- set_prop_border_x_width_from_value (a_style,
+ for (int dir = (int) DIR_TOP ;
+ dir < (int)NB_DIRS ; dir++) {
+ CRDirection direction = (CRDirection)dir;
+ set_prop_border_x_width_from_value (a_style,
cur_term,
direction) ;
}
set_prop_border_style_from_value (CRStyle *a_style,
CRTerm *a_value)
{
- CRTerm *cur_term = NULL ;
- enum CRDirection direction = DIR_TOP ;
-
g_return_val_if_fail (a_style && a_value,
CR_BAD_PARAM_ERROR) ;
- cur_term = a_value ;
+ CRTerm *cur_term = a_value ;
if (!cur_term || cur_term->type != TERM_IDENT) {
return CR_ERROR ;
}
- for (direction = DIR_TOP ;
- direction < NB_DIRS ;
- direction ++) {
+ for (int dir = (int)DIR_TOP ; dir < (int)NB_DIRS ; dir++)
+ {
+ CRDirection direction = (CRDirection)dir;
set_prop_border_x_style_from_value (a_style,
cur_term,
direction) ;
}
struct CRPropDisplayValPair {
- const guchar *prop_name;
+ const gchar *prop_name;
enum CRDisplayType type;
};
}
struct CRPropPositionValPair {
- const guchar *name;
+ const gchar *name;
enum CRPositionType type;
};
&& a_value->content.str->stryng->str) {
status = cr_rgb_set_from_name
(rgb_color,
- a_value->content.str->stryng->str);
+ (guchar *)a_value->content.str->stryng->str);
}
if (status != CR_OK) {
- cr_rgb_set_from_name (rgb_color, "black");
+ cr_rgb_set_from_name (rgb_color, (guchar *)"black");
}
} else if (a_value->type == TERM_RGB) {
if (a_value->content.rgb) {
static enum CRStatus
set_prop_border_from_value (CRStyle * a_style, CRTerm * a_value)
{
- enum CRDirection direction = 0;
-
g_return_val_if_fail (a_style && a_value, CR_BAD_PARAM_ERROR);
- for (direction = 0; direction < NB_DIRS; direction++) {
+ for (int direction = 0; direction < NB_DIRS; direction++) {
set_prop_border_x_from_value (a_style,
a_value,
- direction);
+ (CRDirection)direction);
}
return CR_OK;
set_prop_padding_from_value (CRStyle * a_style, CRTerm * a_value)
{
CRTerm *cur_term = NULL;
- enum CRDirection direction = 0;
enum CRStatus status = CR_OK;
g_return_val_if_fail (a_style && a_value, CR_BAD_PARAM_ERROR);
if (!cur_term)
return CR_ERROR ;
- for (direction = 0; direction < NB_DIRS; direction++) {
- set_prop_padding_x_from_value (a_style, cur_term, direction);
+ for (int direction = 0; direction < (int)NB_DIRS; direction++) {
+ set_prop_padding_x_from_value (a_style,
+ cur_term, (CRDirection)direction);
}
cur_term = cur_term->next;
set_prop_margin_from_value (CRStyle * a_style, CRTerm * a_value)
{
CRTerm *cur_term = NULL;
- enum CRDirection direction = 0;
enum CRStatus status = CR_OK;
g_return_val_if_fail (a_style && a_value, CR_BAD_PARAM_ERROR);
if (!cur_term)
return CR_OK;
- for (direction = 0; direction < NB_DIRS; direction++) {
- set_prop_margin_x_from_value (a_style, cur_term, direction);
+ for (int direction = 0; direction < (int)NB_DIRS; direction++) {
+ set_prop_margin_x_from_value(a_style,
+ cur_term, (CRDirection)direction);
}
cur_term = cur_term->next;
&& cur_term->content.str->stryng->str) {
cur_ff = cr_font_family_new
(FONT_FAMILY_NON_GENERIC,
- cur_term->content.str->stryng->str);
+ (guchar *)cur_term->content.str->stryng->str);
}
}
break;
a_style->white_space = WHITE_SPACE_NORMAL;
} else if (!strcmp (a_value->content.str->stryng->str,
"pre")) {
- a_style->font_weight = WHITE_SPACE_PRE;
+ a_style->white_space = WHITE_SPACE_PRE;
} else if (!strcmp (a_value->content.str->stryng->str,
"nowrap")) {
a_style->white_space = WHITE_SPACE_NOWRAP;
CRStyle *
cr_style_new (gboolean a_set_props_to_initial_values)
{
- CRStyle *result = NULL;
-
- result = g_try_malloc (sizeof (CRStyle));
+ CRStyle *result = (CRStyle *)g_try_malloc (sizeof (CRStyle));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
CR_BAD_PARAM_ERROR);
prop_id = cr_style_get_prop_id
- (a_decl->property->stryng->str);
+ ((guchar *)a_decl->property->stryng->str);
value = a_decl->value;
switch (prop_id) {
*before outputing it value
*/
cr_utils_dump_n_chars2 (' ', str, indent);
- tmp_str = (gchar *) num_prop_code_to_string (i);
+ tmp_str = (gchar *) num_prop_code_to_string ((CRNumProp)i);
if (tmp_str) {
g_string_append_printf (str, "%s: ", tmp_str);
} else {
}
/*loop over the rgb_props and to_string() them all */
for (i = RGB_PROP_BORDER_TOP_COLOR; i < NB_RGB_PROPS; i++) {
- tmp_str = (gchar *) rgb_prop_code_to_string (i);
+ tmp_str = (gchar *) rgb_prop_code_to_string ((CRRgbProp)i);
cr_utils_dump_n_chars2 (' ', str, indent);
if (tmp_str) {
g_string_append_printf (str, "%s: ", tmp_str);
}
/*loop over the border_style_props and to_string() them */
for (i = BORDER_STYLE_PROP_TOP; i < NB_BORDER_STYLE_PROPS; i++) {
- tmp_str = (gchar *) border_style_prop_code_to_string (i);
+ tmp_str = (gchar *)
+ border_style_prop_code_to_string ((CRBorderStyleProp)i);
cr_utils_dump_n_chars2 (' ', str, indent);
if (tmp_str) {
g_string_append_printf (str, "%s: ", tmp_str);
cr_utils_dump_n_chars2 (' ', str, indent);
g_string_append (str, "font-family: ");
- tmp_str = cr_font_family_to_string (a_this->font_family, TRUE);
+ tmp_str = (gchar *)cr_font_family_to_string (a_this->font_family, TRUE);
if (tmp_str) {
g_string_append (str, tmp_str);
g_free (tmp_str);
index 9aeb551e40e6055bf665476854c155596d0542f1..06b27fcab2811c07fef0a182af9e4be58f2cdf09 100644 (file)
CRStyleSheet *
cr_stylesheet_new (CRStatement * a_stmts)
{
- CRStyleSheet *result;
-
- result = g_try_malloc (sizeof (CRStyleSheet));
+ CRStyleSheet *result = (CRStyleSheet *)g_try_malloc (sizeof (CRStyleSheet));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
diff --git a/src/libcroco/cr-term.c b/src/libcroco/cr-term.c
index 33eed40f9b2aac1ce2917c059ca9f6d0dda5c0c6..63b39271b638ee78ea7ee2805c148eedf5b21339 100644 (file)
--- a/src/libcroco/cr-term.c
+++ b/src/libcroco/cr-term.c
CRTerm *
cr_term_new (void)
{
- CRTerm *result = NULL;
-
- result = g_try_malloc (sizeof (CRTerm));
+ CRTerm *result = (CRTerm *)g_try_malloc (sizeof (CRTerm));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
cr_term_parse_expression_from_buf (const guchar * a_buf,
enum CREncoding a_encoding)
{
- CRParser *parser = NULL;
CRTerm *result = NULL;
enum CRStatus status = CR_OK;
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
- a_encoding, FALSE);
+ CRParser *parser = cr_parser_new_from_buf (
+ (guchar*)a_buf,
+ strlen ((char *)a_buf),
+ a_encoding, FALSE);
g_return_val_if_fail (parser, NULL);
status = cr_parser_try_to_skip_spaces_and_comments (parser);
{
GString *str_buf = NULL;
CRTerm *cur = NULL;
- guchar *result = NULL,
- *content = NULL;
+ guchar *result = NULL;
+ gchar *content = NULL;
g_return_val_if_fail (a_this, NULL);
switch (cur->type) {
case TERM_NUMBER:
if (cur->content.num) {
- content = cr_num_to_string (cur->content.num);
+ content = (gchar *)cr_num_to_string (cur->content.num);
}
if (content) {
if (tmp_str) {
g_string_append (str_buf,
- tmp_str);
+ (gchar *)tmp_str);
g_free (tmp_str);
tmp_str = NULL;
}
case TERM_URI:
if (cur->content.str) {
content = g_strndup
- (cur->content.str->stryng->str,
- cur->content.str->stryng->len);
+ (cur->content.str->stryng->str,
+ cur->content.str->stryng->len);
}
if (content) {
tmp_str = cr_rgb_to_string (cur->content.rgb);
if (tmp_str) {
- g_string_append (str_buf, tmp_str);
+ g_string_append (str_buf, (gchar *)tmp_str);
g_free (tmp_str);
tmp_str = NULL;
}
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
cr_term_one_to_string (CRTerm * a_this)
{
GString *str_buf = NULL;
- guchar *result = NULL,
- *content = NULL;
+ guchar *result = NULL;
+ gchar *content = NULL;
g_return_val_if_fail (a_this, NULL);
switch (a_this->type) {
case TERM_NUMBER:
if (a_this->content.num) {
- content = cr_num_to_string (a_this->content.num);
+ content = (gchar *)cr_num_to_string (a_this->content.num);
}
if (content) {
case TERM_RGB:
if (a_this->content.rgb) {
- guchar *tmp_str = NULL;
g_string_append_printf (str_buf, "rgb(");
- tmp_str = cr_rgb_to_string (a_this->content.rgb);
+ gchar *tmp_str = (gchar *)cr_rgb_to_string (a_this->content.rgb);
if (tmp_str) {
g_string_append (str_buf, tmp_str);
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
index b591770f818d4d904bc29080e85b4cda7db815cc..4eb9db7a19a5c5d5c90af846f86e89ee282ba16e 100644 (file)
--- a/src/libcroco/cr-tknzr.c
+++ b/src/libcroco/cr-tknzr.c
*/
#define SKIP_CHARS(a_tknzr, a_nb_chars) \
{ \
-glong nb_chars = a_nb_chars ; \
+gulong nb_chars = a_nb_chars ; \
status = cr_input_consume_chars \
(PRIVATE (a_tknzr)->input,0, &nb_chars) ; \
CHECK_PARSING_STATUS (status, TRUE) ; \
}
if (cr_utils_is_white_space (cur_char) == TRUE) {
- glong nb_chars = -1; /*consume all spaces */
+ gulong nb_chars = -1; /*consume all spaces */
status = cr_input_consume_white_spaces
(PRIVATE (a_this)->input, &nb_chars);
status = cr_tknzr_parse_num (a_this, &num);
ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));
- red = num->val;
+ red = (glong)num->val;
cr_num_destroy (num);
num = NULL;
}
if (i == 0) {
- green = num->val;
+ green = (glong)num->val;
} else if (i == 1) {
- blue = num->val;
+ blue = (glong)num->val;
}
if (num) {
CRTknzr *
cr_tknzr_new (CRInput * a_input)
{
- CRTknzr *result = NULL;
-
- result = g_try_malloc (sizeof (CRTknzr));
+ CRTknzr *result = (CRTknzr *)g_try_malloc (sizeof (CRTknzr));
if (result == NULL) {
cr_utils_trace_info ("Out of memory");
memset (result, 0, sizeof (CRTknzr));
- result->priv = g_try_malloc (sizeof (CRTknzrPriv));
+ result->priv = (CRTknzrPriv *)g_try_malloc (sizeof (CRTknzrPriv));
if (result->priv == NULL) {
cr_utils_trace_info ("Out of memory");
enum CREncoding a_enc)
{
CRTknzr *result = NULL;
- CRInput *input = NULL;
-
- input = cr_input_new_from_uri (a_file_uri, a_enc);
+ CRInput *input = cr_input_new_from_uri ((gchar *)a_file_uri, a_enc);
g_return_val_if_fail (input != NULL, NULL);
result = cr_tknzr_new (input);
}
return cr_input_consume_chars (PRIVATE (a_this)->input,
- a_char, a_nb_char);
+ a_char, (gulong *)a_nb_char);
}
enum CRStatus
index d2bb492ef08481b6ff2adf199c2b86454fb6578e..af95751d029993e2f140636eaae8108764101319 100644 (file)
--- a/src/libcroco/cr-token.c
+++ b/src/libcroco/cr-token.c
CRToken *
cr_token_new (void)
{
- CRToken *result = NULL;
-
- result = g_try_malloc (sizeof (CRToken));
+ CRToken *result = (CRToken *)g_try_malloc (sizeof (CRToken));
if (result == NULL) {
cr_utils_trace_info ("Out of memory");