From ec03b29b4929b6023d1c290dfe0a4471ea048564 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 29 Jan 2010 07:56:12 +0000 Subject: Fix return of reference to a temporary. Bump version to 0.6.1 (library interface version 4,0,0). git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2394 a436a847-0d15-0410-975c-d299462d15a1 --- raul/log.hpp | 4 ++-- src/log.cpp | 8 ++++---- wscript | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/raul/log.hpp b/raul/log.hpp index 17d728f..a2298f1 100644 --- a/raul/log.hpp +++ b/raul/log.hpp @@ -44,10 +44,10 @@ public: {} /** Change the colour of the output, e.g. out << colour(RED) << "red" << endl; */ - const char* colour(Colour c); + std::string colour(Colour c); /** Reset the colour of the output, e.g. out << plain() << "plain" << endl; */ - const char* plain(); + std::string plain(); protected: int_type overflow(int_type c) { diff --git a/src/log.cpp b/src/log.cpp index e9a61b2..fe6b9b5 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -50,16 +50,16 @@ std::ostream error(&error_buffer); std::ostream debug(&debug_buffer); -const char* +std::string Raul::LogBuffer::colour(Colour c) { std::stringstream ss; ss << "\033[0;" << _colour << "m"; - return ss.str().c_str(); + return ss.str(); } -const char* +std::string Raul::LogBuffer::plain() { return "\033[0m"; @@ -70,7 +70,7 @@ void Raul::LogBuffer::emit() { if (_colour != DEFAULT) - _out << colour(_colour); + _out << std::string(colour(_colour)); _out << _prefix << _line; diff --git a/wscript b/wscript index 18a3a68..16d50a6 100644 --- a/wscript +++ b/wscript @@ -4,7 +4,7 @@ import Options import os # Version of this package (even if built as a child) -RAUL_VERSION = '0.6.0' +RAUL_VERSION = '0.6.1' # Library version (UNIX style major, minor, micro) # major increment <=> incompatible changes @@ -15,7 +15,8 @@ RAUL_VERSION = '0.6.0' # 0.5.0 = 1,0,0 (SVN r1283) # 0.5.1 = 2,0,0 # 0.6.0 = 3,0,0 -RAUL_LIB_VERSION = '3.0.0' +# 0.6.1 = 4,0,0 (unreleased) +RAUL_LIB_VERSION = '4.0.0' # Variables for 'waf dist' APPNAME = 'raul' -- cgit v1.2.1