[PATCH] swig: improve indentation

2019-08-22 Thread yegorslists
From: Yegor Yefremov 

Fixes -Wmisleading-indentation warnings.
---
 python/ftdi1.i | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/python/ftdi1.i b/python/ftdi1.i
index f397f84..8b179f9 100644
--- a/python/ftdi1.i
+++ b/python/ftdi1.i
@@ -92,7 +92,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
 %enddef
 %feature("autodoc", ftdi_read_data_docstring) ftdi_read_data;
 %typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = 
PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
-%typemap(argout) (unsigned char *buf, int size) %{ if(result<0) $2=0; $result 
= SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2)); free($1); %}
+%typemap(argout) (unsigned char *buf, int size) %{
+if(result<0)
+$2=0;
+$result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2));
+free($1);
+%}
 int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int 
size);
 %clear (unsigned char *buf, int size);
 
@@ -132,7 +137,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
 %clear int* value;
 
 %typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = 
PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
-%typemap(argout) (unsigned char *buf, int size) %{ if(result<0) $2=0; $result 
= SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2)); free($1); %}
+%typemap(argout) (unsigned char *buf, int size) %{
+if(result<0)
+$2=0;
+$result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2));
+free($1);
+%}
 int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char * buf, 
int size);
 %clear (unsigned char *buf, int size);
 
-- 
2.17.0


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com   



Re: [PATCH] swig: improve indentation

2019-08-22 Thread Yegor Yefremov
Hi Thomas,

this patch is only compile tested.

Regards,
Yegor

On Thu, Aug 22, 2019 at 3:47 PM  wrote:
>
> From: Yegor Yefremov 
>
> Fixes -Wmisleading-indentation warnings.
> ---
>  python/ftdi1.i | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/python/ftdi1.i b/python/ftdi1.i
> index f397f84..8b179f9 100644
> --- a/python/ftdi1.i
> +++ b/python/ftdi1.i
> @@ -92,7 +92,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
>  %enddef
>  %feature("autodoc", ftdi_read_data_docstring) ftdi_read_data;
>  %typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = 
> PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
> -%typemap(argout) (unsigned char *buf, int size) %{ if(result<0) $2=0; 
> $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2)); 
> free($1); %}
> +%typemap(argout) (unsigned char *buf, int size) %{
> +if(result<0)
> +$2=0;
> +$result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, 
> $2));
> +free($1);
> +%}
>  int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int 
> size);
>  %clear (unsigned char *buf, int size);
>
> @@ -132,7 +137,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
>  %clear int* value;
>
>  %typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = 
> PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
> -%typemap(argout) (unsigned char *buf, int size) %{ if(result<0) $2=0; 
> $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2)); 
> free($1); %}
> +%typemap(argout) (unsigned char *buf, int size) %{
> +if(result<0)
> +$2=0;
> +$result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, 
> $2));
> +free($1);
> +%}
>  int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char * buf, 
> int size);
>  %clear (unsigned char *buf, int size);
>
> --
> 2.17.0
>

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com   



Re: [PATCH] swig: improve indentation

2019-09-25 Thread Yegor Yefremov
Hi Thomas,

I've tested the patch with my software and so far everything seems to
be working.

What is your schedule for a new release?

Cheers,
Yegor

On Thu, Aug 22, 2019 at 3:48 PM Yegor Yefremov
 wrote:
>
> Hi Thomas,
>
> this patch is only compile tested.
>
> Regards,
> Yegor
>
> On Thu, Aug 22, 2019 at 3:47 PM  wrote:
> >
> > From: Yegor Yefremov 
> >
> > Fixes -Wmisleading-indentation warnings.
> > ---
> >  python/ftdi1.i | 14 --
> >  1 file changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/python/ftdi1.i b/python/ftdi1.i
> > index f397f84..8b179f9 100644
> > --- a/python/ftdi1.i
> > +++ b/python/ftdi1.i
> > @@ -92,7 +92,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
> >  %enddef
> >  %feature("autodoc", ftdi_read_data_docstring) ftdi_read_data;
> >  %typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = 
> > PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
> > -%typemap(argout) (unsigned char *buf, int size) %{ if(result<0) $2=0; 
> > $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2)); 
> > free($1); %}
> > +%typemap(argout) (unsigned char *buf, int size) %{
> > +if(result<0)
> > +$2=0;
> > +$result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, 
> > $2));
> > +free($1);
> > +%}
> >  int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int 
> > size);
> >  %clear (unsigned char *buf, int size);
> >
> > @@ -132,7 +137,12 @@ char * str2charp_size(PyObject* pyObj, int * size)
> >  %clear int* value;
> >
> >  %typemap(in,numinputs=1) (unsigned char *buf, int size) %{ $2 = 
> > PyInt_AsLong($input);$1 = (unsigned char*)malloc($2*sizeof(char)); %}
> > -%typemap(argout) (unsigned char *buf, int size) %{ if(result<0) $2=0; 
> > $result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, $2)); 
> > free($1); %}
> > +%typemap(argout) (unsigned char *buf, int size) %{
> > +if(result<0)
> > +$2=0;
> > +$result = SWIG_Python_AppendOutput($result, charp2str((char*)$1, 
> > $2));
> > +free($1);
> > +%}
> >  int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char * 
> > buf, int size);
> >  %clear (unsigned char *buf, int size);
> >
> > --
> > 2.17.0
> >

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com   



Re: [PATCH] swig: improve indentation

2019-10-01 Thread Thomas Jarosch
Hi Yegor,

You wrote on Wed, Sep 25, 2019 at 02:55:49PM +0200:
> I've tested the patch with my software and so far everything seems to
> be working.

Also compiles fine here, applied. Thanks!

> What is your schedule for a new release?

there's always something delaying further work ^^

I had to bisect another kernel upgrade issue
(https://patchwork.ozlabs.org/patch/1161654/)
and I'm slowling crawling through the piled up patches.

Let's see if we can make a release in the middle of / end of October.

Cheers,
Thomas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com