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>
This commit is contained in:
Erik Hovland 2008-09-30 14:05:32 -07:00 committed by Dan Dennedy
parent 8ad324c971
commit 038f5f5c98
2 changed files with 8 additions and 7 deletions

View File

@ -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_queue_iso queue_iso;
struct fw_cdev_start_iso start_iso; struct fw_cdev_start_iso start_iso;
struct fw_cdev_iso_packet *p; struct fw_cdev_iso_packet *p;
int retval;
if (len > fwhandle->iso.max_packet_size) { if (len > fwhandle->iso.max_packet_size) {
errno = EINVAL; 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.cycle = fwhandle->iso.start_on_cycle;
start_iso.handle = 0; start_iso.handle = 0;
len = ioctl(fwhandle->iso.fd, retval = ioctl(fwhandle->iso.fd,
FW_CDEV_IOC_START_ISO, &start_iso); FW_CDEV_IOC_START_ISO, &start_iso);
if (len < 0) if (retval < 0)
return len; return retval;
} }
return 0; return 0;

View File

@ -1176,14 +1176,14 @@ fw_lock(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr,
quadlet_t *result) quadlet_t *result)
{ {
quadlet_t buffer[2]; quadlet_t buffer[2];
size_t length; ssize_t length;
length = setup_lock(extcode, data, arg, buffer); length = setup_lock(extcode, data, arg, buffer);
if (length < 0) if (length < 0)
return length; return length;
return send_request_sync(handle, 16 + extcode, node, addr, return send_request_sync(handle, 16 + extcode, node, addr,
length, buffer, result); (size_t) length, buffer, result);
} }
int int
@ -1192,14 +1192,14 @@ fw_lock64(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr,
octlet_t *result) octlet_t *result)
{ {
octlet_t buffer[2]; octlet_t buffer[2];
size_t length; ssize_t length;
length = setup_lock64(extcode, data, arg, buffer); length = setup_lock64(extcode, data, arg, buffer);
if (length < 0) if (length < 0)
return length; return length;
return send_request_sync(handle, 16 + extcode, node, addr, return send_request_sync(handle, 16 + extcode, node, addr,
length, buffer, result); (size_t) length, buffer, result);
} }
int int