Fixed warnings in Linux (old-style cast)

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2015-09-30 20:57:50 +03:00
parent 80d35507ca
commit c3fef2abd7
4 changed files with 18 additions and 18 deletions

View File

@ -196,7 +196,7 @@ bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface)
DL_Dxf::getStrippedLine(groupValue, DL_DXF_MAXLINE, fp) ) DL_Dxf::getStrippedLine(groupValue, DL_DXF_MAXLINE, fp) )
{ {
groupCode = (unsigned int)toInt(groupCodeTmp); groupCode = static_cast<unsigned int>(toInt(groupCodeTmp));
creationInterface->processCodeValuePair(groupCode, groupValue); creationInterface->processCodeValuePair(groupCode, groupValue);
line+=2; line+=2;
@ -222,7 +222,7 @@ bool DL_Dxf::readDxfGroups(std::stringstream& stream,
DL_Dxf::getStrippedLine(groupValue, DL_DXF_MAXLINE, stream) ) DL_Dxf::getStrippedLine(groupValue, DL_DXF_MAXLINE, stream) )
{ {
groupCode = (unsigned int)toInt(groupCodeTmp); groupCode = static_cast<unsigned int>(toInt(groupCodeTmp));
line+=2; line+=2;
processDXFGroup(creationInterface, groupCode, groupValue); processDXFGroup(creationInterface, groupCode, groupValue);
@ -427,7 +427,7 @@ bool DL_Dxf::processDXFGroup(DL_CreationInterface* creationInterface,
width, // width width, // width
linetype, // linetype linetype, // linetype
handle); // handle handle); // handle
attrib.setInPaperSpace((bool)getIntValue(67, 0)); attrib.setInPaperSpace(static_cast<bool>(getIntValue(67, 0)));
attrib.setLinetypeScale(getRealValue(48, 1.0)); attrib.setLinetypeScale(getRealValue(48, 1.0));
creationInterface->setAttributes(attrib); creationInterface->setAttributes(attrib);
@ -2323,7 +2323,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
hatchEdge.angle2 = toReal(groupValue)/360.0*2*M_PI; hatchEdge.angle2 = toReal(groupValue)/360.0*2*M_PI;
return true; return true;
case 73: case 73:
hatchEdge.ccw = (bool)toInt(groupValue); hatchEdge.ccw = static_cast<bool>(toInt(groupValue));
hatchEdge.defined = true; hatchEdge.defined = true;
return true; return true;
} }
@ -2356,7 +2356,7 @@ bool DL_Dxf::handleHatchData(DL_CreationInterface* creationInterface)
hatchEdge.angle2 = toReal(groupValue)/360.0*2*M_PI; hatchEdge.angle2 = toReal(groupValue)/360.0*2*M_PI;
return true; return true;
case 73: case 73:
hatchEdge.ccw = (bool)toInt(groupValue); hatchEdge.ccw = static_cast<bool>(toInt(groupValue));
hatchEdge.defined = true; hatchEdge.defined = true;
return true; return true;
} }
@ -2731,7 +2731,7 @@ void DL_Dxf::writePolyline(DL_WriterA& dw,
dw.entityAttributes(attrib); dw.entityAttributes(attrib);
dw.dxfString(100, "AcDbEntity"); dw.dxfString(100, "AcDbEntity");
dw.dxfString(100, "AcDbPolyline"); dw.dxfString(100, "AcDbPolyline");
dw.dxfInt(90, (int)data.number); dw.dxfInt(90, static_cast<int>(data.number));
dw.dxfInt(70, data.flags); dw.dxfInt(70, data.flags);
} }
else else
@ -3814,7 +3814,7 @@ void DL_Dxf::writeHatch1(DL_WriterA& dw,
{ {
dw.dxfString(2, "SOLID"); dw.dxfString(2, "SOLID");
} }
dw.dxfInt(70, (int)data.solid); dw.dxfInt(70, static_cast<int>(data.solid));
dw.dxfInt(71, 0); // non-associative dw.dxfInt(71, 0); // non-associative
dw.dxfInt(91, data.numLoops); dw.dxfInt(91, data.numLoops);
} }
@ -3931,7 +3931,7 @@ void DL_Dxf::writeHatchEdge(DL_WriterA& dw,
dw.dxfReal(40, data.radius); dw.dxfReal(40, data.radius);
dw.dxfReal(50, data.angle1/(2*M_PI)*360.0); dw.dxfReal(50, data.angle1/(2*M_PI)*360.0);
dw.dxfReal(51, data.angle2/(2*M_PI)*360.0); dw.dxfReal(51, data.angle2/(2*M_PI)*360.0);
dw.dxfInt(73, (int)(data.ccw)); dw.dxfInt(73, static_cast<int>((data.ccw)));
break; break;
// ellipse arc: // ellipse arc:
@ -3943,7 +3943,7 @@ void DL_Dxf::writeHatchEdge(DL_WriterA& dw,
dw.dxfReal(40, data.ratio); dw.dxfReal(40, data.ratio);
dw.dxfReal(50, data.angle1/(2*M_PI)*360.0); dw.dxfReal(50, data.angle1/(2*M_PI)*360.0);
dw.dxfReal(51, data.angle2/(2*M_PI)*360.0); dw.dxfReal(51, data.angle2/(2*M_PI)*360.0);
dw.dxfInt(73, (int)(data.ccw)); dw.dxfInt(73, static_cast<int>((data.ccw)));
break; break;
// spline: // spline:

View File

@ -516,7 +516,7 @@ public:
bool toBool(const std::string& str) bool toBool(const std::string& str)
{ {
char* p; char* p;
return (bool)strtol(str.c_str(), &p, 10); return static_cast<bool>(strtol(str.c_str(), &p, 10));
} }
std::string getStringValue(int code, const std::string& def) std::string getStringValue(int code, const std::string& def)

View File

@ -423,7 +423,7 @@ public:
} }
else else
{ {
dxfHex(5, h); dxfHex(5, static_cast<int>(h));
} }
dxfString(100, "AcDbSymbolTableRecord"); dxfString(100, "AcDbSymbolTableRecord");
dxfString(100, "AcDbLayerTableRecord"); dxfString(100, "AcDbLayerTableRecord");
@ -449,7 +449,7 @@ public:
} }
else else
{ {
dxfHex(5, h); dxfHex(5, static_cast<int>(h));
} }
//dxfHex(330, 0x5); //dxfHex(330, 0x5);
dxfString(100, "AcDbSymbolTableRecord"); dxfString(100, "AcDbSymbolTableRecord");
@ -476,7 +476,7 @@ public:
} }
else else
{ {
dxfHex(5, h); dxfHex(5, static_cast<int>(h));
} }
//dxfHex(330, 0x9); //dxfHex(330, 0x9);
dxfString(100, "AcDbSymbolTableRecord"); dxfString(100, "AcDbSymbolTableRecord");
@ -503,7 +503,7 @@ public:
} }
else else
{ {
dxfHex(5, h); dxfHex(5, static_cast<int>(h));
} }
//dxfHex(330, blockHandle); //dxfHex(330, blockHandle);
dxfString(100, "AcDbEntity"); dxfString(100, "AcDbEntity");
@ -535,7 +535,7 @@ public:
} }
else else
{ {
dxfHex(5, h); dxfHex(5, static_cast<int>(h));
} }
//dxfHex(330, blockHandle); //dxfHex(330, blockHandle);
dxfString(100, "AcDbEntity"); dxfString(100, "AcDbEntity");
@ -593,7 +593,7 @@ public:
unsigned long handle(int gc=5) const unsigned long handle(int gc=5) const
{ {
// handle has to be hex // handle has to be hex
dxfHex(gc, m_handle); dxfHex(gc, static_cast<int>(m_handle));
return m_handle++; return m_handle++;
} }
@ -682,7 +682,7 @@ public:
*/ */
virtual void dxfBool(int gc, bool value) const virtual void dxfBool(int gc, bool value) const
{ {
dxfInt(gc, (int)value); dxfInt(gc, static_cast<int>(value));
} }
/** /**

View File

@ -86,7 +86,7 @@ void DL_WriterA::dxfReal(int gc, double value) const
end = i+1; end = i+1;
} }
} }
if (end>0 && end<(int)strlen(str)) if (end>0 && end<static_cast<int>(strlen(str)))
{ {
str[end] = '\0'; str[end] = '\0';
} }