From 95e933e27cd4627d7ff042b89b730314e068e3ed Mon Sep 17 00:00:00 2001 From: Ryan Drake Date: Thu, 6 Oct 2016 15:43:32 -0700 Subject: [PATCH] Fix warnings about uninitialized variables --- libx52/x52_control.c | 6 +++--- libx52/x52_date_time.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libx52/x52_control.c b/libx52/x52_control.c index d6f0773..6e735b0 100644 --- a/libx52/x52_control.c +++ b/libx52/x52_control.c @@ -22,7 +22,7 @@ int libx52_vendor_command(libx52_device *x52, uint16_t index, uint16_t value) { int j; - int rc; + int rc = LIBUSB_ERROR_OTHER; /* Allow retry in case of failure */ for (j = 0; j < 3; j++) { @@ -110,7 +110,7 @@ static int libx52_write_date(libx52_device *x52) static int libx52_write_time(libx52_device *x52, libx52_clock_id clock) { - uint16_t value; + uint16_t value = 0; uint16_t index; int offset; int negative; @@ -168,7 +168,7 @@ int libx52_update(libx52_device *x52) unsigned int i; uint32_t update_mask; uint16_t value; - int rc; + int rc = LIBUSB_ERROR_OTHER; /* Save the update mask */ update_mask = x52->update_mask; diff --git a/libx52/x52_date_time.c b/libx52/x52_date_time.c index b90cb2b..a8fc690 100644 --- a/libx52/x52_date_time.c +++ b/libx52/x52_date_time.c @@ -39,7 +39,7 @@ int libx52_set_clock(libx52_device *x52, time_t time, int local) /* timezone from time.h presents the offset in seconds west of GMT. * Negate and divide by 60 to get the offset in minutes east of GMT. */ - local_tz = -timezone / 60; + local_tz = (int)(-timezone / 60); } else { timeval = *gmtime(&time); /* No offset from GMT */