The type that an enum is promoted to for arithmetic is compiler
dependent. We can't assume that it's an int, or a short.
Explicitly cast the volume state enum where clang gets upset.
Reviewed-on: http://gerrit.openafs.org/9137
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
304fac42b8cd4a71d0df063cafe88b2888e4d175)
Change-Id: I8c5b3493549ec88727728a7f28e3430660c673b2
Reviewed-on: http://gerrit.openafs.org/10748
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
static_inline int
VnIsValidState(VnState state)
{
- if ((state >= 0) &&
+ if (((int) state >= 0) &&
(state < VN_STATE_COUNT)) {
return 1;
}
VCreateReservation_r(vp);
if (LogLevel >= 5) {
- Log("VShutdownVolume_r: vid=%u, device=%d, state=%hu\n",
- vp->hashid, vp->partition->device, V_attachState(vp));
+ Log("VShutdownVolume_r: vid=%u, device=%d, state=%u\n",
+ vp->hashid, vp->partition->device, (unsigned int)V_attachState(vp));
}
/* wait for other blocking ops to finish */
static_inline int
VIsValidState(VolState state)
{
- if ((state >= 0) &&
+ if (((int) state >= 0) &&
(state < VOL_STATE_COUNT)) {
return 1;
}