[Gambas-devel] need a bit of explanation - please

Kari Laine klaine8 at ...176...
Fri Aug 15 13:09:07 CEST 2008


On Fri, Aug 15, 2008 at 1:38 PM, Benoit Minisini <
gambas at ...1...> wrote:

> On vendredi 15 août 2008, Kari Laine wrote:
> > Hi,
> >
> > I try to figure out Gambas and because I am not C-guru I have used two
> > hours now to understand possibly a basic thing...
> > Could someone help?
> >
> > In function
> >
> > CLASS *CLASS_register_class(GB_DESC *ptr, CLASS *class)
> >
> > There is a loop
> >
> >   desc = (CLASS_DESC *)&gambas[1];
> >
> >   for (start = NULL; start == NULL; desc++)
> >
> > The problem I have is to understand this bit
> >     switch ((intptr_t)desc->gambas.name)
> > Where gambas.name is initialized to have the values tested in the case
> > clauses? Somehow name's pointer is usefull to give out information.
> >
> > Also in the same switch there is following
> >       case (intptr_t)GB_INHERITS_ID:
> >         CLASS_inheritance(class, CLASS_find((const char
> > *)desc->gambas.type));
> >         break;
> > Why is CLASS_find called with a generall name like Control ?
> >
> > Hopefully someone understands my question.
> >
> > Best Regards
> > Kari Laine
> >
>
> Sorry, I don't understand what you are asking for... Can you formulate your
> question differently?
>

I am not sure if I can ask this in a right way.

Could you explain this line.
switch ((intptr_t)desc->gambas.name)

How gambas.name pointer can be cast to intptr_t?

And how it takes one of following values
GB_INHERITS_ID
GB_AUTO_CREATABLE_ID:
GB_NOT_CREATABLE_ID:
GB_VIRTUAL_CLASS_ID:
GB_HOOK_CHECK_ID

Best Regards
Kari Laine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20080815/32de1a9f/attachment.html>


More information about the Devel mailing list