When using typedef it is not required that the typedef be given a name.
But the compiler doesn't have to work as hard if you do.

Also, a function parameter can be hidden by a declaration within the
function itself.

The two attached patches address these problems.

E

-- 
Erik Hovland
mail: [EMAIL PROTECTED]
web: http://hovland.org/
PGP/GPG public key available on request
When using a typedef to create an enum, it is good practice to

From: Erik Hovland <[EMAIL PROTECTED]>

give the typedef a name.
---

 liveMedia/RTSPServer.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/liveMedia/RTSPServer.cpp b/liveMedia/RTSPServer.cpp
index 0739ea4..e552c3a 100644
--- a/liveMedia/RTSPServer.cpp
+++ b/liveMedia/RTSPServer.cpp
@@ -530,7 +530,7 @@ typedef enum StreamingMode {
   RTP_UDP,
   RTP_TCP,
   RAW_UDP
-};
+} StreamingMode;
 
 static void parseTransportHeader(char const* buf,
 				 StreamingMode& streamingMode,
A function parameter can be hidden when a declaration hides it.

From: Erik Hovland <[EMAIL PROTECTED]>


---

 liveMedia/RTSPClient.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/liveMedia/RTSPClient.cpp b/liveMedia/RTSPClient.cpp
index 04837c3..6d4dd21 100644
--- a/liveMedia/RTSPClient.cpp
+++ b/liveMedia/RTSPClient.cpp
@@ -507,9 +507,9 @@ char* RTSPClient::sendOptionsCmd(char const* url,
       // (and no username,password pair was supplied separately):
       if (username == NULL && password == NULL
 	  && parseRTSPURLUsernamePassword(url, username, password)) {
-	Authenticator authenticator;
-	authenticator.setUsernameAndPassword(username, password);
-	result = sendOptionsCmd(url, username, password, &authenticator);
+	Authenticator urlauthenticator;
+	urlauthenticator.setUsernameAndPassword(username, password);
+	result = sendOptionsCmd(url, username, password, &urlauthenticator);
 	delete[] username; delete[] password; // they were dynamically allocated
 	break;
       } else if (username != NULL && password != NULL) {
_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to