mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-04 01:25:25 +08:00
[time] Convince GCC control flow does not reach end of function
This commit is contained in:
parent
704a90deec
commit
103726767c
@ -146,6 +146,8 @@ int builtin_time(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
case tunit::milliseconds: return "milliseconds";
|
||||
case tunit::microseconds: return "microseconds";
|
||||
}
|
||||
// GCC does not recognize the exhaustive switch above
|
||||
return "";
|
||||
};
|
||||
|
||||
auto unit_short_name = [](tunit unit) {
|
||||
@ -155,6 +157,8 @@ int builtin_time(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
case tunit::milliseconds: return "millis";
|
||||
case tunit::microseconds: return "micros";
|
||||
}
|
||||
// GCC does not recognize the exhaustive switch above
|
||||
return "";
|
||||
};
|
||||
|
||||
auto convert = [](int64_t micros, tunit unit) {
|
||||
@ -164,6 +168,8 @@ int builtin_time(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
case tunit::milliseconds: return micros / 1.0E3;
|
||||
case tunit::microseconds: return micros / 1.0;
|
||||
}
|
||||
// GCC does not recognize the exhaustive switch above
|
||||
return 0.0;
|
||||
};
|
||||
|
||||
auto wall_unit = get_unit(net_wall_micros);
|
||||
|
Loading…
x
Reference in New Issue
Block a user