const-correct argv in CORBA_ORB_init()

Michael Haubenwallner <[email protected]> Mon, 23 Feb 2009 17:19:53 +0100
Newsgroups gmane.comp.gnome.orbit.general
Message-ID <[email protected]>
--=-Wn/bJ4sK5oHJjbVbm2wa
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi,

we're using ORBit2 in our application, which now is completely built as
C++. After switching to more recent gcc, we're encouraged to get more
const-correctness into our code.

Compared to how similar things are specified[1], CORBA_ORB_init() should
be declared to get 'char * const * argv' IMHO, like the attached patch.

[1] http://www.opengroup.org/onlinepubs/009695399/functions/exec.html

Thanks!
/haubi/

--=-Wn/bJ4sK5oHJjbVbm2wa
Content-Disposition: attachment; filename=constchar.patch
Content-Type: text/x-patch; name=constchar.patch; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

diff -ru ORBit2-2.14.2.orig/include/orbit/orb-core/corba-orb.h ORBit2-2.14.2/include/orbit/orb-core/corba-orb.h
--- ORBit2-2.14.2.orig/include/orbit/orb-core/corba-orb.h	2006-05-20 13:37:59.000000000 +0200
+++ ORBit2-2.14.2/include/orbit/orb-core/corba-orb.h	2009-02-23 16:31:40.000000000 +0100
@@ -8,7 +8,7 @@
 G_BEGIN_DECLS
 
 CORBA_ORB CORBA_ORB_init (int                *argc,
-			  char              **argv,
+			  char              * const *argv,
 			  CORBA_ORBid         orb_identifier,
 			  CORBA_Environment  *ev);
 
diff -ru ORBit2-2.14.2.orig/src/orb/orb-core/corba-orb.c ORBit2-2.14.2/src/orb/orb-core/corba-orb.c
--- ORBit2-2.14.2.orig/src/orb/orb-core/corba-orb.c	2006-07-24 15:57:13.000000000 +0200
+++ ORBit2-2.14.2/src/orb/orb-core/corba-orb.c	2009-02-23 16:37:31.000000000 +0100
@@ -381,7 +381,7 @@
 }
 
 CORBA_ORB
-CORBA_ORB_init (int *argc, char **argv,
+CORBA_ORB_init (int *argc, char * const *argv,
 		CORBA_ORBid orb_identifier,
 		CORBA_Environment *ev)
 {

--=-Wn/bJ4sK5oHJjbVbm2wa
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
orbit-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/orbit-list
--=-Wn/bJ4sK5oHJjbVbm2wa--