Merge branch 'correct_clang_warnings' into 'master'

various: convert pre-ANSI declarations to ANSI

See merge request sane-project/backends!852
merge-requests/855/head
Ralph Little 2024-09-06 05:33:30 +00:00
commit 41891ced44
30 zmienionych plików z 80 dodań i 80 usunięć

Wyświetl plik

@ -73,7 +73,7 @@ fedora-39-clang:
image: $REGISTRY_HUB:fedora-39-clang image: $REGISTRY_HUB:fedora-39-clang
variables: variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
MAKE_FLAGS: "CFLAGS='-Werror -Wno-error=unused-but-set-variable' CXXFLAGS='-Werror -Wno-error=unused-but-set-variable'" MAKE_FLAGS: "CFLAGS='-Werror -Wno-error=unused-but-set-variable' CXXFLAGS='-Werror'"
<<: *compile_definition <<: *compile_definition
alpine-3.18-musl: alpine-3.18-musl:

Wyświetl plik

@ -544,9 +544,8 @@ static SANE_String_Const paper_list[] =
0 0
}; };
static /* inline */ int _is_host_little_endian(void);
static /* inline */ int static /* inline */ int
_is_host_little_endian() _is_host_little_endian(void)
{ {
SANE_Int val = 255; SANE_Int val = 255;
unsigned char *firstbyte = (unsigned char *) &val; unsigned char *firstbyte = (unsigned char *) &val;

Wyświetl plik

@ -907,7 +907,7 @@ sane_get_select_fd (SANE_Handle __sane_unused__ handle,
/* Clears the contents of gKnownDevices and zeros it */ /* Clears the contents of gKnownDevices and zeros it */
void void
ClearKnownDevices () ClearKnownDevices (void)
{ {
int i; int i;

Wyświetl plik

@ -840,7 +840,8 @@ void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, D
// FIXME: should porbably wait for some timeout // FIXME: should porbably wait for some timeout
Status status; Status status;
for (unsigned i = 0;; ++i) { // for (unsigned i = 0;; ++i) {
for(;;) {
status = scanner_read_status(dev); status = scanner_read_status(dev);
if (status.is_feeding_finished || ( if (status.is_feeding_finished || (
direction == Direction::BACKWARD && status.is_at_home)) direction == Direction::BACKWARD && status.is_at_home))

Wyświetl plik

@ -3809,7 +3809,7 @@ hp_optset_isEnabled (HpOptSet this, HpData data, const char *name,
SANE_Status SANE_Status
sanei_hp_optset_download (HpOptSet this, HpData data, HpScsi scsi) sanei_hp_optset_download (HpOptSet this, HpData data, HpScsi scsi)
{ {
int i, errcount = 0; int i; //, errcount = 0;
DBG(3, "Start downloading parameters to scanner\n"); DBG(3, "Start downloading parameters to scanner\n");
@ -3839,7 +3839,7 @@ sanei_hp_optset_download (HpOptSet this, HpData data, HpScsi scsi)
if ( sanei_hp_scl_errcheck (scsi) != SANE_STATUS_GOOD ) if ( sanei_hp_scl_errcheck (scsi) != SANE_STATUS_GOOD )
{ {
errcount++; //errcount++;
DBG(3, "Option %s generated scanner error\n", DBG(3, "Option %s generated scanner error\n",
this->options[i]->descriptor->name); this->options[i]->descriptor->name);

Wyświetl plik

@ -143,7 +143,7 @@ typedef struct
/* Initialize structure where we remember out open file descriptors */ /* Initialize structure where we remember out open file descriptors */
void void
sanei_hp_init_openfd () sanei_hp_init_openfd (void)
{int iCount; {int iCount;
memset (asHpOpenFd, 0, sizeof (asHpOpenFd)); memset (asHpOpenFd, 0, sizeof (asHpOpenFd));

Wyświetl plik

@ -3813,7 +3813,7 @@ static SANE_Int cfg_timing_get(SANE_Int sensortype, SANE_Int tm, struct st_timin
/** SEC: Motor curves ---------- */ /** SEC: Motor curves ---------- */
static SANE_Int *bq5550_motor() static SANE_Int *bq5550_motor(void)
{ {
SANE_Int *rst = NULL; SANE_Int *rst = NULL;
SANE_Int steps[] = SANE_Int steps[] =
@ -3835,7 +3835,7 @@ static SANE_Int *bq5550_motor()
return rst; return rst;
} }
static SANE_Int *hp4370_motor() static SANE_Int *hp4370_motor(void)
{ {
SANE_Int *rst = NULL; SANE_Int *rst = NULL;
SANE_Int steps[] = SANE_Int steps[] =
@ -3936,7 +3936,7 @@ static SANE_Int *hp4370_motor()
return rst; return rst;
} }
static SANE_Int *hp3970_motor() static SANE_Int *hp3970_motor(void)
{ {
SANE_Int *rst = NULL; SANE_Int *rst = NULL;
SANE_Int steps[] = SANE_Int steps[] =
@ -4037,7 +4037,7 @@ static SANE_Int *hp3970_motor()
return rst; return rst;
} }
static SANE_Int *hp3800_motor() static SANE_Int *hp3800_motor(void)
{ {
SANE_Int *rst = NULL; SANE_Int *rst = NULL;
SANE_Int steps[] = SANE_Int steps[] =
@ -4182,7 +4182,7 @@ static SANE_Int *hp3800_motor()
return rst; return rst;
} }
static SANE_Int *cfg_motorcurve_get() static SANE_Int *cfg_motorcurve_get(void)
{ {
/* returns motor setting buffer for a device */ /* returns motor setting buffer for a device */

Wyświetl plik

@ -618,7 +618,7 @@ RTS_Free (struct st_device *dev)
} }
static struct st_device * static struct st_device *
RTS_Alloc () RTS_Alloc (void)
{ {
/* this function allocates space for device's variable */ /* this function allocates space for device's variable */
@ -6304,7 +6304,7 @@ Gamma_GetTables (struct st_device *dev, SANE_Byte * Gamma_buffer)
} }
static void static void
Gamma_FreeTables () Gamma_FreeTables (void)
{ {
SANE_Int c; SANE_Int c;
@ -11319,7 +11319,7 @@ Head_Relocate (struct st_device *dev, SANE_Int speed, SANE_Int direction,
} }
static SANE_Int static SANE_Int
Calib_CreateFixedBuffers () Calib_CreateFixedBuffers (void)
{ {
SANE_Byte channel; SANE_Byte channel;
SANE_Int ret; SANE_Int ret;
@ -14002,7 +14002,7 @@ Free_Constrains (struct st_device *dev)
} }
static void static void
RTS_DebugInit () RTS_DebugInit (void)
{ {
/* Default values */ /* Default values */
RTS_Debug->dev_model = HP3970; RTS_Debug->dev_model = HP3970;

Wyświetl plik

@ -1752,7 +1752,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
SANE_Char line[PATH_MAX]; SANE_Char line[PATH_MAX];
SANE_Char *str = NULL; SANE_Char *str = NULL;
SANE_String_Const proper_str; SANE_String_Const proper_str;
SANE_Int nline = 0; //SANE_Int nline = 0;
/* Initialize debug */ /* Initialize debug */
DBG_INIT (); DBG_INIT ();
@ -1771,7 +1771,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{ {
while (sanei_config_read (line, sizeof (line), conf_fp)) while (sanei_config_read (line, sizeof (line), conf_fp))
{ {
nline++; //nline++;
if (str) if (str)
free (str); free (str);

Wyświetl plik

@ -109,7 +109,7 @@ static TScannerModel Model_HP54xx =
HP5400_SANE_STATIC HP5400_SANE_STATIC
int int
InitHp5400_internal() { InitHp5400_internal(void) {
MatchVersions = malloc( sizeof(versionString) * numVersions ); MatchVersions = malloc( sizeof(versionString) * numVersions );
strcpy( MatchVersions[0].strVersion, "SilitekIBlizd C3 ScannerV0.84"); strcpy( MatchVersions[0].strVersion, "SilitekIBlizd C3 ScannerV0.84");
@ -121,7 +121,7 @@ InitHp5400_internal() {
HP5400_SANE_STATIC HP5400_SANE_STATIC
int int
FreeHp5400_internal() { FreeHp5400_internal(void) {
free(MatchVersions); free(MatchVersions);
MatchVersions = NULL; MatchVersions = NULL;

Wyświetl plik

@ -648,7 +648,7 @@ DetectScanner (void)
} }
static void static void
StandByScanner () StandByScanner (void)
{ {
WriteScannerRegister (0x74, 0x80); WriteScannerRegister (0x74, 0x80);
WriteScannerRegister (0x75, 0x0C); WriteScannerRegister (0x75, 0x0C);
@ -678,7 +678,7 @@ SwitchHardwareState (SANE_Byte mask, SANE_Byte invert_mask)
/*return value: 0 - no paper, 1 - paper loaded.*/ /*return value: 0 - no paper, 1 - paper loaded.*/
static int static int
CheckPaperPresent () CheckPaperPresent (void)
{ {
if ((CallFunctionWithRetVal (0xB2) & 0x10) == 0) if ((CallFunctionWithRetVal (0xB2) & 0x10) == 0)
return 1; /*Ok - paper present. */ return 1; /*Ok - paper present. */
@ -686,7 +686,7 @@ CheckPaperPresent ()
} }
static int static int
ReleasePaper () ReleasePaper (void)
{ {
int i; int i;
@ -874,7 +874,7 @@ TurnOnPaperPulling (enumColorDepth enColor, SANE_Word wResolution)
} }
static void static void
TurnOffPaperPulling () TurnOffPaperPulling (void)
{ {
CallFunctionWithParameter (0x91, 0); CallFunctionWithParameter (0x91, 0);
} }
@ -884,7 +884,7 @@ TurnOffPaperPulling ()
While paper not loaded this is base "white point". While paper not loaded this is base "white point".
*/ */
static SANE_Byte static SANE_Byte
GetCalibration () GetCalibration (void)
{ {
int i; int i;
int Result; int Result;
@ -1041,7 +1041,7 @@ PaperFeed (SANE_Word wLinesToFeed)
/*For now we do no calibrate elements - just set maximum limits. FIX ME?*/ /*For now we do no calibrate elements - just set maximum limits. FIX ME?*/
static void static void
CalibrateScanElements () CalibrateScanElements (void)
{ {
/*Those arrays will be used in future for correct calibration. */ /*Those arrays will be used in future for correct calibration. */
/*Then we need to transfer UP brightness border, we use these registers */ /*Then we need to transfer UP brightness border, we use these registers */
@ -1260,7 +1260,7 @@ CalibrateScanElements ()
/*Returns 0 in case of fail and 1 in success.*/ /*Returns 0 in case of fail and 1 in success.*/
static int static int
OutputCheck () OutputCheck (void)
{ {
int i; int i;
@ -1277,7 +1277,7 @@ OutputCheck ()
} }
static int static int
InputCheck () InputCheck (void)
{ {
int i; int i;
SANE_Byte Buffer[256]; SANE_Byte Buffer[256];
@ -1298,7 +1298,7 @@ InputCheck ()
} }
static int static int
CallCheck () CallCheck (void)
{ {
int i; int i;
SANE_Byte Buffer[256]; SANE_Byte Buffer[256];
@ -1331,7 +1331,7 @@ CallCheck ()
} }
static void static void
LoadingPaletteToScanner () LoadingPaletteToScanner (void)
{ {
/*For now we have statical gamma. */ /*For now we have statical gamma. */
SANE_Byte Gamma[256]; SANE_Byte Gamma[256];
@ -1394,7 +1394,7 @@ CallFunctionWithRetVal (SANE_Byte Function)
} }
static SANE_Byte static SANE_Byte
ReadDataByte () ReadDataByte (void)
{ {
SANE_Byte Result; SANE_Byte Result;

Wyświetl plik

@ -2497,7 +2497,7 @@ sanei_lexmark_low_find_start_line (Lexmark_Device * dev)
*/ */
int blackLineCount = 0; // int blackLineCount = 0;
int whiteLineCount = 0; int whiteLineCount = 0;
int blackByteCounter = 0; int blackByteCounter = 0;
unsigned char max_byte = 0; unsigned char max_byte = 0;
@ -2838,14 +2838,14 @@ sanei_lexmark_low_find_start_line (Lexmark_Device * dev)
if (blackByteCounter > 0) if (blackByteCounter > 0)
{ {
/* This was a black line */ /* This was a black line */
blackLineCount++; // blackLineCount++;
whiteLineCount = 0; whiteLineCount = 0;
} }
else else
{ {
/* This is a white line */ /* This is a white line */
whiteLineCount++; whiteLineCount++;
blackLineCount = 0; // blackLineCount = 0;
} }
} /* end for buffer */ } /* end for buffer */

Wyświetl plik

@ -624,7 +624,7 @@ attach_one (SANE_String_Const devname)
} }
SANE_Status SANE_Status
scan_devices(){ scan_devices(void){
DBG (2, "scan_devices\n"); DBG (2, "scan_devices\n");
SANE_Char config_line[PATH_MAX]; SANE_Char config_line[PATH_MAX];
FILE *fp; FILE *fp;

Wyświetl plik

@ -78,7 +78,7 @@ static int mustek_scsi_pp_timeout = 5000;
/* FIXME: use same method as mustek.c ? */ /* FIXME: use same method as mustek.c ? */
static int static int
mustek_scsi_pp_get_time () mustek_scsi_pp_get_time (void)
{ {
struct timeval tv; struct timeval tv;
int retval; int retval;

Wyświetl plik

@ -537,7 +537,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
GetDeviceStatus () GetDeviceStatus (void)
{ {
DBG (DBG_FUNC, "GetDeviceStatus: start\n"); DBG (DBG_FUNC, "GetDeviceStatus: start\n");
return MustScanner_GetScannerState (); return MustScanner_GetScannerState ();
@ -576,7 +576,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
CarriageHome () CarriageHome (void)
{ {
DBG (DBG_FUNC, "CarriageHome: start\n"); DBG (DBG_FUNC, "CarriageHome: start\n");
return MustScanner_BackHome (); return MustScanner_BackHome ();
@ -914,7 +914,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
StartScan () StartScan (void)
{ {
DBG (DBG_FUNC, "StartScan: start\n"); DBG (DBG_FUNC, "StartScan: start\n");
if (ST_Reflective == g_ScanType) if (ST_Reflective == g_ScanType)
@ -1099,7 +1099,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
StopScan () StopScan (void)
{ {
SANE_Bool rt; SANE_Bool rt;
int i; int i;
@ -1159,7 +1159,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
IsTAConnected () IsTAConnected (void)
{ {
SANE_Bool hasTA; SANE_Bool hasTA;

Wyświetl plik

@ -199,7 +199,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
MustScanner_Init () MustScanner_Init (void)
{ {
DBG (DBG_FUNC, "MustScanner_Init: Call in\n"); DBG (DBG_FUNC, "MustScanner_Init: Call in\n");
@ -260,7 +260,7 @@ Return value:
return FASLE return FASLE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
MustScanner_GetScannerState () MustScanner_GetScannerState (void)
{ {
if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
@ -343,7 +343,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
MustScanner_BackHome () MustScanner_BackHome (void)
{ {
DBG (DBG_FUNC, "MustScanner_BackHome: call in \n"); DBG (DBG_FUNC, "MustScanner_BackHome: call in \n");
@ -3081,7 +3081,7 @@ Return value:
the lines of scanned the lines of scanned
***********************************************************************/ ***********************************************************************/
static unsigned int static unsigned int
GetScannedLines () GetScannedLines (void)
{ {
unsigned int dwScannedLines = 0; unsigned int dwScannedLines = 0;
@ -3103,7 +3103,7 @@ Return value:
the lines which pass to superstratum the lines which pass to superstratum
***********************************************************************/ ***********************************************************************/
static unsigned int static unsigned int
GetReadyLines () GetReadyLines (void)
{ {
unsigned int dwReadyLines = 0; unsigned int dwReadyLines = 0;
@ -3143,7 +3143,7 @@ Return value:
none none
***********************************************************************/ ***********************************************************************/
static void static void
AddReadyLines () AddReadyLines (void)
{ {
pthread_mutex_lock (&g_readyLinesMutex); pthread_mutex_lock (&g_readyLinesMutex);
g_wtheReadyLines++; g_wtheReadyLines++;

Wyświetl plik

@ -72,7 +72,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Reflective_Reset () Reflective_Reset (void)
{ {
DBG (DBG_FUNC, "Reflective_Reset: call in\n"); DBG (DBG_FUNC, "Reflective_Reset: call in\n");
@ -576,7 +576,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Reflective_AdjustAD () Reflective_AdjustAD (void)
{ {
SANE_Byte * lpCalData; SANE_Byte * lpCalData;
unsigned short wCalWidth; unsigned short wCalWidth;
@ -1293,7 +1293,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Reflective_StopScan () Reflective_StopScan (void)
{ {
DBG (DBG_FUNC, "Reflective_StopScan: call in\n"); DBG (DBG_FUNC, "Reflective_StopScan: call in\n");
if (!g_bOpened) if (!g_bOpened)
@ -1338,7 +1338,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Reflective_LineCalibration16Bits () Reflective_LineCalibration16Bits (void)
{ {
SANE_Status status; SANE_Status status;
SANE_Byte * lpWhiteData; SANE_Byte * lpWhiteData;
@ -1758,7 +1758,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Reflective_PrepareScan () Reflective_PrepareScan (void)
{ {
g_wScanLinesPerBlock = g_dwBufferSize / g_BytesPerRow; g_wScanLinesPerBlock = g_dwBufferSize / g_BytesPerRow;
g_wMaxScanLines = g_dwImageBufferSize / g_BytesPerRow; g_wMaxScanLines = g_dwImageBufferSize / g_BytesPerRow;

Wyświetl plik

@ -73,7 +73,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Transparent_Reset () Transparent_Reset (void)
{ {
DBG (DBG_FUNC, "Transparent_Reset: call in\n"); DBG (DBG_FUNC, "Transparent_Reset: call in\n");
@ -502,7 +502,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Transparent_StopScan () Transparent_StopScan (void)
{ {
DBG (DBG_FUNC, "Transparent_StopScan: call in\n"); DBG (DBG_FUNC, "Transparent_StopScan: call in\n");
@ -613,7 +613,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Transparent_AdjustAD () Transparent_AdjustAD (void)
{ {
SANE_Byte * lpCalData; SANE_Byte * lpCalData;
unsigned short wCalWidth; unsigned short wCalWidth;
@ -1659,7 +1659,7 @@ Return value:
return FALSE return FALSE
***********************************************************************/ ***********************************************************************/
static SANE_Bool static SANE_Bool
Transparent_PrepareScan () Transparent_PrepareScan (void)
{ {
DBG (DBG_FUNC, "Transparent_PrepareScan: call in\n"); DBG (DBG_FUNC, "Transparent_PrepareScan: call in\n");

Wyświetl plik

@ -313,7 +313,7 @@ add_device (const char *name, Net_Device ** ndp)
#endif /* NET_USES_AF_INDEP */ #endif /* NET_USES_AF_INDEP */
/* Calls getpwuid_r(). The return value must be freed by the caller. */ /* Calls getpwuid_r(). The return value must be freed by the caller. */
char* get_current_username() static char* get_current_username(void)
{ {
long bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); long bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
if (bufsize == -1) if (bufsize == -1)

Wyświetl plik

@ -422,7 +422,7 @@ static Bool ioP98OpenScanPath( pScanData ps )
{ {
Byte tmp; Byte tmp;
ULong dw; ULong dw;
ULong dwTime = 1; // ULong dwTime = 1; // Doesn't seem to be used. [RL]
if( 0 == ps->IO.bOpenCount ) { if( 0 == ps->IO.bOpenCount ) {
@ -457,7 +457,7 @@ static Bool ioP98OpenScanPath( pScanData ps )
ps->IO.bOpenCount = 0; ps->IO.bOpenCount = 0;
} }
dwTime++; // dwTime++; // Doesn't seem to be used. [RL]
} }
DBG( DBG_IO, "ioP98OpenScanPath() failed!\n" ); DBG( DBG_IO, "ioP98OpenScanPath() failed!\n" );
return _FALSE; return _FALSE;

Wyświetl plik

@ -457,7 +457,7 @@ static int enqueue_bq(int fd,const void *src, size_t src_size)
return 0; return 0;
} }
static void dequeue_bq() static void dequeue_bq(void)
{ {
static const char me[] = "dequeue_bq"; static const char me[] = "dequeue_bq";
struct usb_busy_queue *tbqe; struct usb_busy_queue *tbqe;

Wyświetl plik

@ -1255,7 +1255,7 @@ fail:
} }
static void static void
cleanup_initial_string_values () cleanup_initial_string_values (void)
{ {
// Cleanup backing memory for initial values of string options. // Cleanup backing memory for initial values of string options.
free (init_mode); free (init_mode);

Wyświetl plik

@ -1496,7 +1496,7 @@ ECPFifoMode (void)
/* wait for ack bit */ /* wait for ack bit */
/* return 1 on success, 0 on error */ /* return 1 on success, 0 on error */
static int static int
waitAck () waitAck (void)
{ {
unsigned char breg = 0; unsigned char breg = 0;
int i = 0; int i = 0;

Wyświetl plik

@ -449,7 +449,7 @@ sanei_umax_pp_status (void)
} }
int int
sanei_umax_pp_close () sanei_umax_pp_close (void)
{ {
#ifdef HAVE_LINUX_PPDEV_H #ifdef HAVE_LINUX_PPDEV_H
int fd; int fd;

Wyświetl plik

@ -22,7 +22,7 @@
extern int sanei_debug_xerox_mfp; extern int sanei_debug_xerox_mfp;
static int static int
xerox_need_clear_halt() xerox_need_clear_halt(void)
{ {
char *env; char *env;
int workaround = 0; int workaround = 0;

Wyświetl plik

@ -217,12 +217,12 @@ extern SANE_Status sanei_usb_testing_enable_record(SANE_String_Const path,
* Returns backend name for the file registered in sanei_usb_testing_enable. * Returns backend name for the file registered in sanei_usb_testing_enable.
* The caller is responsible for freeing it. * The caller is responsible for freeing it.
*/ */
extern SANE_String sanei_usb_testing_get_backend(); extern SANE_String sanei_usb_testing_get_backend(void);
/** Returns SANE_TRUE if replay testing mode is enabled, i.e. whether we are working with fake /** Returns SANE_TRUE if replay testing mode is enabled, i.e. whether we are working with fake
* scan data. * scan data.
*/ */
extern SANE_Bool sanei_usb_is_replay_mode_enabled(); extern SANE_Bool sanei_usb_is_replay_mode_enabled(void);
/** Clears currently recorded data. /** Clears currently recorded data.
@ -235,7 +235,7 @@ extern SANE_Bool sanei_usb_is_replay_mode_enabled();
This function may only be called when no USB devices are open, otherwise the behavior is This function may only be called when no USB devices are open, otherwise the behavior is
unpredictable. unpredictable.
*/ */
extern void sanei_usb_testing_record_clear(); extern void sanei_usb_testing_record_clear(void);
/** Records a debug message in the captured USB data if testing mode is enabled. If testing mode /** Records a debug message in the captured USB data if testing mode is enabled. If testing mode
* is not enabled, this function does nothing. * is not enabled, this function does nothing.

Wyświetl plik

@ -74,7 +74,7 @@
static char *dir_list; static char *dir_list;
const char * const char *
sanei_config_get_paths () sanei_config_get_paths (void)
{ {
#ifdef __BEOS__ #ifdef __BEOS__
char result[PATH_MAX]; char result[PATH_MAX];

Wyświetl plik

@ -876,7 +876,7 @@ pa4s2_close (int fd, SANE_Status * status)
} }
const char ** const char **
sanei_pa4s2_devices() sanei_pa4s2_devices(void)
{ {
SANE_Status status; SANE_Status status;

Wyświetl plik

@ -2053,7 +2053,7 @@ issue (struct req *req)
fdp->sane_qhead = fdp->sane_qtail = 0; fdp->sane_qhead = fdp->sane_qtail = 0;
} }
void sanei_scsi_req_flush_all () void sanei_scsi_req_flush_all (void)
{ {
int fd, i, j = 0; int fd, i, j = 0;

Wyświetl plik

@ -529,7 +529,7 @@ SANE_Status sanei_usb_testing_enable_replay(SANE_String_Const path,
fail_test(); \ fail_test(); \
} while (0) } while (0)
void fail_test() static void fail_test(void)
{ {
} }
@ -671,12 +671,12 @@ static int sanei_xml_is_known_commands_end(xmlNode* node)
return xmlStrcmp(node->name, (const xmlChar*)"known_commands_end") == 0; return xmlStrcmp(node->name, (const xmlChar*)"known_commands_end") == 0;
} }
static xmlNode* sanei_xml_peek_next_tx_node() static xmlNode* sanei_xml_peek_next_tx_node(void)
{ {
return testing_xml_next_tx_node; return testing_xml_next_tx_node;
} }
static xmlNode* sanei_xml_get_next_tx_node() static xmlNode* sanei_xml_get_next_tx_node(void)
{ {
xmlNode* next = testing_xml_next_tx_node; xmlNode* next = testing_xml_next_tx_node;
@ -906,7 +906,7 @@ static void sanei_xml_record_seq(xmlNode* node)
testing_last_known_seq = seq; testing_last_known_seq = seq;
} }
static void sanei_xml_break() static void sanei_xml_break(void)
{ {
} }
@ -1030,7 +1030,7 @@ static int sanei_usb_check_data_equal(xmlNode* node,
return 0; return 0;
} }
SANE_String sanei_usb_testing_get_backend() SANE_String sanei_usb_testing_get_backend(void)
{ {
if (testing_xml_doc == NULL) if (testing_xml_doc == NULL)
return NULL; return NULL;
@ -1054,7 +1054,7 @@ SANE_String sanei_usb_testing_get_backend()
return ret; return ret;
} }
SANE_Bool sanei_usb_is_replay_mode_enabled() SANE_Bool sanei_usb_is_replay_mode_enabled(void)
{ {
if (testing_mode == sanei_usb_testing_mode_replay) if (testing_mode == sanei_usb_testing_mode_replay)
return SANE_TRUE; return SANE_TRUE;
@ -1123,7 +1123,7 @@ static void sanei_usb_replay_debug_msg(SANE_String_Const message)
} }
} }
extern void sanei_usb_testing_record_clear() extern void sanei_usb_testing_record_clear(void)
{ {
if (testing_mode != sanei_usb_testing_mode_record) if (testing_mode != sanei_usb_testing_mode_record)
return; return;
@ -1153,7 +1153,7 @@ static void sanei_usb_add_endpoint(device_list_type* device,
SANE_Int ep_address, SANE_Int ep_address,
SANE_Int ep_direction); SANE_Int ep_direction);
static SANE_Status sanei_usb_testing_init() static SANE_Status sanei_usb_testing_init(void)
{ {
DBG_INIT(); DBG_INIT();
@ -1311,7 +1311,7 @@ static SANE_Status sanei_usb_testing_init()
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
} }
static void sanei_usb_testing_exit() static void sanei_usb_testing_exit(void)
{ {
if (testing_development_mode || testing_mode == sanei_usb_testing_mode_record) if (testing_development_mode || testing_mode == sanei_usb_testing_mode_record)
{ {