[Lcdproc] Fixing non portable code in picolcd

Robert Buchholz rbu@gentoo.org
Thu Oct 4 13:18:01 2007


--nextPart2008739.0XVNit0FPI
Content-Type: text/plain;
  charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Wednesday, 26. September 2007, Markus Dolze wrote:
> Hello,
>
> I tried to fix the use of non portable libusb functions in the
> picolcd driver (usb_get_driver_np() and
> usb_detach_kernel_driver_np()).

portability++

> As I do not have a picolcd device. So can someone test the attached
> patch, please?

I can test it, but couldn't compile the code. It fails here:

if=20
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../..  -I../..  -fPIC    =
   -Wall -march=3Dnocona -mtune=3Dnocona -O2 -pipe -mmmx -msse -msse2 -msse=
3 -mfpmath=3Dsse -fweb -frename-registers -fomit-frame-pointer -fno-ident -=
Wno-unused-function -MT=20
picolcd-picolcd.o -MD -MP -MF ".deps/picolcd-picolcd.Tpo" -c -o=20
picolcd-picolcd.o `test -f 'picolcd.c' || echo './'`picolcd.c; \
        then=20
mv -f ".deps/picolcd-picolcd.Tpo" ".deps/picolcd-picolcd.Po"; else=20
rm -f ".deps/picolcd-picolcd.Tpo"; exit 1; fi
picolcd.c: In function 'picoLCD_init':
picolcd.c:162: error: 'lcd' undeclared (first use in this function)
picolcd.c:162: error: (Each undeclared identifier is reported only once
picolcd.c:162: error: for each function it appears in.)
make: *** [picolcd-picolcd.o] Error 1

The offending line:
162	   if ((usb_detach_kernel_driver_np(lcd, 0) < 0) ||

You'll probably also fail here:
166        if (usb_get_driver_np(lcd, 0, driver, sizeof(driver)) =3D=3D 0)

Regards,
Robert

--nextPart2008739.0XVNit0FPI
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQBHBOfByZx3L/ph1soRAicZAJ47W9xAWfRH3EnSXFPoRIih0LGERACfUdDG
MpemSILifOLyfJ5hTU8sjlE=
=XptK
-----END PGP SIGNATURE-----

--nextPart2008739.0XVNit0FPI--