r3464 - in trunk/libzrtpcpp/src: . libzrtpcpp

erik at minisip.org erik at minisip.org
Thu Nov 15 16:37:05 CET 2007


Author: erik
Date: 2007-11-15 16:37:04 +0100 (Thu, 15 Nov 2007)
New Revision: 3464

Modified:
   trunk/libzrtpcpp/src/ZrtpStateClass.cxx
   trunk/libzrtpcpp/src/ZrtpTextData.cxx
   trunk/libzrtpcpp/src/libzrtpcpp/ZRtp.h
   trunk/libzrtpcpp/src/libzrtpcpp/ZrtpCallback.h
Log:
libzrtpcpp:
 * Compilation warning fixes. 

   The API has been changed so that a few functions take "const char*" as
   parameters instead of "char*".

   The following code generates a warning since it's a implicit conversion
   from "const char * (the "X"), and "char *" (the "x"): 
      char x="X";
   All such lines have been changed to
      const char *x="X";

   Note that since the API has changed, any code using libzrtpcpp must be
   updated to implement "const char *msg" methods instead of the old 
   "char *msg" ones.



Modified: trunk/libzrtpcpp/src/ZrtpStateClass.cxx
===================================================================
--- trunk/libzrtpcpp/src/ZrtpStateClass.cxx	2007-11-15 15:12:54 UTC (rev 3463)
+++ trunk/libzrtpcpp/src/ZrtpStateClass.cxx	2007-11-15 15:37:04 UTC (rev 3464)
@@ -42,13 +42,13 @@
     {SecureState,  &ZrtpStateClass::evSecureState }
 };
 
