[jitsi-dev] Re: [jitsi~svn:10029] Updates library jni portaudio for Linux-64.


#1

Vincent, why did you remove the casts to intptr_t?

···

On 30.10.2012, at 15:29, vincent_lucas@java.net wrote:

- if(((PaDeviceInfo *) (intptr_t) deviceInfo)->structVersion >= 3)
+ if(((PaDeviceInfo *) deviceInfo)->structVersion >= 3)

- const char *type
- = ((PaDeviceInfo *) (intptr_t) deviceInfo)->transportType;
+ const char *type = ((PaDeviceInfo *) deviceInfo)->transportType;

- if(((PaDeviceInfo *) (intptr_t) deviceInfo)->structVersion >= 3)
+ if(((PaDeviceInfo *) deviceInfo)->structVersion >= 3)

- const char *uid
- = ((PaDeviceInfo *) (intptr_t) deviceInfo)->deviceUID;
+ const char *uid = ((PaDeviceInfo *) deviceInfo)->deviceUID;


#2

Hello Lyubomir,

The cast was producing an error on Linux and Windows when compiling. This way the code also conforms to other function like Java_net_java_sip_communicator_impl_neomedia_portaudio_PortAudio_PaDeviceInfo_1getNameBytes:881.

But I wonder why there is no error while compiling with the intptr_t cast from src/native/portaudio/org_jitsi_impl_neomedia_portaudio_PortAudio.c in libjitsi?

Regards,
Vincent

···

On 10/30/12 2:37 PM, Lyubomir Marinov wrote:

Vincent, why did you remove the casts to intptr_t?

--
Vincent Lucas, Ph.D. Jitsi developer
chenzo@jitsi.org http://jitsi.org


#3

The cast was producing an error on Linux and Windows when compiling. This way the code also conforms to other function like Java_net_java_sip_communicator_impl_neomedia_portaudio_PortAudio_PaDeviceInfo_1getNameBytes:881.

If there is no cast to intptr_t, it means that it is old code which has not been updated.

But I wonder why there is no error while compiling with the intptr_t cast from src/native/portaudio/org_jitsi_impl_neomedia_portaudio_PortAudio.c in libjitsi?

Because intptr_t is defined in stdint.h and net_java_sip_communicator_impl_neomedia_portaudio_PortAudio.c does not include it while org_jitsi_impl_neomedia_portaudio_PortAudio.c does?

Please use intptr_t or we'll get warnings when compiling for 32-bit architectures.

···

On 30.10.2012, at 16:11, Vincent Lucas <chenzo@jitsi.org> wrote:


#4

Hi Lyubomir,

Thank you very much for the explanation. r10034 follows your suggestion: it includes stdint.h and uses intptr_t cast to removes the numerous warnings.

Regards,
Vincent

···

On 10/30/12 3:18 PM, Lyubomir Marinov wrote:

On 30.10.2012, at 16:11, Vincent Lucas <chenzo@jitsi.org> wrote:

The cast was producing an error on Linux and Windows when compiling. This way the code also conforms to other function like Java_net_java_sip_communicator_impl_neomedia_portaudio_PortAudio_PaDeviceInfo_1getNameBytes:881.

If there is no cast to intptr_t, it means that it is old code which has not been updated.

But I wonder why there is no error while compiling with the intptr_t cast from src/native/portaudio/org_jitsi_impl_neomedia_portaudio_PortAudio.c in libjitsi?

Because intptr_t is defined in stdint.h and net_java_sip_communicator_impl_neomedia_portaudio_PortAudio.c does not include it while org_jitsi_impl_neomedia_portaudio_PortAudio.c does?

Please use intptr_t or we'll get warnings when compiling for 32-bit architectures.

--
Vincent Lucas, Ph.D. Jitsi developer
chenzo@jitsi.org http://jitsi.org