Fixed some compiler warnings.

This commit is contained in:
Jef Driesen 2008-06-20 13:43:19 +00:00
parent 1a1807a4cc
commit 4b2a3918fd
6 changed files with 11 additions and 12 deletions

View File

@ -31,7 +31,7 @@ int test_dump_memory (const char* name, const char* filename)
}
time_t now = time (NULL);
unsigned char datetime[21] = {0};
char datetime[21] = {0};
strftime (datetime, sizeof (datetime), "%Y-%m-%dT%H:%M:%SZ", gmtime (&now));
message ("time=%lu (%s)\n", (unsigned long)now, datetime);

View File

@ -31,7 +31,7 @@ int test_dump_memory_dives (const char* name, const char* filename)
}
time_t now = time (NULL);
unsigned char datetime[21] = {0};
char datetime[21] = {0};
strftime (datetime, sizeof (datetime), "%Y-%m-%dT%H:%M:%SZ", gmtime (&now));
message ("time=%lu (%s)\n", (unsigned long)now, datetime);
@ -76,7 +76,7 @@ int test_dump_memory_data (const char* name, const char* filename)
}
time_t now = time (NULL);
unsigned char datetime[21] = {0};
char datetime[21] = {0};
strftime (datetime, sizeof (datetime), "%Y-%m-%dT%H:%M:%SZ", gmtime (&now));
message ("time=%lu (%s)\n", (unsigned long)now, datetime);
@ -128,7 +128,7 @@ int test_dump_memory_user (const char* name, const char* filename)
}
time_t now = time (NULL);
unsigned char datetime[21] = {0};
char datetime[21] = {0};
strftime (datetime, sizeof (datetime), "%Y-%m-%dT%H:%M:%SZ", gmtime (&now));
message ("time=%lu (%s)\n", (unsigned long)now, datetime);

View File

@ -228,7 +228,7 @@ irda_socket_discover (irda *device, irda_callback_t callback, void *userdata)
int rc = 0;
unsigned int n = 0;
while ((rc = getsockopt (device->fd, SOL_IRLMP, IRLMP_ENUMDEVICES, data, &size)) != 0) {
while ((rc = getsockopt (device->fd, SOL_IRLMP, IRLMP_ENUMDEVICES, (char*) data, &size)) != 0) {
#ifdef _WIN32
if (WSAGetLastError() != WSAEWOULDBLOCK) {
#else
@ -396,7 +396,7 @@ irda_socket_read (irda* device, void* data, unsigned int size)
break; // Timeout.
}
int n = recv (device->fd, data + nbytes, size - nbytes, 0);
int n = recv (device->fd, (char*) data + nbytes, size - nbytes, 0);
if (n < 0) {
TRACE ("recv");
return -1; // Error during recv call.
@ -419,7 +419,7 @@ irda_socket_write (irda* device, const void *data, unsigned int size)
unsigned int nbytes = 0;
while (nbytes < size) {
int n = send (device->fd, data + nbytes, size - nbytes, 0);
int n = send (device->fd, (char*) data + nbytes, size - nbytes, 0);
if (n < 0) {
TRACE ("send");
return -1; // Error during send call.

View File

@ -426,7 +426,7 @@ serial_read (serial* device, void* data, unsigned int size)
unsigned int nbytes = 0;
for (;;) {
// Attempt to read data from the file descriptor.
int n = read (device->fd, data + nbytes, size - nbytes);
int n = read (device->fd, (char*) data + nbytes, size - nbytes);
if (n < 0) {
if (errno == EINTR)
continue; // Retry.
@ -477,7 +477,7 @@ serial_write (serial* device, const void* data, unsigned int size)
unsigned int nbytes = 0;
for (;;) {
// Attempt to write data to the file descriptor.
int n = write (device->fd, data + nbytes, size - nbytes);
int n = write (device->fd, (char*) data + nbytes, size - nbytes);
if (n < 0) {
if (errno == EINTR)
continue; // Retry.

View File

@ -5,7 +5,7 @@ static FILE* g_logfile = NULL;
int message (const char* fmt, ...)
{
va_list ap = {0};
va_list ap;
if (g_logfile) {
va_start (ap, fmt);

View File

@ -171,7 +171,6 @@ uwatec_smart_read (smart *device, unsigned char data[], unsigned int size)
if (device == NULL)
return UWATEC_ERROR;
unsigned int timestamp = 0;
unsigned char command[9] = {0};
unsigned char answer[4] = {0};
@ -224,7 +223,7 @@ uwatec_smart_read (smart *device, unsigned char data[], unsigned int size)
// PC Time and Time Correction.
time_t now = time (NULL);
unsigned char datetime[21] = {0};
char datetime[21] = {0};
strftime (datetime, sizeof (datetime), "%Y-%m-%dT%H:%M:%SZ", gmtime (&now));
message ("handshake: now=%lu (%s)\n", (unsigned long)now, datetime);