activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r725780 - /activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp
Date Thu, 11 Dec 2008 19:00:29 GMT
Author: tabish
Date: Thu Dec 11 11:00:29 2008
New Revision: 725780

URL: http://svn.apache.org/viewvc?rev=725780&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-212

Code cleanup

Modified:
    activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp

Modified: activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp?rev=725780&r1=725779&r2=725780&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp (original)
+++ activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp Thu Dec 11 11:00:29 2008
@@ -54,7 +54,7 @@
         }
 
     } catch( CMSException& ex ) {
-        onException( ex );
+        ex.printStackTrace();
     }
 }
 
@@ -115,14 +115,13 @@
             char s[120];
 #ifdef AIX
             if( fgets( s, 120, stdin ) == NULL ) {
-                    break;
-            }
-            else if ( feof(stdin) || (strlen(s) == 0) || (s[0] == L'\n') ) {
+                break;
+            } else if ( feof( stdin ) || ( strlen(s) == 0 ) || ( s[0] == L'\n' ) ) {
                 break;
             }
 #else
 
-            std::cin.getline(s, 120, '\n');
+            std::cin.getline( s, 120, '\n' );
 
             // If there was an error reading input, or
             // the line was empty, exit the program.
@@ -214,7 +213,7 @@
 
         char *arg = argv[i];
 
-        if( apr_strnatcmp(arg,"-b" ) == 0 ) {
+        if( apr_strnatcmp( arg,"-b" ) == 0 ) {
 
             if( i == argc - 1 || strncmp( argv[i+1], "-", 1 ) == 0 ) {
                 std::cout << "error: missing broker name:port" << "\n";
@@ -225,8 +224,8 @@
             continue;
         }
 
-        if( apr_strnatcmp(arg, "-u") == 0 ) {
-            if (i == argc - 1 || strncmp( argv[i+1], "-", 1) == 0 ) {
+        if( apr_strnatcmp( arg, "-u" ) == 0 ) {
+            if( i == argc - 1 || strncmp( argv[i+1], "-", 1 ) == 0 ) {
                 std::cout << "error: missing user name" << "\n";
                 exit(1);
             }
@@ -235,7 +234,7 @@
             continue;
         }
 
-        if( apr_strnatcmp(arg, "-p") == 0 ) {
+        if( apr_strnatcmp( arg, "-p" ) == 0 ) {
             if( i == argc - 1 || strncmp( argv[i+1], "-", 1 ) == 0 ) {
                 std::cout << "error: missing password" << "\n";
                 exit(1);
@@ -245,7 +244,7 @@
             continue;
         }
 
-        if( apr_strnatcmp(arg, "-h") == 0 ) {
+        if( apr_strnatcmp( arg, "-h" ) == 0 ) {
             printUsage();
             exit(1);
         }
@@ -268,7 +267,3 @@
 
     return 0;
 }
-
-
-
-



Mime
View raw message