summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-03-26 21:47:26 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-03-26 21:47:26 +0000
commit5ed126c4f90948fbf53d186dc4ef49018fb5ecfc (patch)
tree40a1444d10e0413a202440b595b3a707df22a513 /src/helper
parent9b13ffe4e2edc1eabdf52c2d117396b1b21de968 (diff)
downloadopenocd_libswd-5ed126c4f90948fbf53d186dc4ef49018fb5ecfc.tar.gz
openocd_libswd-5ed126c4f90948fbf53d186dc4ef49018fb5ecfc.tar.bz2
openocd_libswd-5ed126c4f90948fbf53d186dc4ef49018fb5ecfc.tar.xz
openocd_libswd-5ed126c4f90948fbf53d186dc4ef49018fb5ecfc.zip
- fixed arm926 cp15 command bug (thanks to Vincent Palatin for this patch)
- fixed compiler warnings throughout the code (thanks to Vincent Palatin for this patch) - added support for accessing ETB (embedded trace buffer) registers git-svn-id: svn://svn.berlios.de/openocd/trunk@134 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/command.c2
-rw-r--r--src/helper/fileio.c3
-rw-r--r--src/helper/log.h3
-rw-r--r--src/helper/time_support.c3
4 files changed, 7 insertions, 4 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index dbf3f2aa..b4b2164e 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -377,7 +377,7 @@ int command_run_line(command_context_t *context, char *line)
int command_run_file(command_context_t *context, FILE *file, enum command_mode mode)
{
- int retval;
+ int retval = ERROR_OK;
int old_command_mode;
char buffer[4096];
diff --git a/src/helper/fileio.c b/src/helper/fileio.c
index 1e4353af..756e0f46 100644
--- a/src/helper/fileio.c
+++ b/src/helper/fileio.c
@@ -360,6 +360,7 @@ int fileio_close(fileio_t *fileio)
break;
default:
ERROR("BUG: should never get here");
+ retval = ERROR_FILEIO_OPERATION_FAILED;
}
if (retval != ERROR_OK)
@@ -500,7 +501,7 @@ int fileio_dispatch_write(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_writ
int fileio_write(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_written)
{
- int retval;
+ int retval = ERROR_FILEIO_OPERATION_NOT_SUPPORTED;
if (fileio->sec_type == FILEIO_PLAIN)
{
retval = fileio_dispatch_write(fileio, size, buffer, size_written);
diff --git a/src/helper/log.h b/src/helper/log.h
index c495524c..6988bfcb 100644
--- a/src/helper/log.h
+++ b/src/helper/log.h
@@ -39,7 +39,8 @@ enum log_levels
};
extern void log_printf(enum log_levels level, const char *file, int line,
- const char *function, const char *format, ...);
+ const char *function, const char *format, ...)
+ __attribute__ ((format (printf, 5, 6)));
extern int log_register_commands(struct command_context_s *cmd_ctx);
extern int log_init(struct command_context_s *cmd_ctx);
diff --git a/src/helper/time_support.c b/src/helper/time_support.c
index fffc5379..9615817f 100644
--- a/src/helper/time_support.c
+++ b/src/helper/time_support.c
@@ -24,6 +24,7 @@
#include "time_support.h"
#include "log.h"
+#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
@@ -101,7 +102,7 @@ int duration_stop_measure(duration_t *duration, char **text)
if (text)
{
*text = malloc(16);
- snprintf(*text, 16, "%is %ius", duration->duration.tv_sec, duration->duration.tv_usec);
+ snprintf(*text, 16, "%lis %lius", duration->duration.tv_sec, duration->duration.tv_usec);
}
return ERROR_OK;