From 038f5f5c98612f637735e4f4752d8ca8108b0ef6 Mon Sep 17 00:00:00 2001 From: Erik Hovland Date: Tue, 30 Sep 2008 14:05:32 -0700 Subject: [PATCH] Make sure that we have the right types. When an unsigned type is assigned a signed value, the negatived value is never seen. Signed-off-by: Erik Hovland Signed-off-by: Dan Dennedy --- src/fw-iso.c | 7 ++++--- src/fw.c | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/fw-iso.c b/src/fw-iso.c index 9e66fff..8c0dc6b 100644 --- a/src/fw-iso.c +++ b/src/fw-iso.c @@ -260,6 +260,7 @@ int fw_iso_xmit_write(raw1394handle_t handle, unsigned char *data, struct fw_cdev_queue_iso queue_iso; struct fw_cdev_start_iso start_iso; struct fw_cdev_iso_packet *p; + int retval; if (len > fwhandle->iso.max_packet_size) { errno = EINVAL; @@ -284,10 +285,10 @@ int fw_iso_xmit_write(raw1394handle_t handle, unsigned char *data, start_iso.cycle = fwhandle->iso.start_on_cycle; start_iso.handle = 0; - len = ioctl(fwhandle->iso.fd, + retval = ioctl(fwhandle->iso.fd, FW_CDEV_IOC_START_ISO, &start_iso); - if (len < 0) - return len; + if (retval < 0) + return retval; } return 0; diff --git a/src/fw.c b/src/fw.c index 9c0c2e9..a4bbf3c 100644 --- a/src/fw.c +++ b/src/fw.c @@ -1176,14 +1176,14 @@ fw_lock(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, quadlet_t *result) { quadlet_t buffer[2]; - size_t length; + ssize_t length; length = setup_lock(extcode, data, arg, buffer); if (length < 0) return length; return send_request_sync(handle, 16 + extcode, node, addr, - length, buffer, result); + (size_t) length, buffer, result); } int @@ -1192,14 +1192,14 @@ fw_lock64(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, octlet_t *result) { octlet_t buffer[2]; - size_t length; + ssize_t length; length = setup_lock64(extcode, data, arg, buffer); if (length < 0) return length; return send_request_sync(handle, 16 + extcode, node, addr, - length, buffer, result); + (size_t) length, buffer, result); } int