Re: Problem building sane on FreeBSD 2.2.2

David Mosberger-Tang (David.Mosberger@acm.org)
Fri, 17 Oct 1997 21:28:40 -0700

--uTjdChMNF8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

>>>>> On Fri, 17 Oct 1997 02:52:54 -0400 (EDT), Billy the expert skier! <druid@linux.nycmetro.com> said:

Billy> By the way, David, I can't seem to get sane v0.66 compiled on
Billy> SCO. Albeit I haven't tried to correct the errors I'm
Billy> getting, but they are actual 'error' notices when building
Billy> sane.. in the Microtek and Umax backends.

Billy> I'm using SCO OpenServer 5.0.2 (FreeSCO) with the C compilter
Billy> that came with SCO, not gcc, and the latest gnu make. The
Billy> 'warning' notices can be ignored. Here is what I get..

Can you try the following patch and see whether it does the trick?

--david

--uTjdChMNF8
Content-Type: text/plain
Content-Description: 0.66 fix
Content-Disposition: inline;
filename="pp"
Content-Transfer-Encoding: 7bit

--- microtek.c~ Wed Oct 1 23:26:20 1997
+++ microtek.c Fri Oct 17 21:20:25 1997
@@ -91,7 +91,7 @@


/* These are for the E6. Does this hold for other models? */
-static SANE_String_Const halftone_mode_list[13] = {
+static const SANE_String_Const halftone_mode_list[13] = {
" 1 53-dot screen (53 gray levels)",
" 2 Horiz. screen (65 gray levels)",
" 3 Vert. screen (65 gray levels)",
@@ -141,7 +141,7 @@



-static size_t max_string_size (const SANE_String_Const strings[])
+static size_t max_string_size (SANE_String_Const strings[])
{
size_t size, max_size = 0;
int i;
@@ -320,7 +320,7 @@
sod[OPT_SPEED].size = sizeof(SANE_Word);
/* sod[OPT_SPEED].cap = 0;*/
sod[OPT_SPEED].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_SPEED].constraint = &speed_range;
+ sod[OPT_SPEED].constraint.range = &speed_range;
val[OPT_SPEED].w = 1;

sod[OPT_PREVIEW].name = SANE_NAME_PREVIEW;
@@ -385,40 +385,58 @@

switch (ms->dev->info.doc_size_code) {
case 0x00:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range85;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range140;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range85;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range140;
break;
case 0x01:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range85;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range110;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range85;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range110;
break;
case 0x02:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range85;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range1169;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range85;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range1169;
break;
case 0x03:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range85;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range130;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range85;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range130;
break;
case 0x04:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range80;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range100;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range80;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range100;
break;
case 0x05:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range83;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range140;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range83;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range140;
break;
case 0x80:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range35M;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range35M;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range35M;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range35M;
break;
case 0x81:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range50;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range50;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range50;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range50;
break;
case 0x82:
- sod[OPT_TL_X].constraint = sod[OPT_BR_X].constraint = &geo_range36M;
- sod[OPT_TL_Y].constraint = sod[OPT_BR_Y].constraint = &geo_range36M;
+ sod[OPT_TL_X].constraint.range
+ = sod[OPT_BR_X].constraint.range = &geo_range36M;
+ sod[OPT_TL_Y].constraint.range
+ = sod[OPT_BR_Y].constraint.range = &geo_range36M;
break;
default:
DBG(23, "init_options: YYIKES\n"); /* XXXXXXXXXXX */
@@ -441,7 +459,7 @@
sod[OPT_BRIGHTNESS].size = sizeof(SANE_Word);
/* sod[OPT_BRIGHTNESS].cap = 0;*/
sod[OPT_BRIGHTNESS].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_BRIGHTNESS].constraint = &exposure_range;
+ sod[OPT_BRIGHTNESS].constraint.range = &exposure_range;
val[OPT_BRIGHTNESS].w = 0;

sod[OPT_CONTRAST].name = SANE_NAME_CONTRAST;
@@ -452,7 +470,7 @@
sod[OPT_CONTRAST].size = sizeof(SANE_Word);
/* sod[OPT_CONTRAST].cap = 0;*/
sod[OPT_CONTRAST].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_CONTRAST].constraint = &contrast_range;
+ sod[OPT_CONTRAST].constraint.range = &contrast_range;
val[OPT_CONTRAST].w = 0;


@@ -463,7 +481,7 @@
sod[OPT_HIGHLIGHT].unit = SANE_UNIT_NONE;
sod[OPT_HIGHLIGHT].size = sizeof(SANE_Word);
sod[OPT_HIGHLIGHT].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_HIGHLIGHT].constraint = &u8_range;
+ sod[OPT_HIGHLIGHT].constraint.range = &u8_range;
val[OPT_HIGHLIGHT].w = 255;

