From 22487936468d60ee02b3f7ad83506dc3a903cb2e Mon Sep 17 00:00:00 2001 From: bencollins Date: Sun, 13 Jul 2003 00:49:54 +0000 Subject: [PATCH] Fix compiler warnings. git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@109 53a565d1-3bb7-0310-b661-cf11e63c67ab --- src/fcp.c | 1 + src/iso.c | 4 ++-- tools/sendiso.c | 23 ++++++++++++++++------- tools/testlibraw.c | 6 +++--- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/fcp.c b/src/fcp.c index 06fbab8..e5d98d5 100644 --- a/src/fcp.c +++ b/src/fcp.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "raw1394.h" #include "kernel-raw1394.h" diff --git a/src/iso.c b/src/iso.c index 5551fd6..32c0fa5 100644 --- a/src/iso.c +++ b/src/iso.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "raw1394.h" #include "kernel-raw1394.h" @@ -116,7 +117,7 @@ static int do_iso_init(raw1394handle_t handle, int irq_interval, int cmd) { - unsigned int bufsize, stride; + unsigned int stride; /* already initialized? */ if(handle->iso_mode != ISO_INACTIVE) @@ -386,7 +387,6 @@ out_produce: if(ioctl(handle->fd, RAW1394_IOC_ISO_XMIT_PACKETS, &packets)) retval = -1; } -out_free: free(packets.infos); out: if(stop_sync) { diff --git a/tools/sendiso.c b/tools/sendiso.c index 743c83e..8e20cec 100644 --- a/tools/sendiso.c +++ b/tools/sendiso.c @@ -1,9 +1,20 @@ +/* + * libraw1394 - library for raw access to the 1394 bus with the Linux subsystem. + * + * Copyright (C) 1999,2000 Andreas Bombe + * + * This library is licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later. See the file COPYING.LIB in the distribution for + * details. + */ + #include #include #include #include #include #include +#include #include "../src/raw1394.h" @@ -13,8 +24,6 @@ char *filename; unsigned long loopcount = 1; unsigned int speed; -unsigned long packetcount; -volatile unsigned int pend_req; void usage_exit(int exitcode) { @@ -126,12 +135,12 @@ void parse_args(int argc, char **argv) } -int dec_int_callback(raw1394handle_t unused, int *counter, int unused_errcode) +static int dec_int_callback(raw1394handle_t unused, void *counter, raw1394_errcode_t unused_errcode) { - (*counter)--; - packetcount++; - return 0; + (*(int *)counter)--; + return 0; } +static int pend_req; #define BUF_SIZE 65536 #define BUF_OVER BUF_SIZE @@ -143,7 +152,7 @@ void send_file_once(raw1394handle_t handle, int file) static char buffer[BUF_SIZE + BUF_OVER]; static struct raw1394_reqhandle rh = { - (req_callback_t)dec_int_callback, + dec_int_callback, &pend_req }; diff --git a/tools/testlibraw.c b/tools/testlibraw.c index 2836945..5f73bd9 100644 --- a/tools/testlibraw.c +++ b/tools/testlibraw.c @@ -21,12 +21,12 @@ #define TESTADDR (CSR_REGISTER_BASE + CSR_CYCLE_TIME) const char not_compatible[] = "\ -This libraw1394 does not work with your version of Linux. You need a different -version that matches your kernel (see kernel help text for the raw1394 option to +This libraw1394 does not work with your version of Linux. You need a different\n\ +version that matches your kernel (see kernel help text for the raw1394 option to\n\ find out which is the correct version).\n"; const char not_loaded[] = "\ -This probably means that you don't have raw1394 support in the kernel or that +This probably means that you don't have raw1394 support in the kernel or that\n\ you haven't loaded the raw1394 module.\n"; quadlet_t buffer;