Skip to content

Commit 089bb95

Browse files
committed
Fix previous commit on gcc
1 parent 7786b89 commit 089bb95

5 files changed

Lines changed: 18 additions & 20 deletions

File tree

src/ifcconvert/ColladaSerializer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void ColladaSerializer::ColladaExporter::ColladaScene::add(
225225
node.addMatrix(matrix_array);
226226
COLLADASW::InstanceGeometry instanceGeometry(mSW);
227227
instanceGeometry.setUrl ("#" + geom_name);
228-
foreach(std::string material_name, material_ids) {
228+
BOOST_FOREACH(std::string material_name, material_ids) {
229229
/// @todo This is done 6 times in this file, try to perform this once and be done with the material naming for the export.
230230
collada_id(material_name);
231231
COLLADASW::InstanceMaterial material (material_name, "#" + material_name);
@@ -364,7 +364,7 @@ bool ColladaSerializer::ColladaExporter::ColladaMaterials::contains(const IfcGeo
364364

365365
void ColladaSerializer::ColladaExporter::ColladaMaterials::write() {
366366
effects.close();
367-
foreach(const IfcGeom::Material& material, materials) {
367+
BOOST_FOREACH(const IfcGeom::Material& material, materials) {
368368
std::string material_name = (serializer->settings().get(SerializerSettings::USE_MATERIAL_NAMES)
369369
? material.original_name() : material.name());
370370
std::string material_name_unescaped = material_name; // workaround double-escaping that would occur in addInstanceEffect()
@@ -410,7 +410,7 @@ void ColladaSerializer::ColladaExporter::write(const IfcGeom::TriangulationEleme
410410
collada_id(representation_id);
411411

412412
std::vector<std::string> material_references;
413-
foreach(const IfcGeom::Material& material, mesh.materials()) {
413+
BOOST_FOREACH(const IfcGeom::Material& material, mesh.materials()) {
414414
if (!materials.contains(material)) {
415415
materials.add(material);
416416
}

src/ifcconvert/IfcConvert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ void validate(boost::any& v, const std::vector<std::string>& values, exclusion_t
913913
std::vector<IfcGeom::filter_t> setup_filters(const std::vector<geom_filter>& filters, const std::string& output_extension)
914914
{
915915
std::vector<IfcGeom::filter_t> filter_funcs;
916-
foreach(const geom_filter& f, filters) {
916+
BOOST_FOREACH(const geom_filter& f, filters) {
917917
if (f.type == geom_filter::ENTITY_TYPE) {
918918
entity_filter.include = f.include;
919919
entity_filter.traverse = f.traverse;

src/ifcconvert/XmlSerializer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <boost/property_tree/ptree.hpp>
2323
#include <boost/property_tree/xml_parser.hpp>
2424
#include <boost/version.hpp>
25+
#include <boost/foreach.hpp>
2526

2627
#include "XmlSerializer.h"
2728

@@ -340,16 +341,16 @@ void XmlSerializer::finalize() {
340341
ptree root, header, units, decomposition, properties, quantities, types, layers, materials;
341342

342343
// Write the SPF header as XML nodes.
343-
foreach(const std::string& s, file->header().file_description().description()) {
344+
BOOST_FOREACH(const std::string& s, file->header().file_description().description()) {
344345
header.add_child("file_description.description", ptree(s));
345346
}
346-
foreach(const std::string& s, file->header().file_name().author()) {
347+
BOOST_FOREACH(const std::string& s, file->header().file_name().author()) {
347348
header.add_child("file_name.author", ptree(s));
348349
}
349-
foreach(const std::string& s, file->header().file_name().organization()) {
350+
BOOST_FOREACH(const std::string& s, file->header().file_name().organization()) {
350351
header.add_child("file_name.organization", ptree(s));
351352
}
352-
foreach(const std::string& s, file->header().file_schema().schema_identifiers()) {
353+
BOOST_FOREACH(const std::string& s, file->header().file_schema().schema_identifiers()) {
353354
header.add_child("file_schema.schema_identifiers", ptree(s));
354355
}
355356
header.put("file_description.implementation_level", file->header().file_description().implementation_level());

src/ifcgeom/IfcGeomFilter.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "IfcGeom.h"
2727

28+
#include <boost/foreach.hpp>
2829
#include <boost/function.hpp>
2930
#include <boost/regex.hpp>
3031
#include <boost/algorithm/string/replace.hpp>
@@ -87,7 +88,7 @@ namespace IfcGeom
8788
void populate(const std::set<std::string>& patterns)
8889
{
8990
values.clear();
90-
foreach(const std::string &pattern, patterns) {
91+
BOOST_FOREACH(const std::string &pattern, patterns) {
9192
values.insert(wildcard_string_to_regex(pattern));
9293
}
9394
}
@@ -96,7 +97,7 @@ namespace IfcGeom
9697

9798
static bool match_values(const std::set<boost::regex>& values, const std::string &str)
9899
{
99-
foreach(const boost::regex& r, values) {
100+
BOOST_FOREACH(const boost::regex& r, values) {
100101
if (boost::regex_match(str, r)) {
101102
return true;
102103
}
@@ -108,7 +109,7 @@ namespace IfcGeom
108109
{
109110
// Escape all non-"*?" regex special chars
110111
static const std::string special_chars = "\\^.$|()[]+/";
111-
foreach(char c, special_chars) {
112+
BOOST_FOREACH(char c, special_chars) {
112113
std::string char_str(1, c);
113114
boost::replace_all(str, char_str, "\\" + char_str);
114115
}
@@ -180,7 +181,7 @@ namespace IfcGeom
180181

181182
ss << (traverse ? "traverse " : "") << (include ? "include" : "exclude");
182183
std::vector<std::string> patterns;
183-
foreach(const boost::regex& r, values) {
184+
BOOST_FOREACH(const boost::regex& r, values) {
184185
patterns.push_back("\"" + r.str() + "\"");
185186
}
186187

@@ -237,7 +238,7 @@ namespace IfcGeom
237238
std::stringstream ss;
238239
ss << (traverse ? "traverse " : "") << (include ? "include" : "exclude") << " layers";
239240
std::vector<std::string> str_values;
240-
foreach(const boost::regex& r, values) {
241+
BOOST_FOREACH(const boost::regex& r, values) {
241242
str_values.push_back(" \"" + r.str() + "\"");
242243
}
243244
ss << boost::algorithm::join(str_values, " ");
@@ -259,7 +260,7 @@ namespace IfcGeom
259260
void populate(const std::set<std::string>& types)
260261
{
261262
values.clear();
262-
foreach(const std::string& type, types) {
263+
BOOST_FOREACH(const std::string& type, types) {
263264
IfcSchema::Type::Enum ty;
264265
try {
265266
ty = IfcSchema::Type::FromString(boost::to_upper_copy(type));
@@ -274,7 +275,7 @@ namespace IfcGeom
274275
bool match(IfcSchema::IfcProduct* prod) const
275276
{
276277
// The set is iterated over to able to filter on subtypes.
277-
foreach(IfcSchema::Type::Enum type, values) {
278+
BOOST_FOREACH(IfcSchema::Type::Enum type, values) {
278279
if (prod->is(type)) {
279280
return true;
280281
}
@@ -291,7 +292,7 @@ namespace IfcGeom
291292
{
292293
std::stringstream ss;
293294
ss << (traverse ? "traverse " : "") << (include ? "include" : "exclude") << " entities";
294-
foreach(IfcSchema::Type::Enum type, values) {
295+
BOOST_FOREACH(IfcSchema::Type::Enum type, values) {
295296
ss << " " << IfcSchema::Type::ToString(type);
296297
}
297298
description = ss.str();

src/ifcparse/Argument.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838

3939
#include <boost/shared_ptr.hpp>
4040
#include <boost/dynamic_bitset.hpp>
41-
#include <boost/foreach.hpp>
42-
43-
#define foreach BOOST_FOREACH
44-
#define rforeach BOOST_REVERSE_FOREACH
4541

4642
class Argument;
4743
class IfcEntityList;

0 commit comments

Comments
 (0)