Warnings: various fixes (#6582)

* Warnings: various fixes

* Use std::ignore
This commit is contained in:
Vovodroid 2024-09-07 13:16:50 +03:00 committed by GitHub
parent 1afc1372bc
commit 044a1c4fc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 17 additions and 14 deletions

View file

@ -2134,7 +2134,7 @@ bool ImGui::BBLBeginCombo(const char *label, const char *preview_value, ImGuiCom
bool hovered, held;
bool pressed = ButtonBehavior(frame_bb, id, &hovered, &held);
bool push_color_count = 0;
int push_color_count = 0;
if (hovered || g.ActiveId == id) {
ImGui::PushStyleColor(ImGuiCol_Border, GetColorU32(ImGuiCol_BorderActive));
push_color_count = 1;
@ -2168,7 +2168,7 @@ bool ImGui::BBLBeginCombo(const char *label, const char *preview_value, ImGuiCom
OpenPopupEx(popup_id, ImGuiPopupFlags_None);
popup_open = true;
}
if (push_color_count > 0) { ImGui::PopStyleColor(push_color_count); }
if (push_color_count > 0) { ImGui::PopStyleColor(push_color_count); }
if (!popup_open) return false;
if (has_window_size_constraint) {
@ -4170,7 +4170,7 @@ bool ImGui::BBLInputScalar(const char *label, ImGuiDataType data_type, void *p_d
// We are only allowed to access the state if we are already the active widget.
ImGuiInputTextState *state = GetInputTextState(id);
bool push_color_count = 0;
int push_color_count = 0;
if (hovered || g.ActiveId == id) {
ImGui::PushStyleColor(ImGuiCol_Border, GetColorU32(ImGuiCol_BorderActive));
push_color_count = 1;

View file

@ -3057,7 +3057,7 @@ bool GLGizmoEmboss::choose_font_by_wxdialog()
}
#endif // ALLOW_ADD_FONT_BY_OS_SELECTOR
#if defined ALLOW_ADD_FONT_BY_FILE or defined ALLOW_DEBUG_MODE
#if defined ALLOW_ADD_FONT_BY_FILE || defined ALLOW_DEBUG_MODE
namespace priv {
static std::string get_file_name(const std::string &file_path)
{

View file

@ -446,7 +446,7 @@ void PrintJob::process(Ctl &ctl)
std::string curr_job_id;
json job_info_j;
try {
job_info_j.parse(job_info);
std::ignore = job_info_j.parse(job_info);
if (job_info_j.contains("job_id")) {
curr_job_id = job_info_j["job_id"].get<std::string>();
}

View file

@ -27,11 +27,13 @@ const int HEADER_BORDER = 5;
const int CONTENT_BORDER = 3;
const int PANEL_WIDTH = 370;
const int COLOR_LABEL_WIDTH = 180;
#define ICON_SIZE wxSize(FromDIP(16), FromDIP(16))
#undef ICON_SIZE
#define ICON_SIZE wxSize(FromDIP(16), FromDIP(16))
#define MIN_OBJCOLOR_DIALOG_WIDTH FromDIP(400)
#define FIX_SCROLL_HEIGTH FromDIP(400)
#define BTN_SIZE wxSize(FromDIP(58), FromDIP(24))
#define BTN_GAP FromDIP(20)
#define BTN_SIZE wxSize(FromDIP(58), FromDIP(24))
#define BTN_GAP FromDIP(20)
static void update_ui(wxWindow* window)
{

View file

@ -1789,7 +1789,7 @@ void Sidebar::sync_ams_list()
// BBS:Record consumables information before synchronization
std::vector<string> color_before_sync;
std::vector<int> is_support_before;
std::vector<bool> is_support_before;
DynamicPrintConfig& project_config = wxGetApp().preset_bundle->project_config;
ConfigOptionStrings* color_opt = project_config.option<ConfigOptionStrings>("filament_colour");
for (int i = 0; i < p->combos_filament.size(); ++i) {

View file

@ -1139,8 +1139,8 @@ int GuideFrame::LoadProfile()
//cout << iter->path().string() << endl;
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
strVendor = strVendor.AfterLast( '\\');
strVendor = strVendor.AfterLast('\/');
strVendor = strVendor.AfterLast('\\');
strVendor = strVendor.AfterLast('/');
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
if (w2s(strVendor) == PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json") == 0)
@ -1158,8 +1158,8 @@ int GuideFrame::LoadProfile()
//cout << "is a file" << endl;
//cout << iter->path().string() << endl;
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
strVendor = strVendor.AfterLast( '\\');
strVendor = strVendor.AfterLast('\/');
strVendor = strVendor.AfterLast('\\');
strVendor = strVendor.AfterLast('/');
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
if (w2s(strVendor) != PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json")==0)
@ -1656,7 +1656,7 @@ std::string GuideFrame::w2s(wxString sSrc)
void GuideFrame::GetStardardFilePath(std::string &FilePath) {
StrReplace(FilePath, "\\", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
StrReplace(FilePath, "\/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
StrReplace(FilePath, "/" , w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
}
bool GuideFrame::LoadFile(std::string jPath, std::string &sContent)

View file

@ -20,6 +20,7 @@ int scale(const int val) { return val * Slic3r::GUI::wxGetApp().em_unit() / 10;
int ITEM_WIDTH() { return scale(30); }
static const wxColour g_text_color = wxColour(107, 107, 107, 255);
#undef ICON_SIZE
#define ICON_SIZE wxSize(FromDIP(16), FromDIP(16))
#define TABLE_BORDER FromDIP(28)
#define HEADER_VERT_PADDING FromDIP(12)