diff options
| author | 2008-09-30 14:05:32 -0700 | |
|---|---|---|
| committer | 2008-10-28 22:52:32 -0700 | |
| commit | 038f5f5c98612f637735e4f4752d8ca8108b0ef6 (patch) | |
| tree | 95070179dbdabf07d03e1f3c55aa95688bc87d96 /src | |
| parent | Compare unsigned values instead of subtracting them. (diff) | |
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 <erik@hovland.org>
Signed-off-by: Dan Dennedy <dan@dennedy.org>
Diffstat (limited to '')
| -rw-r--r-- | src/fw-iso.c | 7 | ||||
| -rw-r--r-- | 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; @@ -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 |
