Skip to content

Commit

Permalink
Warnings: various fixes (#6582)
Browse files Browse the repository at this point in the history
* Warnings: various fixes

* Use std::ignore
  • Loading branch information
vovodroid authored Sep 7, 2024
1 parent 1afc137 commit 044a1c4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/imgui/imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Jobs/PrintJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
}
Expand Down
8 changes: 5 additions & 3 deletions src/slic3r/GUI/ObjColorDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions src/slic3r/GUI/WebGuideDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/WipeTowerDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 044a1c4

Please sign in to comment.