[Android] [PATCH 06/13] libvlc: add VLCObject

Thomas Guillem thomas at gllm.fr
Thu Jan 15 21:03:44 CET 2015



On Thu, Jan 15, 2015, at 20:16, Jean-Baptiste Kempf wrote:
> On 15 Jan, Thomas Guillem wrote :
> > +struct event_thread {
> > +    bool b_run;
> > +    pthread_mutex_t lock;
> > +    pthread_cond_t cond;
> > +    pthread_t thread;
> > +    EVENT_QUEUE queue;
> > +    jweak jobj_calling;
> > +};
> 
> This struct needs repacking.
> 
> > +#define GET_CLASS(clazz, str) do { \
> > +    (clazz) = (*env)->FindClass(env, (str)); \
> > +    if (!(clazz)) { \
> > +        LOGE("FindClass(%s) failed", (str)); \
> > +        return -1; \
> > +    } \
> > +    (clazz) = (jclass) (*env)->NewGlobalRef(env, (clazz)); \
> > +    if (!(clazz)) { \
> > +        LOGE("NewGlobalRef(%s) failed", (str)); \
> > +        return -1; \
> > +    } \
> > +} while (0)
> 
> Cannot you static inline this?

I would rather not. It's used only in this function and avoid a lot of
redundant checks.

> 
> > +#define GET_ID(get, id, clazz, str, args) do { \
> > +    (id) = (*env)->get(env, (clazz), (str), (args)); \
> > +    if (!(id)) { \
> > +        LOGE(#get"(%s) failed", (str)); \
> > +        return -1; \
> > +    } \
> > +} while (0)
> 
> And that?
> 
> With my kindest regards,
> 
> -- 
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android


More information about the Android mailing list