[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-14-ge7fe069)



The branch, master has been updated
       via  e7fe069ae882f8c0d398cac1b426b8a7df6fff53 (commit)
      from  1cb0094c404926fa28cdc1968041f14b4c1e4779 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 libgeda/src/s_color.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)


=================
 Commit Messages
=================

commit e7fe069ae882f8c0d398cac1b426b8a7df6fff53
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:08:35 2008 +0000

    libgeda: Fix s_color_rgba_decode() to default the alpha channel
    
    Fixes cases where the colour map doesn't specify an alpha.
    
    Signed-off-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

:100644 100644 877d492... 1d266ff... M	libgeda/src/s_color.c

=========
 Changes
=========

commit e7fe069ae882f8c0d398cac1b426b8a7df6fff53
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:08:35 2008 +0000

    libgeda: Fix s_color_rgba_decode() to default the alpha channel
    
    Fixes cases where the colour map doesn't specify an alpha.
    
    Signed-off-by: Peter TB Brett <peter@xxxxxxxxxxxxx>

diff --git a/libgeda/src/s_color.c b/libgeda/src/s_color.c
index 877d492..1d266ff 100644
--- a/libgeda/src/s_color.c
+++ b/libgeda/src/s_color.c
@@ -136,35 +136,35 @@ s_color_rgba_decode (const gchar *rgba,
   gint len, i;
   gchar c;
 
+  /* Default to solid white */
+  *r = 0xff; *g = 0xff; *b = 0xff; *a = 0xff;
+
   /* Check that the string is a valid length and starts with a '#' */
   len = strnlen (rgba, 10);
-  if ((len != 9 && len != 7) || rgba[0] != '#') goto rgba_decode_err;
+  if ((len != 9 && len != 7) || rgba[0] != '#')
+    return FALSE;
 
   /* Check we only have [0-9a-fA-F] */
   for (i = 1; i < len; i++) {
     c = rgba[i];
     if ((c < '0' || c > '9')
         && (c < 'a' || c > 'f')
-        && (c < 'A' || c > 'F')) {
-      goto rgba_decode_err;
-    }
+        && (c < 'A' || c > 'F'))
+      return FALSE;
   }
 
   /* Use sscanf to extract values */
   c = sscanf (rgba + 1, "%2hhx%2hhx%2hhx", r, g, b);
-  if (c != 3) goto rgba_decode_err;
+  if (c != 3)
+    return FALSE;
 
   if (len == 9) {
     c = sscanf (rgba + 7, "%2hhx", a);
-  if (c != 1) goto rgba_decode_err;
+    if (c != 1)
+      return FALSE;
   }
 
   return TRUE;
-
- rgba_decode_err:
-  /* Default to solid white */
-  *r = 0xff; *g = 0xff; *b = 0xff; *a = 0xff;
-  return FALSE;
 }
 
 /* \brief Encode a hexadecimal RGB or RGBA color code.




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs