Skip to content
Snippets Groups Projects
Commit a2b38799 authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'boost_and_ospray_warnings'


596f85b4 suppress boost warning fix ospray one

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5247
parents acfdfe4a 596f85b4
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,10 @@ if (NOT cdash_show_third_party_warnings)
# and causes a match due to the work warning in it
"return 0; /\\* supresses a warning \\*/"
# boost graph lib causes a warning on gcc with code that
# boost uses internally. An example for you template fans is
# /source/Infovis/BoostGraphAlgorithms/Testing/Cxx/TestBoostAdapter.cxx:221:47: warning: '*((void*)(& ei)+32).__gnu_cxx::__normal_iterator<boost::detail::stored_edge_property<long unsigned int, boost::property<boost::edge_index_t, unsigned int> >*, std::vector<boost::detail::stored_edge_property<long unsigned int, boost::property<boost::edge_index_t, unsigned int> >, std::allocator<boost::detail::stored_edge_property<long unsigned int, boost::property<boost::edge_index_t, unsigned int> > > > >::_M_current' may be used uninitialized in this function [-Wmaybe-uninitialized]
"[Bb]oost[Gg]raph.*edge_property.*may be used uninitialized"
)
endif ()
......
......@@ -527,13 +527,24 @@ const char * vtkOSPRayMaterialLibrary::WriteBuffer()
}
root["materials"] = materials;
Json::FastWriter fast;
std::string sFast = fast.write(root);
char *buf = new char[sFast.length()+1];
memcpy(buf, sFast.c_str(), sFast.length());
buf[sFast.length()] =0;
return buf;
Json::StreamWriterBuilder builder;
builder["commentStyle"] = "None";
builder["indentation"] = " ";
std::unique_ptr<Json::StreamWriter> writer(
builder.newStreamWriter());
std::ostringstream result;
writer->write(root, &result);
std::string rstring = result.str();
if (rstring.size())
{
char *buf = new char[rstring.size()+1];
memcpy(buf, rstring.c_str(), rstring.size());
buf[rstring.size()] = 0;
return buf;
}
return nullptr;
}
//-----------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment