mustek_usb2: fix [-Wunused-but-set-variable] compiler warnings

merge-requests/1/head
Olaf Meeuwissen 2015-12-23 22:27:47 +09:00
rodzic 7efb056272
commit 220429ff9e
3 zmienionych plików z 0 dodań i 31 usunięć

Wyświetl plik

@ -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; unsigned short R, G, B, max_R, max_G, max_B, min_R, min_G, min_B;
float fmax_R, fmax_G, fmax_B; float fmax_R, fmax_G, fmax_B;
unsigned int sum_R = 0, sum_G = 0, sum_B = 0; 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 hisgram_R[256], hisgram_G[256], hisgram_B[256];
unsigned int iWidth = BytesPerLine / 3; unsigned int iWidth = BytesPerLine / 3;
unsigned int iHeight = ScanLines; unsigned int iHeight = ScanLines;
SANE_Byte *pbmpdata = (SANE_Byte *) lpSource; SANE_Byte *pbmpdata = (SANE_Byte *) lpSource;
unsigned int tmp = 0;
unsigned short imin_threshold[3]; unsigned short imin_threshold[3];
unsigned short imax_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"); 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[0] = 0;
imin_threshold[1] = 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--) for (ii = 255; ii >= 0; ii--)
{ {
if (hisgram_R[ii] > 0) 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++) for (ii = 0; ii < 256; ii++)
{ {
if (hisgram_G[ii] > 0) 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--) for (ii = 255; ii >= 0; ii--)
{ {
if (hisgram_G[ii] > 0) 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++) for (ii = 0; ii < 256; ii++)
{ {
if (hisgram_B[ii] > 0) 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--) for (ii = 255; ii >= 0; ii--)
{ {
if (hisgram_B[ii] > 0) if (hisgram_B[ii] > 0)

Wyświetl plik

@ -1607,7 +1607,6 @@ LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove)
STATUS status = STATUS_GOOD; STATUS status = STATUS_GOOD;
unsigned int motor_steps; unsigned int motor_steps;
SANE_Byte temp_motor_action; SANE_Byte temp_motor_action;
SANE_Byte temp_status;
DBG (DBG_ASIC, "LLFMotorMove:Enter\n"); DBG (DBG_ASIC, "LLFMotorMove:Enter\n");
@ -1727,7 +1726,6 @@ LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove)
SCAN_BACK_TRACKING_DISABLE | temp_motor_action); SCAN_BACK_TRACKING_DISABLE | temp_motor_action);
Mustek_SendData (chip, ES01_F4_ActiveTriger, ACTION_TRIGER_ENABLE); Mustek_SendData (chip, ES01_F4_ActiveTriger, ACTION_TRIGER_ENABLE);
temp_status = 0;
if (LLF_MotorMove->WaitOrNoWait == 1) if (LLF_MotorMove->WaitOrNoWait == 1)
{ {
if (LLF_MotorMove->ActionType == ACTION_TYPE_BACKTOHOME) if (LLF_MotorMove->ActionType == ACTION_TYPE_BACKTOHOME)
@ -3020,10 +3018,8 @@ SetPackAddress (PAsic chip, unsigned short wXResolution, unsigned short wWidth,
{ {
STATUS status = STATUS_GOOD; STATUS status = STATUS_GOOD;
unsigned short LineTotalOverlapPixel;
SANE_Byte OverLapPixel; SANE_Byte OverLapPixel;
SANE_Byte TotalLineShift; SANE_Byte TotalLineShift;
SANE_Byte InvalidPixelNumberBackup;
unsigned short SegmentTotalPixel; unsigned short SegmentTotalPixel;
unsigned int dwLineTotalPixel; unsigned int dwLineTotalPixel;
unsigned short ValidPixelNumber = *PValidPixelNumber; unsigned short ValidPixelNumber = *PValidPixelNumber;
@ -3038,7 +3034,6 @@ SetPackAddress (PAsic chip, unsigned short wXResolution, unsigned short wWidth,
DBG (DBG_ASIC, "SetPackAddress:Enter\n"); DBG (DBG_ASIC, "SetPackAddress:Enter\n");
LineTotalOverlapPixel = 0;
OverLapPixel = 0; OverLapPixel = 0;
TotalLineShift = 1; TotalLineShift = 1;
PackAreaUseLine = 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, Mustek_SendData (chip, ES01_2C0_VALID_PIXEL_PARAMETER_OF_SEGMENT1 + i,
0); 0);
} }
LineTotalOverlapPixel = OverLapPixel * 16;
FinalLinePixelPerSegment = ValidPixelNumber + OverLapPixel * 2; FinalLinePixelPerSegment = ValidPixelNumber + OverLapPixel * 2;
@ -3080,8 +3074,6 @@ SetPackAddress (PAsic chip, unsigned short wXResolution, unsigned short wWidth,
InValidPixelNumber = 0; InValidPixelNumber = 0;
} }
InvalidPixelNumberBackup = InValidPixelNumber;
Mustek_SendData (chip, ES01_1B0_SEGMENT_PIXEL_NUMBER_LB, Mustek_SendData (chip, ES01_1B0_SEGMENT_PIXEL_NUMBER_LB,
LOBYTE (ValidPixelNumber)); LOBYTE (ValidPixelNumber));
Mustek_SendData (chip, ES01_1B1_SEGMENT_PIXEL_NUMBER_HB, 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 ValidPixelNumber;
unsigned short wPerLineNeedBufferSize = 0;
unsigned short BytePerPixel = 0; unsigned short BytePerPixel = 0;
unsigned int dwTotal_PerLineNeedBufferSize = 0;
unsigned int dwTotalLineTheBufferNeed = 0; unsigned int dwTotalLineTheBufferNeed = 0;
unsigned short dwTotal_CCDResolution = 1200; unsigned short dwTotal_CCDResolution = 1200;
unsigned short wThinkCCDResolution = 0; unsigned short wThinkCCDResolution = 0;
@ -3890,31 +3880,26 @@ Asic_SetWindow (PAsic chip, SANE_Byte bScanBits,
/* calculate byte per line */ /* calculate byte per line */
if (bScanBits > 24) if (bScanBits > 24)
{ {
wPerLineNeedBufferSize = wWidth * 6;
BytePerPixel = 6; BytePerPixel = 6;
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 6; chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 6;
} }
else if (bScanBits == 24) else if (bScanBits == 24)
{ {
wPerLineNeedBufferSize = wWidth * 3;
BytePerPixel = 3; BytePerPixel = 3;
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 3; chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 3;
} }
else if ((bScanBits > 8) && (bScanBits <= 16)) else if ((bScanBits > 8) && (bScanBits <= 16))
{ {
wPerLineNeedBufferSize = wWidth * 2;
BytePerPixel = 2; BytePerPixel = 2;
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 2; chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 2;
} }
else if ((bScanBits == 8)) else if ((bScanBits == 8))
{ {
wPerLineNeedBufferSize = wWidth;
BytePerPixel = 1; BytePerPixel = 1;
chip->dwBytesCountPerRow = (unsigned int) (wWidth); chip->dwBytesCountPerRow = (unsigned int) (wWidth);
} }
else if ((bScanBits < 8)) else if ((bScanBits < 8))
{ {
wPerLineNeedBufferSize = wWidth >> 3;
BytePerPixel = 1; BytePerPixel = 1;
chip->dwBytesCountPerRow = (unsigned int) (wWidth); chip->dwBytesCountPerRow = (unsigned int) (wWidth);
} }
@ -3983,7 +3968,6 @@ Asic_SetWindow (PAsic chip, SANE_Byte bScanBits,
} }
} }
dwTotal_PerLineNeedBufferSize = wPerLineNeedBufferSize;
dwTotalLineTheBufferNeed = wLength; dwTotalLineTheBufferNeed = wLength;
chip->Scan.Dpi = wXResolution; chip->Scan.Dpi = wXResolution;
@ -4848,7 +4832,6 @@ Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution,
unsigned short wPerLineNeedBufferSize = 0; unsigned short wPerLineNeedBufferSize = 0;
unsigned short BytePerPixel = 0; unsigned short BytePerPixel = 0;
unsigned int dwTotal_PerLineNeedBufferSize = 0;
unsigned int dwTotalLineTheBufferNeed = 0; unsigned int dwTotalLineTheBufferNeed = 0;
unsigned short dwTotal_CCDResolution = 0; unsigned short dwTotal_CCDResolution = 0;
unsigned short wThinkCCDResolution = 0; unsigned short wThinkCCDResolution = 0;
@ -4952,7 +4935,6 @@ Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution,
wPerLineNeedBufferSize, BytePerPixel, chip->dwBytesCountPerRow); wPerLineNeedBufferSize, BytePerPixel, chip->dwBytesCountPerRow);
dwTotal_PerLineNeedBufferSize = wPerLineNeedBufferSize;
dwTotalLineTheBufferNeed = wLength; dwTotalLineTheBufferNeed = wLength;
DBG (DBG_ASIC, "wPerLineNeedBufferSize=%d,wLength=%d\n", DBG (DBG_ASIC, "wPerLineNeedBufferSize=%d,wLength=%d\n",
wPerLineNeedBufferSize, wLength); wPerLineNeedBufferSize, wLength);

Wyświetl plik

@ -1696,7 +1696,6 @@ static SANE_Bool
MustScanner_GetRgb24BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert, MustScanner_GetRgb24BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
unsigned short * wLinesCount) unsigned short * wLinesCount)
{ {
SANE_Byte *lpTemp;
unsigned short wWantedTotalLines; unsigned short wWantedTotalLines;
unsigned short TotalXferLines; unsigned short TotalXferLines;
unsigned short wRLinePosOdd = 0; unsigned short wRLinePosOdd = 0;
@ -1717,7 +1716,6 @@ MustScanner_GetRgb24BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
g_isScanning = TRUE; g_isScanning = TRUE;
TotalXferLines = 0; TotalXferLines = 0;
wWantedTotalLines = *wLinesCount; wWantedTotalLines = *wLinesCount;
lpTemp = lpLine;
if (g_bFirstReadImage) if (g_bFirstReadImage)
{ {