Re: [PATCH] make CORBA_sequence_*_allocbuf return a correct type



On Thu, 2 May 2002, ERDI Gergo wrote:

> Hi,
> 
> The attached patch makes sure allocbuf()'s return value is correctly cast,
> this is needed to shut up C++ compilers.

there's also a second part to this:

Index: orbit-idl-c-headers.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/orbit-idl-c-headers.c,v
retrieving revision 1.56.2.2.2.1
diff -u -u -r1.56.2.2.2.1 orbit-idl-c-headers.c
--- orbit-idl-c-headers.c	13 Apr 2002 13:37:54 -0000
1.56.2.2.2.1
+++ orbit-idl-c-headers.c	3 May 2002 21:46:49 -0000
@@ -606,13 +606,16 @@
 
       if (rinfo->small)
         {
-	  char *tc;
+	  char *tc, *member_type;
 	  
 	  tc = orbit_cbe_get_typecode_name (
 		  orbit_cbe_get_typespec (tree));
+	  member_type = orbit_cbe_type_is_builtin (IDL_TYPE_SEQUENCE(tree).simple_type_spec) ?
+	      ctmp + strlen ("CORBA_") : ctmp;
 
-	  fprintf (ci->fh, "#define CORBA_sequence_%s_allocbuf(l) ORBit_small_allocbuf (%s, (l))\n",
- orbit_cbe_type_is_builtin(IDL_TYPE_SEQUENCE(tree).simple_type_spec)?(ctmp+strlen("CORBA_")):ctmp, tc);
+	  fprintf (ci->fh, "#define CORBA_sequence_%s_allocbuf(l) "
+		   "((%s*)ORBit_small_allocbuf (%s, (l)))\n",
+		   member_type, member_type, tc);
 
 	  g_free (tc);
        }


-- 
   .--= ULLA! =---------------------.   `We are not here to give users what
   \     http://cactus.rulez.org     \   they want'  -- RMS, at GUADEC 2001
    `---= cactus@cactus.rulez.org =---'
F U CN RD THS U CNT SPL WRTH A DM!




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