Fix a brunch of -Wextra warnings:

- 'static' is not at beginning of declaration;
  - unused parameter;
  - comparison between signed and unsigned.
This commit is contained in:
Romain Tartiere 2010-04-07 15:08:04 +00:00
parent 3a0d05d15a
commit 5473befa13
8 changed files with 22 additions and 4 deletions

View file

@ -33,6 +33,7 @@
#endif
#endif
#include <err.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
@ -54,6 +55,10 @@ int main(int argc, const char* argv[])
nfc_target_info_t nti;
nfc_device_desc_t *pnddDevices;
if (argc > 1) {
errx (1, "usage: %s", argv[0]);
}
// Display libnfc version
const char* acLibnfcVersion = nfc_version();
printf("%s use libnfc %s\n", argv[0], acLibnfcVersion);

View file

@ -47,7 +47,7 @@ static mifare_tag mtKeys;
static mifare_tag mtDump;
static bool bUseKeyA;
static bool bUseKeyFile;
static uint32_t uiBlocks;
static uint8_t uiBlocks;
static byte_t keys[] = {
0xff,0xff,0xff,0xff,0xff,0xff,
0xd3,0xf7,0xd3,0xf7,0xd3,0xf7,

View file

@ -26,6 +26,7 @@
#include "config.h"
#endif // HAVE_CONFIG_H
#include <err.h>
#include <stdio.h>
#include <string.h>
#include <nfc/nfc.h>
@ -40,6 +41,10 @@ int main(int argc, const char *argv[])
size_t szRecvBits;
byte_t send[] = "Hello World!";
if (argc > 1) {
errx (1, "usage: %s", argv[0]);
}
pnd = nfc_connect(NULL);
if (!pnd || !nfc_initiator_init(pnd)
|| !nfc_initiator_select_dep_target(pnd, NM_PASSIVE_DEP, NULL, 0,

View file

@ -27,6 +27,7 @@
#include "config.h"
#endif // HAVE_CONFIG_H
#include <err.h>
#include <stdio.h>
#include <nfc/nfc.h>
@ -39,6 +40,10 @@ int main(int argc, const char *argv[])
byte_t send[] = "Hello Mars!";
nfc_device_t *pnd = nfc_connect(NULL);
if (argc > 1) {
errx (1, "usage: %s", argv[0]);
}
if (!pnd || !nfc_target_init(pnd, abtRecv, &szRecvBits)) {
printf("unable to connect or initialize\n");
return 1;

View file

@ -30,7 +30,7 @@
#include "bitutils.h"
const static byte_t OddParity[256] = {
static const byte_t OddParity[256] = {
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
@ -49,7 +49,7 @@ const static byte_t OddParity[256] = {
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1
};
const static byte_t ByteMirror[256] = {
static const byte_t ByteMirror[256] = {
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30,
0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98,
0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64,

View file

@ -43,7 +43,7 @@
#define DRIVERS_MAX_DEVICES 16
#define MAX_FRAME_LEN 264
const static struct driver_callbacks drivers_callbacks_list[] = {
static const struct driver_callbacks drivers_callbacks_list[] = {
// Driver Name Pick Device List Devices Connect Transceive Disconnect
#ifdef HAVE_PCSC_LITE
{ ACR122_DRIVER_NAME, acr122_pick_device, acr122_list_devices, acr122_connect, acr122_transceive, acr122_disconnect },

View file

@ -348,6 +348,7 @@ char* acr122_firmware(const nfc_device_spec_t nds)
bool acr122_led_red(const nfc_device_spec_t nds, bool bOn)
{
(void)bOn;
byte_t abtLed[9] = { 0xFF,0x00,0x40,0x05,0x04,0x00,0x00,0x00,0x00 };
acr122_spec_t* pas = (acr122_spec_t*)nds;
byte_t abtBuf[2];

View file

@ -91,6 +91,8 @@ pn532_uart_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_
* sending some PN53x commands. But using this way to probe devices, we can
* have serious problem with other device on this bus */
#ifndef SERIAL_AUTOPROBE_ENABLED
(void)pnddDevices;
(void)szDevices;
*pszDeviceFound = 0;
DBG("%s", "Serial auto-probing have been disabled at compile time. Skipping autoprobe.");
return false;