mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
Merge branch 'fish-shell:master' into master
This commit is contained in:
commit
64219a39a3
|
@ -188,10 +188,10 @@ static const wchar_t *math_describe_error(const te_error_t &error) {
|
|||
static wcstring format_double(double v, const math_cmd_opts_t &opts) {
|
||||
if (opts.base == 16) {
|
||||
v = trunc(v);
|
||||
return format_string(L"0x%x", (long)v);
|
||||
return format_string(L"0x%x", (unsigned int)v);
|
||||
} else if (opts.base == 8) {
|
||||
v = trunc(v);
|
||||
return format_string(L"0%o", (long)v);
|
||||
return format_string(L"0%o", (unsigned int)v);
|
||||
}
|
||||
|
||||
// As a special-case, a scale of 0 means to truncate to an integer
|
||||
|
|
|
@ -147,10 +147,9 @@ static bool set_status_cmd(const wchar_t *cmd, status_cmd_opts_t &opts, status_c
|
|||
|
||||
/// Print the features and their values.
|
||||
static void print_features(io_streams_t &streams) {
|
||||
size_t max_len = std::numeric_limits<size_t>::min();
|
||||
for (const auto &md : features_t::metadata) {
|
||||
max_len = std::max(max_len, wcslen(md.name));
|
||||
}
|
||||
auto max_len = std::numeric_limits<int>::min();
|
||||
for (const auto &md : features_t::metadata)
|
||||
max_len = std::max(max_len, static_cast<int>(wcslen(md.name)));
|
||||
for (const auto &md : features_t::metadata) {
|
||||
int set = feature_test(md.flag);
|
||||
streams.out.append_format(L"%-*ls%-3s %ls %ls\n", max_len + 1, md.name, set ? "on" : "off",
|
||||
|
|
|
@ -911,7 +911,7 @@ struct compiled_regex_t : noncopyable_t {
|
|||
string_error(streams, _(L"%ls: Regular expression compile error: %ls\n"), argv0,
|
||||
pcre2_strerror(err_code).c_str());
|
||||
string_error(streams, L"%ls: %ls\n", argv0, pattern.c_str());
|
||||
string_error(streams, L"%ls: %*ls\n", argv0, err_offset, L"^");
|
||||
string_error(streams, L"%ls: %*ls\n", argv0, static_cast<int>(err_offset), L"^");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ static void print(int resource, int hard, io_streams_t &streams) {
|
|||
if (l == RLIM_INFINITY)
|
||||
streams.out.append(L"unlimited\n");
|
||||
else
|
||||
streams.out.append_format(L"%d\n", l / get_multiplier(resource));
|
||||
streams.out.append_format(L"%lu\n", l / get_multiplier(resource));
|
||||
}
|
||||
|
||||
/// Print values of all resource limits.
|
||||
|
@ -101,7 +101,7 @@ static void print_all(int hard, io_streams_t &streams) {
|
|||
if (l == RLIM_INFINITY) {
|
||||
streams.out.append(L"unlimited\n");
|
||||
} else {
|
||||
streams.out.append_format(L"%d\n", l / get_multiplier(resource_arr[i].resource));
|
||||
streams.out.append_format(L"%lu\n", l / get_multiplier(resource_arr[i].resource));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user