Fixed some warnings related to shadow variables.

This commit is contained in:
Jef Driesen 2009-01-06 21:44:25 +00:00
parent 5cde8bdb52
commit b434fa344b
3 changed files with 7 additions and 7 deletions

View File

@ -247,7 +247,7 @@ reefnet_sensuspro_device_dump (device_t *abstract, unsigned char *data, unsigned
if (len > 256)
len = 256;
int rc = serial_read (device->port, answer + nbytes, len);
rc = serial_read (device->port, answer + nbytes, len);
if (rc != len) {
WARNING ("Failed to receive the answer.");
return EXITCODE (rc);

View File

@ -686,9 +686,9 @@ reefnet_sensusultra_device_foreach (device_t *abstract, dive_callback_t callback
unsigned int npages = 0;
while (nbytes < REEFNET_SENSUSULTRA_MEMORY_DATA_SIZE) {
// Receive the packet.
unsigned int index = REEFNET_SENSUSULTRA_MEMORY_DATA_SIZE -
unsigned int offset = REEFNET_SENSUSULTRA_MEMORY_DATA_SIZE -
nbytes - REEFNET_SENSUSULTRA_PACKET_SIZE;
rc = reefnet_sensusultra_page (device, data + index, REEFNET_SENSUSULTRA_PACKET_SIZE, npages);
rc = reefnet_sensusultra_page (device, data + offset, REEFNET_SENSUSULTRA_PACKET_SIZE, npages);
if (rc != DEVICE_STATUS_SUCCESS) {
free (data);
return rc;
@ -697,12 +697,12 @@ reefnet_sensusultra_device_foreach (device_t *abstract, dive_callback_t callback
progress_event (&progress, DEVICE_EVENT_PROGRESS, REEFNET_SENSUSULTRA_PACKET_SIZE);
// Abort the transfer if the page contains no useful data.
if (reefnet_sensusultra_isempty (data + index, REEFNET_SENSUSULTRA_PACKET_SIZE))
if (reefnet_sensusultra_isempty (data + offset, REEFNET_SENSUSULTRA_PACKET_SIZE))
break;
// Parse the page data.
int aborted = 0;
rc = reefnet_sensusultra_parse (data, index, index + REEFNET_SENSUSULTRA_PACKET_SIZE, &previous, &aborted, callback, userdata, device->timestamp);
rc = reefnet_sensusultra_parse (data, offset, offset + REEFNET_SENSUSULTRA_PACKET_SIZE, &previous, &aborted, callback, userdata, device->timestamp);
if (rc != DEVICE_STATUS_SUCCESS) {
free (data);
return rc;

View File

@ -49,8 +49,8 @@ suunto_common_extract_dives (const unsigned char data[], unsigned int begin, uns
// Check for an end of dive marker (of the next dive),
// to find the start of the current dive.
unsigned int index = ringbuffer_decrement (current, peek, begin, end);
if (data[index] == 0x80) {
unsigned int idx = ringbuffer_decrement (current, peek, begin, end);
if (data[idx] == 0x80) {
unsigned int len = ringbuffer_distance (current, previous, begin, end);
if (current + len > end) {
unsigned int a = end - current;