From c3f2e4b7a64c577e4c75bc4019923573b84ae1dd Mon Sep 17 00:00:00 2001 From: Gerhard Jaeger Date: Thu, 18 Dec 2003 13:22:28 +0000 Subject: [PATCH] cleanup work. --- backend/plustek-pp.h | 2 ++ backend/plustek-pp_hwdefs.h | 2 +- backend/plustek-pp_io.c | 2 +- backend/plustek-pp_p12.c | 8 +++----- backend/plustek-pp_ptdrv.c | 6 +++--- backend/plustek-pp_scan.h | 6 ------ backend/plustek-pp_scandata.h | 28 ---------------------------- backend/plustek-pp_wrapper.c | 2 -- backend/plustek_pp.c | 2 +- 9 files changed, 11 insertions(+), 47 deletions(-) diff --git a/backend/plustek-pp.h b/backend/plustek-pp.h index 3b995efe6..82ac121b0 100644 --- a/backend/plustek-pp.h +++ b/backend/plustek-pp.h @@ -165,10 +165,12 @@ typedef const struct mode_param #define _SCANNER_PAPEROUT 0x4000000 /* for GetLensInformation */ +#if 0 #define SOURCE_Reflection 0 #define SOURCE_Transparency 1 #define SOURCE_Negative 2 #define SOURCE_ADF 3 +#endif /****************************************************************************** * Section 6 - additional definitions diff --git a/backend/plustek-pp_hwdefs.h b/backend/plustek-pp_hwdefs.h index c4a2405d1..62c3ac864 100644 --- a/backend/plustek-pp_hwdefs.h +++ b/backend/plustek-pp_hwdefs.h @@ -736,7 +736,7 @@ typedef struct _SCANDEF ULong dwScanOrigin; /* where to start the scan */ Bool fRefreshState; /* refresh ? */ Bool fMotorBackward; - UChar motorPower; /* how to driver the motor */ + UChar motorPower; /* how to drive the motor */ ULong dwMinReadFifo; ULong dwMaxReadFifo; diff --git a/backend/plustek-pp_io.c b/backend/plustek-pp_io.c index 748e7641f..ccf7ca5dc 100644 --- a/backend/plustek-pp_io.c +++ b/backend/plustek-pp_io.c @@ -556,7 +556,7 @@ static int ioP98ReadWriteTest( pScanData ps ) IODataToRegister( ps, ps->RegMemoryHigh, 0 ); /* fill to buffer */ - IOMoveDataToScanner( ps, buffer, 1280 ); + IOMoveDataToScanner( ps, buffer, _MEMTEST_SIZE ); IODataToRegister( ps, ps->RegModeControl, _ModeMappingMem ); IODataToRegister( ps, ps->RegMemoryLow, 0 ); diff --git a/backend/plustek-pp_p12.c b/backend/plustek-pp_p12.c index 967b45c4f..3d97360f6 100644 --- a/backend/plustek-pp_p12.c +++ b/backend/plustek-pp_p12.c @@ -69,8 +69,7 @@ static RegDef p12CcdStop[] = { /*************************** local functions *********************************/ -/*............................................................................. - * init the stuff according to the buttons +/** init the stuff according to the buttons */ static void p12ButtonSetup( pScanData ps, Byte nrOfButtons ) { @@ -84,12 +83,11 @@ static void p12ButtonSetup( pScanData ps, Byte nrOfButtons ) ps->sCaps.dwFlag |= (SFLAG_MULTIFUNC | SFLAG_BUTTONOPT); } -/*............................................................................. - * According to what we have detected, set the other stuff +/** According to what we have detected, set the other stuff */ static void p12InitiateComponentModel( pScanData ps ) { - /* preset some stuff and do te differences later */ + /* preset some stuff and do the differences later */ ps->Device.buttons = 0; ps->Device.Model1Mono = _BUTTON_MODE + _CCD_SHIFT_GATE + _SCAN_GRAYTYPE; ps->Device.Model1Color = _BUTTON_MODE + _CCD_SHIFT_GATE; diff --git a/backend/plustek-pp_ptdrv.c b/backend/plustek-pp_ptdrv.c index 9fe91b4e2..38e804ecb 100644 --- a/backend/plustek-pp_ptdrv.c +++ b/backend/plustek-pp_ptdrv.c @@ -1203,10 +1203,10 @@ static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg ) ps->DataInf.dwVxdFlag |= _VF_FIRSTSCANLINE; ps->DataInf.dwScanFlag&=~(_SCANNER_SCANNING|_SCANNER_PAPEROUT); - copy_to_user((pStartScan)arg, pstart, sizeof(StartScan)); + copy_to_user((pStartScan)arg, pstart, sizeof(StartScan)); } - } - break; + } + break; /* stop scan */ case _PTDRV_STOP_SCAN: diff --git a/backend/plustek-pp_scan.h b/backend/plustek-pp_scan.h index f64abb38b..486b4f147 100644 --- a/backend/plustek-pp_scan.h +++ b/backend/plustek-pp_scan.h @@ -163,13 +163,7 @@ typedef long long TimerDef, *pTimerDef; * timer topics */ #ifndef __KERNEL__ -#if 0 -# warning "outb as delay!!!!" -# define _DO_UDELAY(usecs) { int i; for( i = usecs; i--; ) outb(0, 0x80); } -#else # define _DO_UDELAY(usecs) sanei_pp_udelay(usecs) -#endif - # define _DODELAY(msecs) { int i; for( i = msecs; i--; ) _DO_UDELAY(1000); } #else # define _DO_UDELAY(usecs) udelay(usecs) diff --git a/backend/plustek-pp_scandata.h b/backend/plustek-pp_scandata.h index b6e642f37..4bcb89424 100644 --- a/backend/plustek-pp_scandata.h +++ b/backend/plustek-pp_scandata.h @@ -103,34 +103,6 @@ typedef struct { /* * here we have some structs internally used */ -/* CHECK: replace current stuff by this - looks much better !!! */ -#if 0 - -typedef struct _IMAGESIZE -{ - DWORD dwPixels; - DWORD dwBytes; - DWORD dwLines; - DWORD dwBytesCh; -} IMAGESIZE, *PIMAGESIZE; - - -typedef struct _IMAGEDEF -{ - IMAGESIZE Image; - DWORD dwVxDFlag; - DWORD dwScanFlag; - CROPRECT Area; - XY Dpi; - WORD wDataType; - WORD wBrightness; - WORD wPhyDpiY; - WORD wResult; - WORD Reserved; -} IMAGEDEF, *PIMAGEDEF; -#endif - - typedef struct { ULong dwVxdFlag; ULong dwScanFlag; diff --git a/backend/plustek-pp_wrapper.c b/backend/plustek-pp_wrapper.c index a195df830..e45127e15 100644 --- a/backend/plustek-pp_wrapper.c +++ b/backend/plustek-pp_wrapper.c @@ -324,9 +324,7 @@ static int ppDev_setMap( Plustek_Device *dev, SANE_Word *map, ioctl( dev->fd, _PTDRV_SETMAP, &m ); /* we ignore the return values */ - free( buf ); - return 0; } diff --git a/backend/plustek_pp.c b/backend/plustek_pp.c index 84278b747..8c48bf188 100644 --- a/backend/plustek_pp.c +++ b/backend/plustek_pp.c @@ -1971,7 +1971,7 @@ SANE_Status sane_start( SANE_Handle handle ) return SANE_STATUS_IO_ERROR; } - /* download gamma correction tables... */ + /* download gamma correction tables... */ if( scanmode <= COLOR_256GRAY || scanmode == COLOR_GRAY16 ) { s->hw->setMap( s->hw, s->gamma_table[0], s->gamma_length, _MAP_MASTER); } else {