Silent down gcc44 -Wextra warnings.

This commit is contained in:
Romain Tartiere 2010-06-26 13:48:25 +00:00
parent a9c026e8f2
commit 5027d69b7e
5 changed files with 12 additions and 10 deletions

View file

@ -77,7 +77,7 @@ freefare_get_tags (nfc_device_t *device)
bool found = false;
struct supported_tag *tag_info;
for (int i = 0; i < sizeof (supported_tags) / sizeof (struct supported_tag); i++) {
for (size_t i = 0; i < sizeof (supported_tags) / sizeof (struct supported_tag); i++) {
if ((target_info.nai.abtAtqa[0] == supported_tags[i].ATQA[0]) &&
(target_info.nai.abtAtqa[1] == supported_tags[i].ATQA[1]) &&
(target_info.nai.btSak == supported_tags[i].SAK)) {
@ -155,7 +155,7 @@ char *
freefare_get_tag_uid (MifareTag tag)
{
char *res = malloc (2 * tag->info.szUidLen + 1);
for (int i =0; i < tag->info.szUidLen; i++)
for (size_t i =0; i < tag->info.szUidLen; i++)
snprintf (res + 2*i, 3, "%02x", tag->info.abtUid[i]);
return res;
}

View file

@ -97,7 +97,7 @@ mifare_application_alloc (Mad mad, MadAid aid, size_t size)
return NULL;
for (int c = 0; c < size; c++) {
for (size_t c = 0; c < size; c++) {
if (free_aids[c]) {
res[c] = free_aids[c];
} else {
@ -111,7 +111,7 @@ mifare_application_alloc (Mad mad, MadAid aid, size_t size)
if (res) {
/* Update the MAD */
for (int c = 0; c < size; c++)
for (size_t c = 0; c < size; c++)
mad_set_aid (mad, res[c], aid);
}

View file

@ -306,12 +306,12 @@ mifare_classic_read_value (MifareTag tag, const MifareClassicBlockNumber block,
union mifare_classic_block b = *((union mifare_classic_block *)(&data));
if ((b.value.value != (~b.value.value_)) || (b.value.value != b.value.value__)) {
if ((b.value.value ^ (uint32_t)~b.value.value_) || (b.value.value != b.value.value__)) {
errno = EIO;
return -1;
}
if ((b.value.address != (unsigned char)(~b.value.address_)) || (b.value.address != b.value.address__) || (b.value.address_ != b.value.address___)) {
if ((b.value.address ^ (uint8_t)~b.value.address_) || (b.value.address != b.value.address__) || (b.value.address_ != b.value.address___)) {
errno = EIO;
return -1;
}
@ -540,7 +540,7 @@ get_block_access_bits (MifareTag tag, const MifareClassicBlockNumber block, Mifa
sector_access_bits_ = trailer_data[6] | ((trailer_data[7] & 0x0f) << 8) | 0xf000;
sector_access_bits = ((trailer_data[7] & 0xf0) >> 4) | (trailer_data[8] << 4);
if (sector_access_bits != (uint16_t) ~sector_access_bits_) {
if (sector_access_bits ^ (uint16_t)~sector_access_bits_) {
/* Sector locked */
errno = EIO;
return -1;