libftdi Archives

Subject: Re: RE: ftdi.write_data doesn’t work with some python3 unicode strings

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Chris Brackert <cbrackert@xxxx>, xantares 09 <xantares09@xxxxxxxxxxx>
Date: Thu, 05 Nov 2015 13:03:23 +0100
On Wednesday, 4. November 2015 14:51:36 Chris Brackert wrote:
> I have confirmed that the patch is also working with Python 2 for my code.
> Thanks!

thanks for testing, Chris!

I do get a compiler warning though with the new code:

libftdi/build/python/ftdi1PYTHON_wrap.c: In function ‘_wrap_write_data’:
libftdi/build/python/ftdi1PYTHON_wrap.c:3618:47: warning: passing argument 2 of 
‘str2charp_size’ from incompatible pointer type [-Wincompatible-pointer-types]
   arg2 = (unsigned char*)str2charp_size(obj1, &arg3); 
                                               ^
libftdi/build/python/ftdi1PYTHON_wrap.c:3010:15: note: expected ‘long int *’ 
but argument is of type ‘int *’
 inline char * str2charp_size(PyObject* pyObj, long * size)

@xantares09: Should I just change the type to "int *size"?

Thomas


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

Current Thread