diff options
author | Lauren Budorick <lauren@mapbox.com> | 2017-04-11 15:02:25 -0700 |
---|---|---|
committer | Lauren Budorick <lauren@mapbox.com> | 2017-04-24 17:10:31 -0700 |
commit | 372ef5e7be2f853c369f14d47f297b138c0ae523 (patch) | |
tree | 66bb326c5cd1b7007c91bd1b4ae5605ded6ceae7 | |
parent | 924bc4f0e8b9877ab2e16964e5c2ba990df813a6 (diff) | |
download | qtlocation-mapboxgl-372ef5e7be2f853c369f14d47f297b138c0ae523.tar.gz |
Revert glfw formatting
-rw-r--r-- | platform/glfw/main.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp index c2d5244429..59d2ce3ec6 100644 --- a/platform/glfw/main.cpp +++ b/platform/glfw/main.cpp @@ -18,6 +18,7 @@ namespace { GLFWView* view = nullptr; + } void quit_handler(int) { @@ -29,7 +30,7 @@ void quit_handler(int) { } } -int main(int argc, char* argv[]) { +int main(int argc, char *argv[]) { bool fullscreen = false; bool benchmark = false; std::string style; @@ -37,22 +38,24 @@ int main(int argc, char* argv[]) { double bearing = 0, zoom = 1, pitch = 0; bool skipConfig = false; - const struct option long_options[] = { { "fullscreen", no_argument, 0, 'f' }, - { "benchmark", no_argument, 0, 'b' }, - { "style", required_argument, 0, 's' }, - { "lon", required_argument, 0, 'x' }, - { "lat", required_argument, 0, 'y' }, - { "zoom", required_argument, 0, 'z' }, - { "bearing", required_argument, 0, 'r' }, - { "pitch", required_argument, 0, 'p' }, - { 0, 0, 0, 0 } }; + const struct option long_options[] = { + {"fullscreen", no_argument, 0, 'f'}, + {"benchmark", no_argument, 0, 'b'}, + {"style", required_argument, 0, 's'}, + {"lon", required_argument, 0, 'x'}, + {"lat", required_argument, 0, 'y'}, + {"zoom", required_argument, 0, 'z'}, + {"bearing", required_argument, 0, 'r'}, + {"pitch", required_argument, 0, 'p'}, + {0, 0, 0, 0} + }; while (true) { int option_index = 0; int opt = getopt_long(argc, argv, "fbs:", long_options, &option_index); - if (opt == -1) - break; - switch (opt) { + if (opt == -1) break; + switch (opt) + { case 0: if (long_options[option_index].flag != 0) break; @@ -88,6 +91,7 @@ int main(int argc, char* argv[]) { default: break; } + } // sigint handling @@ -107,7 +111,7 @@ int main(int argc, char* argv[]) { mbgl::DefaultFileSource fileSource("/tmp/mbgl-cache.db", "."); // Set access token if present - const char* token = getenv("MAPBOX_ACCESS_TOKEN"); + const char *token = getenv("MAPBOX_ACCESS_TOKEN"); if (token == nullptr) { mbgl::Log::Warning(mbgl::Event::Setup, "no access token set. mapbox.com tiles won't work."); } else { @@ -127,8 +131,7 @@ int main(int argc, char* argv[]) { map.setLatLngZoom(mbgl::LatLng(latitude, longitude), zoom); map.setBearing(bearing); map.setPitch(pitch); - mbgl::Log::Info(mbgl::Event::General, "Location: %f/%f (z%.2f, %.2f deg)", latitude, - longitude, zoom, bearing); + mbgl::Log::Info(mbgl::Event::General, "Location: %f/%f (z%.2f, %.2f deg)", latitude, longitude, zoom, bearing); } else { map.setLatLngZoom(mbgl::LatLng(settings.latitude, settings.longitude), settings.zoom); map.setBearing(settings.bearing); @@ -136,22 +139,21 @@ int main(int argc, char* argv[]) { map.setDebug(mbgl::MapDebugOptions(settings.debug)); } - view->setChangeStyleCallback([&map]() { + view->setChangeStyleCallback([&map] () { static uint8_t currentStyleIndex; if (++currentStyleIndex == mbgl::util::default_styles::numOrderedStyles) { currentStyleIndex = 0; } - mbgl::util::default_styles::DefaultStyle newStyle = - mbgl::util::default_styles::orderedStyles[currentStyleIndex]; + mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[currentStyleIndex]; map.setStyleURL(newStyle.url); view->setWindowTitle(newStyle.name); mbgl::Log::Info(mbgl::Event::Setup, "Changed style to: %s", newStyle.name); }); - view->setPauseResumeCallback([&fileSource]() { + view->setPauseResumeCallback([&fileSource] () { static bool isPaused = false; if (isPaused) { @@ -165,10 +167,9 @@ int main(int argc, char* argv[]) { // Load style if (style.empty()) { - const char* url = getenv("MAPBOX_STYLE_URL"); + const char *url = getenv("MAPBOX_STYLE_URL"); if (url == nullptr) { - mbgl::util::default_styles::DefaultStyle newStyle = - mbgl::util::default_styles::orderedStyles[0]; + mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[0]; style = newStyle.url; view->setWindowTitle(newStyle.name); } else { @@ -198,4 +199,4 @@ int main(int argc, char* argv[]) { view = nullptr; return 0; -} +}
\ No newline at end of file |