+ fix various warnings
This commit is contained in:
parent
1a12d109e9
commit
cb16fec6bb
|
@ -375,7 +375,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
|||
this->mousedownConsumedEvent[cnt] = *event;//hopefully, a shallow copy is enough. There are no pointers stored in events, apparently. Will loose a subclass, though.
|
||||
cnt++;
|
||||
assert(cnt<=2);
|
||||
if(cnt>sizeof(mousedownConsumedEvent)){
|
||||
if(cnt>static_cast<int>(sizeof(mousedownConsumedEvent))){
|
||||
cnt=sizeof(mousedownConsumedEvent);//we are in trouble
|
||||
}
|
||||
processed = true;//just consume this event, and wait for the move threshold to be broken to start dragging/panning
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
QString copy = input;
|
||||
|
||||
int len = copy.size();
|
||||
pos = len;
|
||||
const bool plus = max >= 0;
|
||||
const bool minus = min <= 0;
|
||||
|
||||
|
@ -274,7 +275,7 @@ void QuantitySpinBox::userInput(const QString & text)
|
|||
Q_D(QuantitySpinBox);
|
||||
|
||||
QString tmp = text;
|
||||
int pos;
|
||||
int pos = 0;
|
||||
QValidator::State state;
|
||||
Base::Quantity res = d->validateAndInterpret(tmp, pos, state);
|
||||
if (state == QValidator::Acceptable) {
|
||||
|
@ -446,7 +447,7 @@ void QuantitySpinBox::focusOutEvent(QFocusEvent * event)
|
|||
{
|
||||
Q_D(QuantitySpinBox);
|
||||
|
||||
int pos;
|
||||
int pos = 0;
|
||||
QString text = lineEdit()->text();
|
||||
QValidator::State state;
|
||||
d->validateAndInterpret(text, pos, state);
|
||||
|
|
|
@ -60,7 +60,7 @@ QtCoinCompatibility::SbImageToQImage(const SbImage & sbimage, QImage & img)
|
|||
"Implementation not tested for 3 colors or more"
|
||||
);
|
||||
}
|
||||
QImage::Format format;
|
||||
QImage::Format format=QImage::Format_Invalid;
|
||||
if (nc==3||nc==4) {
|
||||
format=QImage::Format_RGB32;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void CompleteGuiExport initCompleteGui()
|
|||
|
||||
// try to load dependent modules, currently not (AssemblyGui, CamGui)
|
||||
char *modules[] = {"PartGui", "MeshGui", "MeshPartGui", "PointsGui", "DrawingGui", "RaytracingGui", "SketcherGui", "PartDesignGui", "ImageGui", "TestGui"};
|
||||
char nModules = sizeof(modules) / sizeof(char*);
|
||||
size_t nModules = sizeof(modules) / sizeof(char*);
|
||||
for (size_t i = 0; i < nModules; i++) {
|
||||
try {
|
||||
Base::Interpreter().loadModule(modules[i]);
|
||||
|
|
|
@ -46,7 +46,7 @@ extern "C" {
|
|||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
return;
|
||||
}
|
||||
PyObject* DraftUtilsModule = Py_InitModule3("DraftUtils", DraftUtils_methods, module_DraftUtils_doc); /* mod name, table ptr */
|
||||
Py_InitModule3("DraftUtils", DraftUtils_methods, module_DraftUtils_doc); /* mod name, table ptr */
|
||||
Base::Console().Log("Loading DraftUtils module... done\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -152,8 +152,7 @@ bool ViewProviderDrawingPage::onDelete(const std::vector<std::string> & items)
|
|||
|
||||
void ViewProviderDrawingPage::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
|
||||
{
|
||||
QAction* act;
|
||||
act = menu->addAction(QObject::tr("Show drawing"), receiver, member);
|
||||
menu->addAction(QObject::tr("Show drawing"), receiver, member);
|
||||
}
|
||||
|
||||
bool ViewProviderDrawingPage::setEdit(int ModNum)
|
||||
|
|
|
@ -65,6 +65,7 @@ static const char *image_oneToOne[]={
|
|||
".##############.",
|
||||
"................"};
|
||||
|
||||
#if 0
|
||||
/* XPM */
|
||||
static const char *image_orig[]={
|
||||
"16 16 5 1",
|
||||
|
@ -114,6 +115,7 @@ static const char *image_bright[]={
|
|||
".cccccccccccccc.",
|
||||
".cccccccccccccc.",
|
||||
"................"};
|
||||
#endif
|
||||
|
||||
} // namespace ImageGui
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ int StepShape::read(const char* fileName)
|
|||
Handle(TColStd_HSequenceOfTransient) list = aReader.GiveList();
|
||||
|
||||
//Use method StepData_StepModel::NextNumberForLabel to find its rank with the following:
|
||||
Standard_CString label = "#...";
|
||||
//Standard_CString label = "#...";
|
||||
Handle_StepData_StepModel model = aReader.StepModel();
|
||||
//rank = model->NextNumberForLabe(label, 0, Standard_False);
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ bool MeshProjection::connectLines(std::list< std::pair<Base::Vector3f, Base::Vec
|
|||
// get nearest line
|
||||
float fMin = fMaxDist * fMaxDist;
|
||||
|
||||
bool bPos;
|
||||
bool bPos = false;
|
||||
for (it = cutLines.begin(); it != cutLines.end(); ++it) {
|
||||
float fD1 = Base::DistanceP2(curr, it->first);
|
||||
float fD2 = Base::DistanceP2(curr, it->second);
|
||||
|
|
|
@ -860,6 +860,9 @@ void MeshObject::cut(const Base::Polygon2D& polygon2d,
|
|||
case OUTER:
|
||||
inner = false;
|
||||
break;
|
||||
default:
|
||||
inner = true;
|
||||
break;
|
||||
}
|
||||
|
||||
MeshCore::MeshFacetGrid meshGrid(this->_kernel);
|
||||
|
|
|
@ -1281,7 +1281,7 @@ PyObject* BSplineSurfacePy::approximate(PyObject *args)
|
|||
Standard_Failure::Raise("not enough points given");
|
||||
}
|
||||
|
||||
GeomAbs_Shape c;
|
||||
GeomAbs_Shape c = GeomAbs_CN;
|
||||
switch(continuity){
|
||||
case 0:
|
||||
c = GeomAbs_C0;
|
||||
|
|
|
@ -215,7 +215,7 @@ bool Part2DObject::seekTrimPoints(const std::vector<Geometry *> &geomlist,
|
|||
gp_Pln plane(gp_Pnt(0,0,0),gp_Dir(0,0,1));
|
||||
|
||||
Standard_Boolean periodic=Standard_False;
|
||||
double period;
|
||||
double period = 0;
|
||||
Handle_Geom2d_Curve primaryCurve;
|
||||
Handle_Geom_Geometry geom = (geomlist[GeoId])->handle();
|
||||
Handle_Geom_Curve curve3d = Handle_Geom_Curve::DownCast(geom);
|
||||
|
|
|
@ -1748,18 +1748,21 @@ PyObject* TopoShapePy::distToShape(PyObject *args)
|
|||
pSuppType1 = PyString_FromString("Vertex");
|
||||
pSupportIndex1 = _getSupportIndex("Vertex",ts1,suppS1);
|
||||
pParm1 = Py_None;
|
||||
pParm2 = Py_None;
|
||||
break;
|
||||
case BRepExtrema_IsOnEdge:
|
||||
pSuppType1 = PyString_FromString("Edge");
|
||||
pSupportIndex1 = _getSupportIndex("Edge",ts1,suppS1);
|
||||
extss.ParOnEdgeS1(i,t1);
|
||||
pParm1 = PyFloat_FromDouble(t1);
|
||||
pParm2 = Py_None;
|
||||
break;
|
||||
case BRepExtrema_IsInFace:
|
||||
pSuppType1 = PyString_FromString("Face");
|
||||
pSupportIndex1 = _getSupportIndex("Face",ts1,suppS1);
|
||||
extss.ParOnFaceS1(i,u1,v1);
|
||||
pParm1 = PyTuple_New(2);
|
||||
pParm2 = Py_None;
|
||||
PyTuple_SetItem(pParm1,0,PyFloat_FromDouble(u1));
|
||||
PyTuple_SetItem(pParm1,1,PyFloat_FromDouble(v1));
|
||||
break;
|
||||
|
@ -1768,6 +1771,7 @@ PyObject* TopoShapePy::distToShape(PyObject *args)
|
|||
pSuppType1 = PyString_FromString("Unknown");
|
||||
pSupportIndex1 = PyInt_FromLong(-1);
|
||||
pParm1 = Py_None;
|
||||
pParm2 = Py_None;
|
||||
}
|
||||
|
||||
P2 = extss.PointOnShape2(i);
|
||||
|
|
|
@ -333,7 +333,7 @@ void CrossSections::on_sectionsBox_toggled(bool b)
|
|||
else {
|
||||
CrossSections::Plane type = plane();
|
||||
Base::Vector3d c = bbox.CalcCenter();
|
||||
double value;
|
||||
double value = 0;
|
||||
switch (type) {
|
||||
case CrossSections::XY:
|
||||
value = c.z;
|
||||
|
@ -362,7 +362,7 @@ void CrossSections::on_checkBothSides_toggled(bool b)
|
|||
void CrossSections::on_countSections_valueChanged(int v)
|
||||
{
|
||||
CrossSections::Plane type = plane();
|
||||
double dist;
|
||||
double dist = 0;
|
||||
switch (type) {
|
||||
case CrossSections::XY:
|
||||
dist = bbox.LengthZ() / v;
|
||||
|
|
|
@ -92,7 +92,7 @@ void Toolpath::insertCommand(const Command &Cmd, int pos)
|
|||
{
|
||||
if (pos == -1) {
|
||||
addCommand(Cmd);
|
||||
} else if (pos <= vpcCommands.size()) {
|
||||
} else if (pos <= static_cast<int>(vpcCommands.size())) {
|
||||
Command *tmp = new Command(Cmd);
|
||||
vpcCommands.insert(vpcCommands.begin()+pos,tmp);
|
||||
} else {
|
||||
|
@ -106,7 +106,7 @@ void Toolpath::deleteCommand(int pos)
|
|||
if (pos == -1) {
|
||||
//delete(*vpcCommands.rbegin()); // causes crash
|
||||
vpcCommands.pop_back();
|
||||
} else if (pos <= vpcCommands.size()) {
|
||||
} else if (pos <= static_cast<int>(vpcCommands.size())) {
|
||||
vpcCommands.erase (vpcCommands.begin()+pos);
|
||||
} else {
|
||||
throw Base::Exception("Index not in range");
|
||||
|
|
|
@ -134,7 +134,7 @@ bool TaskDlgPathCompound::accept()
|
|||
Path::FeatureCompound* pcCompound = static_cast<Path::FeatureCompound*>(CompoundView->getObject());
|
||||
App::Document* pcDoc = static_cast<App::Document*>(pcCompound->getDocument());
|
||||
std::vector<std::string> names = parameter->getList();
|
||||
for(int i = 0; i < names.size(); i++)
|
||||
for(std::size_t i = 0; i < names.size(); i++)
|
||||
{
|
||||
App::DocumentObject* pcPath = static_cast<App::DocumentObject*>(pcDoc->getObject(names[i].c_str()));
|
||||
paths.push_back(pcPath);
|
||||
|
|
|
@ -274,7 +274,7 @@ void ViewProviderPath::updateData(const App::Property* prop)
|
|||
else
|
||||
norm.Set(0,0,1);
|
||||
Base::Vector3d center = (last + cmd.getCenter());
|
||||
double radius = (last - center).Length();
|
||||
//double radius = (last - center).Length();
|
||||
double angle = (next - center).GetAngle(last - center);
|
||||
// BUGGY: not needed anyway?
|
||||
//Base::Vector3d anorm = (last - center) % (next - center);
|
||||
|
@ -308,7 +308,7 @@ void ViewProviderPath::updateData(const App::Property* prop)
|
|||
|
||||
} else if ((name=="G81")||(name=="G82")||(name=="G83")||(name=="G84")||(name=="G85")||(name=="G86")||(name=="G89")){
|
||||
// drill,tap,bore
|
||||
double r;
|
||||
double r = 0;
|
||||
if (cmd.has("R"))
|
||||
r = cmd.getValue("R");
|
||||
Base::Vector3d p1(next.x,next.y,last.z);
|
||||
|
|
|
@ -82,7 +82,7 @@ public:
|
|||
void Offset(double inwards_value);
|
||||
void Thicken(double value);
|
||||
void FitArcs();
|
||||
unsigned int num_curves(){return m_curves.size();}
|
||||
unsigned int num_curves(){return static_cast<unsigned int>(m_curves.size());}
|
||||
Point NearestPoint(const Point& p)const;
|
||||
void GetBox(CBox2D &box);
|
||||
void Reorder();
|
||||
|
|
|
@ -428,17 +428,16 @@ void recur(std::list<CArea> &arealist, const CArea& a1, const CAreaPocketParams
|
|||
static CArea make_obround(const Point& p0, const Point& p1, double radius)
|
||||
{
|
||||
Point dir = p1 - p0;
|
||||
double d = dir.length();
|
||||
dir.normalize();
|
||||
Point right(dir.y, -dir.x);
|
||||
CArea obround;
|
||||
CCurve c;
|
||||
if(fabs(radius) < 0.0000001)radius = (radius > 0.0) ? 0.002 : (-0.002);
|
||||
if(fabs(radius) < 0.0000001)radius = (radius > 0.0) ? 0.002 : (-0.002);
|
||||
Point vt0 = p0 + right * radius;
|
||||
Point vt1 = p1 + right * radius;
|
||||
Point vt2 = p1 - right * radius;
|
||||
Point vt3 = p0 - right * radius;
|
||||
c.append(vt0);
|
||||
c.append(vt0);
|
||||
c.append(vt1);
|
||||
c.append(CVertex(1, vt2, p1));
|
||||
c.append(vt3);
|
||||
|
@ -446,12 +445,12 @@ static CArea make_obround(const Point& p0, const Point& p1, double radius)
|
|||
obround.append(c);
|
||||
return obround;
|
||||
}
|
||||
|
||||
|
||||
static bool feed_possible(const CArea &area_for_feed_possible, const Point& p0, const Point& p1, double tool_radius)
|
||||
{
|
||||
CArea obround = make_obround(p0, p1, tool_radius);
|
||||
obround.Subtract(area_for_feed_possible);
|
||||
return obround.m_curves.size() == 0;
|
||||
return obround.m_curves.empty();
|
||||
}
|
||||
|
||||
void MarkOverlappingOffsetIslands(std::list<IslandAndOffset> &offset_islands)
|
||||
|
|
|
@ -86,7 +86,7 @@ bool CCurve::CheckForArc(const CVertex& prev_vt, std::list<const CVertex*>& migh
|
|||
if(might_be_an_arc.size() < 2)return false;
|
||||
|
||||
// find middle point
|
||||
int num = might_be_an_arc.size();
|
||||
int num = static_cast<int>(might_be_an_arc.size());
|
||||
int i = 0;
|
||||
const CVertex* mid_vt = NULL;
|
||||
int mid_i = (num-1)/2;
|
||||
|
@ -465,7 +465,7 @@ void CCurve::ChangeStart(const Point &p) {
|
|||
|
||||
bool started = false;
|
||||
bool finished = false;
|
||||
int start_span;
|
||||
int start_span = 0;
|
||||
bool closed = IsClosed();
|
||||
|
||||
for(int i = 0; i < (closed ? 2:1); i++)
|
||||
|
@ -911,7 +911,6 @@ double CCurve::PointToPerim(const Point& p)const
|
|||
{
|
||||
double best_dist = 0.0;
|
||||
double perim_at_best_dist = 0.0;
|
||||
Point best_point = Point(0, 0);
|
||||
bool best_dist_found = false;
|
||||
|
||||
double perim = 0.0;
|
||||
|
|
|
@ -33,6 +33,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "Point.h"
|
||||
#include "kurve/geometry.h"
|
||||
|
||||
#if defined (_POSIX_C_SOURCE)
|
||||
# undef _POSIX_C_SOURCE
|
||||
#endif
|
||||
#if defined (_XOPEN_SOURCE)
|
||||
# undef _XOPEN_SOURCE
|
||||
#endif
|
||||
|
||||
#if _DEBUG
|
||||
#undef _DEBUG
|
||||
#include <Python.h>
|
||||
|
@ -86,7 +93,7 @@ boost::python::tuple transformed_point(const geoff_geometry::Matrix &matrix, dou
|
|||
|
||||
static void print_curve(const CCurve& c)
|
||||
{
|
||||
unsigned int nvertices = c.m_vertices.size();
|
||||
std::size_t nvertices = c.m_vertices.size();
|
||||
printf("number of vertices = %d\n", nvertices);
|
||||
int i = 0;
|
||||
for(std::list<CVertex>::const_iterator It = c.m_vertices.begin(); It != c.m_vertices.end(); It++, i++)
|
||||
|
@ -109,7 +116,7 @@ static void print_area(const CArea &a)
|
|||
|
||||
static unsigned int num_vertices(const CCurve& curve)
|
||||
{
|
||||
return curve.m_vertices.size();
|
||||
return static_cast<int>(curve.m_vertices.size());
|
||||
}
|
||||
|
||||
static CVertex FirstVertex(const CCurve& curve)
|
||||
|
|
|
@ -152,9 +152,9 @@ void Trajectory::generateTrajectory(void)
|
|||
pcTrajectory = new KDL::Trajectory_Composite();
|
||||
|
||||
// pointer to the pieces while iterating
|
||||
KDL::Trajectory_Segment *pcTrak;
|
||||
KDL::Path *pcPath;
|
||||
KDL::VelocityProfile *pcVelPrf;
|
||||
KDL::Trajectory_Segment *pcTrak=0;
|
||||
KDL::Path *pcPath=0;
|
||||
KDL::VelocityProfile *pcVelPrf=0;
|
||||
KDL::Path_RoundedComposite *pcRoundComp=0;
|
||||
KDL::Frame Last;
|
||||
|
||||
|
|
|
@ -70,14 +70,14 @@ void CmdRobotExportKukaCompact::activated(int iMsg)
|
|||
std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
|
||||
|
||||
|
||||
Robot::RobotObject *pcRobotObject;
|
||||
Robot::RobotObject *pcRobotObject=0;
|
||||
if(Sel[0].pObject->getTypeId() == Robot::RobotObject::getClassTypeId())
|
||||
pcRobotObject = dynamic_cast<Robot::RobotObject*>(Sel[0].pObject);
|
||||
else if(Sel[1].pObject->getTypeId() == Robot::RobotObject::getClassTypeId())
|
||||
pcRobotObject = dynamic_cast<Robot::RobotObject*>(Sel[1].pObject);
|
||||
std::string RoboName = pcRobotObject->getNameInDocument();
|
||||
|
||||
Robot::TrajectoryObject *pcTrajectoryObject;
|
||||
Robot::TrajectoryObject *pcTrajectoryObject=0;
|
||||
if(Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
|
||||
pcTrajectoryObject = dynamic_cast<Robot::TrajectoryObject*>(Sel[0].pObject);
|
||||
else if(Sel[1].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
|
||||
|
@ -135,14 +135,14 @@ void CmdRobotExportKukaFull::activated(int iMsg)
|
|||
std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
|
||||
|
||||
|
||||
Robot::RobotObject *pcRobotObject;
|
||||
Robot::RobotObject *pcRobotObject=0;
|
||||
if(Sel[0].pObject->getTypeId() == Robot::RobotObject::getClassTypeId())
|
||||
pcRobotObject = dynamic_cast<Robot::RobotObject*>(Sel[0].pObject);
|
||||
else if(Sel[1].pObject->getTypeId() == Robot::RobotObject::getClassTypeId())
|
||||
pcRobotObject = dynamic_cast<Robot::RobotObject*>(Sel[1].pObject);
|
||||
std::string RoboName = pcRobotObject->getNameInDocument();
|
||||
|
||||
Robot::TrajectoryObject *pcTrajectoryObject;
|
||||
Robot::TrajectoryObject *pcTrajectoryObject=0;
|
||||
if(Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
|
||||
pcTrajectoryObject = dynamic_cast<Robot::TrajectoryObject*>(Sel[0].pObject);
|
||||
else if(Sel[1].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
|
||||
|
|
|
@ -115,14 +115,14 @@ void CmdRobotInsertWaypoint::activated(int iMsg)
|
|||
|
||||
std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
|
||||
|
||||
Robot::RobotObject *pcRobotObject;
|
||||
Robot::RobotObject *pcRobotObject=0;
|
||||
if(Sel[0].pObject->getTypeId() == Robot::RobotObject::getClassTypeId())
|
||||
pcRobotObject = dynamic_cast<Robot::RobotObject*>(Sel[0].pObject);
|
||||
else if(Sel[1].pObject->getTypeId() == Robot::RobotObject::getClassTypeId())
|
||||
pcRobotObject = dynamic_cast<Robot::RobotObject*>(Sel[1].pObject);
|
||||
std::string RoboName = pcRobotObject->getNameInDocument();
|
||||
|
||||
Robot::TrajectoryObject *pcTrajectoryObject;
|
||||
Robot::TrajectoryObject *pcTrajectoryObject=0;
|
||||
if(Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
|
||||
pcTrajectoryObject = dynamic_cast<Robot::TrajectoryObject*>(Sel[0].pObject);
|
||||
else if(Sel[1].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId())
|
||||
|
|
|
@ -52,7 +52,7 @@ void DocumentThread::run()
|
|||
{
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
DocumentProtector dp(doc);
|
||||
App::DocumentObject* obj = dp.addObject("Mesh::Ellipsoid", (const char*)objectName().toAscii());
|
||||
dp.addObject("Mesh::Ellipsoid", (const char*)objectName().toAscii());
|
||||
dp.recompute();
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,7 @@ void WorkerThread::run()
|
|||
}
|
||||
seq.next(true);
|
||||
}
|
||||
Q_UNUSED(val);
|
||||
}
|
||||
|
||||
// --------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user