* acinclude.m4, backend/*.[ch], tools/*.[ch], frontend/*.[ch]:

Global replace of u_int??_t with C9x standard based uintxx_t
 in order to remove some tricky and overlapping portability logic
 from acinclude.m4 and leave it in only m4/stdint.m4.
merge-requests/1/head
Chris Bagwell 2009-02-26 03:15:43 +00:00
rodzic df7839f587
commit 70f3fdfba4
37 zmienionych plików z 1756 dodań i 2146 usunięć

Wyświetl plik

@ -1,3 +1,9 @@
2009-02-25 Chris Bagwell <cbagwell-guest at users.alioth.debian.org>
* acinclude.m4, backend/*.[ch], tools/*.[ch], frontend/*.[ch]:
Global replace of u_int??_t with C9x standard based uintxx_t
in order to remove some tricky and overlapping portability logic
from acinclude.m4 and leave it in only m4/stdint.m4.
2009-02-24 Chris Bagwell <cbagwell-guest at users.alioth.debian.org>
* configure.in, m4/stdint.m4: Update to latest version to
get latest fixes and use logic to not recreate _stdint.h if

Wyświetl plik

@ -376,43 +376,13 @@ AC_DEFUN([SANE_LINKER_RPATH],
dnl
dnl SANE_CHECK_U_TYPES
dnl
dnl Some of the following types seem to be defined only in sys/bitypes.h on
dnl some systems (e.g. Tru64 Unix). This is a problem for files that include
dnl sys/bitypes.h indirectly (e.g. net.c). If this is true, we add
dnl sys/bitypes.h to CPPFLAGS.
dnl
dnl FIXME: stdint.h is apart of C99 so we have datatypes that can be
dnl used in place of these and we have a macro to create a replacement
dnl stdint.h on platforms that do not support it. The types below
dnl are tricky to support; as the code below shows.
AC_DEFUN([SANE_CHECK_U_TYPES],
[
if test "$ac_cv_header_sys_bitypes_h" = "yes" ; then
AC_MSG_CHECKING([for u_int8_t only in sys/bitypes.h])
AC_EGREP_CPP(u_int8_t,
[
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
],[AC_MSG_RESULT([no, also in standard headers])],
[AC_EGREP_HEADER(u_int8_t,netinet/in.h,
[AC_DEFINE(NEED_SYS_BITYPES_H, 1, [Do we need <sys/bitypes.h>?])
AH_VERBATIM([NEED_SYS_BITYPES_H_IF],
[/* Make sure that sys/bitypes.h is included on True64 */
#ifdef NEED_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT([no, not even included with netinet/in.h])])])
fi
dnl Use new style of check types that doesn't take default to use.
dnl The old style would add an #undef of the type check on platforms
dnl that defined that type... That is not portable to platform that
dnl define it as a #define.
AC_CHECK_TYPES([u_int8_t, u_int16_t, u_int32_t, u_char, u_int, u_long],,,)
AC_CHECK_TYPES([u_char, u_int, u_long],,,)
])
#
@ -643,18 +613,6 @@ AC_DEFUN([SANE_PROTOTYPES],
[
AH_BOTTOM([
/* FIXME: Do not use these types in code anymore. Use types defined
* in C99 stdint.h and available in our cross-platform _stdint.h.
*/
#ifndef HAVE_U_INT8_T
#define u_int8_t unsigned char
#endif
#ifndef HAVE_U_INT16_T
#define u_int16_t unsigned int
#endif
#ifndef HAVE_U_INT32_T
#define u_int32_t unsigned long
#endif
#ifndef HAVE_U_CHAR
#define u_char unsigned char
#endif
@ -664,7 +622,6 @@ AH_BOTTOM([
#ifndef HAVE_U_LONG
#define u_long unsigned long
#endif
/* END of FIXME: Do not use above types */
/* Prototype for getenv */
#ifndef HAVE_GETENV

Wyświetl plik

@ -61,6 +61,8 @@
#include <sys/types.h>
#include <sys/wait.h>
#include "_stdint.h"
#include "sane/sane.h"
#include "sane/sanei.h"
#include "sane/saneopts.h"
@ -143,12 +145,12 @@ static const SANE_Range y_range =
#define INQ_LEN 0x60
static const u_int8_t inquiry[] =
static const uint8_t inquiry[] =
{
INQUIRY, 0x00, 0x00, 0x00, INQ_LEN, 0x00
};
static const u_int8_t test_unit_ready[] =
static const uint8_t test_unit_ready[] =
{
TEST_UNIT_READY, 0x00, 0x00, 0x00, 0x00, 0x00
};
@ -159,37 +161,37 @@ static const u_int8_t test_unit_ready[] =
#define IS_ACTIVE(OPTION) (((s->opt[OPTION].cap) & SANE_CAP_INACTIVE) == 0)
/* store an 8-bit-wide value at the location specified by ptr */
#define STORE8(ptr, val) (*((u_int8_t *) ptr) = val)
#define STORE8(ptr, val) (*((uint8_t *) ptr) = val)
/* store a 16-bit-wide value in network (big-endian) byte order */
#define STORE16(ptr, val) \
{ \
*((u_int8_t *) ptr) = (val >> 8) & 0xff; \
*((u_int8_t *) ptr+1) = val & 0xff; \
*((uint8_t *) ptr) = (val >> 8) & 0xff; \
*((uint8_t *) ptr+1) = val & 0xff; \
}
/* store a 24-bit-wide value in network (big-endian) byte order */
#define STORE24(ptr, val) \
{ \
*((u_int8_t *) ptr) = (val >> 16) & 0xff; \
*((u_int8_t *) ptr+1) = (val >> 8) & 0xff; \
*((u_int8_t *) ptr+2) = val & 0xff; \
*((uint8_t *) ptr) = (val >> 16) & 0xff; \
*((uint8_t *) ptr+1) = (val >> 8) & 0xff; \
*((uint8_t *) ptr+2) = val & 0xff; \
}
/* store a 32-bit-wide value in network (big-endian) byte order */
#define STORE32(ptr, val) \
{ \
*((u_int8_t *) ptr) = (val >> 24) & 0xff; \
*((u_int8_t *) ptr+1) = (val >> 16) & 0xff; \
*((u_int8_t *) ptr+2) = (val >> 8) & 0xff; \
*((u_int8_t *) ptr+3) = val & 0xff; \
*((uint8_t *) ptr) = (val >> 24) & 0xff; \
*((uint8_t *) ptr+1) = (val >> 16) & 0xff; \
*((uint8_t *) ptr+2) = (val >> 8) & 0xff; \
*((uint8_t *) ptr+3) = val & 0xff; \
}
/* retrieve a 24-bit-wide big-endian value at ptr */
#define GET24(ptr) \
(*((u_int8_t *) ptr) << 16) + \
(*((u_int8_t *) ptr+1) << 8) + \
(*((u_int8_t *) ptr+2))
(*((uint8_t *) ptr) << 16) + \
(*((uint8_t *) ptr+1) << 8) + \
(*((uint8_t *) ptr+2))
static SANE_Status
wait_ready (int fd)
@ -271,8 +273,8 @@ sense_handler (int scsi_fd, u_char * result, void *arg)
static SANE_Status
request_sense (Abaton_Scanner * s)
{
u_int8_t cmd[6];
u_int8_t result[22];
uint8_t cmd[6];
uint8_t result[22];
size_t size = sizeof (result);
SANE_Status status;
@ -317,8 +319,8 @@ request_sense (Abaton_Scanner * s)
static SANE_Status
set_window (Abaton_Scanner * s)
{
u_int8_t cmd[10 + 40];
u_int8_t *window = cmd + 10 + 8;
uint8_t cmd[10 + 40];
uint8_t *window = cmd + 10 + 8;
int invert;
memset (cmd, 0, sizeof (cmd));
@ -391,7 +393,7 @@ static SANE_Status
start_scan (Abaton_Scanner * s)
{
SANE_Status status;
u_int8_t start[7];
uint8_t start[7];
memset (start, 0, sizeof (start));
@ -1046,8 +1048,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
{
/* word options: */
case OPT_NUM_OPTS:
case OPT_X_RESOLUTION:
case OPT_Y_RESOLUTION:
case OPT_X_RESOLUTION:
case OPT_Y_RESOLUTION:
case OPT_RESOLUTION_BIND:
case OPT_PREVIEW:
case OPT_TL_X:
@ -1273,10 +1275,10 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
Abaton_Scanner *s = handle;
SANE_Status status;
u_int8_t get_data_status[10];
u_int8_t read[10];
uint8_t get_data_status[10];
uint8_t read[10];
u_int8_t result[12];
uint8_t result[12];
size_t size;
SANE_Int data_av = 0;
SANE_Int data_length = 0;

Wyświetl plik

@ -59,6 +59,8 @@
#include <sys/types.h>
#include <sys/wait.h>
#include "_stdint.h"
#include "sane/sane.h"
#include "sane/sanei.h"
#include "sane/saneopts.h"
@ -213,12 +215,12 @@ static const SANE_Range u8_range =
static const u_int8_t inquiry[] =
static const uint8_t inquiry[] =
{
APPLE_SCSI_INQUIRY, 0x00, 0x00, 0x00, INQ_LEN, 0x00
};
static const u_int8_t test_unit_ready[] =
static const uint8_t test_unit_ready[] =
{
APPLE_SCSI_TEST_UNIT_READY, 0x00, 0x00, 0x00, 0x00, 0x00
};
@ -364,8 +366,8 @@ sense_handler (int scsi_fd, u_char * result, void *arg)
static SANE_Status
request_sense (Apple_Scanner * s)
{
u_int8_t cmd[6];
u_int8_t result[22];
uint8_t cmd[6];
uint8_t result[22];
size_t size = sizeof (result);
SANE_Status status;
@ -633,7 +635,7 @@ max_string_size (const SANE_String_Const strings[])
static SANE_Status
scan_area_and_windows (Apple_Scanner * s)
{
u_int8_t cmd[10 + 8 + 42];
uint8_t cmd[10 + 8 + 42];
#define CMD cmd + 0
#define WH cmd + 10
#define WP WH + 8
@ -743,7 +745,7 @@ if (s->hw->ScannerModel != COLORONESCANNER)
static SANE_Status
mode_select (Apple_Scanner * s)
{
u_int8_t cmd[6 + 12];
uint8_t cmd[6 + 12];
#define CMD cmd + 0
#define PP cmd + 6
@ -837,7 +839,7 @@ static SANE_Status
start_scan (Apple_Scanner * s)
{
SANE_Status status;
u_int8_t start[7];
uint8_t start[7];
memset (start, 0, sizeof (start));
@ -1652,7 +1654,7 @@ init_options (Apple_Scanner * s)
s->opt[OPT_MTF_CIRCUIT].name = "mtf";
s->opt[OPT_MTF_CIRCUIT].title = "MTF Circuit";
s->opt[OPT_MTF_CIRCUIT].desc ="Turns the MTF (Modulation Transfer Function) "
"peaking circuit on or off.";
"peaking circuit on or off.";
s->opt[OPT_MTF_CIRCUIT].type = SANE_TYPE_BOOL;
if (s->hw->ScannerModel!=COLORONESCANNER)
s->opt[OPT_MTF_CIRCUIT].cap |= SANE_CAP_INACTIVE;
@ -1753,7 +1755,7 @@ init_options (Apple_Scanner * s)
s->opt[OPT_CUSTOM_CCT].name = "custom-cct";
s->opt[OPT_CUSTOM_CCT].title = "Use Custom CCT";
s->opt[OPT_CUSTOM_CCT].desc ="Determines whether a builtin "
"or a custom 3x3 Color Correction Table (CCT) should be used.";
"or a custom 3x3 Color Correction Table (CCT) should be used.";
s->opt[OPT_CUSTOM_CCT].type = SANE_TYPE_BOOL;
s->opt[OPT_CUSTOM_CCT].cap |= SANE_CAP_INACTIVE;
if (s->hw->ScannerModel!=COLORONESCANNER)
@ -2053,7 +2055,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
s->val[option].s : (char *) val);
break;
case SANE_TYPE_FIXED:
{
{
double v1, v2;
SANE_Fixed f;
v1 = SANE_UNFIX (s->val[option].w);
@ -2288,8 +2290,8 @@ eliminated.
/* TODO: fix {down/up}loads */
return SANE_STATUS_UNSUPPORTED;
case OPT_CUSTOM_CCT:
s->val[OPT_CUSTOM_CCT].w=*(SANE_Word *) val;
case OPT_CUSTOM_CCT:
s->val[OPT_CUSTOM_CCT].w=*(SANE_Word *) val;
if (s->val[OPT_CUSTOM_CCT].w)
{
ENABLE(OPT_CCT);
@ -2431,15 +2433,15 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
Apple_Scanner *s = handle;
SANE_Status status;
u_int8_t get_data_status[10];
u_int8_t read[10];
uint8_t get_data_status[10];
uint8_t read[10];
#ifdef RESERVE_RELEASE_HACK
u_int8_t reserve[6];
u_int8_t release[6];
uint8_t reserve[6];
uint8_t release[6];
#endif
u_int8_t result[12];
uint8_t result[12];
size_t size;
SANE_Int data_length = 0;
SANE_Int data_av = 0;

Wyświetl plik

@ -68,6 +68,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include "_stdint.h"
#include "sane/sane.h"
#include "sane/saneopts.h"
#include "sane/sanei_scsi.h"
@ -124,12 +126,12 @@ static const SANE_Range u8_range =
};
#define INQ_LEN 0x60
static const u_int8_t inquiry[] =
static const uint8_t inquiry[] =
{
0x12, 0x00, 0x00, 0x00, INQ_LEN, 0x00
};
static const u_int8_t test_unit_ready[] =
static const uint8_t test_unit_ready[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
@ -648,7 +650,7 @@ static SANE_Status
abort_scan (SANE_Handle handle)
{
ARTEC_Scanner *s = handle;
u_int8_t *data, comm[22];
uint8_t *data, comm[22];
DBG (7, "abort_scan()\n");
memset (comm, 0, sizeof (comm));
@ -695,7 +697,7 @@ static SANE_Status
artec_mode_select (SANE_Handle handle)
{
ARTEC_Scanner *s = handle;
u_int8_t *data, comm[22];
uint8_t *data, comm[22];
DBG (7, "artec_mode_select()\n");
memset (comm, 0, sizeof (comm));
@ -1679,7 +1681,7 @@ end_scan (SANE_Handle handle)
{
ARTEC_Scanner *s = handle;
/* DB
u_int8_t write_6[6] =
uint8_t write_6[6] =
{0x1B, 0, 0, 0, 0, 0};
*/
@ -2990,11 +2992,11 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
if (strcmp (val, "Lineart") == 0)
{
/* Lineart mode */
s->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; /* OFF */
s->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE;
/* Lineart mode */
s->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; /* OFF */
s->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE;
if (s->hw->flags & ARTEC_FLAG_ENHANCE_LINE_EDGE)
if (s->hw->flags & ARTEC_FLAG_ENHANCE_LINE_EDGE)
s->opt[OPT_EDGE_ENH].cap &= ~SANE_CAP_INACTIVE;
}
else if (strcmp (val, "Halftone") == 0)
@ -3013,8 +3015,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
}
else if (strcmp (val, "Color") == 0)
{
/* Color mode */
s->opt[OPT_FILTER_TYPE].cap |= SANE_CAP_INACTIVE;
/* Color mode */
s->opt[OPT_FILTER_TYPE].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_SOFTWARE_CAL].cap &= ~SANE_CAP_INACTIVE;
if (!(s->hw->flags & ARTEC_FLAG_MBPP_NEGATIVE))
{

Wyświetl plik

@ -5186,7 +5186,7 @@ send_3x3_matrix (Avision_Scanner* s)
b_f = a_f - (double) a_i; /* float */
m |= ((a_i & 0x3) << INT_PART);
m |= (uint16_t) (b_f * 1024);
set_double (((u_int8_t*)(&cmd.matrix.v[i])), m);
set_double (((uint8_t*)(&cmd.matrix.v[i])), m);
}
cmd.scmd.opc = AVISION_SCSI_SEND;

Wyświetl plik

@ -85,6 +85,8 @@
#include <sys/types.h>
*/
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -1461,8 +1463,8 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
ssize_t xfer_len_in, xfer_len_line, xfer_len_out;
unsigned long index;
int colour;
u_int8_t *s8 = NULL;
u_int16_t *s16 = NULL;
uint8_t *s8 = NULL;
uint16_t *s16 = NULL;
SANE_Byte *line_buf_new;
DBG (10, "sane_read() called, maxlen = %i.\n", maxlen);
@ -1577,10 +1579,10 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
case 1:
if ((s->infrared_stage == CS2_INFRARED_IN)
&& (colour == s->n_colour_out))
s8 = (u_int8_t *) & (s->infrared_buf[s->infrared_index++]);
s8 = (uint8_t *) & (s->infrared_buf[s->infrared_index++]);
else
s8 =
(u_int8_t *) & (s->line_buf[s->n_colour_out * index + colour]);
(uint8_t *) & (s->line_buf[s->n_colour_out * index + colour]);
*s8 =
s->recv_buf[colour * s->logical_width +
(colour + 1) * s->odd_padding + index];
@ -1589,10 +1591,10 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
if ((s->infrared_stage == CS2_INFRARED_IN)
&& (colour == s->n_colour_out))
s16 =
(u_int16_t *) & (s->infrared_buf[2 * (s->infrared_index++)]);
(uint16_t *) & (s->infrared_buf[2 * (s->infrared_index++)]);
else
s16 =
(u_int16_t *) & (s->
(uint16_t *) & (s->
line_buf[2 *
(s->n_colour_out * index + colour)]);
*s16 =

Wyświetl plik

@ -30,6 +30,8 @@
#include <unistd.h>
#include <time.h>
#include "_stdint.h"
#include <sane/sane.h>
#include <sane/sanei.h>
#include <sane/saneopts.h>
@ -171,7 +173,7 @@ typedef unsigned int cs3_pixel_t;
struct SANE_Cookie
{
u_int16_t version;
uint16_t version;
const char *vendor;
const char *model;
const char *revision;
@ -181,7 +183,7 @@ struct SANE_Cookie
typedef struct
{
/* magic bits :( */
u_int32_t magic;
uint32_t magic;
struct SANE_Cookie *cookie_ptr;
struct SANE_Cookie cookie;
@ -1479,8 +1481,8 @@ sane_read(SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
ssize_t xfer_len_in, xfer_len_line, xfer_len_out;
unsigned long index;
int color;
u_int8_t *s8 = NULL;
u_int16_t *s16 = NULL;
uint8_t *s8 = NULL;
uint16_t *s16 = NULL;
SANE_Byte *line_buf_new;
DBG(32, "%s, maxlen = %i.\n", __func__, maxlen);
@ -1586,7 +1588,7 @@ sane_read(SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
+ (color + 1) * s->odd_padding
+ index;
s8 = (u_int8_t *) & (s->line_buf[where]);
s8 = (uint8_t *) & (s->line_buf[where]);
*s8 = s->recv_buf[p8];
}
break;
@ -1596,7 +1598,7 @@ sane_read(SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
2 * (color * s->logical_width +
index);
s16 = (u_int16_t *) & (s->line_buf[where]);
s16 = (uint16_t *) & (s->line_buf[where]);
*s16 = (s->recv_buf[p16] << 8)
+ s->recv_buf[p16 + 1];

Wyświetl plik

@ -53,6 +53,8 @@
#include <stdarg.h>
#include <string.h>
#include "_stdint.h"
#include "sane/sane.h"
#include "sane/saneopts.h"
#include "sane/sanei_scsi.h"
@ -122,7 +124,7 @@ static SANE_Status
DMCRead(int fd, unsigned int typecode, unsigned int qualifier,
SANE_Byte *buf, size_t maxlen, size_t *len)
{
u_int8_t readCmd[10];
uint8_t readCmd[10];
SANE_Status status;
readCmd[0] = 0x28;
@ -161,7 +163,7 @@ static SANE_Status
DMCWrite(int fd, unsigned int typecode, unsigned int qualifier,
SANE_Byte *buf, size_t maxlen)
{
u_int8_t *writeCmd;
uint8_t *writeCmd;
SANE_Status status;
writeCmd = malloc(maxlen + 10);
@ -209,16 +211,16 @@ DMCAttach(char const *devname, DMC_Device **devp)
size_t size;
char result[INQ_LEN];
u_int8_t exposureCalculationResults[16];
u_int8_t userInterfaceSettings[16];
uint8_t exposureCalculationResults[16];
uint8_t userInterfaceSettings[16];
static u_int8_t const inquiry[] =
static uint8_t const inquiry[] =
{ 0x12, 0x00, 0x00, 0x00, INQ_LEN, 0x00 };
static u_int8_t const test_unit_ready[] =
static uint8_t const test_unit_ready[] =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static u_int8_t const no_viewfinder[] =
static uint8_t const no_viewfinder[] =
{ 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/* If we're already attached, do nothing */
@ -603,7 +605,7 @@ DMCCancel(DMC_Camera *c)
static SANE_Status
DMCSetASA(int fd, unsigned int asa)
{
u_int8_t exposureCalculationResults[16];
uint8_t exposureCalculationResults[16];
SANE_Status status;
size_t len;
int i;
@ -620,7 +622,7 @@ DMCSetASA(int fd, unsigned int asa)
if (status != SANE_STATUS_GOOD) return status;
if (len < sizeof(exposureCalculationResults)) return SANE_STATUS_IO_ERROR;
exposureCalculationResults[13] = (u_int8_t) i - 1;
exposureCalculationResults[13] = (uint8_t) i - 1;
return DMCWrite(fd, 0x87, 0x4, exposureCalculationResults,
sizeof(exposureCalculationResults));
@ -639,7 +641,7 @@ DMCSetASA(int fd, unsigned int asa)
static SANE_Status
DMCSetWhiteBalance(int fd, int mode)
{
u_int8_t userInterfaceSettings[16];
uint8_t userInterfaceSettings[16];
SANE_Status status;
size_t len;
@ -649,7 +651,7 @@ DMCSetWhiteBalance(int fd, int mode)
if (status != SANE_STATUS_GOOD) return status;
if (len < sizeof(userInterfaceSettings)) return SANE_STATUS_IO_ERROR;
userInterfaceSettings[5] = (u_int8_t) mode;
userInterfaceSettings[5] = (uint8_t) mode;
return DMCWrite(fd, 0x82, 0x0, userInterfaceSettings,
sizeof(userInterfaceSettings));
@ -668,7 +670,7 @@ DMCSetWhiteBalance(int fd, int mode)
static SANE_Status
DMCSetShutterSpeed(int fd, unsigned int speed)
{
u_int8_t exposureCalculationResults[16];
uint8_t exposureCalculationResults[16];
SANE_Status status;
size_t len;
@ -1166,13 +1168,13 @@ sane_get_parameters(SANE_Handle handle, SANE_Parameters *params)
SANE_Status
sane_start(SANE_Handle handle)
{
static u_int8_t const acquire[] =
static uint8_t const acquire[] =
{ 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static u_int8_t const viewfinder[] =
static uint8_t const viewfinder[] =
{ 0xCB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static u_int8_t const no_viewfinder[] =
static uint8_t const no_viewfinder[] =
{ 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
DMC_Camera *c = ValidateHandle(handle);

Wyświetl plik

@ -60,6 +60,8 @@
#include <unistd.h>
#include <math.h>
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -183,7 +185,7 @@ genesys_init_cmd_set (Genesys_Device * dev)
/* Write data to a pnm file (e.g. calibration). For debugging only */
/* data is RGB or grey, with little endian byte order */
SANE_Status
sanei_genesys_write_pnm_file (char *filename, u_int8_t * data, int depth,
sanei_genesys_write_pnm_file (char *filename, uint8_t * data, int depth,
int channels, int pixels_per_line, int lines)
{
FILE *out;
@ -282,8 +284,8 @@ sanei_genesys_set_reg_from_set (Genesys_Register_Set * reg, SANE_Byte address,
/* Write to one register */
SANE_Status
sanei_genesys_write_register (Genesys_Device * dev, u_int8_t reg,
u_int8_t val)
sanei_genesys_write_register (Genesys_Device * dev, uint8_t reg,
uint8_t val)
{
SANE_Status status;
@ -318,8 +320,8 @@ sanei_genesys_write_register (Genesys_Device * dev, u_int8_t reg,
/* Read from one register */
SANE_Status
sanei_genesys_read_register (Genesys_Device * dev, u_int8_t reg,
u_int8_t * val)
sanei_genesys_read_register (Genesys_Device * dev, uint8_t reg,
uint8_t * val)
{
SANE_Status status;
@ -355,7 +357,7 @@ sanei_genesys_read_register (Genesys_Device * dev, u_int8_t reg,
/* Set address for writing data */
SANE_Status
sanei_genesys_set_buffer_address (Genesys_Device * dev, u_int32_t addr)
sanei_genesys_set_buffer_address (Genesys_Device * dev, uint32_t addr)
{
SANE_Status status;
@ -415,8 +417,8 @@ sanei_genesys_init_fe (Genesys_Device * dev)
/* Write data for analog frontend */
SANE_Status
sanei_genesys_fe_write_data (Genesys_Device * dev, u_int8_t addr,
u_int16_t data)
sanei_genesys_fe_write_data (Genesys_Device * dev, uint8_t addr,
uint16_t data)
{
SANE_Status status;
Genesys_Register_Set reg[3];
@ -451,7 +453,7 @@ sanei_genesys_fe_write_data (Genesys_Device * dev, u_int8_t addr,
/** read the status register
*/
SANE_Status
sanei_genesys_get_status (Genesys_Device * dev, u_int8_t * status)
sanei_genesys_get_status (Genesys_Device * dev, uint8_t * status)
{
return sanei_genesys_read_register (dev, 0x41, status);
}
@ -497,7 +499,7 @@ SANE_Status
sanei_genesys_read_valid_words (Genesys_Device * dev, unsigned int *words)
{
SANE_Status status;
u_int8_t value;
uint8_t value;
DBG (DBG_proc, "sanei_genesys_read_valid_words\n");
@ -550,10 +552,10 @@ sanei_genesys_get_address (Genesys_Register_Set * regs, SANE_Byte addr)
* done.
*/
SANE_Int
sanei_genesys_generate_slope_table (u_int16_t * slope_table,
sanei_genesys_generate_slope_table (uint16_t * slope_table,
unsigned int max_steps,
unsigned int use_steps, u_int16_t stop_at,
u_int16_t vstart, u_int16_t vend,
unsigned int use_steps, uint16_t stop_at,
uint16_t vstart, uint16_t vend,
unsigned int steps, double g,
unsigned int *used_steps,
unsigned int *vfinal)
@ -562,7 +564,7 @@ sanei_genesys_generate_slope_table (u_int16_t * slope_table,
SANE_Int sum = 0;
unsigned int i;
unsigned int c = 0;
u_int16_t t2;
uint16_t t2;
unsigned int dummy;
unsigned int _vfinal;
if (!used_steps)
@ -654,7 +656,7 @@ sanei_genesys_generate_slope_table (u_int16_t * slope_table,
*/
SANE_Int
sanei_genesys_create_slope_table3 (Genesys_Device * dev,
u_int16_t * slope_table, int max_step,
uint16_t * slope_table, int max_step,
unsigned int use_steps,
int step_type, int exposure_time,
double yres,
@ -721,7 +723,7 @@ sanei_genesys_create_slope_table3 (Genesys_Device * dev,
*/
static SANE_Int
genesys_create_slope_table4 (Genesys_Device * dev,
u_int16_t * slope_table, int steps,
uint16_t * slope_table, int steps,
int step_type, int exposure_time,
SANE_Bool same_speed, double yres,
int power_mode)
@ -778,7 +780,7 @@ genesys_create_slope_table4 (Genesys_Device * dev,
/* the hardcoded values (g and vstart) will go in a motor struct */
static SANE_Int
genesys_create_slope_table2 (Genesys_Device * dev,
u_int16_t * slope_table, int steps,
uint16_t * slope_table, int steps,
int step_type, int exposure_time,
SANE_Bool same_speed, double yres,
int power_mode)
@ -900,7 +902,7 @@ genesys_create_slope_table2 (Genesys_Device * dev,
/* todo: check details */
SANE_Int
sanei_genesys_create_slope_table (Genesys_Device * dev,
u_int16_t * slope_table, int steps,
uint16_t * slope_table, int steps,
int step_type, int exposure_time,
SANE_Bool same_speed, double yres,
int power_mode)
@ -908,7 +910,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
double t;
double start_speed;
double g;
u_int32_t time_period;
uint32_t time_period;
int sum_time = 0;
int i, divider;
int same_step;
@ -939,7 +941,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
divider = 1 << step_type;
time_period =
(u_int32_t) (yres * exposure_time /
(uint32_t) (yres * exposure_time /
dev->motor.base_ydpi /*MOTOR_GEAR */ );
if ((time_period < 2000) && (same_speed))
same_speed = SANE_FALSE;
@ -950,7 +952,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
{
for (i = 0; i < steps; i++)
{
slope_table[i] = (u_int16_t) time_period;
slope_table[i] = (uint16_t) time_period;
sum_time += time_period;
DBG (DBG_io, "slope_table[%d] = %d\n", i, time_period);
@ -1025,7 +1027,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
if (steps <= same_step)
{
time_period =
(u_int32_t) (yres * exposure_time /
(uint32_t) (yres * exposure_time /
dev->motor.base_ydpi /*MOTOR_GEAR */ );
time_period = time_period / divider;
@ -1034,7 +1036,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
for (i = 0; i < same_step; i++)
{
slope_table[i] = (u_int16_t) time_period;
slope_table[i] = (uint16_t) time_period;
sum_time += time_period;
DBG (DBG_io, "slope_table[%d] = %d\n", i, time_period);
@ -1056,7 +1058,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
t = pow (j / (steps - same_step), g);
time_period = /* time required for full steps */
(u_int32_t) (yres * exposure_time /
(uint32_t) (yres * exposure_time /
dev->motor.base_ydpi /*MOTOR_GEAR */ *
(start_speed + (1 - start_speed) * t));
@ -1064,7 +1066,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
if (time_period > 65535)
time_period = 65535;
slope_table[i] = (u_int16_t) time_period;
slope_table[i] = (uint16_t) time_period;
sum_time += time_period;
DBG (DBG_io, "slope_table[%d] = %d\n", i, slope_table[i]);
@ -1079,7 +1081,7 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
/* computes gamma table */
void
sanei_genesys_create_gamma_table (u_int16_t * gamma_table, int size,
sanei_genesys_create_gamma_table (uint16_t * gamma_table, int size,
float maximum, float gamma_max, float gamma)
{
int i;
@ -1258,7 +1260,7 @@ sanei_genesys_exposure_time (Genesys_Device * dev, Genesys_Register_Set * reg,
The data needs to be of size "size", and in little endian byte order.
*/
static SANE_Status
genesys_send_offset_and_shading (Genesys_Device * dev, u_int8_t * data,
genesys_send_offset_and_shading (Genesys_Device * dev, uint8_t * data,
int size)
{
int dpihw;
@ -1311,7 +1313,7 @@ SANE_Status
sanei_genesys_init_shading_data (Genesys_Device * dev, int pixels_per_line)
{
SANE_Status status;
u_int8_t *shading_data, *shading_data_ptr;
uint8_t *shading_data, *shading_data_ptr;
int channels;
int i;
@ -1359,7 +1361,7 @@ sanei_genesys_init_shading_data (Genesys_Device * dev, int pixels_per_line)
SANE_Status
sanei_genesys_test_buffer_empty (Genesys_Device * dev, SANE_Bool * empty)
{
u_int8_t val = 0;
uint8_t val = 0;
SANE_Status status;
status = sanei_genesys_get_status (dev, &val);
@ -1387,7 +1389,7 @@ sanei_genesys_test_buffer_empty (Genesys_Device * dev, SANE_Bool * empty)
/* Read data (e.g scanned image) from scan buffer */
SANE_Status
sanei_genesys_read_data_from_scanner (Genesys_Device * dev, u_int8_t * data,
sanei_genesys_read_data_from_scanner (Genesys_Device * dev, uint8_t * data,
size_t size)
{
SANE_Status status;
@ -1447,13 +1449,13 @@ sanei_genesys_read_data_from_scanner (Genesys_Device * dev, u_int8_t * data,
takes gray level 8 bits data and find
first CCD usable pixel and top of scanning area */
SANE_Status
sanei_genesys_search_reference_point (Genesys_Device * dev, u_int8_t * data,
sanei_genesys_search_reference_point (Genesys_Device * dev, uint8_t * data,
int start_pixel, int dpi, int width,
int height)
{
int x, y;
int current, left, top = 0;
u_int8_t *image;
uint8_t *image;
int size, count;
int level = 80; /* edge threshold level */
@ -1635,7 +1637,7 @@ SANE_Status
sanei_genesys_read_feed_steps (Genesys_Device * dev, unsigned int *steps)
{
SANE_Status status;
u_int8_t value;
uint8_t value;
DBG (DBG_proc, "sanei_genesys_read_feed_steps\n");
@ -1656,11 +1658,11 @@ sanei_genesys_read_feed_steps (Genesys_Device * dev, unsigned int *steps)
void
sanei_genesys_calculate_zmode2 (SANE_Bool two_table,
u_int32_t exposure_time,
u_int16_t * slope_table,
uint32_t exposure_time,
uint16_t * slope_table,
int reg21,
int move, int reg22, u_int32_t * z1,
u_int32_t * z2)
int move, int reg22, uint32_t * z1,
uint32_t * z2)
{
int i;
int sum;
@ -1691,23 +1693,23 @@ sanei_genesys_calculate_zmode2 (SANE_Bool two_table,
/* huh? */
/* todo: double check */
/* Z1 and Z2 seem to be a time to synchronize with clock or a phase correction */
/* steps_sum is the result of create_slope_table */
/* last_speed is the last entry of the slope_table */
/* feedl is registers 3d,3e,3f */
/* fastfed is register 02 bit 3 */
/* scanfed is register 1f */
/* fwdstep is register 22 */
/* tgtime is register 6c bit 6+7 >> 6 */
/* steps_sum is the result of create_slope_table */
/* last_speed is the last entry of the slope_table */
/* feedl is registers 3d,3e,3f */
/* fastfed is register 02 bit 3 */
/* scanfed is register 1f */
/* fwdstep is register 22 */
/* tgtime is register 6c bit 6+7 >> 6 */
void
sanei_genesys_calculate_zmode (Genesys_Device * dev, u_int32_t exposure_time,
u_int32_t steps_sum, u_int16_t last_speed,
u_int32_t feedl, u_int8_t fastfed,
u_int8_t scanfed, u_int8_t fwdstep,
u_int8_t tgtime, u_int32_t * z1,
u_int32_t * z2)
sanei_genesys_calculate_zmode (Genesys_Device * dev, uint32_t exposure_time,
uint32_t steps_sum, uint16_t last_speed,
uint32_t feedl, uint8_t fastfed,
uint8_t scanfed, uint8_t fwdstep,
uint8_t tgtime, uint32_t * z1,
uint32_t * z2)
{
u_int8_t exposure_factor;
uint8_t exposure_factor;
dev = dev;
@ -1734,7 +1736,7 @@ sanei_genesys_calculate_zmode (Genesys_Device * dev, u_int32_t exposure_time,
static void
genesys_adjust_gain (Genesys_Device * dev, double *applied_multi,
u_int8_t * new_gain, double multi, u_int8_t gain)
uint8_t * new_gain, double multi, uint8_t gain)
{
double voltage, original_voltage;
@ -1747,7 +1749,7 @@ genesys_adjust_gain (Genesys_Device * dev, double *applied_multi,
voltage *= multi;
*new_gain = (u_int8_t) ((voltage - 0.5) * 4);
*new_gain = (uint8_t) ((voltage - 0.5) * 4);
if (*new_gain > 0x0e)
*new_gain = 0x0e;
@ -1766,7 +1768,7 @@ genesys_adjust_gain (Genesys_Device * dev, double *applied_multi,
/* todo: is return status necessary (unchecked?) */
static SANE_Status
genesys_average_white (Genesys_Device * dev, int channels, int channel,
u_int8_t * data, int size, int *max_average)
uint8_t * data, int size, int *max_average)
{
int gain_white_ref, sum, range;
int average;
@ -1820,7 +1822,7 @@ genesys_average_white (Genesys_Device * dev, int channels, int channel,
/* todo: understand, values are too high */
static int
genesys_average_black (Genesys_Device * dev, int channel,
u_int8_t * data, int pixels)
uint8_t * data, int pixels)
{
int i;
int sum;
@ -1865,10 +1867,10 @@ genesys_coarse_calibration (Genesys_Device * dev)
int white_average;
int channels;
SANE_Status status;
u_int8_t offset[4] = { 0xa0, 0x00, 0xa0, 0x40 }; /* first value isn't used */
u_int16_t white[12], dark[12];
uint8_t offset[4] = { 0xa0, 0x00, 0xa0, 0x40 }; /* first value isn't used */
uint16_t white[12], dark[12];
int i, j;
u_int8_t *calibration_data, *all_data;
uint8_t *calibration_data, *all_data;
DBG (DBG_info, "genesys_coarse_calibration (scan_mode = %d)\n",
dev->settings.scan_mode);
@ -1990,7 +1992,7 @@ genesys_coarse_calibration (Genesys_Device * dev)
y = x - x * (offset[i - 1] / 2) / 254 - dark[(i - 1) * 3 + j];
rate = (x - DARK_VALUE - y) * 254 / x + 0.5;
dev->frontend.offset[j] = (u_int8_t) (rate);
dev->frontend.offset[j] = (uint8_t) (rate);
if (dev->frontend.offset[j] > 0x7f)
dev->frontend.offset[j] = 0x7f;
@ -2114,11 +2116,11 @@ genesys_coarse_calibration (Genesys_Device * dev)
{
/* todo: huh? */
dev->dark[0] =
(u_int16_t) (1.6925 * dark[i * 3 + 0] + 0.1895 * 256);
(uint16_t) (1.6925 * dark[i * 3 + 0] + 0.1895 * 256);
dev->dark[1] =
(u_int16_t) (1.4013 * dark[i * 3 + 1] + 0.3147 * 256);
(uint16_t) (1.4013 * dark[i * 3 + 1] + 0.3147 * 256);
dev->dark[2] =
(u_int16_t) (1.2931 * dark[i * 3 + 2] + 0.1558 * 256);
(uint16_t) (1.2931 * dark[i * 3 + 2] + 0.1558 * 256);
}
else /* one color-component modes */
{
@ -2127,21 +2129,21 @@ genesys_coarse_calibration (Genesys_Device * dev)
case 0:
default:
dev->dark[0] =
(u_int16_t) (1.6925 * dark[i * 3 + 0] +
(uint16_t) (1.6925 * dark[i * 3 + 0] +
(1.1895 - 1.0) * 256);
dev->dark[1] = dev->dark[2] = dev->dark[0];
break;
case 1:
dev->dark[1] =
(u_int16_t) (1.4013 * dark[i * 3 + 1] +
(uint16_t) (1.4013 * dark[i * 3 + 1] +
(1.3147 - 1.0) * 256);
dev->dark[0] = dev->dark[2] = dev->dark[1];
break;
case 2:
dev->dark[2] =
(u_int16_t) (1.2931 * dark[i * 3 + 2] +
(uint16_t) (1.2931 * dark[i * 3 + 2] +
(1.1558 - 1.0) * 256);
dev->dark[0] = dev->dark[1] = dev->dark[2];
break;
@ -2165,12 +2167,12 @@ genesys_coarse_calibration (Genesys_Device * dev)
average_data and calibration_data are little endian 16 bit words.
*/
static void
genesys_average_data (u_int8_t * average_data,
u_int8_t * calibration_data, u_int16_t lines,
u_int16_t pixel_components_per_line)
genesys_average_data (uint8_t * average_data,
uint8_t * calibration_data, uint16_t lines,
uint16_t pixel_components_per_line)
{
int x, y;
u_int32_t sum;
uint32_t sum;
for (x = 0; x < pixel_components_per_line; x++)
{
@ -2193,9 +2195,9 @@ genesys_dark_shading_calibration (Genesys_Device * dev)
{
SANE_Status status;
size_t size;
u_int16_t pixels_per_line;
u_int8_t channels;
u_int8_t *calibration_data;
uint16_t pixels_per_line;
uint8_t channels;
uint8_t *calibration_data;
DBG (DBG_proc, "genesys_dark_shading_calibration\n");
/* end pixel - start pixel */
@ -2323,8 +2325,8 @@ genesys_dark_shading_calibration (Genesys_Device * dev)
static SANE_Status
genesys_dummy_dark_shading (Genesys_Device * dev)
{
u_int16_t pixels_per_line;
u_int8_t channels;
uint16_t pixels_per_line;
uint8_t channels;
int x, skip, xend;
int dummy1, dummy2, dummy3; /* dummy black average per channel */
@ -2418,9 +2420,9 @@ genesys_white_shading_calibration (Genesys_Device * dev)
{
SANE_Status status;
size_t size;
u_int16_t pixels_per_line;
u_int8_t *calibration_data;
u_int8_t channels;
uint16_t pixels_per_line;
uint8_t *calibration_data;
uint8_t channels;
DBG (DBG_proc, "genesys_white_shading_calibration (lines = %d)\n",
dev->model->shading_lines);
@ -2544,12 +2546,12 @@ genesys_dark_white_shading_calibration (Genesys_Device * dev)
{
SANE_Status status;
size_t size;
u_int16_t pixels_per_line;
u_int8_t *calibration_data, *average_white, *average_dark;
u_int8_t channels;
uint16_t pixels_per_line;
uint8_t *calibration_data, *average_white, *average_dark;
uint8_t channels;
unsigned int x;
int y;
u_int32_t dark, white, dark_sum, white_sum, dark_count, white_count, col,
uint32_t dark, white, dark_sum, white_sum, dark_count, white_count, col,
dif;
@ -2735,9 +2737,9 @@ static SANE_Status
genesys_send_shading_coefficient (Genesys_Device * dev)
{
SANE_Status status;
u_int16_t pixels_per_line;
u_int8_t *shading_data; /*contains 16bit words in little endian */
u_int8_t channels;
uint16_t pixels_per_line;
uint8_t *shading_data; /*contains 16bit words in little endian */
uint8_t channels;
int x, j, o;
unsigned int i;
unsigned int coeff, target_code, val, avgpixels, dk, words_per_color = 0;
@ -3221,7 +3223,7 @@ static SANE_Status
genesys_flatbed_calibration (Genesys_Device * dev)
{
SANE_Status status;
u_int16_t pixels_per_line;
uint16_t pixels_per_line;
int yres;
DBG (DBG_info, "genesys_flatbed_calibration\n");
@ -3446,7 +3448,7 @@ genesys_flatbed_calibration (Genesys_Device * dev)
static SANE_Status
genesys_wait_not_moving (Genesys_Device * dev, int mseconds)
{
u_int8_t value;
uint8_t value;
SANE_Status status;
DBG (DBG_proc,
@ -3490,7 +3492,7 @@ static SANE_Status
genesys_warmup_lamp (Genesys_Device * dev)
{
Genesys_Register_Set local_reg[GENESYS_MAX_REGS];
u_int8_t *first_line, *second_line;
uint8_t *first_line, *second_line;
int seconds = 0;
int pixel;
int channels, total_size;
@ -3923,7 +3925,7 @@ genesys_fill_read_buffer (Genesys_Device * dev)
size_t size;
size_t space;
SANE_Status status;
u_int8_t *work_buffer_dst;
uint8_t *work_buffer_dst;
DBG (DBG_proc, "genesys_fill_read_buffer: start\n");
@ -4009,8 +4011,8 @@ genesys_read_ordered_data (Genesys_Device * dev, SANE_Byte * destination,
size_t bytes, extra;
unsigned int channels, depth, src_pixels;
unsigned int ccd_shift[12], shift_count;
u_int8_t *work_buffer_src;
u_int8_t *work_buffer_dst;
uint8_t *work_buffer_src;
uint8_t *work_buffer_dst;
unsigned int dst_lines;
unsigned int step_1_mode;
unsigned int needs_reorder;
@ -5512,7 +5514,7 @@ get_option_value (Genesys_Scanner * s, int option, void *val)
{
unsigned int i;
SANE_Word *table;
u_int16_t *gamma;
uint16_t *gamma;
SANE_Status status = SANE_STATUS_GOOD;
switch (option)

Wyświetl plik

@ -49,7 +49,7 @@
/*8 bit*/
#define SINGLE_BYTE
#define BYTES_PER_COMPONENT 1
#define COMPONENT_TYPE u_int8_t
#define COMPONENT_TYPE uint8_t
#define FUNC_NAME(f) f ## _8
@ -64,7 +64,7 @@
/*16 bit*/
#define DOUBLE_BYTE
#define BYTES_PER_COMPONENT 2
#define COMPONENT_TYPE u_int16_t
#define COMPONENT_TYPE uint16_t
#define FUNC_NAME(f) f ## _16
@ -78,8 +78,8 @@
static SANE_Status
genesys_reverse_bits(
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
size_t bytes)
{
size_t i;
@ -91,12 +91,12 @@ genesys_reverse_bits(
static SANE_Status
genesys_gray_lineart(
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
size_t pixels,
size_t channels,
size_t lines,
u_int8_t threshold)
uint8_t threshold)
{
size_t x,y,c,b;
for(y = 0; y < lines; y++) {
@ -117,8 +117,8 @@ genesys_gray_lineart(
static SANE_Status
genesys_shrink_lines_1 (
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
unsigned int lines,
unsigned int src_pixels,
unsigned int dst_pixels,
@ -127,8 +127,8 @@ genesys_shrink_lines_1 (
/*in search for a correct implementation*/
unsigned int dst_x, src_x, y, c, cnt;
unsigned int avg[3];
u_int8_t *src = (u_int8_t *)src_data;
u_int8_t *dst = (u_int8_t *)dst_data;
uint8_t *src = (uint8_t *)src_data;
uint8_t *dst = (uint8_t *)dst_data;
src_pixels /= 8;
dst_pixels /= 8;

Wyświetl plik

@ -47,14 +47,14 @@
static SANE_Status
FUNC_NAME(genesys_reorder_components_cis) (
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
unsigned int lines,
unsigned int pixels)
{
unsigned int x, y;
u_int8_t *src[3];
u_int8_t *dst = dst_data;
uint8_t *src[3];
uint8_t *dst = dst_data;
unsigned int rest = pixels * 2 * BYTES_PER_COMPONENT;
src[0] = src_data + pixels * BYTES_PER_COMPONENT * 0;
@ -99,14 +99,14 @@ FUNC_NAME(genesys_reorder_components_cis) (
static SANE_Status
FUNC_NAME(genesys_reorder_components_cis_bgr) (
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
unsigned int lines,
unsigned int pixels)
{
unsigned int x, y;
u_int8_t *src[3];
u_int8_t *dst = dst_data;
uint8_t *src[3];
uint8_t *dst = dst_data;
unsigned int rest = pixels * 2 * BYTES_PER_COMPONENT;
src[0] = src_data + pixels * BYTES_PER_COMPONENT * 0;
@ -150,14 +150,14 @@ FUNC_NAME(genesys_reorder_components_cis_bgr) (
static SANE_Status
FUNC_NAME(genesys_reorder_components_bgr) (
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
unsigned int lines,
unsigned int pixels)
{
unsigned int c;
u_int8_t *src = src_data;
u_int8_t *dst = dst_data;
uint8_t *src = src_data;
uint8_t *dst = dst_data;
for(c = 0; c < lines * pixels; c++) {
@ -192,15 +192,15 @@ FUNC_NAME(genesys_reorder_components_bgr) (
#if defined(DOUBLE_BYTE) && defined(WORDS_BIGENDIAN)
static SANE_Status
FUNC_NAME(genesys_reorder_components_endian) (
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
unsigned int lines,
unsigned int pixels,
unsigned int channels)
{
unsigned int c;
u_int8_t *src = src_data;
u_int8_t *dst = dst_data;
uint8_t *src = src_data;
uint8_t *dst = dst_data;
for(c = 0; c < lines * pixels * channels; c++) {
*dst++ = src[1];
@ -214,8 +214,8 @@ return SANE_STATUS_GOOD;
static SANE_Status
FUNC_NAME(genesys_reverse_ccd) (
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
unsigned int lines,
unsigned int components_per_line,
unsigned int *ccd_shift,
@ -283,8 +283,8 @@ FUNC_NAME(genesys_reverse_ccd) (
static SANE_Status
FUNC_NAME(genesys_shrink_lines) (
u_int8_t *src_data,
u_int8_t *dst_data,
uint8_t *src_data,
uint8_t *dst_data,
unsigned int lines,
unsigned int src_pixels,
unsigned int dst_pixels,

Wyświetl plik

@ -57,6 +57,8 @@
#include <sys/time.h>
#endif
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -266,17 +268,17 @@ enum
};
static SANE_Status gl646_set_fe (Genesys_Device * dev, u_int8_t set);
static SANE_Status gl646_set_fe (Genesys_Device * dev, uint8_t set);
static SANE_Status
gl646_setup_registers (Genesys_Device * dev,
Genesys_Register_Set * regs,
u_int16_t * slope_table1,
u_int16_t * slope_table2,
uint16_t * slope_table1,
uint16_t * slope_table2,
SANE_Int resolution,
u_int32_t move,
u_int32_t linecnt,
u_int16_t startx,
u_int16_t endx, SANE_Bool color, SANE_Int depth);
uint32_t move,
uint32_t linecnt,
uint16_t startx,
uint16_t endx, SANE_Bool color, SANE_Int depth);
static void gl646_init_regs (Genesys_Device * dev);
/* Write to many registers */
@ -285,8 +287,8 @@ gl646_bulk_write_register (Genesys_Device * dev,
Genesys_Register_Set * reg, size_t elems)
{
SANE_Status status;
u_int8_t outdata[8];
u_int8_t buffer[GENESYS_MAX_REGS * 2];
uint8_t outdata[8];
uint8_t buffer[GENESYS_MAX_REGS * 2];
size_t size;
unsigned int i;
@ -347,12 +349,12 @@ gl646_bulk_write_register (Genesys_Device * dev,
/* Write bulk data (e.g. shading, gamma) */
static SANE_Status
gl646_bulk_write_data (Genesys_Device * dev, u_int8_t addr,
u_int8_t * data, size_t len)
gl646_bulk_write_data (Genesys_Device * dev, uint8_t addr,
uint8_t * data, size_t len)
{
SANE_Status status;
size_t size;
u_int8_t outdata[8];
uint8_t outdata[8];
DBG (DBG_io, "gl646_bulk_write_data writing %lu bytes\n", (u_long) len);
@ -421,7 +423,7 @@ gl646_bulk_write_data (Genesys_Device * dev, u_int8_t addr,
* reads value from gpio endpoint
*/
static SANE_Status
gl646_gpio_read (SANE_Int dn, u_int8_t * value)
gl646_gpio_read (SANE_Int dn, uint8_t * value)
{
return sanei_usb_control_msg (dn, REQUEST_TYPE_IN,
REQUEST_REGISTER, GPIO_READ, INDEX, 1, value);
@ -431,7 +433,7 @@ gl646_gpio_read (SANE_Int dn, u_int8_t * value)
* writes the given value to gpio endpoint
*/
static SANE_Status
gl646_gpio_write (SANE_Int dn, u_int8_t value)
gl646_gpio_write (SANE_Int dn, uint8_t value)
{
DBG (DBG_proc, "gl646_gpio_write(0x%02x)\n", value);
return sanei_usb_control_msg (dn, REQUEST_TYPE_OUT,
@ -443,7 +445,7 @@ gl646_gpio_write (SANE_Int dn, u_int8_t value)
* writes the given value to gpio output enable endpoint
*/
static SANE_Status
gl646_gpio_output_enable (SANE_Int dn, u_int8_t value)
gl646_gpio_output_enable (SANE_Int dn, uint8_t value)
{
DBG (DBG_proc, "gl646_gpio_output_enable(0x%02x)\n", value);
return sanei_usb_control_msg (dn, REQUEST_TYPE_OUT,
@ -453,12 +455,12 @@ gl646_gpio_output_enable (SANE_Int dn, u_int8_t value)
/* Read bulk data (e.g. scanned data) */
static SANE_Status
gl646_bulk_read_data (Genesys_Device * dev, u_int8_t addr,
u_int8_t * data, size_t len)
gl646_bulk_read_data (Genesys_Device * dev, uint8_t addr,
uint8_t * data, size_t len)
{
SANE_Status status;
size_t size;
u_int8_t outdata[8];
uint8_t outdata[8];
DBG (DBG_io, "gl646_bulk_read_data: requesting %lu bytes\n", (u_long) len);
DBG (DBG_io, "gl646_bulk_read_data: read bytes left %lu \n",
@ -601,7 +603,7 @@ gl646_test_motor_flag_bit (SANE_Byte val)
static void
gl646_set_triple_reg (Genesys_Register_Set * regs, int regnum,
u_int32_t value)
uint32_t value)
{
Genesys_Register_Set *r = NULL;
@ -615,7 +617,7 @@ gl646_set_triple_reg (Genesys_Register_Set * regs, int regnum,
static void
gl646_set_double_reg (Genesys_Register_Set * regs, int regnum,
u_int16_t value)
uint16_t value)
{
Genesys_Register_Set *r = NULL;
@ -792,7 +794,7 @@ typedef struct
SANE_Int dpiset; /**< set sensor dpi */
SANE_Int cksel; /**< dpiset 'divisor' */
SANE_Int dummy; /**< dummy exposure time */
u_int8_t regs_0x10_0x15[6]; /**< per color exposure time for CIS scanners */
uint8_t regs_0x10_0x15[6]; /**< per color exposure time for CIS scanners */
SANE_Bool half_ccd; /**> true if manual CCD/2 clock programming */
} Sensor_Master;
@ -806,10 +808,10 @@ typedef struct
SANE_Int cksel;
/* values */
u_int8_t regs_0x08_0x0b[4]; /**< settings for normal CCD clock */
u_int8_t manual_0x08_0x0b[4]; /**< settings for manual CCD/2 clock */
u_int8_t regs_0x16_0x1d[8];
u_int8_t regs_0x52_0x5e[13];
uint8_t regs_0x08_0x0b[4]; /**< settings for normal CCD clock */
uint8_t manual_0x08_0x0b[4]; /**< settings for manual CCD/2 clock */
uint8_t regs_0x16_0x1d[8];
uint8_t regs_0x52_0x5e[13];
} Sensor_Settings;
@ -934,13 +936,13 @@ static Sensor_Settings sensor_settings[] = {
static SANE_Status
gl646_setup_registers (Genesys_Device * dev,
Genesys_Register_Set * regs,
u_int16_t * slope_table1,
u_int16_t * slope_table2,
uint16_t * slope_table1,
uint16_t * slope_table2,
SANE_Int resolution,
u_int32_t move,
u_int32_t linecnt,
u_int16_t startx,
u_int16_t endx, SANE_Bool color, SANE_Int depth)
uint32_t move,
uint32_t linecnt,
uint16_t startx,
uint16_t endx, SANE_Bool color, SANE_Int depth)
{
SANE_Status status = SANE_STATUS_GOOD;
int i, nb;
@ -949,11 +951,11 @@ gl646_setup_registers (Genesys_Device * dev,
Sensor_Settings *settings = NULL;
Genesys_Register_Set *r;
unsigned int used, vfinal;
u_int32_t z1, z2, addr = 0xdead;
uint32_t z1, z2, addr = 0xdead;
int dummy, channels = 1, stagger, wpl, max_shift;
size_t requested_buffer_size;
size_t read_buffer_size;
u_int8_t control[4];
uint8_t control[4];
DBG (DBG_proc, "gl646_setup_registers: start\n");
DBG (DBG_info, "gl646_setup_registers: startx=%d, endx=%d, linecnt=%d\n",
@ -1034,9 +1036,9 @@ gl646_setup_registers (Genesys_Device * dev,
{
r = sanei_genesys_get_address (regs, 0x08 + i);
if(sensor->half_ccd==SANE_TRUE)
r->value = settings->manual_0x08_0x0b[i];
r->value = settings->manual_0x08_0x0b[i];
else
r->value = settings->regs_0x08_0x0b[i];
r->value = settings->regs_0x08_0x0b[i];
}
for (i = 0; i < 8; i++)
@ -1509,9 +1511,9 @@ static SANE_Status
gl646_asic_test (Genesys_Device * dev)
{
SANE_Status status;
u_int8_t val;
u_int8_t *data;
u_int8_t *verify_data;
uint8_t val;
uint8_t *data;
uint8_t *verify_data;
size_t size, verify_size;
unsigned int i;
@ -1567,14 +1569,14 @@ gl646_asic_test (Genesys_Device * dev)
otherwise the read doesn't succeed the second time after the scanner has
been plugged in. Very strange. */
data = (u_int8_t *) malloc (size);
data = (uint8_t *) malloc (size);
if (!data)
{
DBG (DBG_error, "gl646_asic_test: could not allocate memory\n");
return SANE_STATUS_NO_MEM;
}
verify_data = (u_int8_t *) malloc (verify_size);
verify_data = (uint8_t *) malloc (verify_size);
if (!verify_data)
{
free (data);
@ -1619,7 +1621,7 @@ gl646_asic_test (Genesys_Device * dev)
}
status =
gl646_bulk_read_data (dev, 0x45, (u_int8_t *) verify_data, verify_size);
gl646_bulk_read_data (dev, 0x45, (uint8_t *) verify_data, verify_size);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error, "gl646_asic_test: failed to bulk read data: %s\n",
@ -1886,12 +1888,12 @@ gl646_init_regs (Genesys_Device * dev)
*/
static SANE_Status
gl646_send_slope_table (Genesys_Device * dev, int table_nr,
u_int16_t * slope_table, int steps)
uint16_t * slope_table, int steps)
{
int dpihw;
int start_address;
SANE_Status status;
u_int8_t *table;
uint8_t *table;
#ifdef WORDS_BIGENDIAN
int i;
#endif
@ -1911,14 +1913,14 @@ gl646_send_slope_table (Genesys_Device * dev, int table_nr,
return SANE_STATUS_INVAL;
#ifdef WORDS_BIGENDIAN
table = (u_int8_t *) malloc (steps * 2);
table = (uint8_t *) malloc (steps * 2);
for (i = 0; i < steps; i++)
{
table[i * 2] = slope_table[i] & 0xff;
table[i * 2 + 1] = slope_table[i] >> 8;
}
#else
table = (u_int8_t *) slope_table;
table = (uint8_t *) slope_table;
#endif
status =
@ -1934,7 +1936,7 @@ gl646_send_slope_table (Genesys_Device * dev, int table_nr,
return status;
}
status = gl646_bulk_write_data (dev, 0x3c, (u_int8_t *) table, steps * 2);
status = gl646_bulk_write_data (dev, 0x3c, (uint8_t *) table, steps * 2);
if (status != SANE_STATUS_GOOD)
{
#ifdef WORDS_BIGENDIAN
@ -1955,7 +1957,7 @@ gl646_send_slope_table (Genesys_Device * dev, int table_nr,
/* Set values of Analog Device type frontend */
static SANE_Status
gl646_set_ad_fe (Genesys_Device * dev, u_int8_t set)
gl646_set_ad_fe (Genesys_Device * dev, uint8_t set)
{
SANE_Status status = SANE_STATUS_GOOD;
@ -1980,11 +1982,11 @@ gl646_set_ad_fe (Genesys_Device * dev, u_int8_t set)
/* Set values of analog frontend */
static SANE_Status
gl646_set_fe (Genesys_Device * dev, u_int8_t set)
gl646_set_fe (Genesys_Device * dev, uint8_t set)
{
SANE_Status status;
int i;
u_int8_t val;
uint8_t val;
DBG (DBG_proc, "gl646_set_fe (%s)\n",
set == AFE_INIT ? "init" : set == AFE_SET ? "set" : set ==
@ -2213,7 +2215,7 @@ gl646_set_powersaving (Genesys_Device * dev, int delay /* in minutes */ )
time = delay * 1000 * 60; /* -> msec */
exposure_time =
(u_int32_t) (time * 32000.0 /
(uint32_t) (time * 32000.0 /
(24.0 * 64.0 * (local_reg[1].value & REG03_LAMPTIM) *
1024.0) + 0.5);
/* 32000 = system clock, 24 = clocks per pixel */
@ -2288,8 +2290,8 @@ gl646_load_document (Genesys_Device * dev)
SANE_Status status = SANE_STATUS_GOOD;
Genesys_Register_Set regs[11];
unsigned int used, vfinal, count;
u_int16_t slope_table[255];
u_int8_t val;
uint16_t slope_table[255];
uint8_t val;
DBG (DBG_proc, "gl646_load_document: start\n");
status = sanei_genesys_get_status (dev, &val);
@ -2458,9 +2460,9 @@ static SANE_Status
gl646_detect_document_end (Genesys_Device * dev)
{
SANE_Status status = SANE_STATUS_GOOD;
u_int8_t val;
uint8_t val;
int bytes_to_flush, lines;
u_int32_t flines, bpl, channels, depth;
uint32_t flines, bpl, channels, depth;
DBG (DBG_proc, "gl646_detect_document_end: start\n");
@ -2530,8 +2532,8 @@ gl646_eject_document (Genesys_Device * dev)
SANE_Status status = SANE_STATUS_GOOD;
Genesys_Register_Set regs[7];
unsigned int used, vfinal, count;
u_int16_t slope_table[255];
u_int8_t val;
uint16_t slope_table[255];
uint8_t val;
DBG (DBG_proc, "gl646_eject_document: start\n");
@ -2731,7 +2733,7 @@ gl646_end_scan (Genesys_Device * dev, Genesys_Register_Set * reg,
{
SANE_Status status;
int i = 0;
u_int8_t val;
uint8_t val;
DBG (DBG_proc, "gl646_end_scan (check_stop = %d)\n", check_stop);
@ -2799,11 +2801,11 @@ gl646_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
{
Genesys_Register_Set local_reg[GENESYS_GL646_MAX_REGS + 1];
SANE_Status status;
u_int8_t val = 0;
u_int8_t prepare_steps;
u_int32_t steps;
u_int16_t slope_table0[256];
u_int16_t exposure_time;
uint8_t val = 0;
uint8_t prepare_steps;
uint32_t steps;
uint16_t slope_table0[256];
uint16_t exposure_time;
int i, dpi;
DBG (DBG_proc, "gl646_slow_back_home (wait_until_home = %d)\n",
@ -3015,7 +3017,7 @@ gl646_park_head (Genesys_Device * dev, Genesys_Register_Set * reg,
{
Genesys_Register_Set local_reg[9];
SANE_Status status;
u_int8_t val = 0;
uint8_t val = 0;
int loop = 0;
int i;
int exposure_time;
@ -3186,8 +3188,8 @@ gl646_search_start_position (Genesys_Device * dev)
{
int size;
SANE_Status status;
u_int8_t *data;
u_int16_t slope_table0[256];
uint8_t *data;
uint16_t slope_table0[256];
Genesys_Register_Set local_reg[GENESYS_GL646_MAX_REGS + 1];
int i, steps;
int exposure_time, half_ccd = 0;
@ -3477,15 +3479,15 @@ static SANE_Status
gl646_init_regs_for_coarse_calibration (Genesys_Device * dev)
{
SANE_Status status;
u_int32_t bytes_per_line;
u_int32_t words_per_line;
u_int32_t steps_sum;
u_int32_t z1, z2;
u_int16_t slope_table[256];
u_int16_t strpixel;
u_int16_t endpixel;
u_int8_t channels;
u_int8_t cksel;
uint32_t bytes_per_line;
uint32_t words_per_line;
uint32_t steps_sum;
uint32_t z1, z2;
uint16_t slope_table[256];
uint16_t strpixel;
uint16_t endpixel;
uint8_t channels;
uint8_t cksel;
DBG (DBG_proc, "gl646_init_regs_for_coarse_calibration\n");
@ -3636,17 +3638,17 @@ static SANE_Status
gl646_init_regs_for_shading (Genesys_Device * dev)
{
SANE_Status status;
u_int32_t bytes_per_line;
u_int32_t num_pixels;
u_int32_t steps_sum;
uint32_t bytes_per_line;
uint32_t num_pixels;
uint32_t steps_sum;
int move = 0;
int exposure_time;
u_int32_t z1, z2;
u_int16_t slope_table[256];
u_int16_t steps;
u_int8_t step_parts;
u_int8_t channels;
u_int8_t dummy_lines = 3;
uint32_t z1, z2;
uint16_t slope_table[256];
uint16_t steps;
uint8_t step_parts;
uint8_t channels;
uint8_t dummy_lines = 3;
int dpiset;
SANE_Bool half_ccd;
int workaround;
@ -3743,12 +3745,12 @@ gl646_init_regs_for_shading (Genesys_Device * dev)
}
else
{
dev->calib_reg[reg_0x21].value = (u_int8_t) steps;
dev->calib_reg[reg_0x21].value = (uint8_t) steps;
steps = 2 * step_parts;
if (steps > 255)
steps = 255;
dev->calib_reg[reg_0x22].value = (u_int8_t) steps;
dev->calib_reg[reg_0x22].value = (uint8_t) steps;
}
dev->calib_reg[reg_0x23].value = dev->calib_reg[reg_0x22].value;
dev->calib_reg[reg_0x24].value = dev->calib_reg[reg_0x21].value;
@ -3974,7 +3976,7 @@ gl646_init_regs_for_scan_old (Genesys_Device * dev)
int fast_dpi = 0;
int fast_exposure = 0;
int dummy;
u_int32_t steps_sum, z1, z2;
uint32_t steps_sum, z1, z2;
SANE_Bool half_ccd; /* false: full CCD res is used, true, half max CCD res is used */
SANE_Status status;
unsigned int stagger;
@ -4527,7 +4529,7 @@ gl646_init_regs_for_scan (Genesys_Device * dev)
SANE_Status status;
SANE_Bool color;
int channels;
u_int16_t startx, endx;
uint16_t startx, endx;
int move;
/* these 2 models use the old way to setup registers */
@ -4670,7 +4672,7 @@ gl646_send_gamma_table (Genesys_Device * dev, SANE_Bool generic)
int size;
int address;
int status;
u_int8_t *gamma;
uint8_t *gamma;
int i;
/* don't send anything if no specific gamma table defined */
@ -4690,7 +4692,7 @@ gl646_send_gamma_table (Genesys_Device * dev, SANE_Bool generic)
size = 4096;
/* allocate temporary gamma tables: 16 bits words, 3 channels */
gamma = (u_int8_t *) malloc (size * 2 * 3);
gamma = (uint8_t *) malloc (size * 2 * 3);
if (!gamma)
return SANE_STATUS_NO_MEM;
/* take care off generic/specific data */
@ -4751,7 +4753,7 @@ gl646_send_gamma_table (Genesys_Device * dev, SANE_Bool generic)
/* send data */
status =
gl646_bulk_write_data (dev, 0x3c, (u_int8_t *) gamma, size * 2 * 3);
gl646_bulk_write_data (dev, 0x3c, (uint8_t *) gamma, size * 2 * 3);
if (status != SANE_STATUS_GOOD)
{
free (gamma);
@ -4788,14 +4790,14 @@ gl646_offset_calibration (Genesys_Device * dev)
int num_pixels;
int total_size;
int avg[3];
u_int8_t *first_line, *second_line;
uint8_t *first_line, *second_line;
int i, j;
SANE_Status status = SANE_STATUS_GOOD;
int average, val, count;
int minimum, offset, dpi, channels;
SANE_Bool half_ccd = 1;
int steps = 0, lincnt = 1, start_pixel;
u_int16_t slope_table[256];
uint16_t slope_table[256];
DBG (DBG_proc, "gl646_offset_calibration\n");
@ -5229,7 +5231,7 @@ gl646_coarse_gain_calibration (Genesys_Device * dev, int dpi)
int num_pixels;
int black_pixels;
int total_size;
u_int8_t *line;
uint8_t *line;
int i, j, channels;
SANE_Status status = SANE_STATUS_GOOD;
float average[3];
@ -5362,7 +5364,7 @@ gl646_init_regs_for_warmup (Genesys_Device * dev,
int startpixel, endpixel;
int steps = 0;
SANE_Status status = SANE_STATUS_GOOD;
u_int16_t slope_table[256];
uint16_t slope_table[256];
DBG (DBG_proc, "gl646_warmup_lamp\n");
@ -5546,7 +5548,7 @@ static SANE_Status
gl646_repark_head (Genesys_Device * dev)
{
Genesys_Register_Set local_reg[GENESYS_GL646_MAX_REGS + 1];
u_int16_t slope_table[256];
uint16_t slope_table[256];
unsigned int exposure_time; /* todo : modify sanei_genesys_exposure_time() */
SANE_Status status;
unsigned int steps = 232;
@ -5718,8 +5720,8 @@ gl646_init (Genesys_Device * dev)
{
SANE_Status status;
struct timeval tv;
u_int8_t cold = 0, val = 0;
u_int32_t addr = 0xdead;
uint8_t cold = 0, val = 0;
uint32_t addr = 0xdead;
int size;
DBG_INIT ();
@ -5823,7 +5825,7 @@ gl646_init (Genesys_Device * dev)
if (dev->sensor.red_gamma_table == NULL)
{
dev->sensor.red_gamma_table = (u_int16_t *) malloc (2 * size);
dev->sensor.red_gamma_table = (uint16_t *) malloc (2 * size);
if (dev->sensor.red_gamma_table == NULL)
{
DBG (DBG_error,
@ -5836,7 +5838,7 @@ gl646_init (Genesys_Device * dev)
}
if (dev->sensor.green_gamma_table == NULL)
{
dev->sensor.green_gamma_table = (u_int16_t *) malloc (2 * size);
dev->sensor.green_gamma_table = (uint16_t *) malloc (2 * size);
if (dev->sensor.red_gamma_table == NULL)
{
DBG (DBG_error,
@ -5850,7 +5852,7 @@ gl646_init (Genesys_Device * dev)
}
if (dev->sensor.blue_gamma_table == NULL)
{
dev->sensor.blue_gamma_table = (u_int16_t *) malloc (2 * size);
dev->sensor.blue_gamma_table = (uint16_t *) malloc (2 * size);
if (dev->sensor.red_gamma_table == NULL)
{
DBG (DBG_error,
@ -6030,7 +6032,7 @@ static SANE_Status
gl646_update_hardware_sensors (Genesys_Scanner *session)
{
Genesys_Device *dev=session->dev;
u_int8_t value;
uint8_t value;
SANE_Status status;
/* do what is needed to get a new set of events, but try to not lose

Wyświetl plik

@ -59,6 +59,8 @@
#include <errno.h>
#include <unistd.h>
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -125,7 +127,7 @@
#define REG07_DMASEL 0x02
#define REG07_DMARDWR 0x01
#define REG08_DECFLAG 0x40
#define REG08_DECFLAG 0x40
#define REG08_GMMFFR 0x20
#define REG08_GMMFFG 0x10
#define REG08_GMMFFB 0x08
@ -390,7 +392,7 @@ gl841_bulk_write_register (Genesys_Device * dev,
{
SANE_Status status = SANE_STATUS_GOOD;
unsigned int i, c;
u_int8_t buffer[GENESYS_MAX_REGS * 2];
uint8_t buffer[GENESYS_MAX_REGS * 2];
/* handle differently sized register sets, reg[0x00] is the last one */
i = 0;
@ -436,12 +438,12 @@ gl841_bulk_write_register (Genesys_Device * dev,
/* Write bulk data (e.g. shading, gamma) */
static SANE_Status
gl841_bulk_write_data (Genesys_Device * dev, u_int8_t addr,
u_int8_t * data, size_t len)
gl841_bulk_write_data (Genesys_Device * dev, uint8_t addr,
uint8_t * data, size_t len)
{
SANE_Status status;
size_t size;
u_int8_t outdata[8];
uint8_t outdata[8];
DBG (DBG_io, "gl841_bulk_write_data writing %lu bytes\n",
(u_long) len);
@ -528,12 +530,12 @@ printtime(char *p) {
/* Read bulk data (e.g. scanned data) */
static SANE_Status
gl841_bulk_read_data (Genesys_Device * dev, u_int8_t addr,
u_int8_t * data, size_t len)
gl841_bulk_read_data (Genesys_Device * dev, uint8_t addr,
uint8_t * data, size_t len)
{
SANE_Status status;
size_t size;
u_int8_t outdata[8];
uint8_t outdata[8];
DBG (DBG_io, "gl841_bulk_read_data: requesting %lu bytes\n",
(u_long) len);
@ -608,7 +610,7 @@ gl841_bulk_read_data (Genesys_Device * dev, u_int8_t addr,
/* Set address for writing data */
static SANE_Status
gl841_set_buffer_address_gamma (Genesys_Device * dev, u_int32_t addr)
gl841_set_buffer_address_gamma (Genesys_Device * dev, uint32_t addr)
{
SANE_Status status;
@ -643,12 +645,12 @@ gl841_set_buffer_address_gamma (Genesys_Device * dev, u_int32_t addr)
/* Write bulk data (e.g. gamma) */
static SANE_Status
gl841_bulk_write_data_gamma (Genesys_Device * dev, u_int8_t addr,
u_int8_t * data, size_t len)
gl841_bulk_write_data_gamma (Genesys_Device * dev, uint8_t addr,
uint8_t * data, size_t len)
{
SANE_Status status;
size_t size;
u_int8_t outdata[8];
uint8_t outdata[8];
DBG (DBG_io, "gl841_bulk_write_data_gamma writing %lu bytes\n",
(u_long) len);
@ -1247,9 +1249,9 @@ static SANE_Status
sanei_gl841_asic_test (Genesys_Device * dev)
{
SANE_Status status;
u_int8_t val;
u_int8_t *data;
u_int8_t *verify_data;
uint8_t val;
uint8_t *data;
uint8_t *verify_data;
size_t size, verify_size;
unsigned int i;
@ -1309,14 +1311,14 @@ sanei_gl841_asic_test (Genesys_Device * dev)
otherwise the read doesn't succeed the second time after the scanner has
been plugged in. Very strange. */
data = (u_int8_t *) malloc (size);
data = (uint8_t *) malloc (size);
if (!data)
{
DBG (DBG_error, "sanei_gl841_asic_test: could not allocate memory\n");
return SANE_STATUS_NO_MEM;
}
verify_data = (u_int8_t *) malloc (verify_size);
verify_data = (uint8_t *) malloc (verify_size);
if (!verify_data)
{
free (data);
@ -1364,7 +1366,7 @@ sanei_gl841_asic_test (Genesys_Device * dev)
}
status =
gl841_bulk_read_data (dev, 0x45, (u_int8_t *) verify_data,
gl841_bulk_read_data (dev, 0x45, (uint8_t *) verify_data,
verify_size);
if (status != SANE_STATUS_GOOD)
{
@ -1545,12 +1547,12 @@ gl841_init_registers (Genesys_Device * dev)
*/
static SANE_Status
gl841_send_slope_table (Genesys_Device * dev, int table_nr,
u_int16_t * slope_table, int steps)
uint16_t * slope_table, int steps)
{
int dpihw;
int start_address;
SANE_Status status;
u_int8_t *table;
uint8_t *table;
/*#ifdef WORDS_BIGENDIAN*/
int i;
/*#endif*/
@ -1570,13 +1572,13 @@ gl841_send_slope_table (Genesys_Device * dev, int table_nr,
return SANE_STATUS_INVAL;
/*#ifdef WORDS_BIGENDIAN*/
table = (u_int8_t*)malloc(steps * 2);
table = (uint8_t*)malloc(steps * 2);
for(i = 0; i < steps; i++) {
table[i * 2] = slope_table[i] & 0xff;
table[i * 2 + 1] = slope_table[i] >> 8;
}
/*#else
table = (u_int8_t*)slope_table;
table = (uint8_t*)slope_table;
#endif*/
status =
@ -1593,7 +1595,7 @@ gl841_send_slope_table (Genesys_Device * dev, int table_nr,
}
status =
gl841_bulk_write_data (dev, 0x3c, (u_int8_t *) table,
gl841_bulk_write_data (dev, 0x3c, (uint8_t *) table,
steps * 2);
if (status != SANE_STATUS_GOOD)
{
@ -1615,11 +1617,11 @@ gl841_send_slope_table (Genesys_Device * dev, int table_nr,
/* Set values of analog frontend */
static SANE_Status
gl841_set_fe (Genesys_Device * dev, u_int8_t set)
gl841_set_fe (Genesys_Device * dev, uint8_t set)
{
SANE_Status status;
int i;
u_int8_t val;
uint8_t val;
DBG (DBG_proc, "gl841_set_fe (%s)\n",
set == 1 ? "init" : set == 2 ? "set" : set ==
@ -1895,7 +1897,7 @@ gl841_init_motor_regs(Genesys_Device * dev,
SANE_Status status;
unsigned int fast_exposure;
int use_fast_fed = 0;
u_int16_t fast_slope_table[256];
uint16_t fast_slope_table[256];
unsigned int fast_slope_time;
unsigned int fast_slope_steps = 0;
unsigned int feedl;
@ -2070,9 +2072,9 @@ gl841_init_motor_regs_scan(Genesys_Device * dev,
int use_fast_fed = 0;
unsigned int fast_time;
unsigned int slow_time;
u_int16_t slow_slope_table[256];
u_int16_t fast_slope_table[256];
u_int16_t back_slope_table[256];
uint16_t slow_slope_table[256];
uint16_t fast_slope_table[256];
uint16_t back_slope_table[256];
unsigned int slow_slope_time;
unsigned int fast_slope_time;
unsigned int back_slope_time;
@ -2082,7 +2084,7 @@ gl841_init_motor_regs_scan(Genesys_Device * dev,
unsigned int feedl;
Genesys_Register_Set * r;
unsigned int min_restep = 0x20;
u_int32_t z1, z2;
uint32_t z1, z2;
DBG (DBG_proc, "gl841_init_motor_regs_scan : scan_exposure_time=%d, "
"scan_yres=%g, scan_step_type=%d, scan_lines=%d, scan_dummy=%d, "
@ -3141,7 +3143,7 @@ gl841_set_lamp_power (Genesys_Device * dev,
/*for fast power saving methods only, like disabling certain amplifiers*/
static SANE_Status
gl841_save_power(Genesys_Device * dev, SANE_Bool enable) {
u_int8_t val;
uint8_t val;
DBG(DBG_proc, "gl841_save_power: enable = %d\n", enable);
@ -3267,7 +3269,7 @@ gl841_set_powersaving (Genesys_Device * dev,
time = delay * 1000 * 60; /* -> msec */
exposure_time =
(u_int32_t) (time * 32000.0 /
(uint32_t) (time * 32000.0 /
(24.0 * 64.0 * (local_reg[1].value & REG03_LAMPTIM) *
1024.0) + 0.5);
/* 32000 = system clock, 24 = clocks per pixel */
@ -3325,7 +3327,7 @@ gl841_stop_action (Genesys_Device * dev)
{
Genesys_Register_Set local_reg[GENESYS_GL841_MAX_REGS+1];
SANE_Status status;
u_int8_t val40;
uint8_t val40;
unsigned int loop;
DBG (DBG_proc,
@ -3405,7 +3407,7 @@ static SANE_Status
gl841_get_paper_sensor(Genesys_Device * dev, SANE_Bool * paper_loaded)
{
SANE_Status status;
u_int8_t val;
uint8_t val;
status = sanei_genesys_read_register(dev, 0x6d, &val);
if (status != SANE_STATUS_GOOD)
@ -3426,7 +3428,7 @@ gl841_eject_document (Genesys_Device * dev)
{
Genesys_Register_Set local_reg[GENESYS_GL841_MAX_REGS+1];
SANE_Status status;
u_int8_t val;
uint8_t val;
SANE_Bool paper_loaded;
unsigned int init_steps;
float feed_mm;
@ -3781,7 +3783,7 @@ gl841_feed (Genesys_Device * dev, int steps)
{
Genesys_Register_Set local_reg[GENESYS_GL841_MAX_REGS+1];
SANE_Status status;
u_int8_t val;
uint8_t val;
int loop;
DBG (DBG_proc, "gl841_feed (steps = %d)\n",
@ -3866,7 +3868,7 @@ gl841_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
{
Genesys_Register_Set local_reg[GENESYS_GL841_MAX_REGS+1];
SANE_Status status;
u_int8_t val;
uint8_t val;
DBG (DBG_proc, "gl841_slow_back_home (wait_until_home = %d)\n",
wait_until_home);
@ -3986,7 +3988,7 @@ gl841_park_head (Genesys_Device * dev, Genesys_Register_Set * reg,
{
Genesys_Register_Set local_reg[GENESYS_GL841_MAX_REGS+1];
SANE_Status status;
u_int8_t val = 0;
uint8_t val = 0;
int loop;
int i = 0;
@ -4112,7 +4114,7 @@ gl841_search_start_position (Genesys_Device * dev)
{
int size;
SANE_Status status;
u_int8_t *data;
uint8_t *data;
Genesys_Register_Set local_reg[GENESYS_GL841_MAX_REGS+1];
int steps;
@ -4233,8 +4235,8 @@ static SANE_Status
gl841_init_regs_for_coarse_calibration (Genesys_Device * dev)
{
SANE_Status status;
u_int8_t channels;
u_int8_t cksel;
uint8_t channels;
uint8_t cksel;
DBG (DBG_proc, "gl841_init_regs_for_coarse_calibration\n");
@ -4301,7 +4303,7 @@ static SANE_Status
gl841_init_regs_for_shading (Genesys_Device * dev)
{
SANE_Status status;
u_int8_t channels;
uint8_t channels;
DBG (DBG_proc, "gl841_init_regs_for_shading: lines = %d\n",
@ -4461,7 +4463,7 @@ gl841_send_gamma_table (Genesys_Device * dev, SANE_Bool generic)
{
int size;
int status;
u_int8_t *gamma;
uint8_t *gamma;
int i;
DBG (DBG_proc, "gl841_send_gamma_table\n");
@ -4480,7 +4482,7 @@ gl841_send_gamma_table (Genesys_Device * dev, SANE_Bool generic)
size = 256;
/* allocate temporary gamma tables: 16 bits words, 3 channels */
gamma = (u_int8_t *) malloc (size * 2 * 3);
gamma = (uint8_t *) malloc (size * 2 * 3);
if (!gamma)
return SANE_STATUS_NO_MEM;
@ -4531,7 +4533,7 @@ gl841_send_gamma_table (Genesys_Device * dev, SANE_Bool generic)
/* send data */
status =
gl841_bulk_write_data_gamma (dev, 0x28, (u_int8_t *) gamma,
gl841_bulk_write_data_gamma (dev, 0x28, (uint8_t *) gamma,
size * 2 * 3);
if (status != SANE_STATUS_GOOD)
{
@ -4559,7 +4561,7 @@ gl841_led_calibration (Genesys_Device * dev)
int num_pixels;
int total_size;
int used_res;
u_int8_t *line;
uint8_t *line;
int i, j;
SANE_Status status = SANE_STATUS_GOOD;
int val;
@ -4567,7 +4569,7 @@ gl841_led_calibration (Genesys_Device * dev)
int avg[3], avga, avge;
int turn;
char fn[20];
u_int16_t expr, expg, expb;
uint16_t expr, expg, expb;
Genesys_Register_Set *r;
SANE_Bool acceptable = SANE_FALSE;
@ -4760,7 +4762,7 @@ gl841_offset_calibration (Genesys_Device * dev)
int num_pixels;
int total_size;
int used_res;
u_int8_t *first_line, *second_line;
uint8_t *first_line, *second_line;
int i, j;
SANE_Status status = SANE_STATUS_GOOD;
int val;
@ -5166,7 +5168,7 @@ gl841_coarse_gain_calibration (Genesys_Device * dev, int dpi)
int num_pixels;
int black_pixels;
int total_size;
u_int8_t *line;
uint8_t *line;
int i, j, channels;
SANE_Status status = SANE_STATUS_GOOD;
int max[3];
@ -5419,9 +5421,9 @@ static SANE_Status
gl841_init (Genesys_Device * dev)
{
SANE_Status status;
u_int8_t val;
uint8_t val;
size_t size;
u_int8_t *line;
uint8_t *line;
DBG_INIT ();
DBG (DBG_proc, "gl841_init\n");
@ -5490,7 +5492,7 @@ gl841_init (Genesys_Device * dev)
if (dev->sensor.red_gamma_table == NULL)
{
dev->sensor.red_gamma_table = (u_int16_t *) malloc (2 * size);
dev->sensor.red_gamma_table = (uint16_t *) malloc (2 * size);
if (dev->sensor.red_gamma_table == NULL)
{
DBG (DBG_error,
@ -5503,7 +5505,7 @@ gl841_init (Genesys_Device * dev)
}
if (dev->sensor.green_gamma_table == NULL)
{
dev->sensor.green_gamma_table = (u_int16_t *) malloc (2 * size);
dev->sensor.green_gamma_table = (uint16_t *) malloc (2 * size);
if (dev->sensor.red_gamma_table == NULL)
{
DBG (DBG_error,
@ -5516,7 +5518,7 @@ gl841_init (Genesys_Device * dev)
}
if (dev->sensor.blue_gamma_table == NULL)
{
dev->sensor.blue_gamma_table = (u_int16_t *) malloc (2 * size);
dev->sensor.blue_gamma_table = (uint16_t *) malloc (2 * size);
if (dev->sensor.red_gamma_table == NULL)
{
DBG (DBG_error,
@ -5600,7 +5602,7 @@ gl841_update_hardware_sensors (Genesys_Scanner * s)
any of them.
*/
SANE_Status status = SANE_STATUS_GOOD;
u_int8_t val;
uint8_t val;
if (s->dev->model->gpo_type == GPO_CANONLIDE35)
{

Wyświetl plik

@ -144,10 +144,10 @@
#define AFE_SET 2
#define AFE_POWER_SAVE 4
#define LOWORD(x) ((u_int16_t)(x & 0xffff))
#define HIWORD(x) ((u_int16_t)(x >> 16))
#define LOBYTE(x) ((u_int8_t)((x) & 0xFF))
#define HIBYTE(x) ((u_int8_t)((x) >> 8))
#define LOWORD(x) ((uint16_t)(x & 0xffff))
#define HIWORD(x) ((uint16_t)(x >> 16))
#define LOBYTE(x) ((uint8_t)((x) & 0xFF))
#define HIBYTE(x) ((uint8_t)((x) >> 8))
/* Global constants */
/* todo: check if those are the same for every scanner */
@ -166,11 +166,11 @@ typedef struct
typedef struct
{
u_int8_t reg[4];
u_int8_t sign[3];
u_int8_t offset[3];
u_int8_t gain[3];
u_int8_t reg2[3];
uint8_t reg[4];
uint8_t sign[3];
uint8_t offset[3];
uint8_t gain[3];
uint8_t reg2[3];
} Genesys_Frontend;
typedef struct
@ -182,21 +182,21 @@ typedef struct
int sensor_pixels; /* total pixels used by the sensor */
int fau_gain_white_ref; /* TA CCD target code (reference gain) */
int gain_white_ref; /* CCD target code (reference gain) */
u_int8_t regs_0x08_0x0b[4];
u_int8_t regs_0x10_0x1d[14];
u_int8_t regs_0x52_0x5e[13];
uint8_t regs_0x08_0x0b[4];
uint8_t regs_0x10_0x1d[14];
uint8_t regs_0x52_0x5e[13];
float red_gamma;
float green_gamma;
float blue_gamma;
u_int16_t *red_gamma_table;
u_int16_t *green_gamma_table;
u_int16_t *blue_gamma_table;
uint16_t *red_gamma_table;
uint16_t *green_gamma_table;
uint16_t *blue_gamma_table;
} Genesys_Sensor;
typedef struct
{
u_int8_t value[2];
u_int8_t enable[2];
uint8_t value[2];
uint8_t enable[2];
} Genesys_Gpo;
typedef struct
@ -319,7 +319,7 @@ typedef struct Genesys_Command_Set
int (*bulk_full_size) (void);
SANE_Status (*set_fe) (Genesys_Device * dev, u_int8_t set);
SANE_Status (*set_fe) (Genesys_Device * dev, uint8_t set);
SANE_Status (*set_powersaving) (Genesys_Device * dev, int delay);
SANE_Status (*save_power) (Genesys_Device * dev, SANE_Bool enable);
@ -351,11 +351,11 @@ typedef struct Genesys_Command_Set
SANE_Status (*bulk_write_register) (Genesys_Device * dev,
Genesys_Register_Set * reg,
size_t elems);
SANE_Status (*bulk_write_data) (Genesys_Device * dev, u_int8_t addr,
u_int8_t * data, size_t len);
SANE_Status (*bulk_write_data) (Genesys_Device * dev, uint8_t addr,
uint8_t * data, size_t len);
SANE_Status (*bulk_read_data) (Genesys_Device * dev, u_int8_t addr,
u_int8_t * data, size_t len);
SANE_Status (*bulk_read_data) (Genesys_Device * dev, uint8_t addr,
uint8_t * data, size_t len);
/* Updates hardware sensor information in Genesys_Scanner.val[].
If possible, just get information for given option.
@ -502,14 +502,14 @@ struct Genesys_Device
Genesys_Sensor sensor;
Genesys_Gpo gpo;
Genesys_Motor motor;
u_int16_t slope_table0[256];
u_int16_t slope_table1[256];
u_int8_t control[6];
uint16_t slope_table0[256];
uint16_t slope_table1[256];
uint8_t control[6];
time_t init_date;
u_int8_t *white_average_data;
u_int8_t *dark_average_data;
u_int16_t dark[3];
uint8_t *white_average_data;
uint8_t *dark_average_data;
uint16_t dark[3];
SANE_Bool already_initialized;
SANE_Int scanhead_position_in_steps;
@ -558,15 +558,15 @@ sanei_genesys_set_reg_from_set (Genesys_Register_Set * regs,
SANE_Byte address, SANE_Byte value);
extern SANE_Status
sanei_genesys_read_register (Genesys_Device * dev, u_int8_t reg,
u_int8_t * val);
sanei_genesys_read_register (Genesys_Device * dev, uint8_t reg,
uint8_t * val);
extern SANE_Status
sanei_genesys_write_register (Genesys_Device * dev, u_int8_t reg,
u_int8_t val);
sanei_genesys_write_register (Genesys_Device * dev, uint8_t reg,
uint8_t val);
extern SANE_Status
sanei_genesys_get_status (Genesys_Device * dev, u_int8_t * status);
sanei_genesys_get_status (Genesys_Device * dev, uint8_t * status);
extern void sanei_genesys_init_fe (Genesys_Device * dev);
@ -583,27 +583,27 @@ extern SANE_Status sanei_genesys_read_feed_steps (Genesys_Device * dev,
extern void
sanei_genesys_calculate_zmode2 (SANE_Bool two_table,
u_int32_t exposure_time,
u_int16_t * slope_table,
uint32_t exposure_time,
uint16_t * slope_table,
int reg21,
int move, int reg22, u_int32_t * z1,
u_int32_t * z2);
int move, int reg22, uint32_t * z1,
uint32_t * z2);
extern void
sanei_genesys_calculate_zmode (Genesys_Device * dev,
u_int32_t exposure_time,
u_int32_t steps_sum,
u_int16_t last_speed, u_int32_t feedl,
u_int8_t fastfed, u_int8_t scanfed,
u_int8_t fwdstep, u_int8_t tgtime,
u_int32_t * z1, u_int32_t * z2);
uint32_t exposure_time,
uint32_t steps_sum,
uint16_t last_speed, uint32_t feedl,
uint8_t fastfed, uint8_t scanfed,
uint8_t fwdstep, uint8_t tgtime,
uint32_t * z1, uint32_t * z2);
extern SANE_Status
sanei_genesys_set_buffer_address (Genesys_Device * dev, u_int32_t addr);
sanei_genesys_set_buffer_address (Genesys_Device * dev, uint32_t addr);
extern SANE_Status
sanei_genesys_fe_write_data (Genesys_Device * dev, u_int8_t addr,
u_int16_t data);
sanei_genesys_fe_write_data (Genesys_Device * dev, uint8_t addr,
uint16_t data);
extern SANE_Int
sanei_genesys_exposure_time2 (Genesys_Device * dev,
@ -614,22 +614,22 @@ extern SANE_Int
sanei_genesys_exposure_time (Genesys_Device * dev, Genesys_Register_Set * reg,
int xdpi);
extern SANE_Int
sanei_genesys_generate_slope_table (u_int16_t * slope_table, unsigned int max_steps,
unsigned int use_steps, u_int16_t stop_at,
u_int16_t vstart, u_int16_t vend,
sanei_genesys_generate_slope_table (uint16_t * slope_table, unsigned int max_steps,
unsigned int use_steps, uint16_t stop_at,
uint16_t vstart, uint16_t vend,
unsigned int steps, double g,
unsigned int *used_steps, unsigned int *vfinal);
extern SANE_Int
sanei_genesys_create_slope_table (Genesys_Device * dev,
u_int16_t * slope_table, int steps,
uint16_t * slope_table, int steps,
int step_type, int exposure_time,
SANE_Bool same_speed, double yres,
int power_mode);
SANE_Int
sanei_genesys_create_slope_table3 (Genesys_Device * dev,
u_int16_t * slope_table, int max_step,
uint16_t * slope_table, int max_step,
unsigned int use_steps,
int step_type, int exposure_time,
double yres,
@ -638,7 +638,7 @@ sanei_genesys_create_slope_table3 (Genesys_Device * dev,
int power_mode);
extern void
sanei_genesys_create_gamma_table (u_int16_t * gamma_table, int size,
sanei_genesys_create_gamma_table (uint16_t * gamma_table, int size,
float maximum, float gamma_max,
float gamma);
@ -647,19 +647,19 @@ extern SANE_Status sanei_genesys_start_motor (Genesys_Device * dev);
extern SANE_Status sanei_genesys_stop_motor (Genesys_Device * dev);
extern SANE_Status
sanei_genesys_search_reference_point (Genesys_Device * dev, u_int8_t * data,
sanei_genesys_search_reference_point (Genesys_Device * dev, uint8_t * data,
int start_pixel, int dpi, int width,
int height);
extern SANE_Status
sanei_genesys_write_pnm_file (char *filename, u_int8_t * data, int depth,
sanei_genesys_write_pnm_file (char *filename, uint8_t * data, int depth,
int channels, int pixels_per_line, int lines);
extern SANE_Status
sanei_genesys_test_buffer_empty (Genesys_Device * dev, SANE_Bool * empty);
extern SANE_Status
sanei_genesys_read_data_from_scanner (Genesys_Device * dev, u_int8_t * data,
sanei_genesys_read_data_from_scanner (Genesys_Device * dev, uint8_t * data,
size_t size);
extern SANE_Status

Plik diff jest za duży Load Diff

Wyświetl plik

@ -90,11 +90,11 @@
struct ScanRequest
{
u_int8_t x1; /* Set to 0x08 */
u_int16_t dpix, dpiy; /* Set to 75, 150 or 300 in network order */
u_int16_t offx, offy; /* Offset to scan, in 1/300th of dpi, in network order */
u_int16_t lenx, leny; /* Size of scan, in 1/300th of dpi, in network order */
u_int16_t flags1, flags2, flags3; /* Undetermined flag info */
uint8_t x1; /* Set to 0x08 */
uint16_t dpix, dpiy; /* Set to 75, 150 or 300 in network order */
uint16_t offx, offy; /* Offset to scan, in 1/300th of dpi, in network order */
uint16_t lenx, leny; /* Size of scan, in 1/300th of dpi, in network order */
uint16_t flags1, flags2, flags3; /* Undetermined flag info */
/* Known combinations are:
1st calibration scan: 0x0000, 0x0010, 0x1820 = 24bpp
2nd calibration scan: 0x0000, 0x0010, 0x3020 = 48bpp ???
@ -105,9 +105,9 @@ struct ScanRequest
6th & 7th like 2nd and 3rd
True colour scan 0x0080, 0x0040, 0x18E8 = 24bpp
*/
u_int8_t zero; /* Seems to always be zero */
u_int16_t gamma[3]; /* Set to 100 in network order. Gamma? */
u_int16_t pad[3]; /* Zero padding ot 32 bytes??? */
uint8_t zero; /* Seems to always be zero */
uint16_t gamma[3]; /* Set to 100 in network order. Gamma? */
uint16_t pad[3]; /* Zero padding ot 32 bytes??? */
}
PACKED;
@ -129,11 +129,11 @@ PACKED;
struct ScanResponse
{
u_int16_t x1; /* Usually 0x0000 or 0x4000 */
u_int32_t transfersize; /* Number of bytes to be transferred */
u_int32_t xsize; /* Shape of returned bitmap */
u_int16_t ysize; /* Why does the X get more bytes? */
u_int16_t pad[2]; /* Zero padding to 16 bytes??? */
uint16_t x1; /* Usually 0x0000 or 0x4000 */
uint32_t transfersize; /* Number of bytes to be transferred */
uint32_t xsize; /* Shape of returned bitmap */
uint16_t ysize; /* Why does the X get more bytes? */
uint16_t pad[2]; /* Zero padding to 16 bytes??? */
}
PACKED;

Wyświetl plik

@ -116,8 +116,8 @@ hp5590_models[] = {
#define PART_NUMBER_LEN 10
#define REVERSE_MAP_LEN 128 * 1024 / sizeof(u_int16_t)
#define FORWARD_MAP_LEN 128 * 1024 / sizeof(u_int16_t)
#define REVERSE_MAP_LEN 128 * 1024 / sizeof(uint16_t)
#define FORWARD_MAP_LEN 128 * 1024 / sizeof(uint16_t)
/* Button flags */
/* From left to rigth */
@ -162,23 +162,23 @@ hp5590_models[] = {
struct init_resp
{
u_int8_t flags; /* bit 0 - TMA, bit 1 - ADF, bit 3 - LCD present */
u_int8_t id[15]; /* SILITEKPenguin */
u_int8_t pad1[9]; /* 00 00 00 00 00 00 00 00 00 */
u_int8_t version[5]; /* 0.0.67 */
u_int16_t max_dpi_x; /* 09 60 = 2400 */
u_int16_t max_dpi_y; /* 09 60 = 2400 */
u_int16_t max_pixels_x; /* 4F B0 = 20400 (20400 / 2400 = 8.5") */
u_int16_t max_pixels_y; /* 6D E0 = 28128 (28128 / 2400 = 11.72") */
u_int8_t pad2[8]; /* 00 00 00 00 00 00 00 00 */
u_int16_t motor_param_normal; /* 00 64 = 100 */
u_int16_t motor_param_max; /* 03 E8 = 1000 */
uint8_t flags; /* bit 0 - TMA, bit 1 - ADF, bit 3 - LCD present */
uint8_t id[15]; /* SILITEKPenguin */
uint8_t pad1[9]; /* 00 00 00 00 00 00 00 00 00 */
uint8_t version[5]; /* 0.0.67 */
uint16_t max_dpi_x; /* 09 60 = 2400 */
uint16_t max_dpi_y; /* 09 60 = 2400 */
uint16_t max_pixels_x; /* 4F B0 = 20400 (20400 / 2400 = 8.5") */
uint16_t max_pixels_y; /* 6D E0 = 28128 (28128 / 2400 = 11.72") */
uint8_t pad2[8]; /* 00 00 00 00 00 00 00 00 */
uint16_t motor_param_normal; /* 00 64 = 100 */
uint16_t motor_param_max; /* 03 E8 = 1000 */
} __attribute__ ((packed));
struct power_resp
{
u_int8_t flags;
u_int16_t unk1;
uint8_t flags;
uint16_t unk1;
} __attribute__ ((packed));
/*
@ -204,7 +204,7 @@ struct power_resp
struct scan_params
{
u_int8_t source; /*
uint8_t source; /*
* TMA Negatives : 11 = 17
* TMA Slides : 12 = 18
* ADF : 14 = 20
@ -212,7 +212,7 @@ struct scan_params
* ADF Duplex : 54 = 84
*/
u_int16_t dpi_x; /*
uint16_t dpi_x; /*
* 50 : 00 64 = 100
* 75 : 00 64 = 100
* 100 : 00 64 = 100
@ -224,7 +224,7 @@ struct scan_params
* 1200 : 04 b0 = 1200
*/
u_int16_t dpi_y; /*
uint16_t dpi_y; /*
* 50 : 00 64 = 100
* 75 : 00 64 = 100
* 100 : 00 64 = 100
@ -236,18 +236,18 @@ struct scan_params
* 1200 : 04 b0 = 1200
*/
u_int16_t top_x; /*
uint16_t top_x; /*
* pixels * (Base DPI / current DPI)
* 00 00, 01 6e = 366 (x = 425 - 302 = 123)
* 04 b0 = 1200 (x = 425 - 24 = 401)
*/
u_int16_t top_y; /*
uint16_t top_y; /*
* pixels * (Base DPI / current DPI)
* 00 00, 06 99 = 1689 (y = 585 - 21 = 564)
*/
u_int16_t size_x; /* X pixels in Base DPI (CMD 15)
uint16_t size_x; /* X pixels in Base DPI (CMD 15)
* 50 : 04f8 = 1272 ; 150
* 75 : 04f8 = 1272 ; 150
* 100 : 04f8 = 1272 ; 150
@ -261,7 +261,7 @@ struct scan_params
* 1200 : 27a8 = 10152 ; 1200
*/
u_int16_t size_y; /* Y pixels in Base DPI (CMD 15)
uint16_t size_y; /* Y pixels in Base DPI (CMD 15)
* 50 : 06db = 1755 ; 150
* 75 : 06da = 1754 ; 150
* 100 : 06db = 1755 ; 150
@ -275,9 +275,9 @@ struct scan_params
* 1200 : 36d8 = 14040 ; 1200
*/
u_int16_t unk1; /* 00 80 */
uint16_t unk1; /* 00 80 */
u_int16_t bw_gray_flag; /*
uint16_t bw_gray_flag; /*
* 00 40 - bw (ntsc gray)/gray,
* 00 20 - bw (by green band),
* 00 10 - bw (by red band),
@ -285,7 +285,7 @@ struct scan_params
* 00 00 - color
*/
u_int8_t pixel_bits; /*
uint8_t pixel_bits; /*
* bw 50/75/150/400 : 08 = 8
* bw 100/200/300/600/1200 : 01 = 1
* gray 50/75/100/150/200/400/600 : 08 = 8
@ -293,28 +293,28 @@ struct scan_params
* color 48 bit 100/200 : 30 = 48
*/
u_int16_t flags; /*
uint16_t flags; /*
* 50/75/100/150/200/300 : e8 40 = 59456
* 400/600/1200 : c8 40 = 51264
*/
u_int16_t motor_param1; /*
uint16_t motor_param1; /*
* 00 64 = 100
*/
u_int16_t motor_param2; /*
uint16_t motor_param2; /*
* 00 64 = 100 - ADF, Flatbed, TMA slides
* 00 c8 = 200 - TMA Negatives
*/
u_int16_t motor_param3; /*
uint16_t motor_param3; /*
* 00 64 = 100 - ADF, Flatbed, TMA slides
* 01 90 = 400 - TMA negatives
*/
u_int32_t pad1; /* 00 00 00 00 */
u_int16_t pad2; /* 00 00 */
u_int8_t mode; /* 00 - normal scan, 04 - preview scan */
u_int16_t pad3; /* 00 00 */
uint32_t pad1; /* 00 00 00 00 */
uint16_t pad2; /* 00 00 */
uint8_t mode; /* 00 - normal scan, 04 - preview scan */
uint16_t pad3; /* 00 00 */
u_int16_t line_width; /* Based on current .dpi_x
uint16_t line_width; /* Based on current .dpi_x
* bw 50 : 03 50 = 848
* gray 50 : 03 50 = 848
* color 50 : 09 f0 = 2544 (3 * gray)
@ -357,9 +357,9 @@ struct scan_params
struct image_params
{
u_int8_t signature; /* c0 */
u_int8_t pad1; /* 00 */
u_int32_t image_size; /*
uint8_t signature; /* c0 */
uint8_t pad1; /* 00 */
uint32_t image_size; /*
* bw 50 : 00 0f 23 a0 = 992 160
* gray 50 : 00 0f 23 a0 = 992 160
* color 50 : 00 2d 6a e0 = 2 976 480
@ -397,31 +397,31 @@ struct image_params
* gray 600 : 02 22 4b 90 = 35 802 000
* color 600 : 06 66 e2 b0 = 107 406 000
*/
u_int16_t pad2; /* 00 00 */
u_int16_t line_width;
u_int16_t real_size_y;
u_int32_t pad3; /* 00 00 00 00 */
uint16_t pad2; /* 00 00 */
uint16_t line_width;
uint16_t real_size_y;
uint32_t pad3; /* 00 00 00 00 */
} __attribute__ ((packed));
struct lamp_state
{
u_int8_t unk1; /* 02 */
u_int8_t flag; /* 01 on start, 02 - TMA, 03 - all other */
u_int16_t turnoff_time; /* 0a 0a, 03 36, 0f 36 */
uint8_t unk1; /* 02 */
uint8_t flag; /* 01 on start, 02 - TMA, 03 - all other */
uint16_t turnoff_time; /* 0a 0a, 03 36, 0f 36 */
} __attribute__ ((packed));
struct color_map
{
u_int8_t color1[6]; /* 00 00 00 00 01 00 */
u_int8_t color2[6]; /* 00 00 00 00 01 00 */
u_int8_t color3[6]; /* 00 00 00 00 01 00 */
uint8_t color1[6]; /* 00 00 00 00 01 00 */
uint8_t color2[6]; /* 00 00 00 00 01 00 */
uint8_t color3[6]; /* 00 00 00 00 01 00 */
} __attribute__ ((packed));
struct reg_03
{
u_int8_t unk1; /* 0x0b - ADF ready, 0x03 - not */
u_int8_t unk2; /* 0x80 */
u_int8_t adf_flags; /* 0x01 - ADF ready when selected, 0x02 - not */
uint8_t unk1; /* 0x0b - ADF ready, 0x03 - not */
uint8_t unk2; /* 0x80 */
uint8_t adf_flags; /* 0x01 - ADF ready when selected, 0x02 - not */
} __attribute__ ((packed));
/******************************************************************************/
@ -588,7 +588,7 @@ hp5590_read_eeprom (SANE_Int dn,
unsigned int addr,
unsigned char *data, unsigned int size)
{
u_int8_t eeprom_addr = addr;
uint8_t eeprom_addr = addr;
SANE_Status ret;
hp5590_cmds_assert (data != NULL);
@ -619,7 +619,7 @@ hp5590_write_eeprom (SANE_Int dn,
unsigned int addr,
unsigned char *data, unsigned int size)
{
u_int8_t eeprom_addr = addr;
uint8_t eeprom_addr = addr;
SANE_Status ret;
hp5590_cmds_assert (data != NULL);
@ -648,7 +648,7 @@ hp5590_write_eeprom (SANE_Int dn,
static SANE_Status
hp5590_read_scan_count (SANE_Int dn, unsigned int *count)
{
u_int32_t scan_count;
uint32_t scan_count;
SANE_Status ret;
hp5590_cmds_assert (count != NULL);
@ -676,7 +676,7 @@ hp5590_read_scan_count (SANE_Int dn, unsigned int *count)
static SANE_Status
hp5590_inc_scan_count (SANE_Int dn)
{
u_int32_t scan_count;
uint32_t scan_count;
unsigned int count;
unsigned int new_count;
SANE_Status ret;
@ -714,7 +714,7 @@ hp5590_inc_scan_count (SANE_Int dn)
static SANE_Status
hp5590_read_max_scan_count (SANE_Int dn, unsigned int *max_count)
{
u_int8_t max_scan_count[3];
uint8_t max_scan_count[3];
SANE_Status ret;
hp5590_cmds_assert (max_count != NULL);
@ -770,7 +770,7 @@ hp5590_read_max_scan_count (SANE_Int dn, unsigned int *max_count)
static __sane_unused__ SANE_Status
hp5590_read_eeprom_all_cmd (SANE_Int dn)
{
u_int8_t eeprom[255];
uint8_t eeprom[255];
SANE_Status ret;
DBG (DBG_proc, "%s\n", __FUNCTION__);
@ -812,7 +812,7 @@ hp5590_read_part_number (SANE_Int dn)
static SANE_Status
hp5590_is_data_available (SANE_Int dn)
{
u_int8_t data_status;
uint8_t data_status;
SANE_Status ret;
SANE_Bool data_available;
@ -844,7 +844,7 @@ hp5590_is_data_available (SANE_Int dn)
static SANE_Status
hp5590_stop_scan (SANE_Int dn)
{
u_int8_t reg_011b = 0x40;
uint8_t reg_011b = 0x40;
SANE_Status ret;
DBG (DBG_proc, "%s\n", __FUNCTION__);
@ -1017,7 +1017,7 @@ hp5590_select_source_and_wakeup (SANE_Int dn,
enum scan_sources source,
SANE_Bool extend_lamp_timeout)
{
u_int8_t reg_d6 = 0x04;
uint8_t reg_d6 = 0x04;
SANE_Status ret;
unsigned int adf_flags;
@ -1091,7 +1091,7 @@ hp5590_select_source_and_wakeup (SANE_Int dn,
static SANE_Status
hp5590_lock_unlock_scanner (SANE_Int dn)
{
u_int8_t reg_00 = 0x01;
uint8_t reg_00 = 0x01;
SANE_Status ret;
unsigned int adf_flags;
unsigned int waiting;
@ -1135,7 +1135,7 @@ hp5590_set_base_dpi (SANE_Int dn,
struct scanner_info *scanner_info,
unsigned int base_dpi)
{
u_int16_t _base_dpi;
uint16_t _base_dpi;
SANE_Status ret;
DBG (DBG_proc, "%s\n", __FUNCTION__);
@ -1657,9 +1657,9 @@ static SANE_Status
hp5590_send_reverse_calibration_map (SANE_Int dn)
{
unsigned int reverse_map_size = REVERSE_MAP_LEN;
u_int16_t reverse_map[REVERSE_MAP_LEN];
uint16_t reverse_map[REVERSE_MAP_LEN];
unsigned int i;
u_int16_t val;
uint16_t val;
unsigned int len;
SANE_Status ret;
@ -1694,7 +1694,7 @@ hp5590_send_reverse_calibration_map (SANE_Int dn)
ret = hp5590_bulk_write (dn, 0x2b,
(unsigned char *) reverse_map,
reverse_map_size * sizeof (u_int16_t));
reverse_map_size * sizeof (uint16_t));
if (ret != SANE_STATUS_GOOD)
return ret;
@ -1706,10 +1706,10 @@ static SANE_Status
hp5590_send_forward_calibration_maps (SANE_Int dn)
{
unsigned int forward_map_size = FORWARD_MAP_LEN;
u_int16_t forward_map[FORWARD_MAP_LEN];
uint16_t forward_map[FORWARD_MAP_LEN];
SANE_Status ret;
unsigned int i;
u_int16_t val;
uint16_t val;
DBG (DBG_proc, "%s\n", __FUNCTION__);
DBG (DBG_proc, "Preparing forward calibration map\n");
@ -1724,19 +1724,19 @@ hp5590_send_forward_calibration_maps (SANE_Int dn)
ret = hp5590_bulk_write (dn, 0x012a,
(unsigned char *) forward_map,
forward_map_size * sizeof (u_int16_t));
forward_map_size * sizeof (uint16_t));
if (ret != SANE_STATUS_GOOD)
return ret;
ret = hp5590_bulk_write (dn, 0x022a,
(unsigned char *) forward_map,
forward_map_size * sizeof (u_int16_t));
forward_map_size * sizeof (uint16_t));
if (ret != SANE_STATUS_GOOD)
return ret;
ret = hp5590_bulk_write (dn, 0x032a,
(unsigned char *) forward_map,
forward_map_size * sizeof (u_int16_t));
forward_map_size * sizeof (uint16_t));
if (ret != SANE_STATUS_GOOD)
return ret;
@ -1766,7 +1766,7 @@ hp5590_read (SANE_Int dn, unsigned char *bytes, unsigned int size,
static SANE_Status
hp5590_start_scan (SANE_Int dn)
{
u_int8_t reg_051b = 0x40;
uint8_t reg_051b = 0x40;
SANE_Status ret;
DBG (DBG_proc, "%s\n", __FUNCTION__);
@ -1787,7 +1787,7 @@ hp5590_start_scan (SANE_Int dn)
static SANE_Status
hp5590_read_buttons (SANE_Int dn, enum button_status * status)
{
u_int16_t button_status;
uint16_t button_status;
SANE_Status ret;
DBG (DBG_proc, "%s\n", __FUNCTION__);

Wyświetl plik

@ -68,29 +68,29 @@
/* Structure describing bulk transfer size */
struct bulk_size
{
u_int16_t size;
u_int8_t unused;
uint16_t size;
uint8_t unused;
} __attribute__ ((packed));
/* Structure describing bulk URB */
/* FIXME: Verify according to USB standard */
struct usb_in_usb_bulk_setup
{
u_int8_t bRequestType;
u_int8_t bRequest;
u_int8_t bEndpoint;
u_int16_t unknown;
u_int16_t wLength;
u_int8_t pad;
uint8_t bRequestType;
uint8_t bRequest;
uint8_t bEndpoint;
uint16_t unknown;
uint16_t wLength;
uint8_t pad;
} __attribute__ ((packed));
/* Structure describing control URB */
struct usb_in_usb_ctrl_setup {
u_int8_t bRequestType;
u_int8_t bRequest;
u_int16_t wValue;
u_int16_t wIndex;
u_int16_t wLength;
uint8_t bRequestType;
uint8_t bRequest;
uint16_t wValue;
uint16_t wIndex;
uint16_t wLength;
} __attribute__ ((packed));
/* CORE status flag - ready or not */
@ -131,7 +131,7 @@ struct bulk_read_state
static SANE_Status
hp5590_get_ack (SANE_Int dn)
{
u_int8_t status;
uint8_t status;
SANE_Status ret;
DBG (DBG_proc, "%s\n", __FUNCTION__);
@ -173,7 +173,7 @@ hp5590_get_ack (SANE_Int dn)
static SANE_Status
hp5590_get_status (SANE_Int dn)
{
u_int8_t status;
uint8_t status;
SANE_Status ret;
DBG (DBG_proc, "%s\n", __FUNCTION__);
@ -228,8 +228,8 @@ hp5590_control_msg (SANE_Int dn,
SANE_Status ret;
unsigned int len;
unsigned char *ptr;
u_int8_t ack;
u_int8_t response;
uint8_t ack;
uint8_t response;
unsigned int needed_response;
DBG (DBG_proc, "%s: USB-in-USB: core data: %s\n",
@ -413,7 +413,7 @@ hp5590_control_msg (SANE_Int dn,
/* Send bulk OUT flags is bulk OUT preparation is performed */
if (core_flags & CORE_BULK_OUT)
{
u_int8_t bulk_flags = 0x24;
uint8_t bulk_flags = 0x24;
DBG (DBG_usb, "%s: USB-in-USB: sending bulk flags\n",
__FUNCTION__);
@ -455,7 +455,7 @@ hp5590_control_msg (SANE_Int dn,
static SANE_Status
hp5590_verify_last_cmd (SANE_Int dn, unsigned int cmd)
{
u_int16_t verify_cmd;
uint16_t verify_cmd;
unsigned int last_cmd;
unsigned int core_status;
SANE_Status ret;
@ -636,7 +636,7 @@ hp5590_bulk_read (SANE_Int dn, unsigned char *bytes, unsigned int size,
struct usb_in_usb_bulk_setup ctrl;
SANE_Status ret;
unsigned int next_pages;
u_int8_t bulk_flags;
uint8_t bulk_flags;
size_t next_portion;
struct bulk_read_state *bulk_read_state;
unsigned int bytes_until_buffer_end;

Wyświetl plik

@ -54,6 +54,8 @@
#include <unistd.h>
#include <math.h>
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -84,8 +86,8 @@ region_type;
#define HomeEdgePoint2 1258
#define HomeTolerance 30
#define LOBYTE(x) ((u_int8_t)((x) & 0xFF))
#define HIBYTE(x) ((u_int8_t)((x) >> 8))
#define LOBYTE(x) ((uint8_t)((x) & 0xFF))
#define HIBYTE(x) ((uint8_t)((x) >> 8))
/* Static low function proto-types */
static SANE_Status low_usb_bulk_write (SANE_Int devnum,
@ -135,7 +137,7 @@ static SANE_Bool read_buffer_is_empty (Read_Buffer * rb);
/*
* RTS88XX START
* RTS88XX START
*
* these rts88xx functions will be spin off in a separate lib
* so that they can be reused.
@ -4701,8 +4703,8 @@ sanei_lexmark_low_offset_calibration (Lexmark_Device * dev)
dev->offset.red = ro - ra;
if (go > ga)
{
dev->offset.green = go - ga;
dev->offset.gray = go - ga;
dev->offset.green = go - ga;
dev->offset.gray = go - ga;
}
if (bo > ba)
dev->offset.blue = bo - ba;

Wyświetl plik

@ -63,9 +63,10 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
#include "_stdint.h"
#include "sane/sane.h"
#include "sane/sanei.h"
#include "sane/sanei_config.h"
@ -211,11 +212,11 @@ static ring_buffer *
ring_alloc (size_t initial_size, size_t bpl, size_t ppl)
{
ring_buffer *rb;
u_int8_t *buff;
uint8_t *buff;
if ((rb = (ring_buffer *)malloc(sizeof(*rb))) == NULL)
return NULL;
if ((buff = (u_int8_t *)malloc(initial_size * sizeof(*buff))) == NULL) {
if ((buff = (uint8_t *)malloc(initial_size * sizeof(*buff))) == NULL) {
free(rb);
return NULL;
}
@ -246,11 +247,11 @@ ring_alloc (size_t initial_size, size_t bpl, size_t ppl)
static SANE_Status
ring_expand (ring_buffer *rb, size_t amount)
{
u_int8_t *buff;
uint8_t *buff;
size_t oldsize;
if (rb == NULL) return SANE_STATUS_INVAL;
buff = (u_int8_t *)realloc(rb->base, (rb->size + amount) * sizeof(*buff));
buff = (uint8_t *)realloc(rb->base, (rb->size + amount) * sizeof(*buff));
if (buff == NULL) return SANE_STATUS_NO_MEM;
rb->base = buff;
@ -389,7 +390,7 @@ sense_handler (int scsi_fd, u_char *sense, void *arg)
static SANE_Status
wait_ready(Microtek_Scanner *ms)
{
u_int8_t comm[6] = { 0, 0, 0, 0, 0, 0 };
uint8_t comm[6] = { 0, 0, 0, 0, 0, 0 };
SANE_Status status;
int retry = 0;
@ -411,7 +412,7 @@ wait_ready(Microtek_Scanner *ms)
static SANE_Status
scanning_frame(Microtek_Scanner *ms)
{
u_int8_t *data, comm[15] = { 0x04, 0, 0, 0, 0x09, 0 };
uint8_t *data, comm[15] = { 0x04, 0, 0, 0, 0x09, 0 };
int x1, y1, x2, y2;
DBG(23, ".scanning_frame...\n");
@ -465,7 +466,7 @@ scanning_frame(Microtek_Scanner *ms)
static SANE_Status
mode_select(Microtek_Scanner *ms)
{
u_int8_t *data, comm[19] = { 0x15, 0, 0, 0, 0, 0 };
uint8_t *data, comm[19] = { 0x15, 0, 0, 0, 0, 0 };
DBG(23, ".mode_select %d...\n", ms->sfd);
data = comm + 6;
@ -509,7 +510,7 @@ mode_select(Microtek_Scanner *ms)
static SANE_Status
mode_select_1(Microtek_Scanner *ms)
{
u_int8_t *data, comm[16] = { 0x16, 0, 0, 0, 0x0A, 0,
uint8_t *data, comm[16] = { 0x16, 0, 0, 0, 0x0A, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
DBG(23, ".mode_select_1 %d...\n", ms->sfd);
@ -541,7 +542,7 @@ mode_select_1(Microtek_Scanner *ms)
static SANE_Status
save_mode_sense(Microtek_Scanner *ms)
{
u_int8_t data[20], comm[6] = { 0x1A, 0, 0, 0, 0, 0};
uint8_t data[20], comm[6] = { 0x1A, 0, 0, 0, 0, 0};
size_t lenp;
SANE_Status status;
int i;
@ -577,7 +578,7 @@ save_mode_sense(Microtek_Scanner *ms)
static SANE_Status
compare_mode_sense(Microtek_Scanner *ms, int *match)
{
u_int8_t data[20], comm[6] = { 0x1A, 0, 0, 0, 0, 0};
uint8_t data[20], comm[6] = { 0x1A, 0, 0, 0, 0, 0};
size_t lenp;
SANE_Status status;
int i;
@ -619,7 +620,7 @@ compare_mode_sense(Microtek_Scanner *ms, int *match)
static SANE_Status
mode_sense_1(Microtek_Scanner *ms)
{
u_int8_t *data, comm[36] = { 0x19, 0, 0, 0, 0x1E, 0 };
uint8_t *data, comm[36] = { 0x19, 0, 0, 0, 0x1E, 0 };
DBG(23, ".mode_sense_1...\n");
data = comm + 6;
@ -645,7 +646,7 @@ mode_sense_1(Microtek_Scanner *ms)
static SANE_Status
accessory(Microtek_Scanner *ms)
{
u_int8_t comm[6] = { 0x10, 0, 0, 0, 0, 0 };
uint8_t comm[6] = { 0x10, 0, 0, 0, 0, 0 };
DBG(23, ".accessory...\n");
comm[4] =
@ -676,7 +677,7 @@ accessory(Microtek_Scanner *ms)
static SANE_Status
start_scan(Microtek_Scanner *ms)
{
u_int8_t comm[6] = { 0x1B, 0, 0, 0, 0, 0 };
uint8_t comm[6] = { 0x1B, 0, 0, 0, 0, 0 };
DBG(23, ".start_scan...\n");
comm[4] =
@ -712,7 +713,7 @@ start_scan(Microtek_Scanner *ms)
static SANE_Status
stop_scan(Microtek_Scanner *ms)
{
u_int8_t comm[6] = { 0x1B, 0, 0, 0, 0, 0 };
uint8_t comm[6] = { 0x1B, 0, 0, 0, 0, 0 };
DBG(23, ".stop_scan...\n");
if (DBG_LEVEL >= 192) {
@ -740,7 +741,7 @@ get_scan_status(Microtek_Scanner *ms,
SANE_Int *bytes_per_line,
SANE_Int *lines)
{
u_int8_t data[6], comm[6] = { 0x0F, 0, 0, 0, 0x06, 0 };
uint8_t data[6], comm[6] = { 0x0F, 0, 0, 0, 0x06, 0 };
SANE_Status status;
size_t lenp;
int retry = 0;
@ -783,10 +784,10 @@ get_scan_status(Microtek_Scanner *ms,
static SANE_Status
read_scan_data(Microtek_Scanner *ms,
int lines,
u_int8_t *buffer,
uint8_t *buffer,
size_t *bufsize)
{
u_int8_t comm[6] = { 0x08, 0, 0, 0, 0, 0 };
uint8_t comm[6] = { 0x08, 0, 0, 0, 0, 0 };
DBG(23, ".read_scan_data...\n");
comm[2] = (lines >> 16) & 0xFF;
@ -804,8 +805,8 @@ read_scan_data(Microtek_Scanner *ms,
static SANE_Status
download_gamma(Microtek_Scanner *ms)
{
u_int8_t *data, *comm; /* commbytes[10] = { 0x55, 0, 0x27, 0, 0,
0, 0, 0, 0, 0 };*/
uint8_t *data, *comm; /* commbytes[10] = { 0x55, 0, 0x27, 0, 0,
0, 0, 0, 0, 0 };*/
int i, pl;
int commsize;
int bit_depth = 8; /* hard-code for now, should match bpp XXXXXXX */
@ -828,7 +829,7 @@ download_gamma(Microtek_Scanner *ms)
DBG(23, ".download_gamma: %d entries of %d bytes, max %d\n",
ms->gamma_entries, ms->gamma_entry_size, max_entry);
commsize = 10 + (ms->gamma_entries * ms->gamma_entry_size);
comm = calloc(commsize, sizeof(u_int8_t));
comm = calloc(commsize, sizeof(uint8_t));
if (comm == NULL) {
DBG(23, ".download_gamma: couldn't allocate %d bytes for comm buffer!\n",
commsize);
@ -859,7 +860,7 @@ download_gamma(Microtek_Scanner *ms)
int val = ms->gray_lut[i] >> table_shift;
switch (ms->gamma_entry_size) {
case 1:
data[i] = (u_int8_t) val;
data[i] = (uint8_t) val;
break;
case 2:
data[i*2] = val & 0xFF;
@ -886,7 +887,7 @@ download_gamma(Microtek_Scanner *ms)
int val = pl_lut[i] >> table_shift;
switch (ms->gamma_entry_size) {
case 1:
data[i] = (u_int8_t) val;
data[i] = (uint8_t) val;
break;
case 2:
data[i*2] = val & 0xFF;
@ -911,7 +912,7 @@ download_gamma(Microtek_Scanner *ms)
1.0 / gamma));
switch (ms->gamma_entry_size) {
case 1:
data[i] = (u_int8_t) val;
data[i] = (uint8_t) val;
break;
case 2:
data[i*2] = val & 0xFF;
@ -936,7 +937,7 @@ download_gamma(Microtek_Scanner *ms)
1.0 / gamma));
switch (ms->gamma_entry_size) {
case 1:
data[i] = (u_int8_t) val;
data[i] = (uint8_t) val;
break;
case 2:
data[i*2] = val & 0xFF;
@ -960,7 +961,7 @@ download_gamma(Microtek_Scanner *ms)
((double) ms->gamma_entries - 1.0);
switch (ms->gamma_entry_size) {
case 1:
data[i] = (u_int8_t) val;
data[i] = (uint8_t) val;
break;
case 2:
data[i*2] = val & 0xFF;
@ -981,7 +982,7 @@ download_gamma(Microtek_Scanner *ms)
static SANE_Status
start_calibration(Microtek_Scanner *ms)
{
u_int8_t comm[8] = { 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x0a };
uint8_t comm[8] = { 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x0a };
DBG(23, ".start_calibrate...\n");
if (DBG_LEVEL >= 192) {
@ -1004,8 +1005,8 @@ start_calibration(Microtek_Scanner *ms)
/* magic command to download calibration values */
/********************************************************************/
static SANE_Status
download_calibration(Microtek_Scanner *ms, u_int8_t *comm,
u_int8_t letter, int linewidth)
download_calibration(Microtek_Scanner *ms, uint8_t *comm,
uint8_t letter, int linewidth)
{
DBG(23, ".download_calibration... %c %d\n", letter, linewidth);
@ -1983,7 +1984,7 @@ dump_suspect_inquiry(unsigned char *result)
/* Determine if device is a Microtek Scanner (from INQUIRY info) */
/********************************************************************/
static SANE_Status
id_microtek(u_int8_t *result, char **model_string)
id_microtek(uint8_t *result, char **model_string)
{
SANE_Byte device_type, response_data_format;
int forcewarn = 0;
@ -2132,7 +2133,7 @@ attach_scanner(const char *devicename, Microtek_Device **devp)
unsigned char result[0x60];
SANE_Status status;
char *model_string;
u_int8_t inquiry[] = { 0x12, 0, 0, 0, 0x60, 0 };
uint8_t inquiry[] = { 0x12, 0, 0, 0, 0x60, 0 };
DBG(15,"attach_scanner: %s\n", devicename);
/* check if device is already known... */
@ -2265,7 +2266,7 @@ static int comparo(const void *a, const void *b)
/* extract values from scanlines and sort */
static void sort_values(int *result, u_int8_t *scanline[], int pix)
static void sort_values(int *result, uint8_t *scanline[], int pix)
{
int i;
for (i=0; i<STRIPS; i++) result[i] = (scanline[i])[pix];
@ -2285,7 +2286,7 @@ static void sort_values(int *result, u_int8_t *scanline[], int pix)
/********************************************************************/
static void calc_calibration(u_int8_t *caldata, u_int8_t *scanline[],
static void calc_calibration(uint8_t *caldata, uint8_t *scanline[],
int pixels)
{
int i,j;
@ -2339,8 +2340,8 @@ static SANE_Status do_real_calibrate(Microtek_Scanner *s)
SANE_Status status, statusA;
SANE_Int busy, linewidth, lines;
size_t buffsize;
u_int8_t *input, *scanline[STRIPS], *combuff;
u_int8_t letter;
uint8_t *input, *scanline[STRIPS], *combuff;
uint8_t letter;
int i, spot;
int nmax, ntoget, nleft;
@ -3730,7 +3731,7 @@ sane_get_parameters (SANE_Handle handle,
SANE_Int widthpix;
double dots_per_mm = s->resolution / MM_PER_INCH;
double units_per_mm =
(s->unit_type == MS_UNIT_18INCH) ?
(s->unit_type == MS_UNIT_18INCH) ?
(8.0 / MM_PER_INCH) : /* 1/8 inches */
(s->dev->info.base_resolution / MM_PER_INCH); /* pixels */
@ -3814,7 +3815,7 @@ sane_get_parameters (SANE_Handle handle,
if (s->onepasscolor) { /* a single-pass color scan */
s->params.format = SANE_FRAME_RGB;
s->params.depth = s->bits_per_color;
s->filter = MS_FILT_CLEAR;
s->filter = MS_FILT_CLEAR;
s->params.bytes_per_line = s->params.pixels_per_line * 3;
} else { /* a three-pass color scan */
s->params.depth = s->bits_per_color;
@ -4020,7 +4021,7 @@ sane_start_guts (SANE_Handle handle)
return end_scan(s, SANE_STATUS_NO_MEM);
}
s->scsi_buffer = (u_int8_t *) malloc(SCSI_BUFF_SIZE * sizeof(u_int8_t));
s->scsi_buffer = (uint8_t *) malloc(SCSI_BUFF_SIZE * sizeof(uint8_t));
if (s->scsi_buffer == NULL) return SANE_STATUS_NO_MEM;
/* what's a good initial size for this? */

Wyświetl plik

@ -227,7 +227,7 @@ typedef struct ring_buffer {
size_t bpl; /* bytes per line */
size_t ppl; /* pixels per line */
u_int8_t *base; /* base address of buffer */
uint8_t *base; /* base address of buffer */
size_t size; /* size (bytes) of ring buffer */
size_t initial_size; /* initial size of ring buffer */
@ -369,7 +369,7 @@ typedef struct Microtek_Scanner {
#define MS_SENSE_IGNORE 1
int sense_flags; /* flags passed to the sense handler */
u_int8_t *scsi_buffer;
uint8_t *scsi_buffer;
ring_buffer *rb;
} Microtek_Scanner;

Plik diff jest za duży Load Diff

Wyświetl plik

@ -779,10 +779,10 @@ typedef struct Microtek2_Info {
#define MI_COLSEQ_GREEN 1
#define MI_COLSEQ_BLUE 2
#define MI_COLSEQ_ILLEGAL 3
u_int8_t color_sequence[RSA_COLORSEQUENCE_L];
uint8_t color_sequence[RSA_COLORSEQUENCE_L];
SANE_Bool new_image_status;
#define MI_DATSEQ_RTOL 1
u_int8_t direction;
uint8_t direction;
SANE_Byte ccd_gap;
SANE_Int max_xresolution;
SANE_Int max_yresolution;
@ -835,9 +835,9 @@ typedef struct Microtek2_Info {
SANE_Bool scnbuttn;
#define MI_HAS_PIPOBUF SANE_TRUE
SANE_Bool buftype;
u_int16_t balance[3]; /* balance factor for red, green */
uint16_t balance[3]; /* balance factor for red, green */
/* and blue data */
u_int16_t aps_maxframes;
uint16_t aps_maxframes;
SANE_Int calib_divisor; /* e.g. the X12USL reads and sends */
/* shading at 1/2 * opt_resolution */
} Microtek2_Info;
@ -863,16 +863,16 @@ typedef struct Microtek2_Device {
/* the following two are derived from lut_cap */
int max_lut_size; /* in bytes */
int lut_entry_size; /* word or byte transfer in LUT */
u_int8_t scan_source;
uint8_t scan_source;
double revision;
/* basically the following two variables should go into the */
/* Microtek2_Scanner structure, but their values must be retained */
/* over several scans, and would be lost, if the application issues */
/* a sane_close. */
u_int8_t *shading_table_w; /* shading table white */
u_int8_t *shading_table_d; /* shading table dark */
u_int8_t shading_table_contents; /* values like ms->mode */
uint8_t *shading_table_w; /* shading table white */
uint8_t *shading_table_d; /* shading table dark */
uint8_t shading_table_contents; /* values like ms->mode */
/* the following structure describes the device status */
#define MD_TLAMP_ON 2
#define MD_FLAMP_ON 1
@ -882,33 +882,33 @@ typedef struct Microtek2_Device {
#define MD_RESERVED17_ON 128
#define MD_CURRENT_MODE_FLATBED 0
struct {
u_int8_t sskip;
u_int8_t stick;
u_int8_t ntrack;
u_int8_t ncalib;
u_int8_t tlamp;
u_int8_t flamp;
u_int8_t reserved17;
u_int8_t rdyman;
u_int8_t trdy;
u_int8_t frdy;
u_int8_t adp;
u_int8_t detect;
u_int8_t adptime;
u_int8_t lensstatus;
u_int8_t aloff;
u_int8_t timeremain;
u_int8_t tmacnt;
u_int8_t paper;
u_int8_t adfcnt;
u_int8_t currentmode;
u_int8_t buttoncount;
uint8_t sskip;
uint8_t stick;
uint8_t ntrack;
uint8_t ncalib;
uint8_t tlamp;
uint8_t flamp;
uint8_t reserved17;
uint8_t rdyman;
uint8_t trdy;
uint8_t frdy;
uint8_t adp;
uint8_t detect;
uint8_t adptime;
uint8_t lensstatus;
uint8_t aloff;
uint8_t timeremain;
uint8_t tmacnt;
uint8_t paper;
uint8_t adfcnt;
uint8_t currentmode;
uint8_t buttoncount;
} status;
/* The following defines are related to the model. Some models have */
/* more or less subtle deviations from the spec, which are indicated */
/* by these defines */
u_int32_t model_flags;
uint32_t model_flags;
#define MD_NO_SLIDE_MODE 1 /* indicates that it has slide */
/* mode, but it does not */
#define MD_DATA_FORMAT_WRONG 2 /* X6 indicates wrong mode for TMA */
@ -935,10 +935,10 @@ typedef struct Microtek2_Device {
size_t n_control_bytes; /* for read_control_bits; the */
/* number is model dependent */
/* and can not be inquired */
u_int32_t shading_length; /* length of the shading image */
uint32_t shading_length; /* length of the shading image */
/* Phantom 336cx, C6, ... */
u_int8_t shading_depth; /* bit depth of shading image */
u_int8_t controlbit_offset; /* first relevant control bit */
uint8_t shading_depth; /* bit depth of shading image */
uint8_t controlbit_offset; /* first relevant control bit */
#define MD_MODESTRING_NUMS 4
@ -1025,12 +1025,12 @@ typedef struct Microtek2_Scanner {
SANE_Parameters params; /* format, lastframe, lines, depth, ppl, bpl */
SANE_Option_Descriptor sod[NUM_OPTIONS + 1]; /* option list for session */
u_int8_t *gamma_table;
u_int8_t *shading_image; /* used for shading image */
u_int8_t *condensed_shading_w; /* used when a model uses "read */
u_int8_t *condensed_shading_d; /* control bit", stores the relevant */
uint8_t *gamma_table;
uint8_t *shading_image; /* used for shading image */
uint8_t *condensed_shading_w; /* used when a model uses "read */
uint8_t *condensed_shading_d; /* control bit", stores the relevant */
/* shading pixels for each color */
u_int8_t *temporary_buffer; /* used when automatic adjustment */
uint8_t *temporary_buffer; /* used when automatic adjustment */
/* is selected */
char *gamma_mode; /* none, linear or custom */
@ -1056,62 +1056,62 @@ typedef struct Microtek2_Scanner {
SANE_Int y1_dots; /* same for y-position */
SANE_Int width_dots; /* scan width in units of optical resolution */
SANE_Int height_dots; /* same for height */
u_int8_t brightness_m;
u_int8_t contrast_m;
u_int8_t exposure_m;
u_int8_t shadow_m;
u_int8_t midtone_m;
u_int8_t highlight_m;
u_int8_t brightness_r;
u_int8_t contrast_r;
u_int8_t exposure_r;
u_int8_t shadow_r;
u_int8_t midtone_r;
u_int8_t highlight_r;
u_int8_t brightness_g;
u_int8_t contrast_g;
u_int8_t exposure_g;
u_int8_t shadow_g;
u_int8_t midtone_g;
u_int8_t highlight_g;
u_int8_t brightness_b;
u_int8_t contrast_b;
u_int8_t exposure_b;
u_int8_t shadow_b;
u_int8_t midtone_b;
u_int8_t highlight_b;
u_int8_t threshold;
uint8_t brightness_m;
uint8_t contrast_m;
uint8_t exposure_m;
uint8_t shadow_m;
uint8_t midtone_m;
uint8_t highlight_m;
uint8_t brightness_r;
uint8_t contrast_r;
uint8_t exposure_r;
uint8_t shadow_r;
uint8_t midtone_r;
uint8_t highlight_r;
uint8_t brightness_g;
uint8_t contrast_g;
uint8_t exposure_g;
uint8_t shadow_g;
uint8_t midtone_g;
uint8_t highlight_g;
uint8_t brightness_b;
uint8_t contrast_b;
uint8_t exposure_b;
uint8_t shadow_b;
uint8_t midtone_b;
uint8_t highlight_b;
uint8_t threshold;
SANE_Bool use_external_ht;
SANE_Byte internal_ht_index;
u_int8_t stay;
u_int8_t rawdat;
uint8_t stay;
uint8_t rawdat;
SANE_Bool quality;
SANE_Bool fastscan;
SANE_Byte scan_source;
u_int8_t no_backtracking;
u_int8_t lightlid35;
u_int8_t auto_adjust;
u_int8_t calib_backend;
u_int8_t colorbalance_adjust;
uint8_t no_backtracking;
uint8_t lightlid35;
uint8_t auto_adjust;
uint8_t calib_backend;
uint8_t colorbalance_adjust;
int current_pass; /* current pass if 3-pass scan */
int lut_size; /* size of gamma lookup table */
int lut_entry_size; /* size of one entry in lookup table */
u_int32_t lut_size_bytes; /* size of LUT in bytes */
u_int8_t word; /* word transfer, used in some read cmds */
uint32_t lut_size_bytes; /* size of LUT in bytes */
uint8_t word; /* word transfer, used in some read cmds */
/* MS_COLOR_X must correspond to color field in READ IMAGE STATUS */
#define MS_COLOR_RED 0
#define MS_COLOR_GREEN 1
#define MS_COLOR_BLUE 2
#define MS_COLOR_ALL 3
u_int8_t current_color; /* for gamma calc. and 3-pass scanners */
u_int8_t current_read_color; /* dto, for RI and RIS */
u_int8_t dark; /* is 1 for reading dark shading */
u_int32_t ppl; /* pixels per line as returned by RII */
u_int32_t bpl; /* bytes per line as returned by RII */
u_int32_t remaining_bytes; /* remaining bytes as returned by RII */
u_int32_t real_remaining_bytes;/* bytes to transfer to the frontend */
u_int32_t real_bpl; /* bpl to transfer to the frontend */
uint8_t current_color; /* for gamma calc. and 3-pass scanners */
uint8_t current_read_color; /* dto, for RI and RIS */
uint8_t dark; /* is 1 for reading dark shading */
uint32_t ppl; /* pixels per line as returned by RII */
uint32_t bpl; /* bytes per line as returned by RII */
uint32_t remaining_bytes; /* remaining bytes as returned by RII */
uint32_t real_remaining_bytes;/* bytes to transfer to the frontend */
uint32_t real_bpl; /* bpl to transfer to the frontend */
SANE_Int src_remaining_lines; /* remaining lines to read */
SANE_Int src_lines_to_read; /* actual number of lines read */
SANE_Int src_max_lines; /* maximum number of lines that fit */
@ -1119,17 +1119,17 @@ typedef struct Microtek2_Scanner {
/* sent to the frontend */
int bits_per_pixel_in; /* bits per pixel transferred from scanner */
int bits_per_pixel_out; /* bits per pixel transf. to frontend */
u_int32_t src_buffer_size; /* size of the buffer */
uint32_t src_buffer_size; /* size of the buffer */
int transfer_length; /* transfer length for RI command */
u_int8_t balance[3]; /* user provided balance factor for */
uint8_t balance[3]; /* user provided balance factor for */
/* red, green and blue data */
struct {
u_int8_t *src_buffer[2]; /* two buffers because of CCD gap */
u_int8_t *src_buf;
uint8_t *src_buffer[2]; /* two buffers because of CCD gap */
uint8_t *src_buf;
int current_src;
SANE_Int free_lines;
SANE_Int free_max_lines;
u_int8_t *current_pos[3]; /* actual position in the source buffer */
uint8_t *current_pos[3]; /* actual position in the source buffer */
int planes[2][3]; /* # of red, green, blue planes in the */
/* current source buffer and leftover */
/* planes from previous "read image" */
@ -1138,7 +1138,7 @@ typedef struct Microtek2_Scanner {
SANE_Bool onepass;
size_t n_control_bytes; /* for READ CONTROL BITS */
u_int8_t *control_bytes; /* pointer to the result */
uint8_t *control_bytes; /* pointer to the result */
int scanning; /* true == between sane_start & sane_read=EOF */
int cancelled;
@ -1163,13 +1163,13 @@ static SANE_Status
attach_one (const char *);
static SANE_Status
auto_adjust_proc_data (Microtek2_Scanner *, u_int8_t **);
auto_adjust_proc_data (Microtek2_Scanner *, uint8_t **);
static SANE_Status
calc_cx_shading_line(Microtek2_Scanner *); /* (KF) new */
static SANE_Status
calculate_gamma(Microtek2_Scanner *, u_int8_t *, int, char *);
calculate_gamma(Microtek2_Scanner *, uint8_t *, int, char *);
static SANE_Status
calculate_sane_params(Microtek2_Scanner *);
@ -1184,14 +1184,14 @@ static void
check_option(const char *, Config_Options *);
static SANE_Status
chunky_copy_pixels(Microtek2_Scanner *, u_int8_t *);
chunky_copy_pixels(Microtek2_Scanner *, uint8_t *);
static SANE_Status
chunky_proc_data(Microtek2_Scanner *);
#if 0
static void
chunky_set_exposure(u_int8_t *, u_int32_t, u_int8_t, u_int8_t, int);
chunky_set_exposure(uint8_t *, uint32_t, uint8_t, uint8_t, int);
#endif
static void
@ -1209,15 +1209,15 @@ static SANE_Status
read_shading_image(Microtek2_Scanner *);
static SANE_Status
dump_area(u_int8_t *, int, char *);
dump_area(uint8_t *, int, char *);
static SANE_Status
dump_area2(u_int8_t *, int, char *);
dump_area2(uint8_t *, int, char *);
/* currently not used */
#if 0
static SANE_Status
dump_to_file(u_int8_t *, int, char *, char *);
dump_to_file(uint8_t *, int, char *, char *);
#endif
static SANE_Status
@ -1227,7 +1227,7 @@ static void
get_calib_params(Microtek2_Scanner *);
static SANE_Status
get_cshading_values(Microtek2_Scanner *,u_int8_t, u_int32_t, float, int,
get_cshading_values(Microtek2_Scanner *,uint8_t, uint32_t, float, int,
float *, float *); /* (KF) new */
static SANE_Status
get_scan_mode_and_depth(Microtek2_Scanner *, int *, SANE_Int *, int *, int *);
@ -1239,28 +1239,28 @@ static SANE_Status
get_lut_size(Microtek2_Info *, int *, int *);
static SANE_Status
gray_copy_pixels(Microtek2_Scanner *ms, u_int8_t *, int, int);
gray_copy_pixels(Microtek2_Scanner *ms, uint8_t *, int, int);
static SANE_Status
gray_proc_data(Microtek2_Scanner *);
#if 0
static void
gray_set_exposure(u_int8_t *, u_int32_t, u_int8_t, u_int8_t);
gray_set_exposure(uint8_t *, uint32_t, uint8_t, uint8_t);
#endif
static SANE_Status
init_options(Microtek2_Scanner *, u_int8_t);
init_options(Microtek2_Scanner *, uint8_t);
static SANE_Status
lineartfake_copy_pixels(Microtek2_Scanner *, u_int8_t *, u_int32_t, u_int8_t,
lineartfake_copy_pixels(Microtek2_Scanner *, uint8_t *, uint32_t, uint8_t,
int, FILE *);
static SANE_Status
lineartfake_proc_data(Microtek2_Scanner *);
static SANE_Status
lplconcat_copy_pixels(Microtek2_Scanner *, u_int8_t **, int, int);
lplconcat_copy_pixels(Microtek2_Scanner *, uint8_t **, int, int);
static SANE_Status
lplconcat_proc_data(Microtek2_Scanner *ms);
@ -1275,7 +1275,7 @@ static SANE_Status
prepare_buffers(Microtek2_Scanner *);
static SANE_Status
prepare_shading_data(Microtek2_Scanner *, u_int32_t, u_int8_t **);
prepare_shading_data(Microtek2_Scanner *, uint32_t, uint8_t **);
static SANE_Status
proc_onebit_data(Microtek2_Scanner *);
@ -1306,20 +1306,20 @@ set_option_dependencies(Microtek2_Scanner *,
SANE_Option_Descriptor *, Option_Value *);
static SANE_Status
shading_function(Microtek2_Scanner *, u_int8_t *);
shading_function(Microtek2_Scanner *, uint8_t *);
static RETSIGTYPE
signal_handler (int);
static SANE_Status
wordchunky_copy_pixels(u_int8_t *, u_int32_t, int, FILE *);
wordchunky_copy_pixels(uint8_t *, uint32_t, int, FILE *);
static SANE_Status
wordchunky_proc_data(Microtek2_Scanner *);
typedef int (*qsortfunc)(const void *, const void *);
static int compare_func_16(const u_int16_t *p1, u_int16_t *p2)
static int compare_func_16(const uint16_t *p1, uint16_t *p2)
{
return ( *p1 - *p2 );
}
@ -1333,7 +1333,7 @@ static SANE_Status
scsi_inquiry(Microtek2_Info *, char *);
static SANE_Status
scsi_read_attributes(Microtek2_Info *, char *, u_int8_t);
scsi_read_attributes(Microtek2_Info *, char *, uint8_t);
static SANE_Status
scsi_read_control_bits(Microtek2_Scanner *);
@ -1343,7 +1343,7 @@ scsi_read_control_bits(Microtek2_Scanner *);
scsi_read_gamma(Microtek2_Scanner *); */
static SANE_Status
scsi_read_image(Microtek2_Scanner *, u_int8_t *, int);
scsi_read_image(Microtek2_Scanner *, uint8_t *, int);
static SANE_Status
scsi_read_image_info(Microtek2_Scanner *);
@ -1362,10 +1362,10 @@ static SANE_Status
scsi_send_gamma(Microtek2_Scanner *);
static SANE_Status
scsi_send_shading(Microtek2_Scanner *, u_int8_t *, u_int32_t, u_int8_t);
scsi_send_shading(Microtek2_Scanner *, uint8_t *, uint32_t, uint8_t);
static SANE_Status
scsi_read_shading(Microtek2_Scanner *, u_int8_t *, u_int32_t);
scsi_read_shading(Microtek2_Scanner *, uint8_t *, uint32_t);
static SANE_Status
scsi_send_system_status(Microtek2_Device *, int);

Wyświetl plik

@ -66,6 +66,8 @@
#include <sys/time.h>
#include <sys/types.h>
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -235,7 +237,7 @@ static SANE_Bool
little_endian (void)
{
SANE_Int testvalue = 255;
u_int8_t *firstbyte = (u_int8_t *) & testvalue;
uint8_t *firstbyte = (uint8_t *) & testvalue;
if (*firstbyte == 255)
return SANE_TRUE;
@ -3070,11 +3072,11 @@ line_distance (Mustek_Scanner * s)
if (s->hw->flags & MUSTEK_FLAG_N)
{
/* According to Andreas Czechanowski, the line-distance values
returned for the AB306N scanners are garbage, so we have to
fix things up manually. Not good.
This seems to be true only for firmware 2.00 which is
extremely seldom.. AB306N scanners with firmware 1.01 don't
need this fix. <henning@meier-geinitz.de> */
returned for the AB306N scanners are garbage, so we have to
fix things up manually. Not good.
This seems to be true only for firmware 2.00 which is
extremely seldom.. AB306N scanners with firmware 1.01 don't
need this fix. <henning@meier-geinitz.de> */
if (peak_res == 600)
{
if (res < 51)
@ -4744,7 +4746,7 @@ output_data (Mustek_Scanner * s, FILE * fp,
else /* lineart */
{
/* need to invert image because of funny SANE 1-bit image
polarity */
polarity */
if (*(data + x / 8 + y * bpl) & (1 << (7 - (x % 8))))
byte |= 1 << (7 - (enlarged_x % 8));
@ -4770,7 +4772,7 @@ output_data (Mustek_Scanner * s, FILE * fp,
|| (s->mode & MUSTEK_MODE_HALFTONE))
{
/* need to invert image because of funny SANE 1-bit image
polarity */
polarity */
ptr = data;
ptr_end = ptr + lines_per_buffer * bpl;

Wyświetl plik

@ -1869,7 +1869,7 @@ sane_start (SANE_Handle handle)
SANE_Status status;
int fd, need_auth;
socklen_t len;
u_int16_t port; /* Internet-specific */
uint16_t port; /* Internet-specific */
DBG (3, "sane_start\n");
@ -2004,7 +2004,7 @@ sane_start (SANE_Handle handle)
SANE_Status status;
int fd, need_auth;
socklen_t len;
u_int16_t port; /* Internet-specific */
uint16_t port; /* Internet-specific */
DBG (3, "sane_start\n");

Wyświetl plik

@ -98,9 +98,9 @@
# include <stdint.h> /* available in ISO C99 */
#else
# include <sys/types.h>
typedef u_int8_t uint8_t;
typedef u_int16_t uint16_t;
typedef u_int32_t uint32_t;
typedef uint8_t uint8_t;
typedef uint16_t uint16_t;
typedef uint32_t uint32_t;
#endif /* HAVE_STDINT_H */
/** \addtogroup API

Wyświetl plik

@ -63,10 +63,10 @@
#define RTS8891_FLAG_UNTESTED (1 << 0) /* Print a warning for these scanners */
#define RTS8891_FLAG_EMULATED_GRAY_MODE (2 << 0) /* gray scans are emulated using comor modes */
#define LOWORD(x) ((u_int16_t)(x & 0xffff))
#define HIWORD(x) ((u_int16_t)(x >> 16))
#define LOBYTE(x) ((u_int8_t)((x) & 0xFF))
#define HIBYTE(x) ((u_int8_t)((x) >> 8))
#define LOWORD(x) ((uint16_t)(x & 0xffff))
#define HIWORD(x) ((uint16_t)(x >> 16))
#define LOBYTE(x) ((uint8_t)((x) & 0xFF))
#define HIBYTE(x) ((uint8_t)((x) >> 8))
#define MAX_SCANNERS 32
#define MAX_RESOLUTIONS 16

Wyświetl plik

@ -55,6 +55,8 @@
#include <stdio.h>
#include <sys/time.h>
#include "_stdint.h"
#define RTS88XX_LIB_BUILD 5
/* init rts88xx library */

Wyświetl plik

@ -74,8 +74,8 @@
#define RTS88XX_MAX_XFER_SIZE 0xFFC0
#define LOBYTE(x) ((u_int8_t)((x) & 0xFF))
#define HIBYTE(x) ((u_int8_t)((x) >> 8))
#define LOBYTE(x) ((uint8_t)((x) & 0xFF))
#define HIBYTE(x) ((uint8_t)((x) >> 8))
/* this function init the rts88xx library */
void sanei_rts88xx_lib_init (void);

Wyświetl plik

@ -50,6 +50,8 @@
#include <unistd.h>
#include <sys/time.h>
#include "_stdint.h"
#include "sane/sane.h"
#include "sane/sanei.h"
#include "sane/saneopts.h"
@ -117,22 +119,22 @@ static const SANE_Range abs_percentage_range =
#define INQ_LEN 0x60
static const u_int8_t inquiry[] =
static const uint8_t inquiry[] =
{
TAMARACK_SCSI_INQUIRY, 0x00, 0x00, 0x00, INQ_LEN, 0x00
};
static const u_int8_t test_unit_ready[] =
static const uint8_t test_unit_ready[] =
{
TAMARACK_SCSI_TEST_UNIT_READY, 0x00, 0x00, 0x00, 0x00, 0x00
};
static const u_int8_t stop[] =
static const uint8_t stop[] =
{
TAMARACK_SCSI_START_STOP, 0x00, 0x00, 0x00, 0x00, 0x00
};
static const u_int8_t get_status[] =
static const uint8_t get_status[] =
{
TAMARACK_SCSI_GET_DATA_STATUS, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0c, 0x00
@ -489,7 +491,7 @@ do_cancel (Tamarack_Scanner *s)
static SANE_Status
get_image_status (Tamarack_Scanner *s)
{
u_int8_t result[12];
uint8_t result[12];
SANE_Status status;
size_t len;
int busy;

Wyświetl plik

@ -59,6 +59,8 @@
#include <unistd.h>
#include <fcntl.h>
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -227,7 +229,7 @@ static SANE_Bool
little_endian (void)
{
SANE_Int testvalue = 255;
u_int8_t *firstbyte = (u_int8_t *) & testvalue;
uint8_t *firstbyte = (uint8_t *) & testvalue;
if (*firstbyte == 255)
return SANE_TRUE;

405
configure vendored
Wyświetl plik

@ -13373,365 +13373,6 @@ _ACEOF
fi
if test "$ac_cv_header_sys_bitypes_h" = "yes" ; then
{ $as_echo "$as_me:$LINENO: checking for u_int8_t only in sys/bitypes.h" >&5
$as_echo_n "checking for u_int8_t only in sys/bitypes.h... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "u_int8_t" >/dev/null 2>&1; then
{ $as_echo "$as_me:$LINENO: result: no, also in standard headers" >&5
$as_echo "no, also in standard headers" >&6; }
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <netinet/in.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "u_int8_t" >/dev/null 2>&1; then
cat >>confdefs.h <<\_ACEOF
#define NEED_SYS_BITYPES_H 1
_ACEOF
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no, not even included with netinet/in.h" >&5
$as_echo "no, not even included with netinet/in.h" >&6; }
fi
rm -f conftest*
fi
rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: checking for u_int8_t" >&5
$as_echo_n "checking for u_int8_t... " >&6; }
if test "${ac_cv_type_u_int8_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_type_u_int8_t=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof (u_int8_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof ((u_int8_t)))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_u_int8_t=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5
$as_echo "$ac_cv_type_u_int8_t" >&6; }
if test "x$ac_cv_type_u_int8_t" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_U_INT8_T 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for u_int16_t" >&5
$as_echo_n "checking for u_int16_t... " >&6; }
if test "${ac_cv_type_u_int16_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_type_u_int16_t=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof (u_int16_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof ((u_int16_t)))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_u_int16_t=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5
$as_echo "$ac_cv_type_u_int16_t" >&6; }
if test "x$ac_cv_type_u_int16_t" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_U_INT16_T 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for u_int32_t" >&5
$as_echo_n "checking for u_int32_t... " >&6; }
if test "${ac_cv_type_u_int32_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_type_u_int32_t=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof (u_int32_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof ((u_int32_t)))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_u_int32_t=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5
$as_echo "$ac_cv_type_u_int32_t" >&6; }
if test "x$ac_cv_type_u_int32_t" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_U_INT32_T 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for u_char" >&5
$as_echo_n "checking for u_char... " >&6; }
if test "${ac_cv_type_u_char+set}" = set; then
@ -19010,7 +18651,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 19013 "configure"' > conftest.$ac_ext
echo '#line 18654 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -21890,11 +21531,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:21893: $lt_compile\"" >&5)
(eval echo "\"\$as_me:21534: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:21897: \$? = $ac_status" >&5
echo "$as_me:21538: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -22180,11 +21821,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:22183: $lt_compile\"" >&5)
(eval echo "\"\$as_me:21824: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:22187: \$? = $ac_status" >&5
echo "$as_me:21828: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -22284,11 +21925,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:22287: $lt_compile\"" >&5)
(eval echo "\"\$as_me:21928: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:22291: \$? = $ac_status" >&5
echo "$as_me:21932: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -24686,7 +24327,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 24689 "configure"
#line 24330 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -24786,7 +24427,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 24789 "configure"
#line 24430 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -27199,11 +26840,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:27202: $lt_compile\"" >&5)
(eval echo "\"\$as_me:26843: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:27206: \$? = $ac_status" >&5
echo "$as_me:26847: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -27303,11 +26944,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:27306: $lt_compile\"" >&5)
(eval echo "\"\$as_me:26947: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:27310: \$? = $ac_status" >&5
echo "$as_me:26951: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -28888,11 +28529,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:28891: $lt_compile\"" >&5)
(eval echo "\"\$as_me:28532: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:28895: \$? = $ac_status" >&5
echo "$as_me:28536: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -28992,11 +28633,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:28995: $lt_compile\"" >&5)
(eval echo "\"\$as_me:28636: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:28999: \$? = $ac_status" >&5
echo "$as_me:28640: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -31213,11 +30854,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:31216: $lt_compile\"" >&5)
(eval echo "\"\$as_me:30857: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:31220: \$? = $ac_status" >&5
echo "$as_me:30861: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -31503,11 +31144,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:31506: $lt_compile\"" >&5)
(eval echo "\"\$as_me:31147: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:31510: \$? = $ac_status" >&5
echo "$as_me:31151: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -31607,11 +31248,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:31610: $lt_compile\"" >&5)
(eval echo "\"\$as_me:31251: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:31614: \$? = $ac_status" >&5
echo "$as_me:31255: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized

Wyświetl plik

@ -194,15 +194,15 @@ static AvahiEntryGroup *avahi_group = NULL;
#ifdef ENABLE_IPV6
# define SANE_IN6_IS_ADDR_LOOPBACK(a) \
(((const u_int32_t *) (a))[0] == 0 \
&& ((const u_int32_t *) (a))[1] == 0 \
&& ((const u_int32_t *) (a))[2] == 0 \
&& ((const u_int32_t *) (a))[3] == htonl (1))
(((const uint32_t *) (a))[0] == 0 \
&& ((const uint32_t *) (a))[1] == 0 \
&& ((const uint32_t *) (a))[2] == 0 \
&& ((const uint32_t *) (a))[3] == htonl (1))
#define SANE_IN6_IS_ADDR_V4MAPPED(a) \
((((const u_int32_t *) (a))[0] == 0) \
&& (((const u_int32_t *) (a))[1] == 0) \
&& (((const u_int32_t *) (a))[2] == htonl (0xffff)))
((((const uint32_t *) (a))[0] == 0) \
&& (((const uint32_t *) (a))[1] == 0) \
&& (((const uint32_t *) (a))[2] == htonl (0xffff)))
#endif /* ENABLE_IPV6 */
#ifndef MAXHOSTNAMELEN
@ -545,7 +545,7 @@ check_v4_in_range (struct sockaddr_in *sin, char *base_ip, char *netmask)
int cidr;
int i, err;
char *end;
u_int32_t mask;
uint32_t mask;
struct sockaddr_in *base;
struct addrinfo hints;
struct addrinfo *res;
@ -679,7 +679,7 @@ check_v4_in_range (struct in_addr *inaddr, struct in_addr *base, char *netmask)
int cidr;
int i;
char *end;
u_int32_t mask;
uint32_t mask;
SANE_Bool ret = SANE_FALSE;
cidr = -1;

Wyświetl plik

@ -41,6 +41,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include "_stdint.h"
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
@ -59,7 +61,7 @@
typedef struct
{
u_int8_t *data;
uint8_t *data;
int width; /*WARNING: this is in bytes, get pixel width from param*/
int height;
int x;

Wyświetl plik

@ -396,15 +396,6 @@
/* Define to 1 if the system has the type `u_int'. */
#undef HAVE_U_INT
/* Define to 1 if the system has the type `u_int16_t'. */
#undef HAVE_U_INT16_T
/* Define to 1 if the system has the type `u_int32_t'. */
#undef HAVE_U_INT32_T
/* Define to 1 if the system has the type `u_int8_t'. */
#undef HAVE_U_INT8_T
/* Define to 1 if the system has the type `u_long'. */
#undef HAVE_U_LONG
@ -417,14 +408,6 @@
/* Define to 1 if you have the `_portaccess' function. */
#undef HAVE__PORTACCESS
/* Do we need <sys/bitypes.h>? */
#undef NEED_SYS_BITYPES_H
/* Make sure that sys/bitypes.h is included on True64 */
#ifdef NEED_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
@ -572,18 +555,6 @@
/* FIXME: Do not use these types in code anymore. Use types defined
* in C99 stdint.h and available in our cross-platform _stdint.h.
*/
#ifndef HAVE_U_INT8_T
#define u_int8_t unsigned char
#endif
#ifndef HAVE_U_INT16_T
#define u_int16_t unsigned int
#endif
#ifndef HAVE_U_INT32_T
#define u_int32_t unsigned long
#endif
#ifndef HAVE_U_CHAR
#define u_char unsigned char
#endif
@ -593,7 +564,6 @@
#ifndef HAVE_U_LONG
#define u_long unsigned long
#endif
/* END of FIXME: Do not use above types */
/* Prototype for getenv */
#ifndef HAVE_GETENV

Wyświetl plik

@ -37,6 +37,8 @@
#include <usb.h>
#include "_stdint.h"
static int verbose = 0;
static SANE_Bool no_chipset_access;
#define TIMEOUT 1000
@ -3065,15 +3067,15 @@ check_rts8822 (struct usb_device *dev)
static char *
check_hp5590 (struct usb_device *dev)
{
usb_dev_handle *handle;
int result;
u_int8_t status;
usb_dev_handle *handle;
int result;
uint8_t status;
struct usb_ctrl_setup ctrl;
u_int8_t data[0x32];
u_int8_t ack;
u_int8_t *ptr;
int next_packet_size;
unsigned int len;
uint8_t data[0x32];
uint8_t ack;
uint8_t *ptr;
int next_packet_size;
unsigned int len;
if (verbose > 2)
printf (" checking for HP5550/5590/7650 chipset ...\n");
@ -3222,8 +3224,8 @@ check_hp5590 (struct usb_device *dev)
{
if (verbose > 2)
printf (" Didn't get correct confirmation for USB-in-USB command "
"(needed: 0x01, got: 0x%02x\n",
status);
"(needed: 0x01, got: 0x%02x\n",
status);
finish_interface (handle);
return NULL;
}
@ -3296,8 +3298,8 @@ check_hp5590 (struct usb_device *dev)
{
if (verbose > 2)
printf (" Didn't get correct confirmation for USB-in-USB command "
"(needed: 0x01, got: 0x%02x\n",
status);
"(needed: 0x01, got: 0x%02x\n",
status);
finish_interface (handle);
return NULL;
}