mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 02:55:38 +08:00
fix: fix some of the compilation errors and warnings
This commit is contained in:
@@ -18,7 +18,9 @@ ASST_DO_PRAGMA(warning(pop))
|
||||
#define ASST_SUPPRESS_CV_WARNINGS_START \
|
||||
ASST_DO_PRAGMA(clang diagnostic push) \
|
||||
ASST_DO_PRAGMA(clang diagnostic ignored "-Wdeprecated-enum-enum-conversion") \
|
||||
ASST_DO_PRAGMA(clang diagnostic ignored "-Wdeprecated-anon-enum-enum-conversion")
|
||||
ASST_DO_PRAGMA(clang diagnostic ignored "-Wdeprecated-anon-enum-enum-conversion") \
|
||||
ASST_DO_PRAGMA(clang diagnostic ignored "-Wc11-extensions") \
|
||||
ASST_DO_PRAGMA(clang diagnostic ignored "-Wunused-but-set-variable")
|
||||
#define ASST_SUPPRESS_CV_WARNINGS_END \
|
||||
ASST_DO_PRAGMA(clang diagnostic pop)
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
@@ -254,6 +254,7 @@ namespace asst::utils
|
||||
int pipe_out[2] = { 0 };
|
||||
int pipe_in_ret = pipe(pipe_in);
|
||||
int pipe_out_ret = pipe(pipe_out);
|
||||
if (pipe_in_ret != 0 || pipe_out_ret != 0) { return {}; }
|
||||
fcntl(pipe_out[PIPE_READ], F_SETFL, O_NONBLOCK);
|
||||
int exit_ret = 0;
|
||||
int child = fork();
|
||||
|
||||
@@ -9,7 +9,7 @@ bool asst::InfrastPowerTask::_run()
|
||||
// 发电站只能造这一个
|
||||
set_product("Drone");
|
||||
|
||||
for (; m_cur_facility_index != max_num_of_facilities(); ++m_cur_facility_index) {
|
||||
for (; m_cur_facility_index != static_cast<int>(max_num_of_facilities()); ++m_cur_facility_index) {
|
||||
if (need_exit()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace asst
|
||||
OcrWithFlagTemplImageAnalyzer(const cv::Mat& image, const Rect& roi);
|
||||
virtual ~OcrWithFlagTemplImageAnalyzer() override = default;
|
||||
|
||||
virtual void set_image(const cv::Mat image);
|
||||
virtual void set_image(const cv::Mat image, const Rect& roi);
|
||||
virtual void set_roi(const Rect& roi) noexcept;
|
||||
virtual void set_image(const cv::Mat image) override;
|
||||
virtual void set_image(const cv::Mat image, const Rect& roi) override;
|
||||
virtual void set_roi(const Rect& roi) noexcept override;
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace asst
|
||||
void set_split(bool split);
|
||||
void set_expansion(int expansion);
|
||||
|
||||
virtual void set_task_info(std::shared_ptr<TaskInfo> task_ptr);
|
||||
virtual void set_task_info(const std::string& task_name);
|
||||
virtual void set_task_info(std::shared_ptr<TaskInfo> task_ptr) override;
|
||||
virtual void set_task_info(const std::string& task_name) override;
|
||||
protected:
|
||||
virtual void set_task_info(OcrTaskInfo task_info) noexcept override;
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle()
|
||||
return true;
|
||||
}
|
||||
// 如果已经放了一些人了,就不要再有费就下了
|
||||
if (m_used_tiles.size() >= std::max(m_homes.size(), 2ULL)) {
|
||||
if (m_used_tiles.size() >= std::max(m_homes.size(), static_cast<size_t>(2))) {
|
||||
size_t available_count = 0;
|
||||
size_t not_cooling_count = 0;
|
||||
for (const auto& oper : opers) {
|
||||
|
||||
Reference in New Issue
Block a user