Commit f2262228 authored by Icecream95's avatar Icecream95 Committed by Marge Bot
Browse files

clc: Use stringstream for printing spirv errors



The type of the spv_position_t components can differ across platforms,
it's simpler to just let C++ overloading handle it.

Reviewed-by: Karol Herbst's avatarKarol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand's avatarJason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <!15437>
parent fb69d992
Pipeline #559087 passed with stage
in 8 minutes and 7 seconds
......@@ -1012,22 +1012,20 @@ public:
void operator()(spv_message_level_t level, const char *src,
const spv_position_t &pos, const char *msg)
{
switch(level) {
case SPV_MSG_FATAL:
case SPV_MSG_INTERNAL_ERROR:
case SPV_MSG_ERROR:
clc_error(logger, "(file=%s,line=%ld,column=%ld,index=%ld): %s\n",
src, pos.line, pos.column, pos.index, msg);
break;
case SPV_MSG_WARNING:
clc_warning(logger, "(file=%s,line=%ld,column=%ld,index=%ld): %s\n",
src, pos.line, pos.column, pos.index, msg);
break;
if (level == SPV_MSG_INFO || level == SPV_MSG_DEBUG)
return;
default:
break;
}
std::ostringstream message;
message << "(file=" << src
<< ",line=" << pos.line
<< ",column=" << pos.column
<< ",index=" << pos.index
<< "): " << msg << "\n";
if (level == SPV_MSG_WARNING)
clc_warning(logger, "%s", message.str().c_str());
else
clc_error(logger, "%s", message.str().c_str());
}
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment