kopia lustrzana https://gitlab.com/sane-project/backends
mustek_usb2: fix [-Wunused-but-set-variable] compiler warnings
rodzic
7efb056272
commit
220429ff9e
|
@ -1270,14 +1270,12 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
unsigned short R, G, B, max_R, max_G, max_B, min_R, min_G, min_B;
|
||||
float fmax_R, fmax_G, fmax_B;
|
||||
unsigned int sum_R = 0, sum_G = 0, sum_B = 0;
|
||||
float mean_R, mean_G, mean_B;
|
||||
unsigned int hisgram_R[256], hisgram_G[256], hisgram_B[256];
|
||||
|
||||
unsigned int iWidth = BytesPerLine / 3;
|
||||
unsigned int iHeight = ScanLines;
|
||||
SANE_Byte *pbmpdata = (SANE_Byte *) lpSource;
|
||||
|
||||
unsigned int tmp = 0;
|
||||
unsigned short imin_threshold[3];
|
||||
unsigned short imax_threshold[3];
|
||||
|
||||
|
@ -1350,10 +1348,6 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
|
||||
DBG (DBG_INFO, "AutoLevel: Find min , max is over!\n");
|
||||
|
||||
mean_R = (float) (sum_R / TotalImgSize);
|
||||
mean_G = (float) (sum_G / TotalImgSize);
|
||||
mean_B = (float) (sum_B / TotalImgSize);
|
||||
|
||||
|
||||
imin_threshold[0] = 0;
|
||||
imin_threshold[1] = 0;
|
||||
|
@ -1372,7 +1366,6 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
}
|
||||
}
|
||||
|
||||
tmp = 0;
|
||||
for (ii = 255; ii >= 0; ii--)
|
||||
{
|
||||
if (hisgram_R[ii] > 0)
|
||||
|
@ -1383,7 +1376,6 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
}
|
||||
}
|
||||
|
||||
tmp = 0;
|
||||
for (ii = 0; ii < 256; ii++)
|
||||
{
|
||||
if (hisgram_G[ii] > 0)
|
||||
|
@ -1394,7 +1386,6 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
}
|
||||
}
|
||||
|
||||
tmp = 0;
|
||||
for (ii = 255; ii >= 0; ii--)
|
||||
{
|
||||
if (hisgram_G[ii] > 0)
|
||||
|
@ -1405,7 +1396,6 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
}
|
||||
}
|
||||
|
||||
tmp = 0;
|
||||
for (ii = 0; ii < 256; ii++)
|
||||
{
|
||||
if (hisgram_B[ii] > 0)
|
||||
|
@ -1416,7 +1406,6 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines,
|
|||
}
|
||||
}
|
||||
|
||||
tmp = 0;
|
||||
for (ii = 255; ii >= 0; ii--)
|
||||
{
|
||||
if (hisgram_B[ii] > 0)
|
||||
|
|
|
@ -1607,7 +1607,6 @@ LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove)
|
|||
STATUS status = STATUS_GOOD;
|
||||
unsigned int motor_steps;
|
||||
SANE_Byte temp_motor_action;
|
||||
SANE_Byte temp_status;
|
||||
|
||||
DBG (DBG_ASIC, "LLFMotorMove:Enter\n");
|
||||
|
||||
|
@ -1727,7 +1726,6 @@ LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove)
|
|||
SCAN_BACK_TRACKING_DISABLE | temp_motor_action);
|
||||
Mustek_SendData (chip, ES01_F4_ActiveTriger, ACTION_TRIGER_ENABLE);
|
||||
|
||||
temp_status = 0;
|
||||
if (LLF_MotorMove->WaitOrNoWait == 1)
|
||||
{
|
||||
if (LLF_MotorMove->ActionType == ACTION_TYPE_BACKTOHOME)
|
||||
|
@ -3020,10 +3018,8 @@ SetPackAddress (PAsic chip, unsigned short wXResolution, unsigned short wWidth,
|
|||
{
|
||||
STATUS status = STATUS_GOOD;
|
||||
|
||||
unsigned short LineTotalOverlapPixel;
|
||||
SANE_Byte OverLapPixel;
|
||||
SANE_Byte TotalLineShift;
|
||||
SANE_Byte InvalidPixelNumberBackup;
|
||||
unsigned short SegmentTotalPixel;
|
||||
unsigned int dwLineTotalPixel;
|
||||
unsigned short ValidPixelNumber = *PValidPixelNumber;
|
||||
|
@ -3038,7 +3034,6 @@ SetPackAddress (PAsic chip, unsigned short wXResolution, unsigned short wWidth,
|
|||
|
||||
DBG (DBG_ASIC, "SetPackAddress:Enter\n");
|
||||
|
||||
LineTotalOverlapPixel = 0;
|
||||
OverLapPixel = 0;
|
||||
TotalLineShift = 1;
|
||||
PackAreaUseLine = TotalLineShift + 1;
|
||||
|
@ -3067,7 +3062,6 @@ SetPackAddress (PAsic chip, unsigned short wXResolution, unsigned short wWidth,
|
|||
Mustek_SendData (chip, ES01_2C0_VALID_PIXEL_PARAMETER_OF_SEGMENT1 + i,
|
||||
0);
|
||||
}
|
||||
LineTotalOverlapPixel = OverLapPixel * 16;
|
||||
|
||||
FinalLinePixelPerSegment = ValidPixelNumber + OverLapPixel * 2;
|
||||
|
||||
|
@ -3080,8 +3074,6 @@ SetPackAddress (PAsic chip, unsigned short wXResolution, unsigned short wWidth,
|
|||
InValidPixelNumber = 0;
|
||||
}
|
||||
|
||||
InvalidPixelNumberBackup = InValidPixelNumber;
|
||||
|
||||
Mustek_SendData (chip, ES01_1B0_SEGMENT_PIXEL_NUMBER_LB,
|
||||
LOBYTE (ValidPixelNumber));
|
||||
Mustek_SendData (chip, ES01_1B1_SEGMENT_PIXEL_NUMBER_HB,
|
||||
|
@ -3823,9 +3815,7 @@ Asic_SetWindow (PAsic chip, SANE_Byte bScanBits,
|
|||
|
||||
unsigned short ValidPixelNumber;
|
||||
|
||||
unsigned short wPerLineNeedBufferSize = 0;
|
||||
unsigned short BytePerPixel = 0;
|
||||
unsigned int dwTotal_PerLineNeedBufferSize = 0;
|
||||
unsigned int dwTotalLineTheBufferNeed = 0;
|
||||
unsigned short dwTotal_CCDResolution = 1200;
|
||||
unsigned short wThinkCCDResolution = 0;
|
||||
|
@ -3890,31 +3880,26 @@ Asic_SetWindow (PAsic chip, SANE_Byte bScanBits,
|
|||
/* calculate byte per line */
|
||||
if (bScanBits > 24)
|
||||
{
|
||||
wPerLineNeedBufferSize = wWidth * 6;
|
||||
BytePerPixel = 6;
|
||||
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 6;
|
||||
}
|
||||
else if (bScanBits == 24)
|
||||
{
|
||||
wPerLineNeedBufferSize = wWidth * 3;
|
||||
BytePerPixel = 3;
|
||||
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 3;
|
||||
}
|
||||
else if ((bScanBits > 8) && (bScanBits <= 16))
|
||||
{
|
||||
wPerLineNeedBufferSize = wWidth * 2;
|
||||
BytePerPixel = 2;
|
||||
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 2;
|
||||
}
|
||||
else if ((bScanBits == 8))
|
||||
{
|
||||
wPerLineNeedBufferSize = wWidth;
|
||||
BytePerPixel = 1;
|
||||
chip->dwBytesCountPerRow = (unsigned int) (wWidth);
|
||||
}
|
||||
else if ((bScanBits < 8))
|
||||
{
|
||||
wPerLineNeedBufferSize = wWidth >> 3;
|
||||
BytePerPixel = 1;
|
||||
chip->dwBytesCountPerRow = (unsigned int) (wWidth);
|
||||
}
|
||||
|
@ -3983,7 +3968,6 @@ Asic_SetWindow (PAsic chip, SANE_Byte bScanBits,
|
|||
}
|
||||
}
|
||||
|
||||
dwTotal_PerLineNeedBufferSize = wPerLineNeedBufferSize;
|
||||
dwTotalLineTheBufferNeed = wLength;
|
||||
|
||||
chip->Scan.Dpi = wXResolution;
|
||||
|
@ -4848,7 +4832,6 @@ Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution,
|
|||
|
||||
unsigned short wPerLineNeedBufferSize = 0;
|
||||
unsigned short BytePerPixel = 0;
|
||||
unsigned int dwTotal_PerLineNeedBufferSize = 0;
|
||||
unsigned int dwTotalLineTheBufferNeed = 0;
|
||||
unsigned short dwTotal_CCDResolution = 0;
|
||||
unsigned short wThinkCCDResolution = 0;
|
||||
|
@ -4952,7 +4935,6 @@ Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution,
|
|||
wPerLineNeedBufferSize, BytePerPixel, chip->dwBytesCountPerRow);
|
||||
|
||||
|
||||
dwTotal_PerLineNeedBufferSize = wPerLineNeedBufferSize;
|
||||
dwTotalLineTheBufferNeed = wLength;
|
||||
DBG (DBG_ASIC, "wPerLineNeedBufferSize=%d,wLength=%d\n",
|
||||
wPerLineNeedBufferSize, wLength);
|
||||
|
|
|
@ -1696,7 +1696,6 @@ static SANE_Bool
|
|||
MustScanner_GetRgb24BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
|
||||
unsigned short * wLinesCount)
|
||||
{
|
||||
SANE_Byte *lpTemp;
|
||||
unsigned short wWantedTotalLines;
|
||||
unsigned short TotalXferLines;
|
||||
unsigned short wRLinePosOdd = 0;
|
||||
|
@ -1717,7 +1716,6 @@ MustScanner_GetRgb24BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
|
|||
g_isScanning = TRUE;
|
||||
TotalXferLines = 0;
|
||||
wWantedTotalLines = *wLinesCount;
|
||||
lpTemp = lpLine;
|
||||
|
||||
if (g_bFirstReadImage)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue