From: Lei Zhang Date: Wed, 14 Sep 2016 16:09:52 +0000 (-0400) Subject: Change parameter name from file to source in Log() and Logf(). X-Git-Tag: upstream/2018.6~1033 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74afb5d112889782be732c807edbc7a808d7a835;p=platform%2Fupstream%2FSPIRV-Tools.git Change parameter name from file to source in Log() and Logf(). --- diff --git a/source/opt/log.h b/source/opt/log.h index def4719..ec919ef 100644 --- a/source/opt/log.h +++ b/source/opt/log.h @@ -78,20 +78,20 @@ namespace spvtools { // Calls the given |consumer| by supplying the |message|. The |message| is from -// the given |file| and |location| and of the given severity |level|. +// the given |source| and |location| and of the given severity |level|. inline void Log(const MessageConsumer& consumer, spv_message_level_t level, - const char* file, const spv_position_t& position, + const char* source, const spv_position_t& position, const char* message) { - if (consumer != nullptr) consumer(level, file, position, message); + if (consumer != nullptr) consumer(level, source, position, message); } // Calls the given |consumer| by supplying the message composed according to the -// given |format|. The |message| is from the given |file| and |location| and of -// the given severity |level|. +// given |format|. The |message| is from the given |source| and |location| and +// of the given severity |level|. template void Logf(const MessageConsumer& consumer, spv_message_level_t level, - const char* file, const spv_position_t& position, const char* format, - Args&&... args) { + const char* source, const spv_position_t& position, + const char* format, Args&&... args) { #if defined(_MSC_VER) && _MSC_VER < 1900 // Sadly, snprintf() is not supported until Visual Studio 2015! #define snprintf _snprintf @@ -104,7 +104,7 @@ void Logf(const MessageConsumer& consumer, spv_message_level_t level, snprintf(message, kInitBufferSize, format, std::forward(args)...); if (size >= 0 && size < kInitBufferSize) { - Log(consumer, level, file, position, message); + Log(consumer, level, source, position, message); return; } @@ -112,11 +112,11 @@ void Logf(const MessageConsumer& consumer, spv_message_level_t level, std::vector longer_message(size + 1); snprintf(longer_message.data(), longer_message.size(), format, std::forward(args)...); - Log(consumer, level, file, position, longer_message.data()); + Log(consumer, level, source, position, longer_message.data()); return; } - Log(consumer, level, file, position, "cannot compose log message"); + Log(consumer, level, source, position, "cannot compose log message"); #if defined(_MSC_VER) && _MSC_VER < 1900 #undef snprintf