ORBit2 IDL compiler output de-warningization



I just checked in this patch (discussed with Michael
previously). ORBit2, bonobo-activation and libbonobo all build happily
for me with this patch.

Yell at me if it breaks anything.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/ORBit2/ChangeLog,v
retrieving revision 1.139
diff -u -r1.139 ChangeLog
--- ChangeLog	2001/08/21 08:45:40	1.139
+++ ChangeLog	2001/08/23 05:52:00
@@ -1,3 +1,10 @@
+2001-08-22  Maciej Stachowiak  <mjs@noisehavoc.org>
+
+	* src/idl-compiler/orbit-idl-c-utils.c
+	(orbit_cbe_write_param_typespec_str): If a type Foo is a typedef
+	for CORBA_string, write const CORBA_char * instead of const
+	Foo. This is needed to avoid warnings in the generated skeletons.
+
 2001-08-20  Mark McLoughlin <mark@skynet.ie>
 
 	* src/orb/orb-core/poa.c
Index: src/idl-compiler/orbit-idl-c-utils.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/orbit-idl-c-utils.c,v
retrieving revision 1.28
diff -u -r1.28 orbit-idl-c-utils.c
--- src/idl-compiler/orbit-idl-c-utils.c	2001/07/12 17:38:37	1.28
+++ src/idl-compiler/orbit-idl-c-utils.c	2001/08/23 05:52:00
@@ -245,15 +245,25 @@
 	gboolean isSlice;
 	char    *name;
 	GString *str = g_string_sized_new (23);
+	IDL_tree typedef_spec;
+	char *typedef_name;
 
 	n = oidl_param_info (ts, role, &isSlice);
 	name = orbit_cbe_get_typespec_str (ts);
 
-	if ( role == DATA_IN )
-		g_string_sprintf (
-			str, "const %s", 
-			!strcmp (name, "CORBA_string") ? "CORBA_char*" : name);
-	else
+	if ( role == DATA_IN ) {
+	        /* We want to check if this is a typedef for CORBA_string so we can do special handling 
+		 * in that case. 
+		 */
+	        typedef_spec = orbit_cbe_get_typespec (ts);
+		typedef_name = orbit_cbe_get_typespec_str (typedef_spec);
+
+		g_string_printf (str, "const %s", 
+				 !strcmp (typedef_name, "CORBA_string") ?
+				 "CORBA_char *" : name);
+
+		g_free (typedef_name);
+	} else
 		g_string_sprintf (str, "%s", name);
 
 	g_free (name);




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