From 25f729fab5d90935973b96ee2b13d69375db479c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 14 Apr 2025 13:00:56 -0700 Subject: [PATCH] use priotity_enum The _t typedef is only useful with C, not C++. Signed-off-by: Rosen Penev --- src/command_file.cc | 2 +- src/ui/element_file_list.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command_file.cc b/src/command_file.cc index 9852ad20..1b4069e9 100644 --- a/src/command_file.cc +++ b/src/command_file.cc @@ -53,7 +53,7 @@ apply_f_set_priority(torrent::File* file, uint32_t value) { if (value > torrent::PRIORITY_HIGH) throw torrent::input_error("Invalid value."); - file->set_priority((torrent::priority_t)value); + file->set_priority(static_cast(value)); } // TODO: Redundant. diff --git a/src/ui/element_file_list.cc b/src/ui/element_file_list.cc index 270c215e..142410c8 100644 --- a/src/ui/element_file_list.cc +++ b/src/ui/element_file_list.cc @@ -265,7 +265,7 @@ ElementFileList::receive_priority() { if (m_window == NULL) return; - torrent::priority_t priority = torrent::priority_t((m_selected.file()->priority() + 2) % 3); + auto priority = torrent::priority_enum((m_selected.file()->priority() + 2) % 3); iterator first = m_selected; iterator last = m_selected; @@ -288,7 +288,7 @@ ElementFileList::receive_change_all() { return; torrent::FileList* fl = m_download->download()->file_list(); - torrent::priority_t priority = torrent::priority_t((m_selected.file()->priority() + 2) % 3); + auto priority = torrent::priority_enum((m_selected.file()->priority() + 2) % 3); for (torrent::FileList::iterator itr = fl->begin(), last = fl->end(); itr != last; ++itr) (*itr)->set_priority(priority);