Skip to content

Commit 1de6eb7

Browse files
committed
chore: Fix Clang-Tidy warnings in prop_override
1 parent 5c654a9 commit 1de6eb7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/src/main/cpp/prop_override.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ char *GetPropOverride(const std::string &key) {
2525
extern "C" int property_get(const char *key, char *value, const char *default_value) {
2626
auto replacement = GetPropOverride(std::string(key));
2727
if (replacement) {
28-
int len = strnlen(replacement, PROP_VALUE_MAX);
28+
auto len = static_cast<int>(strnlen(replacement, PROP_VALUE_MAX));
2929

3030
strncpy(value, replacement, len);
3131
return len;
3232
}
3333

34-
static property_get_ptr original = NULL;
34+
static property_get_ptr original = nullptr;
3535
if (!original) {
3636
// Get the address of the original function.
3737
original = reinterpret_cast<property_get_ptr>(dlsym(RTLD_NEXT, "property_get"));
@@ -50,10 +50,10 @@ std::string GetProperty(const std::string &, const std::string &) asm(GET_PROPER
5050
std::string GetProperty(const std::string &key, const std::string &default_value) {
5151
auto replacement = GetPropOverride(key);
5252
if (replacement) {
53-
return std::string(replacement);
53+
return {replacement};
5454
}
5555

56-
static GetProperty_ptr original = NULL;
56+
static GetProperty_ptr original = nullptr;
5757
if (!original) {
5858
original = reinterpret_cast<GetProperty_ptr>(dlsym(RTLD_NEXT, GET_PROPERTY_MANGLED_NAME));
5959
}

0 commit comments

Comments
 (0)