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.
> 
> Signed-off-by: Xiaofan Chen <[email protected]>
> 
> diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c
> index a38ccfd..dbc7fbe 100644
> --- a/src/jtag/drivers/parport.c
> +++ b/src/jtag/drivers/parport.c
> @@ -265,7 +265,7 @@ static int parport_init(void)
>         struct cable *cur_cable;
>  #if PARPORT_USE_PPDEV == 1
>         char buffer[256];
> -       int i = 0;
> +       /* int i = 0; */
>  #endif
> 
>         cur_cable = cables;

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");
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to