Replace explicit type declarations with automatic inference

This commit is contained in:
Marko Zivanovic
2015-09-04 10:26:50 +02:00
parent 2a0d9cfafe
commit 923765c0f3
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ SOFTWARE.
const std::string Facility::readFromStream(std::istream& src) {
std::string ret;
while (src) {
std::istream::char_type c = src.get();
auto c = src.get();
if (c == '.') {
break;
} else {
+1 -1
View File
@@ -29,7 +29,7 @@ SOFTWARE.
const std::string Severity::readFromStream(std::istream& src) {
std::string ret;
while (src) {
std::istream::char_type c = src.get();
auto c = src.get();
if (c == ' ' || c == '\t') {
break;
} else {
+4 -4
View File
@@ -26,7 +26,7 @@ SOFTWARE.
void skipWhitespace(std::istream& src) {
while (src) {
std::istream::char_type c = src.peek();
auto c = src.peek();
if (c == ' ' || c == '\t') {
src.get();
continue;
@@ -40,7 +40,7 @@ const boost::posix_time::ptime SyslogMessage::readTimestamp(std::istream& src) {
int ws = 0;
std::string ts;
while (src) {
std::istream::char_type c = src.get();
auto c = src.get();
if (c == ' ' || c == '\t') {
ws++;
}
@@ -66,7 +66,7 @@ const std::string SyslogMessage::readSource(std::istream& src) {
std::string ret;
skipWhitespace(src);
while (src) {
std::istream::char_type c = src.get();
auto c = src.get();
if (c == ' ' || c == '\t') {
break;
} else {
@@ -80,7 +80,7 @@ const std::string SyslogMessage::readMessage(std::istream & src) {
std::string ret;
skipWhitespace(src);
while (src) {
std::istream::char_type c = src.get();
auto c = src.get();
if (!src.eof()) {
ret.push_back(c);
}
+1 -1
View File
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(test_run) {
SyslogBulkUploader ul(r, w);
ul.run();
BOOST_CHECK_EQUAL(w._messages.size(), 3);
for (size_t i = 0; i < w._messages.size(); i++) {
for (auto i = 0; i < w._messages.size(); i++) {
std::cout << *(w._messages[i].get()) << std::endl;
}
}