You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/12/11 20:00:29 UTC
svn commit: r725780 -
/activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp
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;
}
-
-
-
-