From 36adc76235fb0a38e7042bc751f988b71627e2a0 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 11 Dec 2012 06:13:02 +0000 Subject: Changes to get successful C++11 based build. Code cleanup, dependency upgrades, and const + inline optimizations in components, samples, and app hosting server. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1420007 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/components/log/scribe-cat.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sca-cpp/trunk/components/log/scribe-cat.cpp') diff --git a/sca-cpp/trunk/components/log/scribe-cat.cpp b/sca-cpp/trunk/components/log/scribe-cat.cpp index 254e2167ae..d9a2e44613 100644 --- a/sca-cpp/trunk/components/log/scribe-cat.cpp +++ b/sca-cpp/trunk/components/log/scribe-cat.cpp @@ -36,14 +36,14 @@ namespace tuscany { namespace scribecat { -int cat(const string& host, const string& category, const string& type) { +const int cat(const string& host, const string& category, const string& type) { // Connect to Scribe scribe::Scribe& sc = *(new (gc_new()) scribe::Scribe(host, 1464)); // Read lines from stdin and log them char buf[8193]; for (;;) { - gc_scoped_pool p; + const gc_scoped_pool p; // Write line prefix ostringstream os; @@ -54,7 +54,7 @@ int cat(const string& host, const string& category, const string& type) { strcpy(buf, c_str(prefix)); // Read log line - const char* s = fgets(buf + pl, 8192 - pl, stdin); + const char* const s = fgets(buf + pl, 8192 - pl, stdin); if (s == NULL) return 0; @@ -73,7 +73,7 @@ int cat(const string& host, const string& category, const string& type) { } } -int main(const int argc, const char** argv) { +int main(const int argc, const char** const argv) { return tuscany::scribecat::cat(argc < 2? "localhost" : argv[1], argc < 3? "default" : argv[2], argc < 4? "" : argv[3]); } -- cgit v1.2.3