CORBA_sequence_CORBA_long__allocbuf



Hi,
first of all: thanks a lot! Your answer is great!
But I have another problem: all properties and methods you told me work
except for CORBA_sequence_CORBA_long__allocbuf.
In particular when I compile the skeleton-impl file where there are
implementations of the idl methods, I receive the following:

listaDisp-skelimpl.c: In function `impl_dispList__create':
listaDisp-skelimpl.c:75: warning: assignment makes pointer from integer
without a cast
listaDisp-skelimpl.c: In function `impl_dispList_addDisp':
listaDisp-skelimpl.c:123: warning: assignment makes pointer from integer
without a cast

where lines 75 and 123 are:

75.    newservant->attr_dispID._buffer =
CORBA_sequence_CORBA_long__allocbuf(1);

and

123.   servant->attr_dispID._buffer =
dispList_list__allocbuf(servant->attr_dispID._length+1);

(obviously in the 123 dispList_list is the other name given by the typedef
to CORBA_sequence_CORBA_long and attr_dispID is a CORBA_sequence_CORBA_long)

and when I finally compile the .o files together I receive the error output:

listaDisp.o: In function `impl_dispList__create':
listaDisp.o(.text+0xb1): undefined reference to
`CORBA_sequence_CORBA_long__allocbuf'
listaDisp.o: In function `impl_dispList_addDisp':
listaDisp.o(.text+0x1c2): undefined reference to `dispList_list__allocbuff'
listaDisp-skelimpl.o: In function `impl_dispList__create':
listaDisp-skelimpl.o(.text+0xb1): undefined reference to
`CORBA_sequence_CORBA_long__allocbuf'
listaDisp-skelimpl.o: In function `impl_dispList_addDisp':
listaDisp-skelimpl.o(.text+0x1c2): undefined reference to
`dispList_list__allocbuf'
collect2: ld returned 1 exit status

that seems not to recognize the ...__allocbuf as a function, but it has
correcly been declared by the orbit-idl in the -common.c file.
Why? What happens??

Thanks a lot agian for your previous answer and for your patience...
Samuele



-----Messaggio originale-----
Da: orbit-list-admin@gnome.org [mailto:orbit-list-admin@gnome.org]Per
conto di Michael Meeks
Inviato: sabato 7 luglio 2001 18.29
A: orbit-list@gnome.org
Oggetto: Re: CORBA_sequence_CORBA_long



Hi Samuele,

On Fri, 6 Jul 2001, samuele Gallazzi wrote:
> in an IDL file I declared a sequence as:
> "typedef sequence <long> list;
>  readonly attribute list ID;
>
> This is mapped in C with CORBA_sequenceCORBA_long type. I don't
> understand how this type is structured: can I access to it like I make
> with an array?

        Yes, there are two elements:

        _buffer, and _length that you need to maintain, eg.

{
        CORBA_sequence_CORBA_long *b = CORBA_sequnce_CORBA_long__alloc ();

        b->_buffer = CORBA_sequence_CORBA_long__allocbuf (20);
        b->_length = 20;

        for (i = 0; i < 20; i++)
                b->_buffer [i] = my_long * i;

        return b;
}

> In particular, in the skeleton-impl file where is the error if I try
> to use "servant->attr_ID[i]" to access to the data in the sequence? Or
> this sequence is mapped like a linked list? And if so which is its
> internal structure? Thank you again. Samue

        A plain array, no magic.

        HTH,

                Michael.

--
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot


_______________________________________________
orbit-list mailing list
orbit-list@gnome.org
http://mail.gnome.org/mailman/listinfo/orbit-list





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