Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 99518b6

Browse files
committed
Suppress some clang warnings.
1 parent d8f702c commit 99518b6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tiny_obj_loader.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ typedef struct {
177177
real_t anisotropy; // aniso. [0, 1] default 0
178178
real_t anisotropy_rotation; // anisor. [0, 1] default 0
179179
real_t pad0;
180-
real_t pad1;
181180
std::string roughness_texname; // map_Pr
182181
std::string metallic_texname; // map_Pm
183182
std::string sheen_texname; // map_Ps
@@ -418,6 +417,8 @@ static std::istream &safeGetline(std::istream &is, std::string &t) {
418417
}
419418
}
420419
}
420+
421+
return is;
421422
}
422423

423424
#define IS_SPACE(x) (((x) == ' ') || ((x) == '\t'))
@@ -1030,9 +1031,11 @@ void LoadMtl(std::map<std::string, int> *material_map,
10301031

10311032
// set new mtl name
10321033
token += 7;
1033-
std::stringstream ss;
1034-
ss << token;
1035-
material.name = ss.str();
1034+
{
1035+
std::stringstream sstr;
1036+
sstr << token;
1037+
material.name = sstr.str();
1038+
}
10361039
continue;
10371040
}
10381041

@@ -1688,9 +1691,9 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes,
16881691

16891692
tag.stringValues.resize(static_cast<size_t>(ts.num_strings));
16901693
for (size_t i = 0; i < static_cast<size_t>(ts.num_strings); ++i) {
1691-
std::stringstream ss;
1692-
ss << token;
1693-
tag.stringValues[i] = ss.str();
1694+
std::stringstream sstr;
1695+
sstr << token;
1696+
tag.stringValues[i] = sstr.str();
16941697
token += tag.stringValues[i].size() + 1;
16951698
}
16961699

0 commit comments

Comments
 (0)