summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2014-12-04 01:10:43 +1100
committerLeith Bade <leith@mapbox.com>2014-12-04 01:10:43 +1100
commit14cdd9c96fb6eb9b2d6de4eb521ad50ebe1654ba (patch)
tree4270e25a7494939afa83be3642a54475636a1aac /platform/android
parenta26ef7f33df475b6a0e90a0f4362f18802bafe8f (diff)
downloadqtlocation-mapboxgl-14cdd9c96fb6eb9b2d6de4eb521ad50ebe1654ba.tar.gz
Rename lots of things
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/asset_request_baton_libzip.cpp30
-rw-r--r--platform/android/cache_database_data.cpp2
-rw-r--r--platform/android/log_android.cpp12
3 files changed, 22 insertions, 22 deletions
diff --git a/platform/android/asset_request_baton_libzip.cpp b/platform/android/asset_request_baton_libzip.cpp
index 628e9c93b6..7fc86ae1be 100644
--- a/platform/android/asset_request_baton_libzip.cpp
+++ b/platform/android/asset_request_baton_libzip.cpp
@@ -24,20 +24,20 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) {
}
int error = 0;
- struct zip *apk = zip_open(mbgl::android::apk_path.c_str(), 0, &error);
+ struct zip *apk = zip_open(mbgl::android::apkPath.c_str(), 0, &error);
if ((apk == nullptr) || ptr->canceled || !ptr->request) {
// Opening the APK failed or was canceled. There isn't much left we can do.
- const int message_size = zip_error_to_str(nullptr, 0, error, errno);
- const std::unique_ptr<char[]> message = mbgl::util::make_unique<char[]>(message_size);
+ const int messageSize = zip_error_to_str(nullptr, 0, error, errno);
+ const std::unique_ptr<char[]> message = mbgl::util::make_unique<char[]>(messageSize);
zip_error_to_str(message.get(), 0, error, errno);
notify_error(ptr, 500, message.get());
cleanup(ptr);
return;
}
- std::string apk_file_path = "assets/" + ptr->path;
- struct zip_file *apk_file = zip_fopen(apk, apk_file_path.c_str(), ZIP_FL_NOCASE);
- if ((apk_file == nullptr) || ptr->canceled || !ptr->request) {
+ std::string apkFilePath = "assets/" + ptr->path;
+ struct zip_file *apkFile = zip_fopen(apk, apkFilePath.c_str(), ZIP_FL_NOCASE);
+ if ((apkFile == nullptr) || ptr->canceled || !ptr->request) {
// Opening the asset failed or was canceled. We already have an open file handle
// though, which we'll have to close.
zip_error_get(apk, &error, nullptr);
@@ -49,12 +49,12 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) {
}
struct zip_stat stat;
- if ((zip_stat(apk, apk_file_path.c_str(), ZIP_FL_NOCASE, &stat) != 0) || ptr->canceled || !ptr->request) {
+ if ((zip_stat(apk, apkFilePath.c_str(), ZIP_FL_NOCASE, &stat) != 0) || ptr->canceled || !ptr->request) {
// Stating failed or was canceled. We already have an open file handle
// though, which we'll have to close.
notify_error(ptr, 500, zip_strerror(apk));
- zip_fclose(apk_file);
- apk_file = nullptr;
+ zip_fclose(apkFile);
+ apkFile = nullptr;
zip_close(apk);
apk = nullptr;
cleanup(ptr);
@@ -63,12 +63,12 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) {
const std::unique_ptr<char[]> data = mbgl::util::make_unique<char[]>(stat.size);
- if (static_cast<zip_uint64_t>(zip_fread(apk_file, reinterpret_cast<void *>(data.get()), stat.size)) != stat.size || ptr->canceled || !ptr->request) {
+ if (static_cast<zip_uint64_t>(zip_fread(apkFile, reinterpret_cast<void *>(data.get()), stat.size)) != stat.size || ptr->canceled || !ptr->request) {
// Reading failed or was canceled. We already have an open file handle
// though, which we'll have to close.
- notify_error(ptr, 500, zip_file_strerror(apk_file));
- zip_fclose(apk_file);
- apk_file = nullptr;
+ notify_error(ptr, 500, zip_file_strerror(apkFile));
+ zip_fclose(apkFile);
+ apkFile = nullptr;
zip_close(apk);
apk = nullptr;
cleanup(ptr);
@@ -83,10 +83,10 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) {
ptr->request->notify();
}
- if (zip_fclose(apk_file) != 0) {
+ if (zip_fclose(apkFile) != 0) {
// Closing the asset failed. But there isn't anything we can do.
}
- apk_file = nullptr;
+ apkFile = nullptr;
if (zip_close(apk) != 0) {
// Closing the APK failed. But there isn't anything we can do.
diff --git a/platform/android/cache_database_data.cpp b/platform/android/cache_database_data.cpp
index aff1412687..2fefcdc4a3 100644
--- a/platform/android/cache_database_data.cpp
+++ b/platform/android/cache_database_data.cpp
@@ -6,7 +6,7 @@ namespace platform {
// Returns the path to the default cache database on this system.
std::string defaultCacheDatabase() {
- return mbgl::android::cache_path + "/mbgl-cache.db";
+ return mbgl::android::cachePath + "/mbgl-cache.db";
}
}
diff --git a/platform/android/log_android.cpp b/platform/android/log_android.cpp
index 8a7e9df518..5e40ce33bd 100644
--- a/platform/android/log_android.cpp
+++ b/platform/android/log_android.cpp
@@ -9,7 +9,7 @@
namespace mbgl {
-int AndroidLogBackend::severity_to_priority(EventSeverity severity) {
+int AndroidLogBackend::severityToPriority(EventSeverity severity) {
switch(severity) {
case EventSeverity::Debug:
return ANDROID_LOG_DEBUG;
@@ -22,14 +22,14 @@ int AndroidLogBackend::severity_to_priority(EventSeverity severity) {
case EventSeverity::Error:
return ANDROID_LOG_ERROR;
-
+
default:
return ANDROID_LOG_VERBOSE;
}
}
void AndroidLogBackend::record(EventSeverity severity, Event event, const std::string &msg) {
- __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "%s", msg.c_str());
+ __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "%s", msg.c_str());
}
void AndroidLogBackend::record(EventSeverity severity, Event event, const char* format, ...) {
@@ -42,18 +42,18 @@ void AndroidLogBackend::record(EventSeverity severity, Event event, const char*
va_end(args);
- __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "%s", buf);
+ __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "%s", buf);
delete buf;
buf = nullptr;
}
void AndroidLogBackend::record(EventSeverity severity, Event event, int64_t code) {
- __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "(%" PRId64 ")", code);
+ __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "(%" PRId64 ")", code);
}
void AndroidLogBackend::record(EventSeverity severity, Event event, int64_t code, const std::string &msg) {
- __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "(%" PRId64 ") %s", code, msg.c_str());
+ __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "(%" PRId64 ") %s", code, msg.c_str());
}
}