Page MenuHomePhabricator

Type cast in cluster.h and dirent.h
Closed, ResolvedPublic

Description

Could we please add some type cast in cluster.h and dirent.h, so that compiler implicit type conversion warning can be suppressed?

Changing the following line could fix this problem, though it might not be the best solution.

cluster.h, line 74:
size_type getCount() const { return (size_type)offsets.size() - 1; }

cluster.h, line 77:
size_type getSize() const { return (size_type)offsets.size() * sizeof(size_type) + (size_type)data().size(); }

dirent.h, line 83:
unsigned ret = (isRedirect() ? 12 : 16) + (unsigned int)url.size() + (unsigned int)parameter.size() + 2;

Event Timeline

@Mgautierfr @Automactic
I do not have this warnings on Ubuntu 64, might that be that "typedef uint32_t size_type" is wrong (at least for OSX/iOS)

I do not have this warnings on Fedora23 64bits neither.

@Automactic, what are the exact warning messages ? Can you provide us a compilation trace ?

@Mgautierfr , @Kelson, here is the compile log. Hope it helps!

Kelson claimed this task.

This has been fixed AFAIK.