From 65253cba50b4e8233ff6bd323959270e64fae918 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 27 Apr 2016 14:00:14 -0700 Subject: [PATCH] Drag header files into C++ --- decode.cpp | 7 ++----- geojson.cpp | 13 +++++++------ geometry.cpp | 9 +++------ mbtiles.cpp | 9 +++------ mbtiles.h => mbtiles.hpp | 0 memfile.cpp | 5 +---- memfile.h => memfile.hpp | 0 pool.cpp | 5 +---- pool.h => pool.hpp | 0 projection.cpp | 5 +---- projection.h => projection.hpp | 0 tile-join.cpp | 11 ++++------- tile.cpp | 11 ++++------- tile.h => tile.hpp | 0 version.h => version.hpp | 0 15 files changed, 26 insertions(+), 49 deletions(-) rename mbtiles.h => mbtiles.hpp (100%) rename memfile.h => memfile.hpp (100%) rename pool.h => pool.hpp (100%) rename projection.h => projection.hpp (100%) rename tile.h => tile.hpp (100%) rename version.h => version.hpp (100%) diff --git a/decode.cpp b/decode.cpp index 4982bc4..f52d3d6 100644 --- a/decode.cpp +++ b/decode.cpp @@ -12,11 +12,8 @@ #include #include #include "mvt.hpp" -#include "tile.h" - -extern "C" { -#include "projection.h" -} +#include "tile.hpp" +#include "projection.hpp" void printq(const char *s) { putchar('"'); diff --git a/geojson.cpp b/geojson.cpp index 826daa3..2de135c 100644 --- a/geojson.cpp +++ b/geojson.cpp @@ -32,14 +32,15 @@ extern "C" { #include "jsonpull.h" -#include "tile.h" -#include "pool.h" -#include "mbtiles.h" -#include "projection.h" -#include "version.h" -#include "memfile.h" } +#include "tile.hpp" +#include "pool.hpp" +#include "mbtiles.hpp" +#include "projection.hpp" +#include "version.hpp" +#include "memfile.hpp" + static int low_detail = 12; static int full_detail = -1; static int min_detail = 7; diff --git a/geometry.cpp b/geometry.cpp index cb868f3..ce185d1 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -8,14 +8,11 @@ #include #include #include +#include #include "geometry.hpp" #include "clipper/clipper.hpp" - -extern "C" { -#include -#include "tile.h" -#include "projection.h" -} +#include "tile.hpp" +#include "projection.hpp" static int pnpoly(drawvec &vert, size_t start, size_t nvert, long long testx, long long testy); static int clip(double *x0, double *y0, double *x1, double *y1, double xmin, double ymin, double xmax, double ymax); diff --git a/mbtiles.cpp b/mbtiles.cpp index f7f018e..216bdbb 100644 --- a/mbtiles.cpp +++ b/mbtiles.cpp @@ -5,12 +5,9 @@ #include #include #include -#include "pool.h" -#include "tile.h" - -extern "C" { -#include "mbtiles.h" -}; +#include "pool.hpp" +#include "tile.hpp" +#include "mbtiles.hpp" sqlite3 *mbtiles_open(char *dbname, char **argv, int forcetable) { sqlite3 *outdb; diff --git a/mbtiles.h b/mbtiles.hpp similarity index 100% rename from mbtiles.h rename to mbtiles.hpp diff --git a/memfile.cpp b/memfile.cpp index d75cef3..a763c71 100644 --- a/memfile.cpp +++ b/memfile.cpp @@ -2,10 +2,7 @@ #include #include #include - -extern "C" { -#include "memfile.h" -} +#include "memfile.hpp" #define INCREMENT 131072 diff --git a/memfile.h b/memfile.hpp similarity index 100% rename from memfile.h rename to memfile.hpp diff --git a/pool.cpp b/pool.cpp index e6218fc..050a2c5 100644 --- a/pool.cpp +++ b/pool.cpp @@ -1,10 +1,7 @@ #include #include #include - -extern "C" { -#include "pool.h" -} +#include "pool.hpp" #define POOL_WIDTH 256 diff --git a/pool.h b/pool.hpp similarity index 100% rename from pool.h rename to pool.hpp diff --git a/projection.cpp b/projection.cpp index 534646c..521c7ed 100644 --- a/projection.cpp +++ b/projection.cpp @@ -1,8 +1,5 @@ #include - -extern "C" { -#include "projection.h" -} +#include "projection.hpp" // http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames void latlon2tile(double lat, double lon, int zoom, long long *x, long long *y) { diff --git a/projection.h b/projection.hpp similarity index 100% rename from projection.h rename to projection.hpp diff --git a/tile-join.cpp b/tile-join.cpp index 518ba4d..b265264 100644 --- a/tile-join.cpp +++ b/tile-join.cpp @@ -10,13 +10,10 @@ #include #include #include "mvt.hpp" -#include "tile.h" - -extern "C" { -#include "projection.h" -#include "pool.h" -#include "mbtiles.h" -} +#include "tile.hpp" +#include "projection.hpp" +#include "pool.hpp" +#include "mbtiles.hpp" std::string dequote(std::string s); diff --git a/tile.cpp b/tile.cpp index 389cb8e..c670019 100644 --- a/tile.cpp +++ b/tile.cpp @@ -21,13 +21,10 @@ #include #include "mvt.hpp" #include "geometry.hpp" - -extern "C" { -#include "tile.h" -#include "pool.h" -#include "mbtiles.h" -#include "projection.h" -} +#include "tile.hpp" +#include "pool.hpp" +#include "mbtiles.hpp" +#include "projection.hpp" #define CMD_BITS 3 diff --git a/tile.h b/tile.hpp similarity index 100% rename from tile.h rename to tile.hpp diff --git a/version.h b/version.hpp similarity index 100% rename from version.h rename to version.hpp