Loading libcutils/properties.c +15 −22 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ int8_t property_get_bool(const char *key, int8_t default_value) { } int8_t result = default_value; char buf[PROPERTY_VALUE_MAX] = {'\0',}; char buf[PROPERTY_VALUE_MAX] = {'\0'}; int len = property_get(key, buf, ""); if (len == 1) { Loading Loading @@ -65,7 +65,7 @@ static intmax_t property_get_imax(const char *key, intmax_t lower_bound, intmax_ } intmax_t result = default_value; char buf[PROPERTY_VALUE_MAX] = {'\0',}; char buf[PROPERTY_VALUE_MAX] = {'\0'}; char *end = NULL; int len = property_get(key, buf, ""); Loading @@ -86,8 +86,8 @@ static intmax_t property_get_imax(const char *key, intmax_t lower_bound, intmax_ } else if (end == buf) { // Numeric conversion failed result = default_value; ALOGV("%s(%s,%" PRIdMAX ") - numeric conversion failed", __FUNCTION__, key, default_value); ALOGV("%s(%s,%" PRIdMAX ") - numeric conversion failed", __FUNCTION__, key, default_value); } errno = tmp; Loading @@ -107,13 +107,11 @@ int32_t property_get_int32(const char *key, int32_t default_value) { #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include <sys/_system_properties.h> int property_set(const char *key, const char *value) { int property_set(const char *key, const char *value) { return __system_property_set(key, value); } int property_get(const char *key, char *value, const char *default_value) { int property_get(const char *key, char *value, const char *default_value) { int len; len = __system_property_get(key, value); Loading @@ -131,14 +129,12 @@ int property_get(const char *key, char *value, const char *default_value) return len; } struct property_list_callback_data { struct property_list_callback_data { void (*propfn)(const char *key, const char *value, void *cookie); void *cookie; }; static void property_list_callback(const prop_info *pi, void *cookie) { static void property_list_callback(const prop_info *pi, void *cookie) { char name[PROP_NAME_MAX]; char value[PROP_VALUE_MAX]; struct property_list_callback_data *data = cookie; Loading @@ -147,10 +143,7 @@ static void property_list_callback(const prop_info *pi, void *cookie) data->propfn(name, value, data->cookie); } int property_list( void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) { int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) { struct property_list_callback_data data = {propfn, cookie}; return __system_property_foreach(property_list_callback, &data); } Loading
libcutils/properties.c +15 −22 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ int8_t property_get_bool(const char *key, int8_t default_value) { } int8_t result = default_value; char buf[PROPERTY_VALUE_MAX] = {'\0',}; char buf[PROPERTY_VALUE_MAX] = {'\0'}; int len = property_get(key, buf, ""); if (len == 1) { Loading Loading @@ -65,7 +65,7 @@ static intmax_t property_get_imax(const char *key, intmax_t lower_bound, intmax_ } intmax_t result = default_value; char buf[PROPERTY_VALUE_MAX] = {'\0',}; char buf[PROPERTY_VALUE_MAX] = {'\0'}; char *end = NULL; int len = property_get(key, buf, ""); Loading @@ -86,8 +86,8 @@ static intmax_t property_get_imax(const char *key, intmax_t lower_bound, intmax_ } else if (end == buf) { // Numeric conversion failed result = default_value; ALOGV("%s(%s,%" PRIdMAX ") - numeric conversion failed", __FUNCTION__, key, default_value); ALOGV("%s(%s,%" PRIdMAX ") - numeric conversion failed", __FUNCTION__, key, default_value); } errno = tmp; Loading @@ -107,13 +107,11 @@ int32_t property_get_int32(const char *key, int32_t default_value) { #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include <sys/_system_properties.h> int property_set(const char *key, const char *value) { int property_set(const char *key, const char *value) { return __system_property_set(key, value); } int property_get(const char *key, char *value, const char *default_value) { int property_get(const char *key, char *value, const char *default_value) { int len; len = __system_property_get(key, value); Loading @@ -131,14 +129,12 @@ int property_get(const char *key, char *value, const char *default_value) return len; } struct property_list_callback_data { struct property_list_callback_data { void (*propfn)(const char *key, const char *value, void *cookie); void *cookie; }; static void property_list_callback(const prop_info *pi, void *cookie) { static void property_list_callback(const prop_info *pi, void *cookie) { char name[PROP_NAME_MAX]; char value[PROP_VALUE_MAX]; struct property_list_callback_data *data = cookie; Loading @@ -147,10 +143,7 @@ static void property_list_callback(const prop_info *pi, void *cookie) data->propfn(name, value, data->cookie); } int property_list( void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) { int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) { struct property_list_callback_data data = {propfn, cookie}; return __system_property_foreach(property_list_callback, &data); }