const-correct argv in CORBA_ORB_init()



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/
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)
 {


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