ddiakopoulos / tinyply

:earth_africa: C++11 ply 3d mesh format importer & exporter
598 stars 118 forks source link

VS2019 Compiler Warnings? #32

Closed marnef closed 4 years ago

marnef commented 5 years ago

First of all, thank you very much for this excellent library.

Nonetheless VS2019 tells me that there is an unused variable (warning C4189). And I think there is an issue:

file: tinyply.h line: 473 method: PlyFile::PlyFileImpl::read(std::istream & is)

` // Discover if we can allocate up front without parsing the file twice

uint32_t list_hints = 0;

for (auto & b : buffers) for (auto & entry : userData) list_hints += entry.second.list_size_hint;

`

The lool for (auto & b : buffers) seems wrong to me. VS2019 warns that b is unused which is true. My guess is that the loop should be removed, and even better, the variable list_hints might be computed in the loop on line 469 what would perform better.

marnef commented 5 years ago

BTW: We're using our own vcxproj files. At the moment the warnings 4189 and 4244 have to be added so that the code compiles under W4.

ddiakopoulos commented 4 years ago

The library should now compile nicely under VS2019 W4 as of version 2.3.2. Cheers.

marnef commented 4 years ago

Thank you!