From df08914549e9ec1d3c36725315a8eea261144990 Mon Sep 17 00:00:00 2001 From: Mike Stewart Date: Fri, 20 Jan 2012 16:21:50 -0800 Subject: [PATCH] Better fix for building protobufs with C++0x turned on. --- .../compiler/command_line_interface.cc | 2 +- plugins/mapexport/mapexport.cpp | 66 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/library/depends/protobuf/google/protobuf/compiler/command_line_interface.cc b/library/depends/protobuf/google/protobuf/compiler/command_line_interface.cc index 8cdd2ccf7..88850f2cd 100644 --- a/library/depends/protobuf/google/protobuf/compiler/command_line_interface.cc +++ b/library/depends/protobuf/google/protobuf/compiler/command_line_interface.cc @@ -910,7 +910,7 @@ bool CommandLineInterface::InterpretArgument(const string& name, cerr << disk_path << ": warning: directory does not exist." << endl; } - proto_path_.push_back(make_pair(virtual_path.c_str(), disk_path.c_str())); + proto_path_.push_back(pair(virtual_path, disk_path)); } } else if (name == "-o" || name == "--descriptor_set_out") { diff --git a/plugins/mapexport/mapexport.cpp b/plugins/mapexport/mapexport.cpp index 4fe10c80c..90777c2ee 100644 --- a/plugins/mapexport/mapexport.cpp +++ b/plugins/mapexport/mapexport.cpp @@ -45,13 +45,13 @@ DFhackCExport command_result mapexport (Core * c, std::vector & pa return CR_OK; } } - std::string filename; - if (parameters.size() < 1) - { - c->con.printerr("Please supply a filename.\n"); - return CR_OK; - } - filename = parameters[0]; + std::string filename; + if (parameters.size() < 1) + { + c->con.printerr("Please supply a filename.\n"); + return CR_OK; + } + filename = parameters[0]; bool showHidden = true; @@ -84,10 +84,10 @@ DFhackCExport command_result mapexport (Core * c, std::vector & pa c->con.printerr("Unable to read vegetation; plants won't be listed!\n" ); } - dfproto::Map protomap; - protomap.set_x_size(x_max); - protomap.set_y_size(y_max); - protomap.set_z_size(z_max); + dfproto::Map protomap; + protomap.set_x_size(x_max); + protomap.set_y_size(y_max); + protomap.set_z_size(z_max); DFHack::t_feature blockFeatureGlobal; DFHack::t_feature blockFeatureLocal; @@ -106,10 +106,10 @@ DFhackCExport command_result mapexport (Core * c, std::vector & pa continue; } - dfproto::Block *protoblock = protomap.add_block(); - protoblock->set_x(b_x); - protoblock->set_y(b_y); - protoblock->set_z(z); + dfproto::Block *protoblock = protomap.add_block(); + protoblock->set_x(b_x); + protoblock->set_y(b_y); + protoblock->set_z(z); { // Find features uint32_t index = b->raw.global_feature; @@ -138,9 +138,9 @@ DFhackCExport command_result mapexport (Core * c, std::vector & pa continue; } - dfproto::Tile *prototile = protoblock->add_tile(); - prototile->set_x(x); - prototile->set_y(y); + dfproto::Tile *prototile = protoblock->add_tile(); + prototile->set_x(x); + prototile->set_y(y); // Check for liquid if (des.bits.flow_size) @@ -152,7 +152,7 @@ DFhackCExport command_result mapexport (Core * c, std::vector & pa uint16_t type = b->TileTypeAt(coord); const DFHack::TileRow *info = DFHack::getTileRow(type); - prototile->set_type((dfproto::Tile::TileType)info->shape); + prototile->set_type((dfproto::Tile::TileType)info->shape); /*switch (info->shape) { case DFHack::WALL: @@ -170,20 +170,20 @@ DFhackCExport command_result mapexport (Core * c, std::vector & pa } // block y } // z - std::ofstream output(filename, std::ios::out | std::ios::trunc | std::ios::binary); - if (!output.is_open()) - { - c->con.printerr("Couldn't open the output file.\n"); - c->Resume(); - return CR_FAILURE; - } - if (!protomap.SerializeToOstream(&output)) - { - c->con.printerr("Failed to save map file.\n"); - c->Resume(); - return CR_FAILURE; - } - c->con.print("Map succesfully exported.\n"); + std::ofstream output(filename, std::ios::out | std::ios::trunc | std::ios::binary); + if (!output.is_open()) + { + c->con.printerr("Couldn't open the output file.\n"); + c->Resume(); + return CR_FAILURE; + } + if (!protomap.SerializeToOstream(&output)) + { + c->con.printerr("Failed to save map file.\n"); + c->Resume(); + return CR_FAILURE; + } + c->con.print("Map succesfully exported.\n"); c->Resume(); return CR_OK; }