Skip to content

Commit 1c3c601

Browse files
committed
remove ATTR_PURE from ATTR_MALLOC method calls
- a function returning new memory can't be pure
1 parent befae75 commit 1c3c601

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/platformchannel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ ATTR_PURE int64_t raw_std_value_as_int64(const struct raw_std_value *value);
888888
ATTR_PURE bool raw_std_value_is_float64(const struct raw_std_value *value);
889889
ATTR_PURE double raw_std_value_as_float64(const struct raw_std_value *value);
890890
ATTR_PURE bool raw_std_value_is_string(const struct raw_std_value *value);
891-
ATTR_PURE ATTR_MALLOC char *raw_std_string_dup(const struct raw_std_value *value);
891+
ATTR_MALLOC char *raw_std_string_dup(const struct raw_std_value *value);
892892
ATTR_PURE bool raw_std_string_equals(const struct raw_std_value *value, const char *str);
893893
ATTR_PURE bool raw_std_value_is_uint8array(const struct raw_std_value *value);
894894
ATTR_PURE const uint8_t *raw_std_value_as_uint8array(const struct raw_std_value *value);
@@ -924,7 +924,7 @@ ATTR_PURE bool raw_std_method_call_response_check(const struct raw_std_value *va
924924
ATTR_PURE bool raw_std_event_check(const struct raw_std_value *value, size_t buffer_size);
925925

926926
ATTR_PURE const struct raw_std_value *raw_std_method_call_get_method(const struct raw_std_value *value);
927-
ATTR_PURE ATTR_MALLOC char *raw_std_method_call_get_method_dup(const struct raw_std_value *value);
927+
ATTR_MALLOC char *raw_std_method_call_get_method_dup(const struct raw_std_value *value);
928928
ATTR_PURE const struct raw_std_value *raw_std_method_call_get_arg(const struct raw_std_value *value);
929929

930930
#define CONCAT(a, b) CONCAT_INNER(a, b)

src/platformchannel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,7 @@ ATTR_PURE bool raw_std_value_is_string(const struct raw_std_value *value) {
18601860
return raw_std_value_get_type(value) == kStdString;
18611861
}
18621862

1863-
ATTR_PURE ATTR_MALLOC char *raw_std_string_dup(const struct raw_std_value *value) {
1863+
ATTR_MALLOC char *raw_std_string_dup(const struct raw_std_value *value) {
18641864
DEBUG_ASSERT(raw_std_value_is_string(value));
18651865

18661866
size_t size = raw_std_value_get_size(value);
@@ -2456,7 +2456,7 @@ ATTR_PURE bool raw_std_method_call_response_check(const struct raw_std_value *va
24562456

24572457
bool successful = (*(const uint8_t*) (value)) != 0;
24582458

2459-
value = (intptr_t) value + 1;
2459+
value = (void*) ((intptr_t) value + (intptr_t) 1);
24602460
buffer_size -= 1;
24612461

24622462
if (successful) {
@@ -2505,7 +2505,7 @@ ATTR_PURE const struct raw_std_value *raw_std_method_call_get_method(const struc
25052505
return value;
25062506
}
25072507

2508-
ATTR_MALLOC ATTR_PURE char *raw_std_method_call_get_method_dup(const struct raw_std_value *value) {
2508+
ATTR_MALLOC char *raw_std_method_call_get_method_dup(const struct raw_std_value *value) {
25092509
DEBUG_ASSERT(raw_std_value_is_string(value));
25102510
return raw_std_string_dup(value);
25112511
}

0 commit comments

Comments
 (0)