changeset 1259:13ba50dd5a8e

Some cleanups from David Vrable
author gthomas
date Tue, 30 Sep 2003 21:17:43 +0000
parents a77bd30a9395
children c5a75fb0568a
files packages/redboot/current/ChangeLog packages/redboot/current/include/redboot.h packages/redboot/current/src/fconfig.c packages/redboot/current/src/net/tcp.c packages/redboot/current/src/parse.c
diffstat 5 files changed, 22 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -1,3 +1,15 @@
+2003-09-30  Gary Thomas  <gary@mlbassoc.com>
+
+	* src/fconfig.c (do_flash_config): Fix typo in error message.
+
+2003-09-30  David Vrabel  <dvrabel@arcom.com>
+
+        * src/net/tcp.c: Include missing <cyg/infra/diag.h>.
+
+        * include/redboot.h, src/parse.c (init_opts, scan_opts): Remove
+        the excessive level of indirection in the handling of option
+        arguments.
+	
 2003-09-29  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/load.c (load_elf_image): Use LMA (loader memory address), instead
--- a/packages/redboot/current/include/redboot.h
+++ b/packages/redboot/current/include/redboot.h
@@ -289,7 +289,7 @@ struct option_info {
     char flag;
     bool takes_arg;
     int  arg_type;
-    void **arg;
+    void *arg;
     bool *arg_set;
     char *name;
 };
@@ -302,10 +302,10 @@ struct option_info {
 externC struct cmd *parse(char **line, int *argc, char **argv);
 
 externC void init_opts(struct option_info *opts, char flag, bool takes_arg, 
-                       int arg_type, void **arg, bool *arg_set, char *name);
+                       int arg_type, void *arg, bool *arg_set, char *name);
 externC bool scan_opts(int argc, char *argv[], int first, 
                        struct option_info *opts, int num_opts, 
-                       void **def_arg, int def_arg_type, char *def_descr);
+                       void *def_arg, int def_arg_type, char *def_descr);
 
 #ifdef CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS
 #define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \
--- a/packages/redboot/current/src/fconfig.c
+++ b/packages/redboot/current/src/fconfig.c
@@ -551,7 +551,7 @@ do_flash_config(int argc, char *argv[])
             diag_printf("Trying to add value\n");
         }
 #else
-        diag_printf("** entry '%s' not found", onlyone);
+        diag_printf("** entry '%s' not found\n", onlyone);
 #endif
     }
     if (!need_update)
--- a/packages/redboot/current/src/net/tcp.c
+++ b/packages/redboot/current/src/net/tcp.c
@@ -53,6 +53,7 @@
 //==========================================================================
 
 #include <net/net.h>
+#include <cyg/infra/diag.h>
 
 #define MAX_TCP_SEGMENT (ETH_MAX_PKTLEN - (sizeof(eth_header_t) + sizeof(ip_header_t)))
 #define MAX_TCP_DATA    (MAX_TCP_SEGMENT - sizeof(tcp_header_t))
--- a/packages/redboot/current/src/parse.c
+++ b/packages/redboot/current/src/parse.c
@@ -200,7 +200,7 @@ cmd_usage(struct cmd *tab, struct cmd *t
 //
 void
 init_opts(struct option_info *opts, char flag, bool takes_arg, 
-          int arg_type, void **arg, bool *arg_set, char *name)
+          int arg_type, void *arg, bool *arg_set, char *name)
 {
     opts->flag = flag;
     opts->takes_arg = takes_arg;
@@ -216,7 +216,7 @@ init_opts(struct option_info *opts, char
 bool
 scan_opts(int argc, char *argv[], int first, 
           struct option_info *opts, int num_opts, 
-          void **def_arg, int def_arg_type, char *def_descr)
+          void *def_arg, int def_arg_type, char *def_descr)
 {
     bool ret = true;
     bool flag_ok;
@@ -226,7 +226,7 @@ scan_opts(int argc, char *argv[], int fi
     struct option_info *opt;
 
     if (def_arg && (def_arg_type == OPTION_ARG_TYPE_STR)) {
-        *def_arg = (char *)0;
+        *(char **)def_arg = (char *)0;
     }
     opt = opts;
     for (j = 0;  j < num_opts;  j++, opt++) {
@@ -271,7 +271,7 @@ scan_opts(int argc, char *argv[], int fi
                             }
                             break;
                         case OPTION_ARG_TYPE_STR:
-                            *opt->arg = s;
+                            *(char **)opt->arg = s;
                             break;
                         }
                         *opt->arg_set = true;
@@ -308,7 +308,7 @@ scan_opts(int argc, char *argv[], int fi
                     }
                     break;
                 case OPTION_ARG_TYPE_STR:
-                    *def_arg = argv[i];
+                    *(char **)def_arg = argv[i];
                     break;
                 }
                 def_arg_set = true;