On Wed, Nov 14, 2007 at 07:29:09PM +0200, Bernd Jendrissek wrote:
> I put some stuff in this directory:
> 
> ftp://ftp.uunet.co.za/pub/incoming/berndj/gaf-cleanups/
> 
> Again, a git bundle (also based on
> 23ead18086e59aab22945c37ff95f49e5747f277), the equivalent output from
> git-log -p, and individual patches with git-format-patch.
> 
> The changes should be independently cherry-pickable.

> commit cd04a71b1d926cb35f47019d3d18297615e03be4
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Mon Sep 3 03:04:02 2007 +0200
> 
>     Quote '}' in comment so as not to confuse vim.
> 
> diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
> index b11e493..7c90032 100644
> --- a/libgeda/src/a_basic.c
> +++ b/libgeda/src/a_basic.c
> @@ -495,7 +495,7 @@ OBJECT *o_read_buffer(TOPLEVEL *toplevel, OBJECT 
> *object_list,
>          break;
>  
>        case(ENDATTACH_ATTR):
> -        /* this case is never hit, since the } is consumed by o_read_attribs 
> */
> +        /* this case is never hit, since the '}' is consumed by 
> o_read_attribs */
>          break;       
>  
>        case(INFO_FONT): 
> 
> commit 9884b44375875e245cb4b9843ada16e023c88ab5
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Mon Sep 3 03:02:34 2007 +0200
> 
>     Remove unneeded casts.
> 
> diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
> index 5b8c679..bfe5e12 100644
> --- a/libgeda/src/o_text_basic.c
> +++ b/libgeda/src/o_text_basic.c
> @@ -200,7 +200,7 @@ OBJECT *o_text_load_font(TOPLEVEL *toplevel, gunichar 
> needed_char)
>    }
>  
>    /* Make new object for the font set list */
> -  o_font_set = (OBJECT*)g_new (OBJECT, 1);   
> +  o_font_set = g_new (OBJECT, 1);    
>    
>    o_font_set->font_prim_objs = NULL;
>    o_font_set->font_text_size = 100;
> diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
> index 6506685..7b5350f 100644
> --- a/libgeda/src/s_page.c
> +++ b/libgeda/src/s_page.c
> @@ -70,7 +70,7 @@ PAGE *s_page_new (TOPLEVEL *toplevel, const gchar *filename)
>    PAGE *page;
>  
>    /* Now create a blank page */
> -  page = (PAGE*)g_new0 (PAGE, 1);
> +  page = g_new0 (PAGE, 1);
>  
>    page->pid = global_pid++;
>  
> diff --git a/libgeda/src/s_toplevel.c b/libgeda/src/s_toplevel.c
> index e97a298..8048411 100644
> --- a/libgeda/src/s_toplevel.c
> +++ b/libgeda/src/s_toplevel.c
> @@ -56,7 +56,7 @@ TOPLEVEL *s_toplevel_new (void)
>  {
>    TOPLEVEL *toplevel;
>  
> -  toplevel = (TOPLEVEL*)g_new (TOPLEVEL, 1);
> +  toplevel = g_new (TOPLEVEL, 1);
>  
>    toplevel->current_attribute = NULL;
>    toplevel->internal_symbol_name = NULL;
> 
> commit 0faf9172a07d93d7dfc118ffe552c40750d50ad6
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Sep 2 00:39:35 2007 +0200
> 
>     Fix typo in comment.
> 
> diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
> index e0b478b..68e9fe2 100644
> --- a/libgeda/src/o_complex_basic.c
> +++ b/libgeda/src/o_complex_basic.c
> @@ -98,7 +98,7 @@ int world_get_single_object_bounds(TOPLEVEL *toplevel, 
> OBJECT *o_current,
>  }
>  
>  /*! \brief Return the bounds of the given list of objects.
> - *  \par Given a list of objects, calcule the bounds coordinates.
> + *  \par Given a list of objects, calculate the bounds coordinates.
>   *  \param [in] toplevel The toplevel structure.
>   *  \param [in] complex   The list of objects to look the bounds for.
>   *  \param [out] left   pointer to the left coordinate of the object.
> 
> commit 4a502fb7b145564763724bce92dfc4642ffe9ddd
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Sep 2 00:38:25 2007 +0200
> 
>     Fix test field formatting (expected exit code).
> 
> diff --git a/gnetlist/tests/spice-sdb/tests.list 
> b/gnetlist/tests/spice-sdb/tests.list
> index dfc9d69..833876c 100644
> --- a/gnetlist/tests/spice-sdb/tests.list
> +++ b/gnetlist/tests/spice-sdb/tests.list
> @@ -24,7 +24,7 @@ JD | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | |
>  JD_Include | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | -I
>  JD_Sort | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | -s
>  # Now test non-munged version.
> -JD_nomunge | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | | -n
> +JD_nomunge | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | -n
>  JD_Include_nomunge | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | -I 
> -n
>  JD_Sort_nomunge | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | -s -n
>  JD_nomunge_longopt | LVDfoo.sch | gafrc models/openIP_5.cir sym/LVD.sym | 
> --nomunge | | HAVE_GETOPT_LONG
> 
> commit c39639d921f55bfd4a8b8694f8c97efe978b57d9
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Sep 2 00:38:00 2007 +0200
> 
>     Invert sense of 'if' to 'if test ... -eq ...'.  FAILs typo'd tests.
> 
> diff --git a/gnetlist/tests/spice-sdb/run_tests.sh 
> b/gnetlist/tests/spice-sdb/run_tests.sh
> index fe10f64..2fb818c 100755
> --- a/gnetlist/tests/spice-sdb/run_tests.sh
> +++ b/gnetlist/tests/spice-sdb/run_tests.sh
> @@ -179,7 +179,10 @@ for t in $all_tests ; do
>      echo "${GNETLIST} -g spice-sdb $args $schematics"
>      cd ${rundir} && ${GNETLIST} -g spice-sdb $args $schematics 
>      rc=$?
> -    if test $rc -ne $code ; then
> +    if test $rc -eq "$code" ; then
> +     # PASS only if $? is what we expect, AND $rc and $code are numbers.
> +     :
> +    else
>       echo "FAILED:  gnetlist -g spice-sdb returned $rc which did not match 
> the expected $code"
>       fail=`expr $fail + 1`
>       continue
> 
> commit 1834bdc4965194b687b4319afd1027743154c2a1
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Aug 26 21:39:59 2007 +0200
> 
>     Delete bad comment.
> 
> diff --git a/libgeda/configure.ac b/libgeda/configure.ac
> index eefcc2d..84daf5b 100644
> --- a/libgeda/configure.ac
> +++ b/libgeda/configure.ac
> @@ -337,10 +337,6 @@ AC_C_CONST
>  AC_TYPE_SIGNAL
>  AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf chown)
>  
> -# 
> -# Checks for header files end
> -#########################################################################
> -
>  #########################################################################
>  #
>  
> 
> commit ecbc6d3beb84e86e25dd22cf587d21b1bbeacabb
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Aug 26 21:39:14 2007 +0200
> 
>     LIBGEDA_USE_GUILE: Automake conditional.
>     
>     If libguile is available, collect guile-specific files in
>     $(libgeda_scheme_CFILES).  Libguile is still mandatory, but this
>     patch makes that decision easier to change.
> 
> diff --git a/libgeda/configure.ac b/libgeda/configure.ac
> index 68b5267..eefcc2d 100644
> --- a/libgeda/configure.ac
> +++ b/libgeda/configure.ac
> @@ -82,8 +82,15 @@ AC_MSG_RESULT($GUILE_VERSION)
>  if test $guile_need_major -gt $guile_major \
>     || test $guile_need_minor -gt $guile_minor; then
>    AC_MSG_ERROR([Guile version >= $guile_need_version is required.])
> +  guile_whitelisted=no
> +else
> +  guile_whitelisted=yes
> +  AC_DEFINE(LIBGEDA_USE_GUILE, 1,
> +         [Define if you are using Guile as an extension language])
>  fi
>  
> +AM_CONDITIONAL(LIBGEDA_USE_GUILE, test x$guile_whitelisted = xyes)
> +
>  # Guile 1.6 compatability
>  
>  AC_CHECK_DECLS([scm_is_string, scm_is_integer, scm_to_int,
> diff --git a/libgeda/src/Makefile.am b/libgeda/src/Makefile.am
> index 3015c90..bdd12c6 100644
> --- a/libgeda/src/Makefile.am
> +++ b/libgeda/src/Makefile.am
> @@ -12,8 +12,15 @@ endif
>  # Build a libtool library, libhello.la for installation in libdir.
>  lib_LTLIBRARIES = libgeda.la
>  
> +if LIBGEDA_USE_GUILE
> +libgeda_scheme_CFILES = \
> +     g_basic.c g_smob.c g_register.c g_rc.c
> +else
> +libgeda_scheme_CFILES =
> +endif
> +
>  libgeda_la_SOURCES = \
> -     a_basic.c f_basic.c f_print.c g_basic.c m_basic.c \
> +     a_basic.c f_basic.c f_print.c m_basic.c \
>       o_arc_basic.c o_attrib.c o_basic.c o_box_basic.c \
>       o_circle_basic.c o_complex_basic.c o_line_basic.c o_list.c \
>       o_net_basic.c o_selection.c o_bus_basic.c o_text_basic.c \
> @@ -22,9 +29,9 @@ libgeda_la_SOURCES = \
>       s_clib.c s_encoding.c s_hierarchy.c s_papersizes.c s_stretch.c \
>       s_log.c s_textbuffer.c \
>       s_page.c s_slib.c s_color.c s_undo.c s_conn.c \
> -     s_cue.c s_tile.c s_menu.c s_toplevel.c g_smob.c libgeda.c \
> -     g_register.c g_rc.c i_vars.c o_picture.c gdk-pixbuf-hacks.c \
> -     geda_list.c
> +     s_cue.c s_tile.c s_menu.c s_toplevel.c libgeda.c \
> +     i_vars.c o_picture.c gdk-pixbuf-hacks.c \
> +     geda_list.c $(libgeda_scheme_CFILES)
>  
>  INCLUDES = -I$(top_srcdir)/include @LIBGEDA_CFLAGS@
>  libgeda_la_LDFLAGS = @LIBTOOL_FLAGS@ @LIBGEDA_LDFLAGS@
> 
> commit 983996e01c1ae8b621e16d253a12b0e94a58be28
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Aug 26 21:20:29 2007 +0200
> 
>     Let awk grep for /gettext/.
> 
> diff --git a/gschem/autogen.sh b/gschem/autogen.sh
> index ffefb13..593782c 100755
> --- a/gschem/autogen.sh
> +++ b/gschem/autogen.sh
> @@ -81,7 +81,7 @@ esac
>  # Create the configure.ac from the configure.ac.in file.  
>  # The below line to get the gettext version isn't the most robust construct
>  # because if gettext changes its version output format, this will break.
> -installed_gettext_version=`gettext --version | grep gettext | awk '{print 
> $4}'`
> +installed_gettext_version=`gettext --version | awk '/gettext/ {print $4}'`
>  cat $configure_script | \
>    sed "s/%INSTALLED_GETTEXT_VERSION%/$installed_gettext_version/" > 
> configure.ac
>  configure_script=configure.ac
> 
> commit e91dd66d22fd98ec3b9d44559c3d8956998c9b1e
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Aug 26 21:16:08 2007 +0200
> 
>     Remove unneeded casts.
> 
> diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
> index 0c4d85d..7f0898a 100644
> --- a/libgeda/src/o_attrib.c
> +++ b/libgeda/src/o_attrib.c
> @@ -523,44 +523,44 @@ void o_save_attribs(FILE *fp, GList *attribs)
>        switch (o_current->type) {
>  
>          case(OBJ_LINE):
> -          out = (char *) o_line_save(o_current);
> +          out = o_line_save(o_current);
>            break;
>  
>          case(OBJ_NET):
> -          out = (char *) o_net_save(o_current);
> +          out = o_net_save(o_current);
>            break;
>  
>          case(OBJ_BUS):
> -          out = (char *) o_bus_save(o_current);
> +          out = o_bus_save(o_current);
>            break;
>  
>          case(OBJ_BOX):
> -          out = (char *) o_box_save(o_current);
> +          out = o_box_save(o_current);
>            break;
>               
>          case(OBJ_CIRCLE):
> -          out = (char *) o_circle_save(o_current);
> +          out = o_circle_save(o_current);
>            break;
>  
>          case(OBJ_COMPLEX):
>          case(OBJ_PLACEHOLDER):  /* new type -- SDB 1.20.2005 */
> -          out = (char *) o_complex_save(o_current);
> +          out = o_complex_save(o_current);
>            break;
>  
>          case(OBJ_TEXT):
> -          out = (char *) o_text_save(o_current);
> +          out = o_text_save(o_current);
>            break;
>  
>          case(OBJ_PIN):
> -          out = (char *) o_pin_save(o_current);
> +          out = o_pin_save(o_current);
>            break;
>  
>          case(OBJ_ARC):
> -          out = (char *) o_arc_save(o_current);
> +          out = o_arc_save(o_current);
>            break;
>  
>       case(OBJ_PICTURE):
> -       out = (char *) o_picture_save(o_current); 
> +       out = o_picture_save(o_current); 
>         break;
>  
>          default:
> 
> commit da4324c1271dc8671259b741fad1941beced34fe
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Aug 26 21:15:24 2007 +0200
> 
>     Quote braces in comments so vim doesn't get confused.
> 
> diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
> index 72cfe87..27b9c94 100644
> --- a/libgeda/src/s_basic.c
> +++ b/libgeda/src/s_basic.c
> @@ -849,13 +849,13 @@ char *expand_env_variables(char *string)
>  
>        }
>  
> -      /* the > 1 bit is so that we don't store the { */
> +      /* The > 1 bit is so that we don't store the '{'. */
>        if (found_dollar && found_lbrac && (count > 1)) {
>          wanted_var[j] = return_string[i];
>          j++; /* check for size */
>        }
>  
> -      /* skip over initial { */ 
> +      /* Skip over initial '{' */ 
>        count++;
>  
>        if (found_rbrac && !found_lbrac) {
> 
> commit f20a49641ae008df02586c6e6275c58d38ecca75
> Author: Bernd Jendrissek <[EMAIL PROTECTED]>
> Date:   Sun Aug 26 20:37:06 2007 +0200
> 
>     Don't leak memory on improper attributes.
> 
> diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
> index c2c56ba..0c4d85d 100644
> --- a/libgeda/src/o_attrib.c
> +++ b/libgeda/src/o_attrib.c
> @@ -639,20 +639,16 @@ int o_attrib_get_name_value(char *string, char 
> **name_ptr, char **value_ptr )
>  
>    str_array = g_strsplit (string, "=", 2);
>    
> +  if (str_array[1] && str_array[1][0] == '\0') {
> +    s_log_message("Found an improper attribute: _%s_\n", string);
> +    return(FALSE);
> +  }
> +
>    *name_ptr = g_strdup(str_array[0]);
>    *value_ptr = g_strdup(str_array[1]);
>    g_strfreev(str_array);
>    
> -  if (*value_ptr && (*value_ptr)[0] == '\0') {
> -    s_log_message("Found an improper attribute: _%s_\n", string);
> -#if 0 /* for now leak this memory till this is verified correct everywhere */
> -    g_free(*name_ptr); *name_ptr = NULL;
> -    g_free(*value_ptr); *value_ptr = NULL;
> -#endif
> -    return(FALSE);
> -  } else {
> -    return(TRUE);
> -  }
> +  return(TRUE);
>  }
>  

That's not my call but I certainly prefer omitting prentheses
around the value of return statements. 

Since the majority of return statements (at least in libgeda/src) 
avoid these useless parentheses, it might be a good idea to remove 
these superfluous (and ugly IMO) decorators whenever a patch affects
return statements.

        Regards,
        Gabriel


_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to