Skip to content

Commit

Permalink
+ fix many minor warnings, activate -Wall for gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 2, 2015
1 parent 92a65a8 commit e744114
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
include(cMake/ConfigureChecks.cmake)
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_definitions(-DHAVE_CONFIG_H)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-write-strings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated -Wno-write-strings")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
# get linker errors as soon as possible and not at runtime e.g. for modules
if(UNIX)
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ QString Unit::getString(void) const
Sig.ThermodynamicTemperature<0?1:2 +
Sig.AmountOfSubstance<0?1:2 +
Sig.LuminoseIntensity<0?1:2 +
Sig.Angle<0?1:2 ;
Sig.Angle<0?1:2 +
Sig.Density<0?1:2 ;
if (nnom > 1) ret << '(';
bool mult=false;
Expand Down
3 changes: 0 additions & 3 deletions src/Gui/CommandDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ StdCmdRevert::StdCmdRevert()

void StdCmdRevert::activated(int iMsg)
{
App::Document* doc = App::GetApplication().getActiveDocument();
QMessageBox msgBox;
msgBox.setText(qApp->translate("Std_Revert","This will discard all the changes since last file save."));
msgBox.setInformativeText(qApp->translate("Std_Revert","Are you sure?"));
Expand Down Expand Up @@ -1009,7 +1008,6 @@ void StdCmdDelete::activated(int iMsg)
if (vpedit) {
// check if the edited view provider is selected
for (std::vector<Gui::SelectionObject>::iterator ft = sel.begin(); ft != sel.end(); ++ft) {
App::DocumentObject* obj = ft->getObject();
Gui::ViewProvider* vp = pGuiDoc->getViewProvider(ft->getObject());
if (vp == vpedit) {
if (!ft->getSubNames().empty()) {
Expand All @@ -1031,7 +1029,6 @@ void StdCmdDelete::activated(int iMsg)
// check if we can delete the object
for (std::vector<Gui::SelectionObject>::iterator ft = sel.begin(); ft != sel.end(); ++ft) {
App::DocumentObject* obj = ft->getObject();
Gui::ViewProvider* vp = pGuiDoc->getViewProvider(ft->getObject());
std::vector<App::DocumentObject*> links = obj->getInList();
if (!links.empty()) {
// check if the referenced objects are groups or are selected too
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ void Document::slotChangedObject(const App::DocumentObject& Obj, const App::Prop
SoGroup* childGroup = viewProvider->getChildRoot();

// size not the same -> build up the list new
if(childGroup->getNumChildren() != children.size()){
if(childGroup->getNumChildren() != static_cast<int>(children.size())){

childGroup->removeAllChildren();

Expand Down
10 changes: 7 additions & 3 deletions src/Gui/GestureNavigationStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
}
}
break;
default:
break;
}
}
if (processed)
Expand Down Expand Up @@ -343,6 +345,8 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
}
processed = TRUE;
break;
default:
break;
}//switch key
}
if (processed)
Expand Down Expand Up @@ -474,8 +478,8 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
if (evIsButton) {
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
const int button = event->getButton();
const SbBool press //the button was pressed (if false -> released)
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
//const SbBool press //the button was pressed (if false -> released)
// = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
switch(button){
case SoMouseButtonEvent::BUTTON1:
case SoMouseButtonEvent::BUTTON2:
Expand All @@ -495,7 +499,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
//the essence part 1!
//mouse movement into camera motion. Suppress if in gesture. Ignore until threshold is surpassed.
if (evIsLoc2 && ! this->inGesture && this->mouseMoveThresholdBroken) {
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
//const SoLocation2Event * const event = (const SoLocation2Event *) ev;
if (curmode == NavigationStyle::ZOOMING) {//doesn't happen
this->zoomByCursor(posn, prevnormalized);
processed = TRUE;
Expand Down
2 changes: 2 additions & 0 deletions src/Gui/Quarter/FocusHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ FocusHandler::eventFilter(QObject * obj, QEvent * event)
case QEvent::FocusOut:
this->focusEvent("sim.coin3d.coin.InputFocus.OUT");
break;
default:
break;
}
return QObject::eventFilter(obj, event);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/Quarter/ImageReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ ImageReader::readImage(const SbString & filename, SbImage & sbimage) const
{
QImage image;
if (image.load(filename.getString())) {
int c;
int w = image.width();
int h = image.height();
//int c;
//int w = image.width();
//int h = image.height();

// Keep in 8-bits mode if that was what we read
if (image.depth() != 8 || !image.isGrayscale()) {
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/Quarter/QuarterWidgetP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ QuarterWidgetP::QuarterWidgetP(QuarterWidget * masterptr, const QGLWidget * shar
initialsoeventmanager(false),
headlight(NULL),
cachecontext(NULL),
contextmenu(NULL),
contextmenuenabled(true),
autoredrawenabled(true),
interactionmodeenabled(false),
clearzbuffer(true),
clearwindow(true),
addactions(true)
addactions(true),
contextmenu(NULL)
{
this->cachecontext = findCacheContext(masterptr, sharewidget);

Expand Down
2 changes: 1 addition & 1 deletion src/Gui/TaskView/TaskView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void TaskGroup::actionEvent (QActionEvent* e)
switch (e->type()) {
case QEvent::ActionAdded:
{
QSint::ActionLabel *label = this->createItem(action);
this->createItem(action);
break;
}
case QEvent::ActionChanged:
Expand Down
3 changes: 0 additions & 3 deletions src/Gui/View3DInventorViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,9 +1297,6 @@ void View3DInventorViewer::setRenderType(const RenderType type)
break;
case Image:
{
const SbViewportRegion vp = this->getSoRenderManager()->getViewportRegion();
SbVec2s size = vp.getViewportSizePixels();

QGLWidget* gl = static_cast<QGLWidget*>(this->viewport());
gl->makeCurrent();
int w = gl->width();
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/propertyeditor/PropertyItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ QVariant PropertyEnumItem::value(const App::Property* prop) const
const std::vector<std::string>& value = prop_enum->getEnumVector();
long currentItem = prop_enum->getValue();

if (currentItem < 0 || currentItem >= value.size())
if (currentItem < 0 || currentItem >= static_cast<long>(value.size()))
return QVariant(QString());
return QVariant(QString::fromUtf8(value[currentItem].c_str()));
}
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Mesh/App/Core/Projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ bool MeshProjection::projectLineOnMesh(const MeshFacetGrid& grid,

// cut all facets with plane
std::list< std::pair<Base::Vector3f, Base::Vector3f> > cutLine;
unsigned long start = 0, end = 0;
//unsigned long start = 0, end = 0;
for (std::vector<unsigned long>::iterator it = facets.begin(); it != facets.end(); ++it) {
Base::Vector3f e1, e2;
MeshGeomFacet tria = kernel.GetFacet(*it);
Expand All @@ -418,7 +418,7 @@ bool MeshProjection::projectLineOnMesh(const MeshFacetGrid& grid,
else
cutLine.push_back(std::pair<Base::Vector3f, Base::Vector3f>(v1, e1));

start = it - facets.begin();
//start = it - facets.begin();
}

if (*it == f2) { // end facet
Expand All @@ -427,7 +427,7 @@ bool MeshProjection::projectLineOnMesh(const MeshFacetGrid& grid,
else
cutLine.push_back(std::pair<Base::Vector3f, Base::Vector3f>(v2, e1));

end = it - facets.begin();
//end = it - facets.begin();
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Mesh/Gui/ViewProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,10 @@ bool ViewProviderMesh::exportToVrml(const char* filename, const MeshCore::Materi
SoMaterialBinding* binding = new SoMaterialBinding;
SoMaterial* material = new SoMaterial;

if (mat.diffuseColor.size() == coords->point.getNum()) {
if (static_cast<int>(mat.diffuseColor.size()) == coords->point.getNum()) {
binding->value = SoMaterialBinding::PER_VERTEX_INDEXED;
}
else if (mat.diffuseColor.size() == faces->coordIndex.getNum()/4) {
else if (static_cast<int>(mat.diffuseColor.size()) == faces->coordIndex.getNum()/4) {
binding->value = SoMaterialBinding::PER_FACE_INDEXED;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/App/PrimitiveFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ App::DocumentObjectExecReturn *Helix::execute(void)
Standard_Real myRadius = Radius.getValue();
Standard_Real myAngle = Angle.getValue();
Standard_Boolean myLocalCS = LocalCoord.getValue() ? Standard_True : Standard_False;
Standard_Boolean myStyle = Style.getValue() ? Standard_True : Standard_False;
//Standard_Boolean myStyle = Style.getValue() ? Standard_True : Standard_False;
TopoShape helix;
// work around for OCC bug #23314 (FC #0954)
// the exact conditions for failure are unknown. building the helix 1 turn at a time
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Part/Gui/SoBrepFaceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist,
break;
}
v4 = viptr < viendptr ? *viptr++ : -1;
(void)v4;

/* vertex 1 *********************************************************/
if (mbind == PER_PART) {
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Part/Gui/ViewProviderBoolean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void ViewProviderBoolean::updateData(const App::Property* prop)
colBool.resize(boolMap.Extent(), this->ShapeColor.getValue());

bool setColor=false;
if (colBase.size() == baseMap.Extent()) {
if (static_cast<int>(colBase.size()) == baseMap.Extent()) {
applyColor(hist[0], colBase, colBool);
setColor = true;
}
Expand All @@ -115,7 +115,7 @@ void ViewProviderBoolean::updateData(const App::Property* prop)
applyColor(hist[0], colBase, colBool);
setColor = true;
}
if (colTool.size() == toolMap.Extent()) {
if (static_cast<int>(colTool.size()) == toolMap.Extent()) {
applyColor(hist[1], colTool, colBool);
setColor = true;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ void ViewProviderMultiFuse::updateData(const App::Property* prop)

Gui::ViewProvider* vpBase = Gui::Application::Instance->getViewProvider(objBase);
std::vector<App::Color> colBase = static_cast<PartGui::ViewProviderPart*>(vpBase)->DiffuseColor.getValues();
if (colBase.size() == baseMap.Extent()) {
if (static_cast<int>(colBase.size()) == baseMap.Extent()) {
applyColor(hist[index], colBase, colBool);
setColor = true;
}
Expand Down Expand Up @@ -316,7 +316,7 @@ void ViewProviderMultiCommon::updateData(const App::Property* prop)

Gui::ViewProvider* vpBase = Gui::Application::Instance->getViewProvider(objBase);
std::vector<App::Color> colBase = static_cast<PartGui::ViewProviderPart*>(vpBase)->DiffuseColor.getValues();
if (colBase.size() == baseMap.Extent()) {
if (static_cast<int>(colBase.size()) == baseMap.Extent()) {
applyColor(hist[index], colBase, colBool);
setColor = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/Gui/ViewProviderCompound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void ViewProviderCompound::updateData(const App::Property* prop)

Gui::ViewProvider* vpBase = Gui::Application::Instance->getViewProvider(objBase);
std::vector<App::Color> baseCol = static_cast<PartGui::ViewProviderPart*>(vpBase)->DiffuseColor.getValues();
if (baseCol.size() == baseMap.Extent()) {
if (static_cast<int>(baseCol.size()) == baseMap.Extent()) {
applyColor(hist[index], baseCol, compCol);
setColor = true;
}
Expand Down
1 change: 0 additions & 1 deletion src/Mod/Part/Gui/ViewProviderExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@ void ViewProviderPartExt::updateVisual(const TopoDS_Shape& inputShape)
bounds.Get(xMin, yMin, zMin, xMax, yMax, zMax);
Standard_Real deflection = ((xMax-xMin)+(yMax-yMin)+(zMax-zMin))/300.0 *
Deviation.getValue();
Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * M_PI;

// create or use the mesh on the data structure
#if OCC_VERSION_HEX >= 0x060600
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Part/Gui/ViewProviderMirror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void ViewProviderFillet::updateData(const App::Property* prop)
colFill.resize(fillMap.Extent(), static_cast<PartGui::ViewProviderPart*>(vpBase)->ShapeColor.getValue());

bool setColor=false;
if (colBase.size() == baseMap.Extent()) {
if (static_cast<int>(colBase.size()) == baseMap.Extent()) {
applyColor(hist[0], colBase, colFill);
setColor = true;
}
Expand Down Expand Up @@ -356,7 +356,7 @@ void ViewProviderChamfer::updateData(const App::Property* prop)
colCham.resize(chamMap.Extent(), static_cast<PartGui::ViewProviderPart*>(vpBase)->ShapeColor.getValue());

bool setColor=false;
if (colBase.size() == baseMap.Extent()) {
if (static_cast<int>(colBase.size()) == baseMap.Extent()) {
applyColor(hist[0], colBase, colCham);
setColor = true;
}
Expand Down
1 change: 0 additions & 1 deletion src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ void ViewProviderTransformed::recomputeFeature(void)
bounds.Get(xMin, yMin, zMin, xMax, yMax, zMax);
}
Standard_Real deflection = ((xMax-xMin)+(yMax-yMin)+(zMax-zMin))/300.0 * Deviation.getValue();
Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * M_PI;

// create or use the mesh on the data structure
#if OCC_VERSION_HEX >= 0x060600
Expand Down

0 comments on commit e744114

Please sign in to comment.