summaryrefslogtreecommitdiff
path: root/src/helper/command.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-09 05:55:23 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-09 05:55:23 +0000
commit2585fc34200938fb3fa55a450ea37f68012aafa7 (patch)
tree1b43cf1f32e7ac5f52596fe7660923a7f63b8927 /src/helper/command.c
parenta0647227439434c4a71470e336ec8715d43d0501 (diff)
downloadopenocd_libswd-2585fc34200938fb3fa55a450ea37f68012aafa7.tar.gz
openocd_libswd-2585fc34200938fb3fa55a450ea37f68012aafa7.tar.bz2
openocd_libswd-2585fc34200938fb3fa55a450ea37f68012aafa7.tar.xz
openocd_libswd-2585fc34200938fb3fa55a450ea37f68012aafa7.zip
Don Porges fixed c99 issues.
git-svn-id: svn://svn.berlios.de/openocd/trunk@553 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper/command.c')
-rw-r--r--src/helper/command.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index ef567333..ec7cc6bb 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -142,10 +142,10 @@ command_t* register_command(command_context_t *context, command_t *parent, char
int unregister_command(command_context_t *context, char *name)
{
- unique_length_dirty = 1;
-
command_t *c, *p = NULL, *c2;
+ unique_length_dirty = 1;
+
if ((!context) || (!name))
return ERROR_INVALID_ARGUMENTS;
@@ -452,7 +452,11 @@ int command_run_file(command_context_t *context, FILE *file, enum command_mode m
void command_print_help_line(command_context_t* context, struct command_s *command, int indent)
{
command_t *c;
+ #ifdef HAVE_C_VARRAYS
char indent_text[indent + 2];
+ #else
+ char indent_text[68];
+ #endif
char *help = "no help available";
char name_buf[64];
@@ -578,12 +582,13 @@ int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
int handle_time_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- if (argc<1)
- return ERROR_COMMAND_SYNTAX_ERROR;
-
duration_t duration;
char *duration_text;
int retval;
+ float t;
+
+ if (argc<1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
duration_start_measure(&duration);
@@ -591,7 +596,7 @@ int handle_time_command(struct command_context_s *cmd_ctx, char *cmd, char **arg
duration_stop_measure(&duration, &duration_text);
- float t=duration.duration.tv_sec;
+ t=duration.duration.tv_sec;
t+=((float)duration.duration.tv_usec / 1000000.0);
command_print(cmd_ctx, "%s took %fs", args[0], t);