Skip to content

Commit

Permalink
Init value to suppress GCC warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Jun 23, 2024
1 parent 1c28d35 commit 264eb9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/usdMtlx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ bool ParseMaterialXValue(const std::string &str, T *value, std::string *err) {
str.size(), /* swap endian */ false);
tinyusdz::ascii::AsciiParser parser(&sr);

T val;
T val{};

if (!ParseValue(parser, val, err)) {
return false;
Expand Down Expand Up @@ -522,14 +522,14 @@ static bool ConvertPlace2d(const pugi::xml_node &node, PrimSpec &ps,
}

if (pugi::xml_attribute pivot_attr = node.attribute("pivot")) {
value::float2 value;
value::float2 value{};
if (!ParseMaterialXValue(pivot_attr.as_string(), &value, err)) {
ps.props()["inputs:pivot"] = Property(Attribute::Uniform(value));
}
}

if (pugi::xml_attribute scale_attr = node.attribute("scale")) {
value::float2 value;
value::float2 value{};
if (!ParseMaterialXValue(scale_attr.as_string(), &value, err)) {
PUSH_ERROR_AND_RETURN(
"Failed to parse `rotate` attribute of `place2d`.\n");
Expand All @@ -538,7 +538,7 @@ static bool ConvertPlace2d(const pugi::xml_node &node, PrimSpec &ps,
}

if (pugi::xml_attribute rotate_attr = node.attribute("rotate")) {
float value;
float value{};
if (!ParseMaterialXValue(rotate_attr.as_string(), &value, err)) {
PUSH_ERROR_AND_RETURN(
"Failed to parse `rotate` attribute of `place2d`.\n");
Expand All @@ -548,7 +548,7 @@ static bool ConvertPlace2d(const pugi::xml_node &node, PrimSpec &ps,

pugi::xml_attribute offset_attr = node.attribute("offset");
if (offset_attr) {
value::float2 value;
value::float2 value{};
if (!ParseMaterialXValue(offset_attr.as_string(), &value, err)) {
PUSH_ERROR_AND_RETURN(
"Failed to parse `offset` attribute of `place2d`.\n");
Expand Down

0 comments on commit 264eb9f

Please sign in to comment.