summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@linux.intel.com>2013-03-25 17:45:53 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-03-28 18:40:02 +0100
commiteb6a3479cf4eed83d4b11124a65f1ec869927739 (patch)
tree910214b3b1affbc8da5604bc7e77e468e4649804
parentea123fb149632d0952d20feb4a38e1830c77d674 (diff)
downloadneard-eb6a3479cf4eed83d4b11124a65f1ec869927739.tar.gz
neard-eb6a3479cf4eed83d4b11124a65f1ec869927739.tar.bz2
neard-eb6a3479cf4eed83d4b11124a65f1ec869927739.zip
nfctool: Fix some integer sizes and signedness
Also, use glib types to be coherent.
-rw-r--r--tools/nfctool/llcp-decode.c6
-rw-r--r--tools/nfctool/sniffer.c14
-rw-r--r--tools/nfctool/sniffer.h4
3 files changed, 12 insertions, 12 deletions
diff --git a/tools/nfctool/llcp-decode.c b/tools/nfctool/llcp-decode.c
index 4805bb7..a49cd8e 100644
--- a/tools/nfctool/llcp-decode.c
+++ b/tools/nfctool/llcp-decode.c
@@ -334,7 +334,7 @@ exit:
return err;
}
-static int llcp_print_dm(guint8 *data, guint8 data_len)
+static int llcp_print_dm(guint8 *data, guint32 data_len)
{
gchar *reason;
@@ -382,7 +382,7 @@ static int llcp_print_dm(guint8 *data, guint8 data_len)
return 0;
}
-static int llcp_print_i(guint8 *data, guint8 data_len)
+static int llcp_print_i(guint8 *data, guint32 data_len)
{
if (llcp_print_sequence(data, data_len))
return -EINVAL;
@@ -392,7 +392,7 @@ static int llcp_print_i(guint8 *data, guint8 data_len)
return 0;
}
-static int llcp_print_frmr(guint8 *data, guint8 data_len)
+static int llcp_print_frmr(guint8 *data, guint32 data_len)
{
guint8 val;
diff --git a/tools/nfctool/sniffer.c b/tools/nfctool/sniffer.c
index c48e053..2c79f35 100644
--- a/tools/nfctool/sniffer.c
+++ b/tools/nfctool/sniffer.c
@@ -157,14 +157,14 @@ static void pcap_file_cleanup(void)
* 00000000: 01 01 43 20 30 70 72 6F 70 65 72 74 69 65 73 20 |..C 0properties |
*
*/
-void sniffer_print_hexdump(FILE *file, unsigned char *data, int len,
- char *line_prefix)
+void sniffer_print_hexdump(FILE *file, guint8 *data, guint32 len,
+ gchar *line_prefix)
{
- int digits;
- int offset;
- int total;
- char line[LINE_SIZE];
- char *hexa = NULL, *human = NULL;
+ guint8 digits;
+ guint32 offset;
+ guint32 total;
+ gchar line[LINE_SIZE];
+ gchar *hexa = NULL, *human = NULL;
if (len <= 0)
return;
diff --git a/tools/nfctool/sniffer.h b/tools/nfctool/sniffer.h
index cfa0eb4..848a71a 100644
--- a/tools/nfctool/sniffer.h
+++ b/tools/nfctool/sniffer.h
@@ -30,7 +30,7 @@ int sniffer_init(void);
void sniffer_cleanup(void);
-void sniffer_print_hexdump(FILE *file, unsigned char *data, int len,
- char *line_prefix);
+void sniffer_print_hexdump(FILE *file, guint8 *data, guint32 len,
+ gchar *line_prefix);
#endif /* __SNIFFER_H */