-static char* sendErrorText = "Cannot send data via RTP - connection or peer down?";
-static char* sendErrorTextSrtp = "Cannot send data via SRTP - connection or peer down?";
-static char* timerError = "Cannot start a timer - internal resources exhausted?";
-static char* resendError = "Too much retries during ZRTP negotiation - connection or peer down?";
-static char* internalProtocolError = "Internal protocol error occured!";
-static char* zrtpClosed = "No more security for this session";
-static char* goClearReceived = "Received a GoClear message - no security processing!";
+static const char* sendErrorText = "Cannot send data via RTP - connection or peer down?";
+static const char* sendErrorTextSrtp = "Cannot send data via SRTP - connection or peer down?";
+static const char* timerError = "Cannot start a timer - internal resources exhausted?";
+static const char* resendError = "Too much retries during ZRTP negotiation - connection or peer down?";
+static const char* internalProtocolError = "Internal protocol error occured!";
+static const char* zrtpClosed = "No more security for this session";
+static const char* goClearReceived = "Received a GoClear message - no security processing!";
 
 ZrtpStateClass::ZrtpStateClass(ZRtp *p) {
     parent = p;

Modified: trunk/libzrtpcpp/src/ZrtpTextData.cxx
===================================================================
--- trunk/libzrtpcpp/src/ZrtpTextData.cxx	2007-11-15 15:12:54 UTC (rev 3463)
+++ trunk/libzrtpcpp/src/ZrtpTextData.cxx	2007-11-15 15:37:04 UTC (rev 3464)
@@ -23,70 +23,71 @@
 /**
  *
  */
-char *clientId = "minisip        "; // must be 15 chars
-char *zrtpVersion = "0.02";	// must be 4 chars
+const char *clientId = "minisip        "; // must be 15 chars
+const char *zrtpVersion = "0.02";	// must be 4 chars
 
 /**
  *
  */
-char *HelloMsg =    "Hello   ";
-char *HelloAckMsg = "HelloACK";
-char *CommitMsg =   "Commit  ";
-char *DHPart1Msg =  "DHPart1 ";
-char *DHPart2Msg =  "DHPart2 ";
-char *Confirm1Msg = "Confirm1";
-char *Confirm2Msg = "Confirm2";
-char *Conf2AckMsg = "Conf2ACK";
-char *ErrorMsg =    "Error   ";
-char *GoClearMsg =  "GoClear ";
-char *ClearAckMsg = "ClearACK";
+const char *HelloMsg =    "Hello   ";
+const char *HelloAckMsg = "HelloACK";
+const char *CommitMsg =   "Commit  ";
+const char *DHPart1Msg =  "DHPart1 ";
+const char *DHPart2Msg =  "DHPart2 ";
+const char *Confirm1Msg = "Confirm1";
+const char *Confirm2Msg = "Confirm2";
+const char *Conf2AckMsg = "Conf2ACK";
+const char *ErrorMsg =    "Error   ";
+const char *GoClearMsg =  "GoClear ";
+const char *ClearAckMsg = "ClearACK";
 
 /**
  *
  */
-char *responder = "Responder";
-char *initiator = "Initiator";
-char *iniMasterKey = "Initiator SRTP master key";
-char *iniMasterSalt = "Initiator SRTP master salt";
-char *respMasterKey = "Responder SRTP master key";
-char *respMasterSalt = "Responder SRTP master salt";
+const char *responder = "Responder";
+const char *initiator = "Initiator";
+const char *iniMasterKey = "Initiator SRTP master key";
+const char *iniMasterSalt = "Initiator SRTP master salt";
+const char *respMasterKey = "Responder SRTP master key";
+const char *respMasterSalt = "Responder SRTP master salt";
 
-char *hmacKey = "HMAC key";
-char *retainedSec = "retained secret";
-char *knownPlain = "known plaintext";
+const char *hmacKey = "HMAC key";
+const char *retainedSec = "retained secret";
+const char *knownPlain = "known plaintext";
 
-char *sasString = "Short Authentication String";
+const char *sasString = "Short Authentication String";
 
 /**
  * The arrays are sorted: the most secure / best algorithm is first in the
  * array
  */
-char *supportedHashes[] = { "SHA256  ",
-			    "        ",
-			    "        ",
-			    "        ",
-			    "        " };
+const char *supportedHashes[] = { "SHA256  ",
+				  "        ",
+				  "        ",
+				  "        ",
+				  "        " };
 
-char *supportedCipher[] = { "AES256  ",
-			    "AES128  ",
-			    "        ",
-			    "        ",
-			    "        " };
+const char *supportedCipher[] = { "AES256  ",
+				  "AES128  ",
+				  "        ",
+				  "        ",
+				  "        " };
 
-char *supportedPubKey[] = { "DH4096  ",
-			    "DH3072  ",
-			    "        ",
-			    "        ",
-			    "        " };
+const char *supportedPubKey[] = { "DH4096  ",
+				  "DH3072  ",
+				  "        ",
+				  "        ",
+				  "        " };
 
-char *supportedSASType[] = { "libase32",
-			    "        ",
-			    "        ",
-			    "        ",
-			    "        " };
+const char *supportedSASType[] = { "libase32",
+				   "        ",
+				   "        ",
+				   "        ",
+				   "        " };
 
-char *supportedAuthLen[] = { "80      ",
-                             "32      ",
-                             "        ",
-                             "        ",
-                             "        " };
+const char *supportedAuthLen[] = { "80      ",
+	                           "32      ",
+        	                   "        ",
+                	           "        ",
+                        	   "        " };
+

Modified: trunk/libzrtpcpp/src/libzrtpcpp/ZRtp.h
===================================================================
--- trunk/libzrtpcpp/src/libzrtpcpp/ZRtp.h	2007-11-15 15:12:54 UTC (rev 3463)
+++ trunk/libzrtpcpp/src/libzrtpcpp/ZRtp.h	2007-11-15 15:37:04 UTC (rev 3464)
@@ -619,7 +619,7 @@
      * @param msg
      *     The message string, terminated with a null byte.
      */
-    void sendInfo(MessageSeverity severity, char* msg) {
+    void sendInfo(MessageSeverity severity, const char* msg) {
 	callback->sendInfo(severity, msg);
     }
 
@@ -634,7 +634,7 @@
      * @param msg
      *     The message string, terminated with a null byte.
      */
-    void zrtpNegotiationFailed(MessageSeverity severity, char* msg) {
+    void zrtpNegotiationFailed(MessageSeverity severity, const char* msg) {
         callback->zrtpNegotiationFailed(severity, msg);
     }
 

Modified: trunk/libzrtpcpp/src/libzrtpcpp/ZrtpCallback.h
===================================================================
--- trunk/libzrtpcpp/src/libzrtpcpp/ZrtpCallback.h	2007-11-15 15:12:54 UTC (rev 3463)
+++ trunk/libzrtpcpp/src/libzrtpcpp/ZrtpCallback.h	2007-11-15 15:37:04 UTC (rev 3464)
@@ -192,7 +192,7 @@
      *     The message string, terminated with a null byte.
      * @see #MessageSeverity
      */
-    virtual void sendInfo(MessageSeverity severity, char* msg) =0;
+    virtual void sendInfo(MessageSeverity severity, const char* msg) =0;
 
     /**
      * This method gets call by ZRTP as soon as the SRTP secrets are available.
@@ -258,7 +258,7 @@
      * @param msg
      *     The message string, terminated with a null byte.
      */
-    virtual void zrtpNegotiationFailed(MessageSeverity severity, char* msg) =0;
+    virtual void zrtpNegotiationFailed(MessageSeverity severity, const char* msg) =0;
 
     /**
      * ZRTP calls this methof if the other side does not support ZRTP.



More information about the Minisip-devel mailing list