Merge "Const modifiers"
am: 4efd353d8f
Change-Id: I8ae993749d5f2c58cc5ef23f90845cf5a0bf756d
This commit is contained in:
commit
92d8772c49
6 changed files with 11 additions and 11 deletions
|
@ -89,7 +89,7 @@ static int __ota_fclose(FILE* fh) {
|
||||||
return fclose(fh);
|
return fclose(fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OtaFcloser::operator()(FILE* f) {
|
void OtaFcloser::operator()(FILE* f) const {
|
||||||
__ota_fclose(f);
|
__ota_fclose(f);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ using unique_fd = android::base::unique_fd_impl<OtaCloser>;
|
||||||
int ota_close(unique_fd& fd);
|
int ota_close(unique_fd& fd);
|
||||||
|
|
||||||
struct OtaFcloser {
|
struct OtaFcloser {
|
||||||
void operator()(FILE*);
|
void operator()(FILE*) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
using unique_file = std::unique_ptr<FILE, OtaFcloser>;
|
using unique_file = std::unique_ptr<FILE, OtaFcloser>;
|
||||||
|
|
|
@ -98,7 +98,7 @@ GRSurface* ScreenRecoveryUI::GetCurrentText() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ScreenRecoveryUI::PixelsFromDp(int dp) {
|
int ScreenRecoveryUI::PixelsFromDp(int dp) const {
|
||||||
return dp * density_;
|
return dp * density_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,12 +256,12 @@ void ScreenRecoveryUI::DrawHorizontalRule(int* y) {
|
||||||
*y += 4;
|
*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);
|
gr_text(gr_sys_font(), x, *y, line, bold);
|
||||||
*y += char_height_ + 4;
|
*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) {
|
for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) {
|
||||||
DrawTextLine(x, y, lines[i], false);
|
DrawTextLine(x, y, lines[i], false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,14 +160,14 @@ class ScreenRecoveryUI : public RecoveryUI {
|
||||||
void LoadBitmap(const char* filename, GRSurface** surface);
|
void LoadBitmap(const char* filename, GRSurface** surface);
|
||||||
void LoadLocalizedBitmap(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 GetAnimationBaseline();
|
||||||
virtual int GetProgressBaseline();
|
virtual int GetProgressBaseline();
|
||||||
virtual int GetTextBaseline();
|
virtual int GetTextBaseline();
|
||||||
|
|
||||||
void DrawHorizontalRule(int* y);
|
void DrawHorizontalRule(int* y);
|
||||||
void DrawTextLine(int x, int* y, const char* line, bool bold);
|
void DrawTextLine(int x, int* y, const char* line, bool bold) const;
|
||||||
void DrawTextLines(int x, int* y, const char* const* lines);
|
void DrawTextLines(int x, int* y, const char* const* lines) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RECOVERY_UI_H
|
#endif // RECOVERY_UI_H
|
||||||
|
|
|
@ -376,7 +376,7 @@ std::unique_ptr<RSA, RSADeleter> parse_rsa_key(FILE* file, uint32_t exponent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct BNDeleter {
|
struct BNDeleter {
|
||||||
void operator()(BIGNUM* bn) {
|
void operator()(BIGNUM* bn) const {
|
||||||
BN_free(bn);
|
BN_free(bn);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,13 +26,13 @@
|
||||||
#include <openssl/sha.h>
|
#include <openssl/sha.h>
|
||||||
|
|
||||||
struct RSADeleter {
|
struct RSADeleter {
|
||||||
void operator()(RSA* rsa) {
|
void operator()(RSA* rsa) const {
|
||||||
RSA_free(rsa);
|
RSA_free(rsa);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ECKEYDeleter {
|
struct ECKEYDeleter {
|
||||||
void operator()(EC_KEY* ec_key) {
|
void operator()(EC_KEY* ec_key) const {
|
||||||
EC_KEY_free(ec_key);
|
EC_KEY_free(ec_key);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue