Browse files

better c++ style as per mapnik conventions

  • Loading branch information...
1 parent 3a02935 commit 38dd2ab3c95fe5215c4f0569ea4f96f4d5e78f6e @springmeyer springmeyer committed Apr 12, 2012
View
4 src/ds_emitter.hpp
@@ -136,7 +136,7 @@ static void describe_datasource(Local<Object> description, mapnik::datasource_pt
}
}
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
ThrowException(Exception::Error(
String::New(ex.what())));
@@ -193,7 +193,7 @@ static void datasource_features(Local<Array> a, mapnik::datasource_ptr ds, unsig
}
}
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_color.cpp
@@ -85,7 +85,7 @@ Handle<Value> Color::New(const Arguments& args)
// todo allow int,int,int and int,int,int,int contructor
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
8 src/mapnik_datasource.cpp
@@ -105,7 +105,7 @@ Handle<Value> Datasource::New(const Arguments& args)
{
ds = mapnik::datasource_cache::create(params, bind);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -170,7 +170,7 @@ Handle<Value> Datasource::describe(const Arguments& args)
{
node_mapnik::describe_datasource(description,d->datasource_);
}
- catch (const std::exception & ex )
+ catch (std::exception const& ex )
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -209,7 +209,7 @@ Handle<Value> Datasource::features(const Arguments& args)
{
node_mapnik::datasource_features(a,d->datasource_,first,last);
}
- catch (const std::exception & ex )
+ catch (std::exception const& ex )
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -246,7 +246,7 @@ Handle<Value> Datasource::featureset(const Arguments& args)
fs = ds->datasource_->features(q);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_expression.cpp
@@ -56,7 +56,7 @@ Handle<Value> Expression::New(const Arguments& args)
String::New("invalid arguments: accepts a single argument of string type")));
}
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
4 src/mapnik_feature.cpp
@@ -166,7 +166,7 @@ Handle<Value> Feature::addGeometry(const Arguments& args)
String::New("empty geometry!")));
}
}
- catch (const std::exception & ex )
+ catch (std::exception const& ex )
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -222,7 +222,7 @@ Handle<Value> Feature::addAttributes(const Arguments& args)
i++;
}
}
- catch (const std::exception & ex )
+ catch (std::exception const& ex )
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_featureset.cpp
@@ -57,7 +57,7 @@ Handle<Value> Featureset::next(const Arguments& args)
{
fp = fs->this_->next();
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_fonts.hpp
@@ -66,7 +66,7 @@ static inline Handle<Value> register_fonts(const Arguments& args)
return scope.Close(Boolean::New(found));
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_image.cpp
@@ -487,7 +487,7 @@ Handle<Value> Image::save(const Arguments& args)
{
mapnik::save_to_file<mapnik::image_data_32>(im->get()->data(),filename);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_image_view.cpp
@@ -390,7 +390,7 @@ Handle<Value> ImageView::save(const Arguments& args)
{
save_to_file(*im->get(),filename);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_js_datasource.cpp
@@ -91,7 +91,7 @@ Handle<Value> JSDatasource::New(const Arguments& args)
ds = mapnik::datasource_ptr(new js_datasource(params,bind,args[args.Length()-1]));
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
24 src/mapnik_map.cpp
@@ -617,7 +617,7 @@ void Map::EIO_Load(uv_work_t* req)
{
mapnik::load_map(*closure->m->map_,closure->stylesheet,closure->strict);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
closure->error = true;
closure->error_name = ex.what();
@@ -675,7 +675,7 @@ Handle<Value> Map::loadSync(const Arguments& args)
{
mapnik::load_map(*m->map_,stylesheet,strict);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -743,7 +743,7 @@ Handle<Value> Map::fromStringSync(const Arguments& args)
{
mapnik::load_map_string(*m->map_,stylesheet,strict,base_path);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -841,7 +841,7 @@ void Map::EIO_FromString(uv_work_t* req)
{
mapnik::load_map_string(*closure->m->map_,closure->stylesheet,closure->strict,closure->base_url);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
closure->error = true;
closure->error_name = ex.what();
@@ -911,7 +911,7 @@ Handle<Value> Map::zoomAll(const Arguments& args)
try {
m->map_->zoom_all();
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -1218,7 +1218,7 @@ void Map::EIO_RenderGrid(uv_work_t* req)
ren.apply(layer,attributes);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
closure->error = true;
closure->error_name = ex.what();
@@ -1274,7 +1274,7 @@ void Map::EIO_RenderImage(uv_work_t* req)
closure->offset_y);
ren.apply();
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
closure->error = true;
closure->error_name = ex.what();
@@ -1442,7 +1442,7 @@ void Map::EIO_RenderFile(uv_work_t* req)
}
}
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
closure->error = true;
closure->error_name = ex.what();
@@ -1609,7 +1609,7 @@ Handle<Value> Map::renderLayerSync(const Arguments& args)
ren.apply(layer,attributes);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -1673,7 +1673,7 @@ Handle<Value> Map::renderSync(const Arguments& args)
s = save_to_string(im, format);
}
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -1776,7 +1776,7 @@ Handle<Value> Map::renderFileSync(const Arguments& args)
}
}
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -1994,7 +1994,7 @@ void Map::EIO_RenderGrid2(uv_work_t* req)
mapnik::layer const& layer = layers[closure->layer_idx];
ren.apply(layer,attributes);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
closure->error = true;
closure->error_name = ex.what();
View
4 src/mapnik_memory_datasource.cpp
@@ -139,7 +139,7 @@ Handle<Value> MemoryDatasource::describe(const Arguments& args)
try {
node_mapnik::describe_datasource(description,d->datasource_);
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -175,7 +175,7 @@ Handle<Value> MemoryDatasource::features(const Arguments& args)
{
node_mapnik::datasource_features(a,d->datasource_,first,last);
}
- catch (const std::exception & ex )
+ catch (std::exception const& ex )
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
2 src/mapnik_palette.cpp
@@ -70,7 +70,7 @@ Handle<Value> Palette::New(const Arguments& args) {
p->Wrap(args.This());
return args.This();
}
- catch (const std::exception & ex) {
+ catch (std::exception const& ex) {
return ThrowException(Exception::Error(String::New(ex.what())));
}
}
View
2 src/mapnik_projection.cpp
@@ -45,7 +45,7 @@ Handle<Value> Projection::New(const Arguments& args)
p->Wrap(args.This());
return args.This();
}
- catch (const std::exception & ex)
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
View
1 tools/fix_cpp_style.sh
@@ -1,4 +1,3 @@
-echo `pwd`
for file in $(find ./src/ -name '*.*')
do
emacs -batch $file -l `pwd`/tools/cpp.el -f fixup

0 comments on commit 38dd2ab

Please sign in to comment.