WPettersson / regina

Regina - a topological software suite
Other
1 stars 0 forks source link

Fix warnings #11

Open WPettersson opened 8 years ago

WPettersson commented 8 years ago

Fixes a whole heap of warnings, but!

There are some slight API changes, all in enumerate/

The column permutation of an LP is now an array of unsigned int, rather than an array of signed int. In particular, this results in: LPConstraint::addRows() uses unsigned int rather than int* for columnPerm Ban::init() uses const unsigned int instead of const int LPData::extractSolution() uses const unsigned int* instead of int

NTreeTraversal had some private members changed to unsigned, as well as an API change from int nextUnmarkedTriangleType(int startFrom) to int nextUnmarkedTriangleType(unsigned startFrom)

In NTypeTrie the insert() and dominate() functions take unsigned char* pointers rather than char* pointers, as these are used as array indexes.

All of these are in amongst the commit entitled "More signedness fixes"

Outside of these, it's 95% static_casts<> along with some changed declarations of variable types, as well as a few excess semi-colons removed and a couple of unused variables removed where I knew it was safe to do so.

Issue #10

WPettersson commented 8 years ago

Forgot to mention, these changes are almost completely contained within engine/. There are a few testsuite fixes as well as a fix to utils/censuslookup.cpp. I have also changed std::auto_ptr to std::unique_ptr in most of the python bindings. I haven't moved all of them yet, as Boost doesn't really support move semantics so anything that is "fancy" is still using auto_ptr. At this point I think it's best to just leave these as is, and fix them when Boost does support move semantics better (apparently coming soon).

WPettersson commented 8 years ago

Update: I removed the auto_ptr -> unique_ptr fixes. I forgot to check how this ran on other distros, and apparently on boost 1.56 you can't really use unique_ptr at all with Boost. Given that Debian stable is on 1.55, we might be better off waiting for Stretch before making that merge.