On Sun, Feb 21, 2010 at 1:03 AM, David Brownell <[email protected]> wrote:
> On Thursday 18 February 2010, Xiaofan Chen wrote:
>> This trivial patch will solve the problem of unused variable warning
>> if building the Parallel Port driver under FreeBSD. Tested under
>> FreeBSD 8.0-RELEASE-p2.
>>
> So the non-FreeBSD builds which enable PPDEV should get
> fatal build errors since "i" is no longer defined?
>
> A better patch is below ... I'll likely merge it later.
>
> --- a/src/jtag/drivers/parport.c
> +++ b/src/jtag/drivers/parport.c
> @@ -265,7 +265,6 @@ static int parport_init(void)
>        struct cable *cur_cable;
>  #if PARPORT_USE_PPDEV == 1
>        char buffer[256];
> -       int i = 0;
>  #endif
>
>        cur_cable = cables;
> @@ -323,7 +322,8 @@ static int parport_init(void)
>        LOG_DEBUG("...open");
>
>  #if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
> -       i = ioctl(device_handle, PPCLAIM);
> +       int i = ioctl(device_handle, PPCLAIM);
> +
>        if (i < 0)
>        {
>                LOG_ERROR("cannot claim device");
>

Thanks. This works. I do not have parallel port for my PC
so I do not test the real thing but the building is now okay,
no more warnings.


-- 
Xiaofan http://mcuee.blogspot.com
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to