aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2014-06-23 14:01:56 +0400
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2014-07-03 18:41:39 +0000
commitd48b47e4329c6fa51f18e759281ba13e01b85394 (patch)
treeb4574f5289323cadf0b7d4b0c405dc9deaec65cc /src
parent3039f01aaf63cd2c4d2c1f15dbba99ede6f49392 (diff)
downloadriscv-openocd-d48b47e4329c6fa51f18e759281ba13e01b85394.zip
riscv-openocd-d48b47e4329c6fa51f18e759281ba13e01b85394.tar.gz
riscv-openocd-d48b47e4329c6fa51f18e759281ba13e01b85394.tar.bz2
jtag/drivers/opendous: remove ftime() calls
ftime() is deprecated by POSIX.1-2008 and causes a warning on FreeBSD. The generic OpenOCD LOG_DEBUG implementation already outputs time of an event with a millisecond precision. Change-Id: Ic8e4ea27c268f07554ba519768b9bdfc4343f3e9 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2187 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/opendous.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/jtag/drivers/opendous.c b/src/jtag/drivers/opendous.c
index b4abe89..8bfaf0d 100644
--- a/src/jtag/drivers/opendous.c
+++ b/src/jtag/drivers/opendous.c
@@ -36,7 +36,6 @@
#include <jtag/commands.h>
#include "libusb_common.h"
#include <string.h>
-#include <sys/timeb.h>
#include <time.h>
#define OPENDOUS_MAX_VIDS_PIDS 4
@@ -150,9 +149,7 @@ static int opendous_usb_read(struct opendous_jtag *opendous_jtag);
int opendous_get_version_info(void);
#ifdef _DEBUG_USB_COMMS_
-char time_str[50];
static void opendous_debug_buffer(uint8_t *buffer, int length);
-char *opendous_get_time(char *);
#endif
static struct opendous_jtag *opendous_jtag_handle;
@@ -760,7 +757,7 @@ int opendous_usb_write(struct opendous_jtag *opendous_jtag, int out_length)
}
#ifdef _DEBUG_USB_COMMS_
- LOG_DEBUG("%s: USB write begin", opendous_get_time(time_str));
+ LOG_DEBUG("USB write begin");
#endif
if (opendous_probe->CONTROL_TRANSFER) {
result = jtag_libusb_control_transfer(opendous_jtag->usb_handle,
@@ -771,7 +768,7 @@ int opendous_usb_write(struct opendous_jtag *opendous_jtag, int out_length)
(char *)usb_out_buffer, out_length, OPENDOUS_USB_TIMEOUT);
}
#ifdef _DEBUG_USB_COMMS_
- LOG_DEBUG("%s: USB write end: %d bytes", opendous_get_time(time_str), result);
+ LOG_DEBUG("USB write end: %d bytes", result);
#endif
DEBUG_JTAG_IO("opendous_usb_write, out_length = %d, result = %d", out_length, result);
@@ -786,7 +783,7 @@ int opendous_usb_write(struct opendous_jtag *opendous_jtag, int out_length)
int opendous_usb_read(struct opendous_jtag *opendous_jtag)
{
#ifdef _DEBUG_USB_COMMS_
- LOG_DEBUG("%s: USB read begin", opendous_get_time(time_str));
+ LOG_DEBUG("USB read begin");
#endif
int result;
if (opendous_probe->CONTROL_TRANSFER) {
@@ -798,7 +795,7 @@ int opendous_usb_read(struct opendous_jtag *opendous_jtag)
(char *)usb_in_buffer, OPENDOUS_IN_BUFFER_SIZE, OPENDOUS_USB_TIMEOUT);
}
#ifdef _DEBUG_USB_COMMS_
- LOG_DEBUG("%s: USB read end: %d bytes", opendous_get_time(time_str), result);
+ LOG_DEBUG("USB read end: %d bytes", result);
#endif
DEBUG_JTAG_IO("opendous_usb_read, result = %d", result);
@@ -827,15 +824,4 @@ void opendous_debug_buffer(uint8_t *buffer, int length)
LOG_DEBUG("%s", line);
}
}
-
-char *opendous_get_time(char *str)
-{
- struct timeb timebuffer;
- char *timeline;
-
- ftime(&timebuffer);
- timeline = ctime(&(timebuffer.time));
- snprintf(str, 49, "%.8s.%hu", &timeline[11], timebuffer.millitm);
- return str;
-}
#endif