Closed paulftw closed 8 years ago
@d-led could you please take a look if this change makes sense? I'm not sure about the unsigned/signed conversion
unsigned long long
is at least 64bit, but a quick search doesn't yield a platform, where this could be bigger, thus I'd say 64bit is ok. As for signedness, let's write a test. (can't do at the moment, will think about one in the evening)
first approach check if ULLONG_MAX
survives:
ull_t max = { ULLONG_MAX };
// struct to avoid compiler warning C4307
REQUIRE((max.v + 1) == 0);
bean_ptr<ull_t> id = db.copyBean(max);
bean_ptr<ull_t> max_new = db.loadBean<ull_t>(id.get_id());
CHECK(max_new->v == max.v);
didn't have time to make a runnable test yet
looks ok for me, since storing and retrieving the maximum value of unsigned long long works. If a platform that has a bigger ull comes around, it'll need a breaking change, but it's probably unlikely
This should fix #16