epson2: code style fixes

Minor code style fixes, like missing tabs, lenghty line, etc
merge-requests/1/head
Alessandro Zummo 2009-06-03 02:28:44 +02:00
rodzic 40e08cbb36
commit 83b0f1f4f5
1 zmienionych plików z 74 dodań i 85 usunięć

Wyświetl plik

@ -213,10 +213,11 @@ static const SANE_String_Const color_list[] = {
/*
* Gamma correction:
* The A and B level scanners work differently than the D level scanners, therefore
* I define two different sets of arrays, plus one set of variables that get set to
* the actally used params and list arrays at runtime.
* The A and B level scanners work differently than the D level scanners,
* therefore I define two different sets of arrays, plus one set of
* variables that get set to the actally used params and list arrays at runtime.
*/
static int gamma_params_ab[] = {
0x01,
0x03,
@ -287,7 +288,7 @@ static const SANE_Range outline_emphasis_range = { -2, 2, 0 };
* List of pointers to devices - will be dynamically allocated depending
* on the number of devices found.
*/
static const SANE_Device **devlist = 0;
static const SANE_Device **devlist;
/* Some utility functions */
@ -341,9 +342,8 @@ close_scanner(Epson_Scanner * s)
esci_request_status(s, NULL);
/* request extended status. This toggles w_cmd_count only */
if (w_cmd_count % 2) {
if (w_cmd_count % 2)
esci_request_extended_status(s, NULL, NULL);
}
if (s->hw->connection == SANE_EPSON_NET) {
sanei_epson_net_unlock(s);
@ -652,9 +652,8 @@ attach(const char *name, Epson_Device * *devp, int type)
status = sanei_usb_open(name, &s->fd);
if (status != SANE_STATUS_GOOD) {
if (status != SANE_STATUS_GOOD)
goto free;
}
/* if the sanei_usb_get_vendor_product call is not supported,
then we just ignore this and rely on the user to config
@ -1020,9 +1019,8 @@ init_options(Epson_Scanner * s)
s->val[OPT_HALFTONE].w = 1; /* Halftone A */
if (!s->hw->cmd->set_halftoning) {
if (!s->hw->cmd->set_halftoning)
s->opt[OPT_HALFTONE].cap |= SANE_CAP_INACTIVE;
}
/* dropout */
s->opt[OPT_DROPOUT].name = "dropout";
@ -1047,9 +1045,8 @@ init_options(Epson_Scanner * s)
s->opt[OPT_BRIGHTNESS].constraint.range = &s->hw->cmd->bright_range;
s->val[OPT_BRIGHTNESS].w = 0; /* Normal */
if (!s->hw->cmd->set_bright) {
if (!s->hw->cmd->set_bright)
s->opt[OPT_BRIGHTNESS].cap |= SANE_CAP_INACTIVE;
}
/* sharpness */
s->opt[OPT_SHARPNESS].name = "sharpness";
@ -1098,10 +1095,8 @@ init_options(Epson_Scanner * s)
gamma_params = gamma_params_ab;
}
if (!s->hw->cmd->set_gamma) {
if (!s->hw->cmd->set_gamma)
s->opt[OPT_GAMMA_CORRECTION].cap |= SANE_CAP_INACTIVE;
}
/* gamma vector */
@ -1202,9 +1197,8 @@ init_options(Epson_Scanner * s)
s->opt[OPT_COLOR_CORRECTION].constraint.string_list = color_list;
s->val[OPT_COLOR_CORRECTION].w = 5; /* scanner default: CRT monitors */
if (!s->hw->cmd->set_color_correction) {
if (!s->hw->cmd->set_color_correction)
s->opt[OPT_COLOR_CORRECTION].cap |= SANE_CAP_INACTIVE;
}
/* resolution */
s->opt[OPT_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION;
@ -1228,9 +1222,8 @@ init_options(Epson_Scanner * s)
s->opt[OPT_THRESHOLD].constraint.range = &u8_range;
s->val[OPT_THRESHOLD].w = 0x80;
if (!s->hw->cmd->set_threshold) {
if (!s->hw->cmd->set_threshold)
s->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE;
}
s->opt[OPT_CCT_GROUP].title =
SANE_I18N("Color correction coefficients");
@ -1483,13 +1476,12 @@ init_options(Epson_Scanner * s)
s->opt[OPT_FOCUS].constraint_type = SANE_CONSTRAINT_STRING_LIST;
s->opt[OPT_FOCUS].constraint.string_list = focus_list;
s->val[OPT_FOCUS].w = 0;
s->opt[OPT_FOCUS].cap |= SANE_CAP_ADVANCED;
if (s->hw->focusSupport == SANE_TRUE) {
if (s->hw->focusSupport == SANE_TRUE)
s->opt[OPT_FOCUS].cap &= ~SANE_CAP_INACTIVE;
} else {
else
s->opt[OPT_FOCUS].cap |= SANE_CAP_INACTIVE;
}
/* forward feed / eject */
s->opt[OPT_EJECT].name = "eject";
@ -1552,9 +1544,8 @@ init_options(Epson_Scanner * s)
s->opt[OPT_WAIT_FOR_BUTTON].constraint.range = NULL;
s->opt[OPT_WAIT_FOR_BUTTON].cap |= SANE_CAP_ADVANCED;
if (!s->hw->cmd->request_push_button_status) {
if (!s->hw->cmd->request_push_button_status)
s->opt[OPT_WAIT_FOR_BUTTON].cap |= SANE_CAP_INACTIVE;
}
return SANE_STATUS_GOOD;
}
@ -1657,15 +1648,14 @@ sane_get_option_descriptor(SANE_Handle handle, SANE_Int option)
if (option < 0 || option >= NUM_OPTIONS)
return NULL;
return (s->opt + option);
return s->opt + option;
}
static const SANE_String_Const *
search_string_list(const SANE_String_Const *list, SANE_String value)
{
while (*list != NULL && strcmp(value, *list) != 0) {
++list;
}
while (*list != NULL && strcmp(value, *list) != 0)
list++;
return ((*list == NULL) ? NULL : list);
}
@ -2235,11 +2225,10 @@ sane_get_parameters(SANE_Handle handle, SANE_Parameters * params)
*/
if (s->hw->color_shuffle) {
s->params.lines -= 4 * s->line_distance;
if (s->params.lines < 0) {
if (s->params.lines < 0)
s->params.lines = 0;
}
DBG(1,
"adjusted params.lines for color_shuffle by %d to %d\n",
DBG(1, "adjusted params.lines for color_shuffle by %d to %d\n",
4 * s->line_distance, s->params.lines);
}
@ -2336,9 +2325,9 @@ sane_start(SANE_Handle handle)
}
/* set scanning parameters */
if (dev->extended_commands) {
if (dev->extended_commands)
status = e2_set_extended_scanning_parameters(s);
} else
else
status = e2_set_scanning_parameters(s);
if (status != SANE_STATUS_GOOD)