mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Add explicit case statements where -Wswitch-enum would report them
This commit is contained in:
parent
ed7885017c
commit
3dac4c7874
5 changed files with 7 additions and 2 deletions
|
@ -1024,6 +1024,8 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
|
|||
str << v.fpoint;
|
||||
break;
|
||||
|
||||
case nThunk:
|
||||
case nExternal:
|
||||
default:
|
||||
str << ANSI_RED "«unknown»" ANSI_NORMAL;
|
||||
break;
|
||||
|
|
|
@ -2337,6 +2337,7 @@ bool EvalState::eqValues(Value & v1, Value & v2, const PosIdx pos, std::string_v
|
|||
case nFloat:
|
||||
return v1.fpoint == v2.fpoint;
|
||||
|
||||
case nThunk: // Must not be left by forceValue
|
||||
default:
|
||||
error("cannot compare %1% with %2%", showType(v1), showType(v2)).withTrace(pos, errorCtx).debugThrow<EvalError>();
|
||||
}
|
||||
|
|
|
@ -275,6 +275,7 @@ json listNar(ref<FSAccessor> accessor, const Path & path, bool recurse)
|
|||
obj["type"] = "symlink";
|
||||
obj["target"] = accessor->readLink(path);
|
||||
break;
|
||||
case FSAccessor::Type::tMissing:
|
||||
default:
|
||||
throw Error("path '%s' does not exist in NAR", path);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,8 @@ public:
|
|||
case lvlWarn: c = '4'; break;
|
||||
case lvlNotice: case lvlInfo: c = '5'; break;
|
||||
case lvlTalkative: case lvlChatty: c = '6'; break;
|
||||
default: c = '7';
|
||||
case lvlDebug: case lvlVomit: c = '7';
|
||||
default: c = '7'; break;
|
||||
}
|
||||
prefix = std::string("<") + c + ">";
|
||||
}
|
||||
|
|
|
@ -443,7 +443,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
|
|||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
default: case qDefault:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue