diff --git a/backend/mustek_usb2.h b/backend/mustek_usb2.h index c9f0c86ab..ee8c4cb89 100644 --- a/backend/mustek_usb2.h +++ b/backend/mustek_usb2.h @@ -61,7 +61,7 @@ #define DEF_LINEARTTHRESHOLD 128 -enum Mustek_Usb_Option +enum { OPT_NUM_OPTS = 0, OPT_MODE_GROUP, @@ -79,12 +79,13 @@ enum Mustek_Usb_Option OPT_TL_Y, /* top-left y */ OPT_BR_X, /* bottom-right x */ OPT_BR_Y, /* bottom-right y */ + /* must come last: */ NUM_OPTIONS }; -typedef struct Scanner_Model +typedef struct { /** @name Identification */ /*@{ */ @@ -126,7 +127,6 @@ typedef struct Mustek_Scanner SANE_Byte *Scan_data_buf; /*store Scanned data for transfer */ SANE_Byte *Scan_data_buf_start; /*point to data need to transfer */ size_t scan_buffer_len; /* length of data buf */ -} -Mustek_Scanner; +} Mustek_Scanner; #endif diff --git a/backend/mustek_usb2_asic.h b/backend/mustek_usb2_asic.h index 8c2d2c91f..ee05e92eb 100644 --- a/backend/mustek_usb2_asic.h +++ b/backend/mustek_usb2_asic.h @@ -67,7 +67,7 @@ #endif -typedef enum tagFIRMWARESTATE +typedef enum { FS_NULL = 0, FS_ATTACHED = 1, @@ -75,13 +75,13 @@ typedef enum tagFIRMWARESTATE FS_SCANNING = 3 } FIRMWARESTATE; -typedef enum tagUSBHOST +typedef enum { HT_USB10 = 0, HT_USB20 = 1 } USBHOST; -typedef enum tagLIGHTSOURCE +typedef enum { LS_REFLECTIVE = 1, LS_POSITIVE = 2, @@ -130,7 +130,7 @@ typedef struct } Timings; -typedef struct tagADConverter +typedef struct { SANE_Byte GainR; SANE_Byte GainG; @@ -164,8 +164,7 @@ typedef struct SANE_Byte isMotorGoToFirstLine; /*Roy add */ SANE_Byte * lpShadingTable; /*Roy add */ SANE_Byte isUniformSpeedToScan; -} -Asic, *PAsic; +} Asic, *PAsic; typedef enum { @@ -176,8 +175,7 @@ typedef enum STATUS_INVAL, STATUS_MEM_ERROR, STATUS_IO_ERROR -} -STATUS; +} STATUS; /* debug levels */ @@ -1150,7 +1148,7 @@ static STATUS Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short /* ---------------------- asic motor defines -------------------------- */ -typedef struct tagLLF_RAMACCESS +typedef struct { SANE_Byte ReadWrite; SANE_Byte IsOnChipGamma; @@ -1161,7 +1159,7 @@ typedef struct tagLLF_RAMACCESS SANE_Byte *BufferPtr; } LLF_RAMACCESS; -typedef struct tagLLF_MOTOR_CURRENT_AND_PHASE +typedef struct { SANE_Byte MoveType; SANE_Byte FillPhase; @@ -1170,7 +1168,7 @@ typedef struct tagLLF_MOTOR_CURRENT_AND_PHASE SANE_Byte MotorCurrentTableB[32]; } LLF_MOTOR_CURRENT_AND_PHASE; -typedef struct tagLLF_CALCULATEMOTORTABLE +typedef struct { unsigned short StartSpeed; unsigned short EndSpeed; @@ -1179,13 +1177,13 @@ typedef struct tagLLF_CALCULATEMOTORTABLE unsigned short * lpMotorTable; } LLF_CALCULATEMOTORTABLE; -typedef struct tagLLF_SETMOTORTABLE +typedef struct { SANE_Byte MotorTableAddress; unsigned short *MotorTablePtr; } LLF_SETMOTORTABLE; -typedef struct tagLLF_MOTORMOVE +typedef struct { SANE_Byte ActionMode; /* 0: AccDec Mode, 1: Uniform Speed Mode, 2: Test Mode */ SANE_Byte ActionType; /* 0: Forward, 1: Backward, 2:Back To Home */ diff --git a/backend/mustek_usb2_high.h b/backend/mustek_usb2_high.h index 3381dcc14..11462a770 100644 --- a/backend/mustek_usb2_high.h +++ b/backend/mustek_usb2_high.h @@ -65,7 +65,7 @@ typedef unsigned char SCANTYPE; #define ST_Reflective 0x00 #define ST_Transparent 0x01 -typedef enum tagCOLORMODE +typedef enum { CM_RGB48 = 0, CM_RGB24 = 4, @@ -80,7 +80,7 @@ typedef enum tagCOLORMODE /* structures use in parameters of export function*/ -typedef struct tagGETPARAMETERS +typedef struct { unsigned short wSourceXDPI; unsigned short wSourceYDPI; @@ -88,7 +88,7 @@ typedef struct tagGETPARAMETERS unsigned int dwLength; } GETPARAMETERS, *LPGETPARAMETERS; -typedef struct tagFRAME +typedef struct { unsigned short x1; unsigned short y1; @@ -96,7 +96,7 @@ typedef struct tagFRAME unsigned short y2; } FRAME, *LPFRAME; -typedef struct tagSETPARAMETERS +typedef struct { FRAME fmArea; unsigned short wTargetDPI; @@ -106,7 +106,7 @@ typedef struct tagSETPARAMETERS unsigned short * pGammaTable; } SETPARAMETERS, *LPSETPARAMETERS; -typedef struct tagIMAGEROWS +typedef struct { RGBORDER roRgbOrder; unsigned short wWantedLineNum; @@ -114,7 +114,7 @@ typedef struct tagIMAGEROWS SANE_Byte * pBuffer; } IMAGEROWS, *LPIMAGEROWS; -typedef struct tagTARGETIMAGE +typedef struct { SANE_Bool isOptimalSpeed; COLORMODE cmColorMode; @@ -126,7 +126,7 @@ typedef struct tagTARGETIMAGE SCANSOURCE ssScanSource; } TARGETIMAGE, *PTARGETIMAGE; -typedef struct tagSUGGESTSETTING +typedef struct { COLORMODE cmScanMode; unsigned short wXDpi;