Home
last modified time | relevance | path

Searched refs:SAFELY_CLAMP (Results 1 – 5 of 5) sorted by relevance

/system/connectivity/wifilogd/tests/
Dlocal_utils_unittest.cpp134 EXPECT_EQ(int8_t{0}, (SAFELY_CLAMP(int8_t{-1}, int8_t, 0, 2))); in TEST()
135 EXPECT_EQ(int8_t{0}, (SAFELY_CLAMP(int8_t{0}, int8_t, 0, 2))); in TEST()
136 EXPECT_EQ(int8_t{1}, (SAFELY_CLAMP(int8_t{1}, int8_t, 0, 2))); in TEST()
137 EXPECT_EQ(int8_t{2}, (SAFELY_CLAMP(int8_t{2}, int8_t, 0, 2))); in TEST()
138 EXPECT_EQ(int8_t{2}, (SAFELY_CLAMP(int8_t{3}, int8_t, 0, 2))); in TEST()
144 EXPECT_EQ(uint8_t{0}, (SAFELY_CLAMP(int8_t{-1}, uint8_t, 0, 127))); in TEST()
145 EXPECT_EQ(uint8_t{0}, (SAFELY_CLAMP(int8_t{0}, uint8_t, 0, 127))); in TEST()
146 EXPECT_EQ(uint8_t{1}, (SAFELY_CLAMP(int8_t{1}, uint8_t, 0, 127))); in TEST()
147 EXPECT_EQ(uint8_t{127}, (SAFELY_CLAMP(int8_t{127}, uint8_t, 0, 127))); in TEST()
153 EXPECT_EQ(int8_t{0}, (SAFELY_CLAMP(uint8_t{0}, int8_t, 0, 127))); in TEST()
[all …]
Dcommand_processor_unittest.cpp93 .set_tag_len(SAFELY_CLAMP( in BuildAsciiMessageCommandWithAdjustments()
96 .set_data_len(SAFELY_CLAMP( in BuildAsciiMessageCommandWithAdjustments()
109 .set_payload_len(SAFELY_CLAMP( in BuildAsciiMessageCommandWithAdjustments()
/system/connectivity/wifilogd/
Dos.cpp61 now_timestamp.secs = SAFELY_CLAMP( in GetTimestamp()
69 SAFELY_CLAMP(now_timespec.tv_nsec, uint32_t, 0, kMaxNanoSeconds); in GetTimestamp()
76 SAFELY_CLAMP(sleep_time_nsec, decltype(timespec::tv_nsec), 0, kMaxNanos)}; in Nanosleep()
125 SAFELY_CLAMP(buflen, ssize_t, 0, in Write()
Dcommand_processor.cpp170 SAFELY_CLAMP(command_len_in, uint16_t, 0, protocol::kMaxMessageSize); in CopyCommandToLog()
200 SAFELY_CLAMP(message_buf.size(), uint16_t, 0, GetMaxVal<uint16_t>())); in CopyCommandToLog()
Dlocal_utils.h35 #define SAFELY_CLAMP(SRC, DST_TYPE, MIN, MAX) \ macro