aboutsummaryrefslogtreecommitdiff
path: root/projects/libhal-test
diff options
context:
space:
mode:
Diffstat (limited to 'projects/libhal-test')
-rw-r--r--projects/libhal-test/gettimeofday.c2
-rw-r--r--projects/libhal-test/printf.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/projects/libhal-test/gettimeofday.c b/projects/libhal-test/gettimeofday.c
index b13485d..f7a87f1 100644
--- a/projects/libhal-test/gettimeofday.c
+++ b/projects/libhal-test/gettimeofday.c
@@ -56,6 +56,8 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
{
uint32_t tick = HAL_GetTick(); /* uptime in ms */
+ tz = tz;
+
tv->tv_sec = tick / 1000;
tv->tv_usec = (tick % 1000) * 1000;
diff --git a/projects/libhal-test/printf.c b/projects/libhal-test/printf.c
index 5a15d12..85af09b 100644
--- a/projects/libhal-test/printf.c
+++ b/projects/libhal-test/printf.c
@@ -244,7 +244,7 @@ OK, I found my mistake. The math here is _always_ unsigned */
if (precision != 0)
{
width = max(width, precision);
- if (precision > strlen(where))
+ if (precision > strlen((const char *)where))
flags |= PR_LZ;
precision = 0;
}
@@ -295,7 +295,7 @@ EMIT2: if((flags & PR_LJ) == 0)
count++;
}
/* emit string/char/converted number */
- for(int i = (flags & PR_WS) ? 1 : 0;
+ for(unsigned i = (flags & PR_WS) ? 1 : 0;
i < length; ++i)
{
fn(*where++, &ptr);
@@ -362,6 +362,8 @@ You must write your own putchar()
*****************************************************************************/
int vprintf_help(unsigned c, void **ptr)
{
+ ptr = ptr;
+
putchar(c);
return 0 ;
}