Fix compiler warnings.

git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@109 53a565d1-3bb7-0310-b661-cf11e63c67ab
This commit is contained in:
bencollins 2003-07-13 00:49:54 +00:00
parent f149163899
commit 2248793646
4 changed files with 22 additions and 12 deletions

View File

@ -11,6 +11,7 @@
#include <config.h> #include <config.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include "raw1394.h" #include "raw1394.h"
#include "kernel-raw1394.h" #include "kernel-raw1394.h"

View File

@ -16,6 +16,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <malloc.h>
#include "raw1394.h" #include "raw1394.h"
#include "kernel-raw1394.h" #include "kernel-raw1394.h"
@ -116,7 +117,7 @@ static int do_iso_init(raw1394handle_t handle,
int irq_interval, int irq_interval,
int cmd) int cmd)
{ {
unsigned int bufsize, stride; unsigned int stride;
/* already initialized? */ /* already initialized? */
if(handle->iso_mode != ISO_INACTIVE) if(handle->iso_mode != ISO_INACTIVE)
@ -386,7 +387,6 @@ out_produce:
if(ioctl(handle->fd, RAW1394_IOC_ISO_XMIT_PACKETS, &packets)) if(ioctl(handle->fd, RAW1394_IOC_ISO_XMIT_PACKETS, &packets))
retval = -1; retval = -1;
} }
out_free:
free(packets.infos); free(packets.infos);
out: out:
if(stop_sync) { if(stop_sync) {

View File

@ -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 <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h>
#include "../src/raw1394.h" #include "../src/raw1394.h"
@ -13,8 +24,6 @@ char *filename;
unsigned long loopcount = 1; unsigned long loopcount = 1;
unsigned int speed; unsigned int speed;
unsigned long packetcount;
volatile unsigned int pend_req;
void usage_exit(int exitcode) 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)--; (*(int *)counter)--;
packetcount++; return 0;
return 0;
} }
static int pend_req;
#define BUF_SIZE 65536 #define BUF_SIZE 65536
#define BUF_OVER BUF_SIZE #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 char buffer[BUF_SIZE + BUF_OVER];
static struct raw1394_reqhandle rh = { static struct raw1394_reqhandle rh = {
(req_callback_t)dec_int_callback, dec_int_callback,
&pend_req &pend_req
}; };

View File

@ -21,12 +21,12 @@
#define TESTADDR (CSR_REGISTER_BASE + CSR_CYCLE_TIME) #define TESTADDR (CSR_REGISTER_BASE + CSR_CYCLE_TIME)
const char not_compatible[] = "\ const char not_compatible[] = "\
This libraw1394 does not work with your version of Linux. You need a different 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 version that matches your kernel (see kernel help text for the raw1394 option to\n\
find out which is the correct version).\n"; find out which is the correct version).\n";
const char not_loaded[] = "\ 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"; you haven't loaded the raw1394 module.\n";
quadlet_t buffer; quadlet_t buffer;