diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 06:13:02 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 06:13:02 +0000 |
commit | 36adc76235fb0a38e7042bc751f988b71627e2a0 (patch) | |
tree | fc83b3f4e0afeb3932c8d200f5493f0a8d6c4619 /sca-cpp/trunk/components/log/scribe-cat.cpp | |
parent | 86b1de85536e93c59a25702a5a2d3e384202ffd2 (diff) |
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
Diffstat (limited to 'sca-cpp/trunk/components/log/scribe-cat.cpp')
-rw-r--r-- | sca-cpp/trunk/components/log/scribe-cat.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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>()) 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]); } |