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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-331-g27ce6d5)



The branch, master has been updated
       via  27ce6d5531d9dac2bf6c1933df6ba6ff88c3d2ae (commit)
      from  ae116565a078a4f781ca5c32944d0b8193d1c3d2 (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/o_box_basic.c  |   54 ++++++++++++++++++++++----------------------
 libgeda/src/o_bus_basic.c  |   36 +++++++++++------------------
 libgeda/src/o_line_basic.c |   53 ++++++++++++++++++------------------------
 libgeda/src/o_net_basic.c  |   28 +++++++++-------------
 libgeda/src/o_pin_basic.c  |   43 ++++++++++++++--------------------
 5 files changed, 93 insertions(+), 121 deletions(-)


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

commit 27ce6d5531d9dac2bf6c1933df6ba6ff88c3d2ae
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 7 17:13:04 2008 +0000

    o_..._read(): Remove redundant variable assignemnt and tidy whitespace.

:100644 100644 6d16e55... 7080c4c... M	libgeda/src/o_box_basic.c
:100644 100644 d0796f8... 7793276... M	libgeda/src/o_bus_basic.c
:100644 100644 c0fab50... b39e2eb... M	libgeda/src/o_line_basic.c
:100644 100644 a7916e6... d475b68... M	libgeda/src/o_net_basic.c
:100644 100644 6d24e11... df11edc... M	libgeda/src/o_pin_basic.c

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

commit 27ce6d5531d9dac2bf6c1933df6ba6ff88c3d2ae
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 7 17:13:04 2008 +0000

    o_..._read(): Remove redundant variable assignemnt and tidy whitespace.

diff --git a/libgeda/src/o_box_basic.c b/libgeda/src/o_box_basic.c
index 6d16e55..7080c4c 100644
--- a/libgeda/src/o_box_basic.c
+++ b/libgeda/src/o_box_basic.c
@@ -246,8 +246,8 @@ void o_box_modify(TOPLEVEL *toplevel, OBJECT *object,
  *  \param [in]     fileformat_ver  libgeda file format version number.
  *  \return The BOX OBJECT that was created.
  */
-OBJECT *o_box_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
-		   unsigned int release_ver, unsigned int fileformat_ver)
+OBJECT *o_box_read (TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
+                    unsigned int release_ver, unsigned int fileformat_ver)
 {
   OBJECT *new_obj;
   char type; 
@@ -261,8 +261,8 @@ OBJECT *o_box_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
   int box_end;
   int box_type;
   int box_filling;
-  
-  if(release_ver <= VERSION_20000704) {
+
+  if (release_ver <= VERSION_20000704) {
 
   /*! \note
    *  The old geda file format, i.e. releases 20000704 and older, does not
@@ -270,22 +270,22 @@ OBJECT *o_box_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
    *  to default.
    */
 
-    sscanf(buf, "%c %d %d %d %d %d\n",
-	   &type, &x1, &y1, &width, &height, &color);
+    sscanf (buf, "%c %d %d %d %d %d\n",
+            &type, &x1, &y1, &width, &height, &color);
 
     box_width   = 0;
     box_end     = END_NONE;
     box_type    = TYPE_SOLID;
     box_length  = -1;
     box_space   = -1;
-    
-    box_filling = FILLING_HOLLOW;		
+
+    box_filling = FILLING_HOLLOW;
     fill_width  = 0;
     angle1      = -1;
     pitch1      = -1;
     angle2      = -1;
     pitch2      = -1;
-			  
+
   } else {
 
     /*! \note
@@ -293,24 +293,24 @@ OBJECT *o_box_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
      *  characters and numbers in plain ASCII on a single line. The meaning of
      *  each item is described in the file format documentation.
      */
-    sscanf(buf, "%c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
-	   &type, &x1, &y1, &width, &height, &color,
-	   &box_width, &box_end, &box_type, &box_length, 
-	   &box_space, &box_filling,
-	   &fill_width, &angle1, &pitch1, &angle2, &pitch2);
+    sscanf (buf, "%c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
+            &type, &x1, &y1, &width, &height, &color,
+            &box_width, &box_end, &box_type, &box_length,
+            &box_space, &box_filling,
+            &fill_width, &angle1, &pitch1, &angle2, &pitch2);
   }
 
   if (width == 0 || height == 0) {
-    s_log_message(_("Found a zero width/height box [ %c %d %d %d %d %d ]\n"),
-                  type, x1, y1, width, height, color);
+    s_log_message (_("Found a zero width/height box [ %c %d %d %d %d %d ]\n"),
+                   type, x1, y1, width, height, color);
   }
 
   if (color < 0 || color > MAX_COLORS) {
-    s_log_message(_("Found an invalid color [ %s ]\n"), buf);
-    s_log_message(_("Setting color to WHITE\n"));
+    s_log_message (_("Found an invalid color [ %s ]\n"), buf);
+    s_log_message (_("Setting color to WHITE\n"));
     color = WHITE;
   }
-  
+
   /*! \note
    *  A box is internally described by its lower right and upper left corner
    *  whereas the line describe it with the lower left corner and the width
@@ -323,14 +323,14 @@ OBJECT *o_box_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
 
   /* upper left corner of the box */
   d_x1 = x1;
-  d_y1 = y1+height; /* move box origin to top left */
-  
+  d_y1 = y1 + height; /* move box origin to top left */
+
   /* lower right corner of the box */
-  d_x2 = x1+width; /* end points of the box */
+  d_x2 = x1 + width;  /* end points of the box */
   d_y2 = y1;
-  
+
   /* create a new box */
-  new_obj = o_box_new(toplevel, type, color, d_x1, d_y1, d_x2, d_y2);
+  new_obj = o_box_new (toplevel, type, color, d_x1, d_y1, d_x2, d_y2);
   /* set its line options */
   o_set_line_options (toplevel, new_obj,
                       box_end, box_type, box_width,
@@ -340,8 +340,8 @@ OBJECT *o_box_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
                       box_filling, fill_width,
                       pitch1, angle1, pitch2, angle2);
   /* Add the box to the object list */
-  object_list = s_basic_link_object(new_obj, object_list);
-  return(object_list);
+  object_list = s_basic_link_object (new_obj, object_list);
+  return object_list;
 }
 
 /*! \brief Create a character string representation of a BOX.
@@ -349,7 +349,7 @@ OBJECT *o_box_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
  *  This function formats a string in the buffer <B>*buff</B> to describe the
  *  box object <B>*object</B>.
  *  It follows the post-20000704 release file format that handle the line type
- *  and fill options. 
+ *  and fill options.
  *
  *  \param [in] object  The BOX OBJECT to create string from.
  *  \return A pointer to the BOX character string.
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index d0796f8..7793276 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -142,33 +142,26 @@ void o_bus_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
  *  \param [in] fileformat_ver a integer value of the file format
  *  \return The object list
  */
-OBJECT *o_bus_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
-		   unsigned int release_ver, unsigned int fileformat_ver)
+OBJECT *o_bus_read (TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
+                    unsigned int release_ver, unsigned int fileformat_ver)
 {
   OBJECT *new_obj;
   char type; 
   int x1, y1;
   int x2, y2;
-  int d_x1, d_y1;
-  int d_x2, d_y2;
   int color;
   int ripper_dir;
 
-  if(release_ver <= VERSION_20020825) {
-    sscanf(buf, "%c %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color);
+  if (release_ver <= VERSION_20020825) {
+    sscanf (buf, "%c %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color);
     ripper_dir = 0;
   } else {
-    sscanf(buf, "%c %d %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color,
-           &ripper_dir);
+    sscanf (buf, "%c %d %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color,
+            &ripper_dir);
   }
-    
-  d_x1 = x1; 
-  d_y1 = y1; 
-  d_x2 = x2; 
-  d_y2 = y2; 
 
   if (x1 == x2 && y1 == y2) {
-    s_log_message(_("Found a zero length bus [ %c %d %d %d %d %d ]\n"),
+    s_log_message (_("Found a zero length bus [ %c %d %d %d %d %d ]\n"),
                     type, x1, y1, x2, y2, color);
   }
 
@@ -177,23 +170,22 @@ OBJECT *o_bus_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
   }
 
   if (color < 0 || color > MAX_COLORS) {
-    s_log_message(_("Found an invalid color [ %s ]\n"), buf);
-    s_log_message(_("Setting color to WHITE\n"));
+    s_log_message (_("Found an invalid color [ %s ]\n"), buf);
+    s_log_message (_("Setting color to WHITE\n"));
     color = WHITE;
   }
 
   if (ripper_dir < -1 || ripper_dir > 1) {
-    s_log_message(_("Found an invalid bus ripper direction [ %s ]\n"), buf);
-    s_log_message(_("Resetting direction to neutral (no direction)\n"));
+    s_log_message (_("Found an invalid bus ripper direction [ %s ]\n"), buf);
+    s_log_message (_("Resetting direction to neutral (no direction)\n"));
     ripper_dir = 0;
   }
 
-  new_obj = o_bus_new(toplevel, type, color,
-                      d_x1, d_y1, d_x2, d_y2, ripper_dir);
+  new_obj = o_bus_new (toplevel, type, color, x1, y1, x2, y2, ripper_dir);
 
-  object_list = s_basic_link_object(new_obj, object_list);
+  object_list = s_basic_link_object (new_obj, object_list);
 
-  return(object_list);
+  return object_list;
 }
 
 /*! \brief Create a string representation of the bus object
diff --git a/libgeda/src/o_line_basic.c b/libgeda/src/o_line_basic.c
index c0fab50..b39e2eb 100644
--- a/libgeda/src/o_line_basic.c
+++ b/libgeda/src/o_line_basic.c
@@ -223,28 +223,26 @@ void o_line_modify(TOPLEVEL *toplevel, OBJECT *object,
  *  \param [in]  fileformat_ver  libgeda file format version number.
  *  \return A pointer to the new line object.
  */
-OBJECT *o_line_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
-		    unsigned int release_ver, unsigned int fileformat_ver)
+OBJECT *o_line_read (TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
+                     unsigned int release_ver, unsigned int fileformat_ver)
 {
   OBJECT *new_obj;
-  char type; 
+  char type;
   int x1, y1;
   int x2, y2;
-  int d_x1, d_y1;
-  int d_x2, d_y2;
   int line_width, line_space, line_length;
   int line_end;
   int line_type;
   int color;
 
-  if(release_ver <= VERSION_20000704) {
+  if (release_ver <= VERSION_20000704) {
     /*
      * The old geda file format, i.e. releases 20000704 and older, does
      * not handle the line type and the filling - here filling is irrelevant.
      * They are set to default.
      */
-    sscanf(buf, "%c %d %d %d %d %d\n", &type,
-	   &x1, &y1, &x2, &y2, &color);
+    sscanf (buf, "%c %d %d %d %d %d\n", &type,
+            &x1, &y1, &x2, &y2, &color);
 
     line_width = 0;
     line_end   = END_NONE;
@@ -257,16 +255,11 @@ OBJECT *o_line_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
      * list of characters and numbers in plain ASCII on a single line.
      * The meaning of each item is described in the file format documentation.
      */
-    sscanf(buf, "%c %d %d %d %d %d %d %d %d %d %d\n", &type,
-	   &x1, &y1, &x2, &y2, &color,
-	   &line_width, &line_end, &line_type, &line_length, &line_space);
+    sscanf (buf, "%c %d %d %d %d %d %d %d %d %d %d\n", &type,
+            &x1, &y1, &x2, &y2, &color,
+            &line_width, &line_end, &line_type, &line_length, &line_space);
   }
-  
-  d_x1 = x1; /* \todo PB : Needed ? */
-  d_y1 = y1; 
-  d_x2 = x2; 
-  d_y2 = y2; 
-    
+
   /*
    * Null length line are not allowed. If such a line is detected a
    * message is issued.
@@ -274,13 +267,13 @@ OBJECT *o_line_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
    * It also checks is the required color is valid.
    */
   if (x1 == x2 && y1 == y2) {
-    s_log_message(_("Found a zero length line [ %c %d %d %d %d %d ]\n"),
-                  type, x1, y1, x2, y2, color);
+    s_log_message (_("Found a zero length line [ %c %d %d %d %d %d ]\n"),
+                   type, x1, y1, x2, y2, color);
   }
-  
+
   if (color < 0 || color > MAX_COLORS) {
-    s_log_message(_("Found an invalid color [ %s ]\n"), buf);
-    s_log_message(_("Setting color to WHITE\n"));
+    s_log_message (_("Found an invalid color [ %s ]\n"), buf);
+    s_log_message (_("Setting color to WHITE\n"));
     color = WHITE;
   }
 
@@ -290,18 +283,18 @@ OBJECT *o_line_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
    * type is set according to the values of the fields on the line.
    */
   /* create and add the line to the list */
-  new_obj = o_line_new(toplevel, type, color, d_x1, d_y1, d_x2, d_y2);
+  new_obj = o_line_new (toplevel, type, color, x1, y1, x2, y2);
   /* set its line options */
-  o_set_line_options(toplevel, new_obj,
-		     line_end, line_type, line_width, line_length, 
-		     line_space);
+  o_set_line_options (toplevel, new_obj,
+                      line_end, line_type, line_width, line_length,
+                      line_space);
   /* filling is irrelevant for line, just set to default */
-  o_set_fill_options(toplevel, new_obj,
-		     FILLING_HOLLOW, -1, -1, -1, -1, -1);
+  o_set_fill_options (toplevel, new_obj,
+                      FILLING_HOLLOW, -1, -1, -1, -1, -1);
 
-  object_list = s_basic_link_object(new_obj, object_list);
+  object_list = s_basic_link_object (new_obj, object_list);
 
-  return(object_list);
+  return object_list;
 }
 
 /*! \brief Create a character string representation of a line OBJECT.
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index a7916e6..d475b68 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -130,7 +130,7 @@ void o_net_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
  *  This function reads a net object from the buffer \a buf.
  *  If the netobject was read successfully, a new net object is
  *  allocated and appended to the \a object_list.
- *  
+ *
  *  \param [in] toplevel     The TOPLEVEL object
  *  \param [in] object_list  list of OBJECTS to append a new net
  *  \param [in] buf          a text buffer (usually a line of a schematic file)
@@ -139,26 +139,20 @@ void o_net_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
  *  \return The object list
  *
  */
-OBJECT *o_net_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
-		   unsigned int release_ver, unsigned int fileformat_ver)
+OBJECT *o_net_read (TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
+                    unsigned int release_ver, unsigned int fileformat_ver)
 {
   OBJECT *new_obj;
   char type;
   int x1, y1;
   int x2, y2;
-  int d_x1, d_y1;
-  int d_x2, d_y2;
   int color;
 
-  sscanf(buf, "%c %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color);
-  d_x1 = x1;
-  d_y1 = y1;
-  d_x2 = x2;
-  d_y2 = y2;
+  sscanf (buf, "%c %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color);
 
   if (x1 == x2 && y1 == y2) {
-    s_log_message(_("Found a zero length net [ %c %d %d %d %d %d ]\n"),
-                  type, x1, y1, x2, y2, color);
+    s_log_message (_("Found a zero length net [ %c %d %d %d %d %d ]\n"),
+                   type, x1, y1, x2, y2, color);
   }
 
 
@@ -167,16 +161,16 @@ OBJECT *o_net_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
   }
 
   if (color < 0 || color > MAX_COLORS) {
-    s_log_message(_("Found an invalid color [ %s ]\n"), buf);
-    s_log_message(_("Setting color to WHITE\n"));
+    s_log_message (_("Found an invalid color [ %s ]\n"), buf);
+    s_log_message (_("Setting color to WHITE\n"));
     color = WHITE;
   }
 
-  new_obj = o_net_new(toplevel, type, color, d_x1, d_y1, d_x2, d_y2);
+  new_obj = o_net_new (toplevel, type, color, x1, y1, x2, y2);
 
-  object_list = s_basic_link_object(new_obj, object_list);
+  object_list = s_basic_link_object (new_obj, object_list);
 
-  return (object_list);
+  return object_list;
 }
 
 /*! \brief Create a string representation of the net object
diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c
index 6d24e11..df11edc 100644
--- a/libgeda/src/o_pin_basic.c
+++ b/libgeda/src/o_pin_basic.c
@@ -130,7 +130,7 @@ void o_pin_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
  *  This function reads a pin object from the buffer \a buf.
  *  If the pin object was read successfully, a new pin object is
  *  allocated and appended to the \a object_list.
- *  
+ *
  *  \param [in] toplevel     The TOPLEVEL object
  *  \param [in] object_list  list of OBJECTS to append a new pin
  *  \param [in] buf          a text buffer (usually a line of a schematic file)
@@ -138,49 +138,42 @@ void o_pin_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
  *  \param [in] fileformat_ver a integer value of the file format
  *  \return The object list
  */
-OBJECT *o_pin_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
-		   unsigned int release_ver, unsigned int fileformat_ver)
+OBJECT *o_pin_read (TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
+                    unsigned int release_ver, unsigned int fileformat_ver)
 {
   OBJECT *new_obj;
   char type; 
   int x1, y1;
   int x2, y2;
-  int d_x1, d_y1;
-  int d_x2, d_y2;
   int color;
   int pin_type;
   int whichend;
 
-  if(release_ver <= VERSION_20020825) {
-    sscanf(buf, "%c %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color);
+  if (release_ver <= VERSION_20020825) {
+    sscanf (buf, "%c %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2, &color);
     pin_type = PIN_TYPE_NET;
-    whichend = -1;     
+    whichend = -1;
   } else {
-    sscanf(buf, "%c %d %d %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2,
-           &color, &pin_type, &whichend);
+    sscanf (buf, "%c %d %d %d %d %d %d %d\n", &type, &x1, &y1, &x2, &y2,
+            &color, &pin_type, &whichend);
   }
 
   if (whichend == -1) {
-    s_log_message(_("Found a pin which did not have the whichone field set.\n"
-                    "Verify and correct manually.\n"));
+    s_log_message (_("Found a pin which did not have the whichone field set.\n"
+                     "Verify and correct manually.\n"));
   } else if (whichend < -1 || whichend > 1) {
-    s_log_message(_("Found an invalid whichend on a pin (reseting to zero): %d\n"),
-                  whichend);
+    s_log_message (_("Found an invalid whichend on a pin (reseting to zero): %d\n"),
+                   whichend);
     whichend = 0;
   }
-  
-  d_x1 = x1; 
-  d_y1 = y1; 
-  d_x2 = x2; 
-  d_y2 = y2; 
 
   if (x1 == x2 && y1 == y2) {
-    s_log_message(_("Found a zero length pin: [ %s ]\n"), buf);
+    s_log_message (_("Found a zero length pin: [ %s ]\n"), buf);
   }
 
   if (color < 0 || color > MAX_COLORS) {
-    s_log_message(_("Found an invalid color [ %s ]\n"), buf);
-    s_log_message(_("Setting color to WHITE\n"));
+    s_log_message (_("Found an invalid color [ %s ]\n"), buf);
+    s_log_message (_("Setting color to WHITE\n"));
     color = WHITE;
   }
 
@@ -188,12 +181,12 @@ OBJECT *o_pin_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
     color = toplevel->override_pin_color;
   }
 
-  new_obj = o_pin_new(toplevel, type, color, d_x1, d_y1,
-                      d_x2, d_y2, pin_type, whichend);
+  new_obj = o_pin_new (toplevel, type, color, x1, y1, x2, y2,
+                       pin_type, whichend);
 
   object_list = s_basic_link_object(new_obj, object_list);
 
-  return(object_list);
+  return object_list;
 }
 
 /*! \brief Create a string representation of the pin object




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