gcc warnings fix

This commit is contained in:
gabime 2014-10-18 16:05:41 +03:00
parent 5f4d4d0909
commit e6345e008b
5 changed files with 18 additions and 18 deletions

View File

@ -37,9 +37,9 @@ int main(int argc, char* argv[])
auto delta = system_clock::now() - start;
auto delta_d = duration_cast<duration<double>> (delta).count();
cout << "Total:" << format(howmany) << endl;
cout << "Delta:" << format(delta_d) << endl;
cout << "Rate:" << format(howmany / delta_d) << "/sec" << endl;
cout_logger.info("Total:") << format(howmany);
cout_logger.info("Delta:") << format(delta_d);
cout_logger.info("Rate:") << format(howmany / delta_d) << "/sec";
return 0;
}

View File

@ -9,7 +9,7 @@
#include "c11log/sinks/file_sinks.h"
using namespace std;
int main2(int, char* [])
int main(int, char* [])
{
auto console = c11log::factory::stdout_logger();

View File

@ -89,9 +89,9 @@ public:
std::string str()
{
auto buf = _dev.buf();
const char*data = buf.data();
return std::string(data, data+buf.size());
auto buffer = _dev.buf();
const char*data = buffer.data();
return std::string(data, data+buffer.size());
}
const stack_devicebuf::stackbuf_t& buf() const
@ -133,11 +133,11 @@ public:
void write_fast_oss(const fast_oss& oss)
{
auto buf = oss.buf();
_dev.sputn(buf.data(), buf.size());
auto buffer = oss.buf();
_dev.sputn(buffer.data(), buffer.size());
}
private:
stack_devicebuf _dev;
};

View File

@ -3,6 +3,7 @@
#include <algorithm>
#include <array>
#include <vector>
#include <cstring>
// Fast memory storage on the stack when possible or in std::vector

View File

@ -29,7 +29,7 @@ class logger
{
public:
using sink_ptr = std::shared_ptr<sinks::sink>;
using formatter_ptr = std::shared_ptr<formatter>;
using formatter_ptr = std::shared_ptr<c11log::formatter>;
logger(const std::string& name, std::initializer_list<sink_ptr>, formatter_ptr formatter = nullptr);
template<class It>
@ -93,12 +93,12 @@ private:
#include "details/line_logger.h"
inline c11log::logger::logger(const std::string& logger_name, std::initializer_list<sink_ptr> sinks_list, formatter_ptr formatter) :
inline c11log::logger::logger(const std::string& logger_name, std::initializer_list<sink_ptr> sinks_list, formatter_ptr msg_formatter) :
_name(logger_name),
_formatter(formatter),
_formatter(msg_formatter),
_sinks(sinks_list)
{
if (!formatter) //default formatter
if (!msg_formatter) //default formatter
_formatter = std::make_shared<details::pattern_formatter>(_default_pattern);
// no support under vs2013 for member initialization for std::atomic
@ -169,10 +169,9 @@ inline bool c11log::logger::should_log(c11log::level::level_enum msg_level) cons
return msg_level >= _level.load();
}
inline void c11log::logger::formatter(formatter_ptr formatter)
inline void c11log::logger::formatter(formatter_ptr msg_formatter)
{
_formatter = formatter;
_formatter = msg_formatter;
}
inline c11log::logger::formatter_ptr c11log::logger::formatter() const