Re: patch for orbit-idl-2 to emit per interface imethod index



Hi Jules,

Thanks for the info, I will try to get an account.
According to your suggestion, I made the modification and also
add a extra macro ORBIT_IMETHODS_INDEX(x) so caller can, eg,
use ORBIT_IMETHODS_INDEX(Hello_hello2) to get the
index of hello2.

The IDL now will emit:

/* IMethods index */

typedef enum {
    Hello__get_data_IMETHODS_INDEX,
    Hello__set_data_IMETHODS_INDEX,
    Hello_hello1_IMETHODS_INDEX,
    Hello_hello2_IMETHODS_INDEX,
    Hello_hello3_IMETHODS_INDEX
} Hello__imethods_index;

#ifndef __ORBIT_IMETHODS_INDEX
#define __ORBIT_IMETHODS_INDEX
#define ORBIT_IMETHODS_INDEX(m) (m ## _IMETHODS_INDEX)
#endif /* __ORBIT_IMETHODS_INDEX */

For the "make check" in current CVS ... I did not do the test.
I only tested this patch on ORBit2-2.14.0 and it's OK.
Well, I will do it later when I know how to deal with CVS stuff
and get the account.


Regards
KC
kccheng linuxdaq-labs org


On 4/24/06, Jules Colding <colding omesc com> wrote:
> Hi KC,
>
> On Mon, 2006-04-24 at 18:24 +0800, KC wrote:
> > Hi,
> >
> > Don't know how to contribute yet (anyone want to tell me how ?),
>
> You would need a Gnome cvs account:
>
> http://developer.gnome.org/doc/policies/accounts/requesting.html
>
> or someone to check it into cvs for on your behalf. I think Michael
> Meeks would be the one to approve your request for an account.
>
>
> > so I just email the patch to this mailing list:
>
> Is "make check" in current cvs HEAD happy with your patch?
>
>
> > will emit the following extra codes to Hello.h
> >
> > ...
> > /* IMethods index */
> > typedef enum {
> >     Hello__get_data_IMETHODS_INDEX = 0,
> >     Hello__set_data_IMETHODS_INDEX = 1,
> >     Hello_hello1_IMETHODS_INDEX = 2,
> >     Hello_hello2_IMETHODS_INDEX = 3,
> >     Hello_hello3_IMETHODS_INDEX = 4
> > } Hello__imethods_index;
> > ...
>
> I think you should drop the explicit enum values. They are not needed so
> they shouldn't be used unless for a good reason. Such a change would
> also reduce the parameter list of your ch_output_method() and remove one
> variable from ch_output_imethods_index(). Cleaner and faster, IMHO.
>
> Best regards,
>   jules
>
>
>

Attachment: patch.imethods-index
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]