Code

clean up tabs and DOS-ishness
[inkscape.git] / src / libcroco / cr-rgb.c
index 4bda1968e25b5b45af3a2e614e2c40583f17bf4e..893c2080b6e27132306fa3fed9b5b754d455f1f5 100644 (file)
@@ -186,9 +186,7 @@ static CRRgb gv_standard_colors[] = {
 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");
@@ -236,10 +234,8 @@ cr_rgb_new_with_vals (gulong a_red, gulong a_green,
 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) {
@@ -267,7 +263,7 @@ cr_rgb_to_string (CRRgb * a_this)
                 g_string_free (str_buf, FALSE);
         }
 
-        return result;
+        return (guchar *)result;
 }
 
 /**
@@ -423,7 +419,7 @@ cr_rgb_set_from_name (CRRgb * a_this, const guchar * a_color_name)
         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;
                 }
@@ -446,7 +442,7 @@ cr_rgb_set_from_hex_str (CRRgb * a_this, const guchar * a_hex)
 
         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';
@@ -461,7 +457,7 @@ cr_rgb_set_from_hex_str (CRRgb * a_this, const guchar * a_hex)
                                 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;
@@ -499,8 +495,8 @@ cr_rgb_set_from_hex_str (CRRgb * a_this, const guchar * a_hex)
 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) {
@@ -522,7 +518,7 @@ cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value)
                        } 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 
@@ -535,7 +531,7 @@ cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value)
                     && 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") ;
@@ -586,7 +582,7 @@ CRRgb *cr_rgb_parse_from_buf (const guchar *a_str,
        
        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);