Apply clang-format.
This commit is contained in:
@@ -602,8 +602,7 @@ static inline float parseFloat(const char **token) {
|
||||
float f = static_cast<float>(atof(*token));
|
||||
(*token) += strcspn((*token), " \t\r");
|
||||
#else
|
||||
const char *end =
|
||||
(*token) + until_space((*token));
|
||||
const char *end = (*token) + until_space((*token));
|
||||
double val = 0.0;
|
||||
tryParseDouble((*token), end, &val);
|
||||
float f = static_cast<float>(val);
|
||||
@@ -924,30 +923,28 @@ struct CommandCount {
|
||||
}
|
||||
};
|
||||
|
||||
class
|
||||
LoadOption
|
||||
{
|
||||
class LoadOption {
|
||||
public:
|
||||
LoadOption() : req_num_threads(-1), triangulate(true), verbose(false) {}
|
||||
|
||||
int req_num_threads;
|
||||
bool triangulate;
|
||||
bool verbose;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/// Parse wavefront .obj(.obj string data is expanded to linear char array
|
||||
/// `buf')
|
||||
/// -1 to req_num_threads use the number of HW threads in the running system.
|
||||
bool parseObj(attrib_t *attrib, std::vector<shape_t> *shapes, const char *buf,
|
||||
size_t len, const LoadOption& option);
|
||||
size_t len, const LoadOption &option);
|
||||
|
||||
#ifdef TINYOBJ_LOADER_OPT_IMPLEMENTATION
|
||||
|
||||
static bool parseLine(Command *command, const char *p, size_t p_len,
|
||||
bool triangulate = true) {
|
||||
// @todo { operate directly on pointer `p'. to do that, add range check for string operatoion against `p', since `p' is not null-terminated at p[p_len] }
|
||||
// @todo { operate directly on pointer `p'. to do that, add range check for
|
||||
// string operatoion against `p', since `p' is not null-terminated at p[p_len]
|
||||
// }
|
||||
char linebuf[4096];
|
||||
assert(p_len < 4095);
|
||||
memcpy(linebuf, p, p_len);
|
||||
@@ -1141,8 +1138,7 @@ static inline bool is_line_ending(const char *p, size_t i, size_t end_i) {
|
||||
}
|
||||
|
||||
bool parseObj(attrib_t *attrib, std::vector<shape_t> *shapes, const char *buf,
|
||||
size_t len, const LoadOption& option)
|
||||
{
|
||||
size_t len, const LoadOption &option) {
|
||||
attrib->vertices.clear();
|
||||
attrib->normals.clear();
|
||||
attrib->texcoords.clear();
|
||||
@@ -1153,7 +1149,8 @@ bool parseObj(attrib_t *attrib, std::vector<shape_t> *shapes, const char *buf,
|
||||
|
||||
if (len < 1) return false;
|
||||
|
||||
auto num_threads = (option.req_num_threads < 0) ? std::thread::hardware_concurrency()
|
||||
auto num_threads = (option.req_num_threads < 0)
|
||||
? std::thread::hardware_concurrency()
|
||||
: option.req_num_threads;
|
||||
num_threads =
|
||||
std::max(1, std::min(static_cast<int>(num_threads), kMaxThreads));
|
||||
|
||||
@@ -86,7 +86,7 @@ static void vsub(const float *src1, const float *src2, float *dst) {
|
||||
}
|
||||
|
||||
static void vcopy(const float *v1, float *v2) {
|
||||
register int i;
|
||||
int i;
|
||||
for (i = 0; i < 3; i++)
|
||||
v2[i] = v1[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user