Skip to content

Commit

Permalink
fix format specifiers in wxString::Format calls
Browse files Browse the repository at this point in the history
Fixes the following assert issues happening with wxWidgets 3.0
like the following:

ASSERT INFO:
/usr/include/wx-3.0/wx/strvararg.h(456): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
  • Loading branch information
maurossi committed Aug 7, 2016
1 parent 06170db commit 6c9a6fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/SHLD_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SHLD_ctrl
//set's the control's value
void set_value(const std::vector<pcs_shield_triangle>&t){
data=t;
info->set_value(std::string(wxString::Format(_("Editing of shield data is currently unavailable\nshield has %d faces"), data.size()).mb_str()));
info->set_value(std::string(wxString::Format(_("Editing of shield data is currently unavailable\nshield has %ld faces"), data.size()).mb_str()));
}

//return's the control's value
Expand Down
6 changes: 3 additions & 3 deletions src/SOBJ_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ class SOBJ_ctrl
vector3d& min_box = data.bounding_box_min_point_overridden ? data.bounding_box_min_point_override : data.bounding_box_min_point;
vector3d& max_box = data.bounding_box_max_point_overridden ? data.bounding_box_max_point_override : data.bounding_box_max_point;
vector3d size = max_box - min_box;
wxString info(wxString::Format(_("Poly Count: %i\nChild Poly Count: %i\nTotal: %i\n"),
wxString info(wxString::Format(_("Poly Count: %li\nChild Poly Count: %li\nTotal: %li\n"),
data.polygons.size(),
model.get_child_subobj_poly_count(sobj_num),
data.polygons.size() + model.get_child_subobj_poly_count(sobj_num)));
info += wxString::Format(_("Vertices: %i\n"), count_vertices());
info += wxString::Format(_("Normals: %i\n"), count_normals());
info += wxString::Format(_("Vertices: %li\n"), count_vertices());
info += wxString::Format(_("Normals: %li\n"), count_normals());
info += wxString::Format(_("H: %0.2f, W: %0.2f, D: %0.2f\nParent submodel: "),
fabs(size.y), fabs(size.x), fabs(size.z));
if (data.parent_sobj > -1) {
Expand Down
2 changes: 1 addition & 1 deletion src/array_ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class array_ctrl :
array_list->Append(wxString().Format(_("%d"),i+1));
}
//update the size box
array_size_box->ChangeValue(wxString().Format(_("%d"),(this->array.size())));
array_size_box->ChangeValue(wxString().Format(_("%ld"),(this->array.size())));
//make sure the cuurent item is selected in the combo box
array_list->Select(index);
}
Expand Down
2 changes: 1 addition & 1 deletion src/header_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class header_ctrl
vector3d size = max_box - min_box;
hinfo->set_value(std::string(wxString::Format(
_("H: %0.2f, W: %0.2f, D: %0.2f"),
abs(size.y), abs(size.x), abs(size.z) ).mb_str()));
fabs(size.y), fabs(size.x), fabs(size.z) ).mb_str()));

}

Expand Down

0 comments on commit 6c9a6fa

Please sign in to comment.