summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-24 21:34:37 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-03-24 21:34:37 +0100
commitd51bd8770a7bce1d2ead5b30e7bce71ea93b6af4 (patch)
tree0feff3c2e55eb9be9731cd46bf657a1bd0cd6c25
parentMerge "Removed C-style casts" am: 110155a604 (diff)
parentMerge "Const modifiers" (diff)
downloadandroid_bootable_recovery-d51bd8770a7bce1d2ead5b30e7bce71ea93b6af4.tar
android_bootable_recovery-d51bd8770a7bce1d2ead5b30e7bce71ea93b6af4.tar.gz
android_bootable_recovery-d51bd8770a7bce1d2ead5b30e7bce71ea93b6af4.tar.bz2
android_bootable_recovery-d51bd8770a7bce1d2ead5b30e7bce71ea93b6af4.tar.lz
android_bootable_recovery-d51bd8770a7bce1d2ead5b30e7bce71ea93b6af4.tar.xz
android_bootable_recovery-d51bd8770a7bce1d2ead5b30e7bce71ea93b6af4.tar.zst
android_bootable_recovery-d51bd8770a7bce1d2ead5b30e7bce71ea93b6af4.zip
-rw-r--r--otafault/ota_io.cpp2
-rw-r--r--otafault/ota_io.h2
-rw-r--r--screen_ui.cpp6
-rw-r--r--screen_ui.h6
-rw-r--r--verifier.cpp2
-rw-r--r--verifier.h4
6 files changed, 11 insertions, 11 deletions
diff --git a/otafault/ota_io.cpp b/otafault/ota_io.cpp
index f5b01136f..3a89bb5dd 100644
--- a/otafault/ota_io.cpp
+++ b/otafault/ota_io.cpp
@@ -89,7 +89,7 @@ static int __ota_fclose(FILE* fh) {
return fclose(fh);
}
-void OtaFcloser::operator()(FILE* f) {
+void OtaFcloser::operator()(FILE* f) const {
__ota_fclose(f);
};
diff --git a/otafault/ota_io.h b/otafault/ota_io.h
index 395b4230e..9428f1b1f 100644
--- a/otafault/ota_io.h
+++ b/otafault/ota_io.h
@@ -59,7 +59,7 @@ using unique_fd = android::base::unique_fd_impl<OtaCloser>;
int ota_close(unique_fd& fd);
struct OtaFcloser {
- void operator()(FILE*);
+ void operator()(FILE*) const;
};
using unique_file = std::unique_ptr<FILE, OtaFcloser>;
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 706877b4d..bb2772dd8 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -98,7 +98,7 @@ GRSurface* ScreenRecoveryUI::GetCurrentText() {
}
}
-int ScreenRecoveryUI::PixelsFromDp(int dp) {
+int ScreenRecoveryUI::PixelsFromDp(int dp) const {
return dp * density_;
}
@@ -256,12 +256,12 @@ void ScreenRecoveryUI::DrawHorizontalRule(int* y) {
*y += 4;
}
-void ScreenRecoveryUI::DrawTextLine(int x, int* y, const char* line, bool bold) {
+void ScreenRecoveryUI::DrawTextLine(int x, int* y, const char* line, bool bold) const {
gr_text(gr_sys_font(), x, *y, line, bold);
*y += char_height_ + 4;
}
-void ScreenRecoveryUI::DrawTextLines(int x, int* y, const char* const* lines) {
+void ScreenRecoveryUI::DrawTextLines(int x, int* y, const char* const* lines) const {
for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) {
DrawTextLine(x, y, lines[i], false);
}
diff --git a/screen_ui.h b/screen_ui.h
index b2dcf4aeb..a2322c36c 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -160,14 +160,14 @@ class ScreenRecoveryUI : public RecoveryUI {
void LoadBitmap(const char* filename, GRSurface** surface);
void LoadLocalizedBitmap(const char* filename, GRSurface** surface);
- int PixelsFromDp(int dp);
+ int PixelsFromDp(int dp) const;
virtual int GetAnimationBaseline();
virtual int GetProgressBaseline();
virtual int GetTextBaseline();
void DrawHorizontalRule(int* y);
- void DrawTextLine(int x, int* y, const char* line, bool bold);
- void DrawTextLines(int x, int* y, const char* const* lines);
+ void DrawTextLine(int x, int* y, const char* line, bool bold) const;
+ void DrawTextLines(int x, int* y, const char* const* lines) const;
};
#endif // RECOVERY_UI_H
diff --git a/verifier.cpp b/verifier.cpp
index 8be6da09f..2ef9c4c37 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -376,7 +376,7 @@ std::unique_ptr<RSA, RSADeleter> parse_rsa_key(FILE* file, uint32_t exponent) {
}
struct BNDeleter {
- void operator()(BIGNUM* bn) {
+ void operator()(BIGNUM* bn) const {
BN_free(bn);
}
};
diff --git a/verifier.h b/verifier.h
index 6bee74947..6fa8f2b0a 100644
--- a/verifier.h
+++ b/verifier.h
@@ -26,13 +26,13 @@
#include <openssl/sha.h>
struct RSADeleter {
- void operator()(RSA* rsa) {
+ void operator()(RSA* rsa) const {
RSA_free(rsa);
}
};
struct ECKEYDeleter {
- void operator()(EC_KEY* ec_key) {
+ void operator()(EC_KEY* ec_key) const {
EC_KEY_free(ec_key);
}
};