Remove some compiler warnings.

DEVEL_2_0_BRANCH-1
Petter Reinholdtsen 2000-09-19 03:48:08 +00:00
rodzic 2350fef3ba
commit a21b6eafcd
3 zmienionych plików z 58 dodań i 48 usunięć

Wyświetl plik

@ -33,15 +33,15 @@ struct GRABBER {
struct STRTAB *inputs; struct STRTAB *inputs;
int (*grab_open)(char *opt); int (*grab_open)(char *opt);
int (*grab_close)(); int (*grab_close)(void);
int (*grab_setupfb)(int sw, int sh, int format, void *base, int bpl); int (*grab_setupfb)(int sw, int sh, int format, void *base, int bpl);
int (*grab_overlay)(int x, int y, int width, int height, int format, int (*grab_overlay)(int x, int y, int width, int height, int format,
struct OVERLAY_CLIP *oc, int count); struct OVERLAY_CLIP *oc, int count);
int (*grab_setparams)(int format, int *width, int *height, int *linelength); int (*grab_setparams)(int format, int *width, int *height, int *linelength);
void* (*grab_capture)(int single); void* (*grab_capture)(int single);
void (*grab_cleanup)(); void (*grab_cleanup)(void);
int (*grab_tune)(unsigned long freq); int (*grab_tune)(unsigned long freq);
int (*grab_tuned)(void); int (*grab_tuned)(void);
@ -66,5 +66,5 @@ extern unsigned char* format_desc[];
int grabber_open(int sw, int sh, void *base, int format, int width); int grabber_open(int sw, int sh, void *base, int format, int width);
int grabber_setparams(int format, int *width, int *height, int grabber_setparams(int format, int *width, int *height,
int *linelength, int lut_valid); int *linelength, int lut_valid);
void* grabber_capture(void *dest, int dest_linelength, int single); void* grabber_capture(void *dest, int dest_linelength, int single);

Wyświetl plik

@ -634,6 +634,8 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
V4L_Device *dev; V4L_Device *dev;
int i; int i;
local_only = TRUE; /* Avoid compile warning */
if (devlist) if (devlist)
free (devlist); free (devlist);
@ -1069,11 +1071,19 @@ sane_cancel (SANE_Handle handle)
SANE_Status SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{ {
/* Avoid compile warning */
handle = 0;
non_blocking = 0;
return SANE_STATUS_UNSUPPORTED; return SANE_STATUS_UNSUPPORTED;
} }
SANE_Status SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{ {
/* Avoid compile warning */
handle = 0;
fd = 0;
return SANE_STATUS_UNSUPPORTED; return SANE_STATUS_UNSUPPORTED;
} }

Wyświetl plik

@ -54,8 +54,8 @@
typedef enum typedef enum
{ {
V4L_MONO = 0x01, V4L_MONO = 0x01,
V4L_COLOR = 0x10 V4L_COLOR = 0x10
} }
V4L_Model; V4L_Model;
@ -69,36 +69,36 @@ V4L_Resolution;
/* commands common to all quick-cameras: */ /* commands common to all quick-cameras: */
typedef enum typedef enum
{ {
V4L_SEND_VIDEO_FRAME = 7, V4L_SEND_VIDEO_FRAME = 7,
V4L_SET_BRIGHTNESS = 11, V4L_SET_BRIGHTNESS = 11,
V4L_SET_TOP = 13, V4L_SET_TOP = 13,
V4L_SET_LEFT = 15, V4L_SET_LEFT = 15,
V4L_SET_NUM_V = 17, V4L_SET_NUM_V = 17,
V4L_SET_NUM_H = 19, V4L_SET_NUM_H = 19,
V4L_SEND_VERSION = 23, V4L_SEND_VERSION = 23,
V4L_SET_BLACK = 29, V4L_SET_BLACK = 29,
V4L_SET_WHITE = 31, V4L_SET_WHITE = 31,
V4L_SET_SATURATION = 35, V4L_SET_SATURATION = 35,
V4L_SEND_STATUS = 41, V4L_SEND_STATUS = 41,
V4L_SET_SPEED = 45 V4L_SET_SPEED = 45
} }
V4L_Command; V4L_Command;
/* commands for grayscale camera: */ /* commands for grayscale camera: */
typedef enum typedef enum
{ {
V4L_MONO_SET_CONTRAST = 25, V4L_MONO_SET_CONTRAST = 25,
V4L_MONO_AUTO_ADJUST_OFFSET = 27, V4L_MONO_AUTO_ADJUST_OFFSET = 27,
V4L_MONO_GET_OFFSET = 33 V4L_MONO_GET_OFFSET = 33
} }
V4L_Mono_Command; V4L_Mono_Command;
/* commands for color camera: */ /* commands for color camera: */
typedef enum typedef enum
{ {
V4L_COL_LOAD_RAM = 27, V4L_COL_LOAD_RAM = 27,
V4L_COL_SET_HUE = 33, V4L_COL_SET_HUE = 33,
V4L_COL_SET_CONTRAST = 37 V4L_COL_SET_CONTRAST = 37
} }
V4L_Col_Command; V4L_Col_Command;
@ -107,17 +107,17 @@ typedef enum
OPT_NUM_OPTS = 0, OPT_NUM_OPTS = 0,
OPT_MODE_GROUP, OPT_MODE_GROUP,
OPT_DEPTH, /* 4 or 6 (b&w) or 24 (color) */ OPT_DEPTH, /* 4 or 6 (b&w) or 24 (color) */
OPT_RESOLUTION, /* resolution in pixels */ OPT_RESOLUTION, /* resolution in pixels */
OPT_XFER_SCALE, /* transfer-scale */ OPT_XFER_SCALE, /* transfer-scale */
OPT_DESPECKLE, /* turn on despeckling? */ OPT_DESPECKLE, /* turn on despeckling? */
OPT_TEST, /* test image */ OPT_TEST, /* test image */
OPT_GEOMETRY_GROUP, OPT_GEOMETRY_GROUP,
OPT_TL_X, /* top-left x */ OPT_TL_X, /* top-left x */
OPT_TL_Y, /* top-left y */ OPT_TL_Y, /* top-left y */
OPT_BR_X, /* bottom-right x */ OPT_BR_X, /* bottom-right x */
OPT_BR_Y, /* bottom-right y */ OPT_BR_Y, /* bottom-right y */
OPT_ENHANCEMENT_GROUP, OPT_ENHANCEMENT_GROUP,
OPT_BRIGHTNESS, OPT_BRIGHTNESS,
@ -135,7 +135,7 @@ V4L_Option;
typedef union typedef union
{ {
SANE_Word w; SANE_Word w;
SANE_Word *wa; /* word array */ SANE_Word *wa; /* word array */
SANE_String s; SANE_String s;
} }
Option_Value; Option_Value;
@ -149,11 +149,11 @@ V4L_Port_Mode;
typedef struct typedef struct
{ {
size_t num_bytes; /* # of bytes to read */ size_t num_bytes; /* # of bytes to read */
V4L_Resolution resolution; /* high-resolution? */ V4L_Resolution resolution; /* high-resolution? */
SANE_Parameters params; /* other parameters */ SANE_Parameters params; /* other parameters */
u_int mode; /* qcam scan code (get video data command) */ u_int mode; /* qcam scan code (get video data command) */
int despeckle; /* apply despeckling filter? */ int despeckle; /* apply despeckling filter? */
} }
V4L_Scan_Request; V4L_Scan_Request;
@ -162,8 +162,8 @@ typedef struct V4L_Device
struct V4L_Device * next; struct V4L_Device * next;
SANE_Device sane; SANE_Device sane;
V4L_Port_Mode port_mode; V4L_Port_Mode port_mode;
int version; /* camera version */ int version; /* camera version */
int lock_fd; /* used for locking protocol */ int lock_fd; /* used for locking protocol */
} }
V4L_Device; V4L_Device;
@ -175,16 +175,16 @@ typedef struct V4L_Scanner
Option_Value val[NUM_OPTIONS]; Option_Value val[NUM_OPTIONS];
V4L_Resolution resolution; V4L_Resolution resolution;
SANE_Parameters params; SANE_Parameters params;
char* devicename; /* Name of the Device */ SANE_String_Const devicename; /* Name of the Device */
int fd; /* Filedescriptor */ int fd; /* Filedescriptor */
SANE_Int user_corner; /* bitmask of user-selected coordinates */ SANE_Int user_corner; /* bitmask of user-selected coordinates */
SANE_Int value_changed; /* bitmask of options that were set */ SANE_Int value_changed; /* bitmask of options that were set */
SANE_Bool scanning; SANE_Bool scanning;
SANE_Bool deliver_eof; SANE_Bool deliver_eof;
SANE_Bool mmap; /* Do we use mmap ? */ SANE_Bool mmap; /* Do we use mmap ? */
/* state for reading a frame: */ /* state for reading a frame: */
size_t num_bytes; /* # of bytes read so far */ size_t num_bytes; /* # of bytes read so far */
size_t bytes_per_frame; /* total number of bytes in frame */ size_t bytes_per_frame; /* total number of bytes in frame */
/* internal state for v4l_readbytes(): */ /* internal state for v4l_readbytes(): */
int readbytes_state; int readbytes_state;
unsigned int saved_bits; unsigned int saved_bits;