Remove some useless casts

I think the warnings from -Wuseless-cast are mostly platform-specific but
I hope these are correct.
This commit is contained in:
Johannes Altmanninger 2020-09-08 22:33:44 +02:00
parent fbaa5d193d
commit de9874e4de
3 changed files with 3 additions and 2 deletions

View file

@ -179,6 +179,7 @@ maybe_t<int> builtin_set_color(parser_t &parser, io_streams_t &streams, wchar_t
outputter_t outp;
if (bold && enter_bold_mode) {
// These casts are needed to work with different curses implementations.
writembs_nofail(outp, tparm(const_cast<char *>(enter_bold_mode)));
}

View file

@ -387,7 +387,7 @@ void event_print(io_streams_t &streams, maybe_t<event_type_t> type_filter) {
if (!last_type || *last_type != evt->desc.type) {
if (last_type) streams.out.append(L"\n");
last_type = static_cast<event_type_t>(evt->desc.type);
last_type = evt->desc.type;
streams.out.append_format(L"Event %ls\n", event_name_for_type(*last_type));
}
switch (evt->desc.type) {

View file

@ -84,7 +84,7 @@ bool wreaddir_resolving(DIR *dir, const wcstring &dir_path, wcstring &out_name,
if (stat(fullpath.c_str(), &buf) != 0) {
is_dir = false;
} else {
is_dir = static_cast<bool>(S_ISDIR(buf.st_mode));
is_dir = S_ISDIR(buf.st_mode);
}
}
*out_is_dir = is_dir;