sod[OPT_SHADOW].name = SANE_NAME_BLACK_LEVEL;
@@ -473,7 +491,7 @@
sod[OPT_SHADOW].unit = SANE_UNIT_NONE;
sod[OPT_SHADOW].size = sizeof(SANE_Word);
sod[OPT_SHADOW].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_SHADOW].constraint = &u8_range;
+ sod[OPT_SHADOW].constraint.range = &u8_range;
val[OPT_SHADOW].w = 0;

if (ms->dev->info.enhance_cap & MI_ENH_CAP_SHADOW) {
@@ -491,7 +509,7 @@
sod[OPT_MIDTONE].unit = SANE_UNIT_NONE;
sod[OPT_MIDTONE].size = sizeof(SANE_Word);
sod[OPT_MIDTONE].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_MIDTONE].constraint = &u8_range;
+ sod[OPT_MIDTONE].constraint.range = &u8_range;
val[OPT_MIDTONE].w = 128;
if (ms->dev->info.enhance_cap & MI_ENH_CAP_MIDTONE) {
sod[OPT_MIDTONE].cap |= SANE_CAP_ADVANCED;
@@ -526,7 +544,7 @@
sod[OPT_GAMMA_VECTOR].size = 256 * sizeof(SANE_Word);
sod[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE;
sod[OPT_GAMMA_VECTOR].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_GAMMA_VECTOR].constraint = &u8_range;
+ sod[OPT_GAMMA_VECTOR].constraint.range = &u8_range;
val[OPT_GAMMA_VECTOR].wa = &(ms->gamma_table[0][0]);

sod[OPT_GAMMA_VECTOR_R].name = SANE_NAME_GAMMA_VECTOR_R;
@@ -538,7 +556,7 @@
sod[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE;
/* sod[OPT_GAMMA_VECTOR_R].cap = 0;*/
sod[OPT_GAMMA_VECTOR_R].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_GAMMA_VECTOR_R].constraint = &u8_range;
+ sod[OPT_GAMMA_VECTOR_R].constraint.range = &u8_range;
val[OPT_GAMMA_VECTOR_R].wa = &(ms->gamma_table[1][0]);

sod[OPT_GAMMA_VECTOR_G].name = SANE_NAME_GAMMA_VECTOR_G;
@@ -550,7 +568,7 @@
sod[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE;
/* sod[OPT_GAMMA_VECTOR_G].cap = 0;*/
sod[OPT_GAMMA_VECTOR_G].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_GAMMA_VECTOR_G].constraint = &u8_range;
+ sod[OPT_GAMMA_VECTOR_G].constraint.range = &u8_range;
val[OPT_GAMMA_VECTOR_G].wa = &(ms->gamma_table[2][0]);

sod[OPT_GAMMA_VECTOR_B].name = SANE_NAME_GAMMA_VECTOR_B;
@@ -561,7 +579,7 @@
sod[OPT_GAMMA_VECTOR_B].size = 256 * sizeof(SANE_Word);
sod[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE;
sod[OPT_GAMMA_VECTOR_B].constraint_type = SANE_CONSTRAINT_RANGE;
- sod[OPT_GAMMA_VECTOR_B].constraint = &u8_range;
+ sod[OPT_GAMMA_VECTOR_B].constraint.range = &u8_range;
val[OPT_GAMMA_VECTOR_B].wa = &(ms->gamma_table[3][0]);


@@ -574,7 +592,7 @@
sod[OPT_].size = sizeof(SANE_Word);
sod[OPT_].cap = 0;
sod[OPT_].constraint_type = SANE_CONSTRAINT_NONE;
- sod[OPT_].constraint = ;
+ sod[OPT_].constraint.range = ;
val[OPT_].w = ;
*/
DBG(23, "init_options: done.\n");
--- umax.c~ Sat Oct 11 01:39:09 1997
+++ umax.c Fri Oct 17 21:22:20 1997
@@ -2007,7 +2007,9 @@
if (scanner->device->us.three_pass == 0) /* one pass color scan */
{
unsigned int i, dest, color, value;
- char gamma[3 * scanner->gamma_length * scanner->output_bytes];
+ char *gamma;
+
+ gamma = alloca (3 * scanner->gamma_length * scanner->output_bytes);

dest=0;
for(color=1;color<=3;color++)
@@ -2030,7 +2032,9 @@
else /* three pass color scan */
{
unsigned int i, dest, color, value;
- char gamma[scanner->gamma_length * scanner->output_bytes];
+ char *gamma;
+
+ gamma = alloca (scanner->gamma_length * scanner->output_bytes);

dest = 0;
color = scanner->device->us.three_pass_color;
@@ -2052,7 +2056,9 @@
else /* greyscale scan */
{
int i, dest, value;
- char gamma[scanner->gamma_length * scanner->output_bytes];
+ char *gamma;
+
+ gamma = alloca (scanner->gamma_length * scanner->output_bytes);

dest=0;
for(i=0; i < scanner->gamma_length; i++)

--uTjdChMNF8--

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com