/packages/modules/Bluetooth/system/gd/packet/parser/ |
D | packet_def.cc | 34 void PacketDef::GenParserDefinition(std::ostream& s, bool generate_fuzzing, bool generate_tests) co… in GenParserDefinition() argument 35 s << "class " << name_ << "View"; in GenParserDefinition() 37 s << " : public " << parent_->name_ << "View {"; in GenParserDefinition() 39 s << " : public PacketView<" << (is_little_endian_ ? "" : "!") << "kLittleEndian> {"; in GenParserDefinition() 41 s << " public:"; in GenParserDefinition() 45 s << "static " << name_ << "View Create(" << parent_->name_ << "View parent)"; in GenParserDefinition() 46 s << "{ return " << name_ << "View(std::move(parent)); }"; in GenParserDefinition() 48 s << "static std::optional<" << name_ << "View> CreateOptional("; in GenParserDefinition() 49 s << parent_->name_ << "View parent)"; in GenParserDefinition() 50 s << "{ auto to_validate = " << name_ << "View::Create(std::move(parent));"; in GenParserDefinition() [all …]
|
D | struct_def.cc | 38 void StructDef::GenSpecialize(std::ostream& s) const { in GenSpecialize() 42 s << "static " << name_ << "* Specialize(" << parent_->name_ << "* parent) {"; in GenSpecialize() 43 s << "ASSERT(" << name_ << "::IsInstance(*parent));"; in GenSpecialize() 44 s << "return static_cast<" << name_ << "*>(parent);"; in GenSpecialize() 45 s << "}"; in GenSpecialize() 48 void StructDef::GenToString(std::ostream& s) const { in GenToString() 49 s << "std::string ToString() const {"; in GenToString() 50 s << "std::stringstream ss;"; in GenToString() 51 s << "ss << std::hex << std::showbase << \"" << name_ << " { \";"; in GenToString() 54 s << "ss"; in GenToString() [all …]
|
D | struct_parser_generator.cc | 21 for (const auto& s : decls.type_defs_queue_) { in StructParserGenerator() local 22 if (s.second->GetDefinitionType() == TypeDef::Type::STRUCT) { in StructParserGenerator() 23 const auto* struct_def = static_cast<const StructDef*>(s.second); in StructParserGenerator() 38 void StructParserGenerator::explore_children(const TreeNode& node, std::ostream& s) const { in explore_children() 41 s << "bool " << field->GetName() << "_child_found = false; /* Greedy match */"; in explore_children() 44 s << "if (!" << field->GetName() << "_child_found && "; in explore_children() 45 s << child->struct_def_->name_ << "::IsInstance(*" << field->GetName() << "_value.get())) {"; in explore_children() 46 s << field->GetName() << "_child_found = true;"; in explore_children() 47 …s << "std::unique_ptr<" << child->struct_def_->name_ << "> " << child->packet_field_->GetName() <<… in explore_children() 48 s << child->packet_field_->GetName() << "_value.reset(new "; in explore_children() [all …]
|
D | parent_def.cc | 263 void ParentDef::GenMembers(std::ostream& s) const { in GenMembers() 266 if (field->GenBuilderMember(s)) { in GenMembers() 267 s << "_{};"; in GenMembers() 272 void ParentDef::GenSize(std::ostream& s) const { in GenSize() 290 s << "protected:"; in GenSize() 291 s << "size_t BitsOfHeader() const {"; in GenSize() 292 s << "return 0"; in GenSize() 296 s << " + " << parent_->name_ << "Builder::BitsOfHeader() "; in GenSize() 298 s << " + " << parent_->name_ << "::BitsOfHeader() "; in GenSize() 304 s << " + " << padded_size; in GenSize() [all …]
|
D | packet_def.h | 34 void GenParserDefinition(std::ostream& s, bool generate_fuzzing, bool generate_tests) const; 36 void GenTestingParserFromBytes(std::ostream& s) const; 38 void GenParserDefinitionPybind11(std::ostream& s) const; 40 void GenParserFieldGetter(std::ostream& s, const PacketField* field) const; 42 void GenValidator(std::ostream& s) const; 44 void GenParserToString(std::ostream& s) const; 48 void GenBuilderDefinition(std::ostream& s, bool generate_fuzzing, bool generate_tests) const; 50 void GenBuilderDefinitionPybind11(std::ostream& s) const; 52 void GenTestDefine(std::ostream& s) const; 54 void GenReflectTestDefine(std::ostream& s) const; [all …]
|
/packages/modules/adb/ |
D | sockets.cpp | 68 for (asocket* s : local_socket_list) { in find_local_socket() 69 if (s->id != local_id) { in find_local_socket() 72 if (peer_id == 0 || (s->peer && s->peer->id == peer_id)) { in find_local_socket() 73 result = s; in find_local_socket() 81 void install_local_socket(asocket* s) { in install_local_socket() argument 84 s->id = local_socket_next_id++; in install_local_socket() 91 local_socket_list.push_back(s); in install_local_socket() 94 void remove_socket(asocket* s) { in remove_socket() argument 97 list->erase(std::remove_if(list->begin(), list->end(), [s](asocket* x) { return x == s; }), in remove_socket() 108 for (asocket* s : local_socket_list) { in close_all_sockets() [all …]
|
/packages/apps/LegacyCamera/jni/feature_stab/db_vlvm/ |
D | db_utilities_indexing.h | 88 inline int db_MaxIndex2(double s[2]) in db_MaxIndex2() 90 if(s[0]>=s[1]) return(0); in db_MaxIndex2() 94 inline int db_MaxIndex3(const double s[3]) in db_MaxIndex3() 99 best=s[0];pos=0; in db_MaxIndex3() 100 if(s[1]>best){best=s[1];pos=1;} in db_MaxIndex3() 101 if(s[2]>best){best=s[2];pos=2;} in db_MaxIndex3() 105 inline int db_MaxIndex4(const double s[4]) in db_MaxIndex4() 110 best=s[0];pos=0; in db_MaxIndex4() 111 if(s[1]>best){best=s[1];pos=1;} in db_MaxIndex4() 112 if(s[2]>best){best=s[2];pos=2;} in db_MaxIndex4() [all …]
|
/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/ |
D | StaticIpConfigurationTest.java | 73 private void checkEmpty(StaticIpConfiguration s) { in checkEmpty() argument 74 assertNull(s.ipAddress); in checkEmpty() 75 assertNull(s.gateway); in checkEmpty() 76 assertNull(s.domains); in checkEmpty() 77 assertEquals(0, s.dnsServers.size()); in checkEmpty() 81 StaticIpConfiguration s = new StaticIpConfiguration(); in makeTestObject() local 82 s.ipAddress = ADDR; in makeTestObject() 83 s.gateway = GATEWAY; in makeTestObject() 84 s.dnsServers.add(DNS1); in makeTestObject() 85 s.dnsServers.add(DNS2); in makeTestObject() [all …]
|
/packages/modules/Bluetooth/system/embdrv/g722/ |
D | g722_decode.cc | 87 band->r[0] = __ssat16(band->s + d); in block4() 167 band->s = __ssat16(band->sp + band->sz); in block4() 171 g722_decode_state_t *g722_decode_init(g722_decode_state_t *s, unsigned int rate, int options) in g722_decode_init() argument 173 if (s == NULL) in g722_decode_init() 176 if ((s = (g722_decode_state_t *) malloc(sizeof(*s))) == NULL) in g722_decode_init() 180 memset(s, 0, sizeof(*s)); in g722_decode_init() 182 s->bits_per_sample = 6; in g722_decode_init() 184 s->bits_per_sample = 7; in g722_decode_init() 186 s->bits_per_sample = 8; in g722_decode_init() 187 s->dac_pcm = options & G722_FORMAT_DAC12; in g722_decode_init() [all …]
|
D | g722_encode.cc | 84 band->r[0] = saturate(band->s + d); in block4() 161 band->s = saturate(band->sp + band->sz); in block4() 165 g722_encode_state_t *g722_encode_init(g722_encode_state_t *s, in g722_encode_init() argument 168 if (s == NULL) in g722_encode_init() 171 if ((s = (g722_encode_state_t *) malloc(sizeof(*s))) == NULL) in g722_encode_init() 175 memset(s, 0, sizeof(*s)); in g722_encode_init() 177 s->bits_per_sample = 6; in g722_encode_init() 179 s->bits_per_sample = 7; in g722_encode_init() 181 s->bits_per_sample = 8; in g722_encode_init() 182 s->band[0].det = 32; in g722_encode_init() [all …]
|
D | g722_enc_dec.h | 54 #define NLDECOMPRESS_APPLY_GAIN(s,g) (((s) * (int32_t)(g)) >> 16) argument 56 #define NLDECOMPRESS_APPLY_GAIN_CONVERTED_DAC(s,g) (uint16_t)((uint16_t)(((s) * (int32_t)(g)) >> 20… argument 58 #define NLDECOMPRESS_APPLY_GAIN(s,g) (((int32_t)(s) * (int32_t)(g)) >> 16) argument 62 #define NLDECOMPRESS_PREPROCESS_PCM_SAMPLE_WITH_GAIN(s,g) NLDECOMPRESS_APPLY_GAIN_CONVERTED_DAC((s)… argument 63 #define NLDECOMPRESS_PREPROCESS_SAMPLE_WITH_GAIN(s,g) ((int16_t)NLDECOMPRESS_APPLY_GAIN((s),(g))) argument 66 #define NLDECOMPRESS_PREPROCESS_SAMPLE_WITH_GAIN(s,g) ((int16_t)(NLDECOMPRESS_APPLY_GAIN((s),(g)))) argument 70 int s; member 136 g722_encode_state_t *g722_encode_init(g722_encode_state_t *s, unsigned int rate, int options); 137 int g722_encode_release(g722_encode_state_t *s); 138 int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[], int len); [all …]
|
/packages/modules/Bluetooth/system/gd/packet/parser/fields/ |
D | array_field.cc | 86 void ArrayField::GenExtractor(std::ostream& s, int num_leading_bits, bool for_struct) const { in GenExtractor() argument 87 s << GetDataType() << "::iterator ret_it = " << GetName() << "_ptr->begin();"; in GenExtractor() 88 s << "auto " << element_field_->GetName() << "_it = " << GetName() << "_it;"; in GenExtractor() 90 …s << "while (" << element_field_->GetName() << "_it.NumBytesRemaining() >= " << element_size_.byte… in GenExtractor() 91 s << " && ret_it < " << GetName() << "_ptr->end()) {"; in GenExtractor() 93 s << "while (" << element_field_->GetName() << "_it.NumBytesRemaining() > 0 "; in GenExtractor() 94 s << " && ret_it < " << GetName() << "_ptr->end()) {"; in GenExtractor() 97 s << element_field_->GetDataType() << " " << element_field_->GetName() << "_ptr;"; in GenExtractor() 99 s << "auto " << element_field_->GetName() << "_ptr = ret_it;"; in GenExtractor() 101 element_field_->GenExtractor(s, num_leading_bits, for_struct); in GenExtractor() [all …]
|
D | vector_field.cc | 110 void VectorField::GenExtractor(std::ostream& s, int num_leading_bits, bool for_struct) const { in GenExtractor() argument 111 s << "auto " << element_field_->GetName() << "_it = " << GetName() << "_it;"; in GenExtractor() 113 s << "size_t " << element_field_->GetName() << "_count = "; in GenExtractor() 115 s << "to_fill->" << size_field_->GetName() << "_extracted_;"; in GenExtractor() 117 s << "Get" << util::UnderscoreToCamelCase(size_field_->GetName()) << "();"; in GenExtractor() 120 s << "while ("; in GenExtractor() 122 s << "(" << element_field_->GetName() << "_count > 0) && "; in GenExtractor() 123 s << "(" << element_field_->GetName() << "_count-- > 0) && "; in GenExtractor() 126 … s << element_field_->GetName() << "_it.NumBytesRemaining() >= " << element_size_.bytes() << ") {"; in GenExtractor() 128 s << element_field_->GetName() << "_it.NumBytesRemaining() > 0) {"; in GenExtractor() [all …]
|
D | custom_field.cc | 42 void CustomField::GenExtractor(std::ostream& s, int, bool) const { in GenExtractor() argument 43 s << "auto optional_it = "; in GenExtractor() 44 s << GetDataType() << "::Parse( " << GetName() << "_ptr, " << GetName() << "_it);"; in GenExtractor() 45 s << "if (optional_it) {"; in GenExtractor() 46 s << GetName() << "_it = *optional_it;"; in GenExtractor() 47 s << "} else {"; in GenExtractor() 48 s << GetName() << "_it = " << GetName() << "_it + " << GetName() << "_it.NumBytesRemaining();"; in GenExtractor() 49 s << GetName() << "_ptr = nullptr;"; in GenExtractor() 50 s << "}"; in GenExtractor() 59 void CustomField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument [all …]
|
D | scalar_field.cc | 52 int ScalarField::GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const { in GenBounds() argument 58 s << "auto " << GetName() << "_it = to_bound + (" << start_offset << ") / 8;"; in GenBounds() 62 …s << "auto " << GetName() << "_it = to_bound + (to_bound.NumBytesRemaining() - (" << byte_offset <… in GenBounds() 69 void ScalarField::GenExtractor(std::ostream& s, int num_leading_bits, bool) const { in GenExtractor() argument 75 s << "auto extracted_value = " << GetName() << "_it.extract<" << extract_type << ">();"; in GenExtractor() 79 s << "extracted_value >>= " << num_leading_bits << ";"; in GenExtractor() 88 s << "extracted_value &= 0x" << std::hex << mask << std::dec << ";"; in GenExtractor() 90 s << "*" << GetName() << "_ptr = static_cast<" << GetDataType() << ">(extracted_value);"; in GenExtractor() 99 void ScalarField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 100 s << GetDataType() << " " << GetGetterFunctionName() << "() const {"; in GenGetter() [all …]
|
D | variable_length_struct_field.cc | 43 void VariableLengthStructField::GenExtractor(std::ostream& s, int, bool) const { in GenExtractor() argument 44 s << GetName() << "_ptr = Parse" << type_name_ << "(" << GetName() << "_it);"; in GenExtractor() 45 s << "if (" << GetName() << "_ptr != nullptr) {"; in GenExtractor() 46 s << GetName() << "_it = " << GetName() << "_it + " << GetName() << "_ptr->size();"; in GenExtractor() 47 s << "} else {"; in GenExtractor() 48 s << GetName() << "_it = " << GetName() << "_it + " << GetName() << "_it.NumBytesRemaining();"; in GenExtractor() 49 s << "}"; in GenExtractor() 58 void VariableLengthStructField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) cons… in GenGetter() argument 59 s << GetDataType() << " " << GetGetterFunctionName() << "() const {"; in GenGetter() 60 s << "ASSERT(was_validated_);"; in GenGetter() [all …]
|
D | struct_field.cc | 42 void StructField::GenExtractor(std::ostream& s, int, bool) const { in GenExtractor() argument 43 s << GetName() << "_it = "; in GenExtractor() 44 s << GetDataType() << "::Parse(" << GetName() << "_ptr, " << GetName() << "_it);"; in GenExtractor() 53 void StructField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 54 s << GetDataType() << " " << GetGetterFunctionName() << "() const {"; in GenGetter() 55 s << "ASSERT(was_validated_);"; in GenGetter() 56 s << "size_t end_index = size();"; in GenGetter() 57 s << "auto to_bound = begin();"; in GenGetter() 58 int num_leading_bits = GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 59 s << GetDataType() << " " << GetName() << "_value{};"; in GenGetter() [all …]
|
/packages/modules/Connectivity/staticlibs/tests/unit/src/com/android/net/module/util/netlink/ |
D | StructNlMsgHdrTest.java | 78 String s = struct.toString(); in testToString() local 79 assertContains(s, TEST_NLMSG_LEN_STR); in testToString() 80 assertContains(s, TEST_NLMSG_FLAGS_STR); in testToString() 81 assertContains(s, TEST_NLMSG_SEQ_STR); in testToString() 82 assertContains(s, TEST_NLMSG_PID_STR); in testToString() 83 assertContains(s, "nlmsg_type{20()}"); in testToString() 86 s = struct.toString(); in testToString() 87 assertContains(s, TEST_NLMSG_LEN_STR); in testToString() 88 assertContains(s, TEST_NLMSG_FLAGS_STR); in testToString() 89 assertContains(s, TEST_NLMSG_SEQ_STR); in testToString() [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/utils/ |
D | CapsModeUtilsTests.java | 51 final int s = TextUtils.CAP_MODE_SENTENCES; in allPathsForCaps() local 52 onePathForCaps(cs, expectedResult, c | w | s, sp, hasSpaceBefore); in allPathsForCaps() 53 onePathForCaps(cs, expectedResult, w | s, sp, hasSpaceBefore); in allPathsForCaps() 54 onePathForCaps(cs, expectedResult, c | s, sp, hasSpaceBefore); in allPathsForCaps() 58 onePathForCaps(cs, expectedResult, s, sp, hasSpaceBefore); in allPathsForCaps() 65 final int s = TextUtils.CAP_MODE_SENTENCES; in testGetCapsMode() local 74 allPathsForCaps("", c | w | s, sp, false); in testGetCapsMode() 78 allPathsForCaps("Word. ", c | w | s, sp, false); in testGetCapsMode() 80 allPathsForCaps("Word.. ", c | w | s, sp, false); in testGetCapsMode() 81 allPathsForCaps("Word... ", c | w | s, sp, false); in testGetCapsMode() [all …]
|
/packages/modules/Bluetooth/floss/android-base/include/android-base/ |
D | parseint.h | 35 bool ParseUint(const char* s, T* out, T max = std::numeric_limits<T>::max(), 39 while (isspace(*s)) { 40 s++; 43 if (s[0] == '-') { 51 int base = (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) ? 16 : 10; 54 unsigned long long int result = strtoull(s, &end, base); 56 if (end == s) { 83 bool ParseUint(const std::string& s, T* out, 86 return ParseUint(s.c_str(), out, max, allow_suffixes); 90 bool ParseByteCount(const char* s, T* out, [all …]
|
/packages/modules/adb/daemon/ |
D | jdwp_service.cpp | 340 static void jdwp_socket_close(asocket* s) { in jdwp_socket_close() argument 341 D("LS(%d): closing jdwp socket", s->id); in jdwp_socket_close() 343 if (s->peer) { in jdwp_socket_close() 344 D("LS(%d) peer->close()ing peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd); in jdwp_socket_close() 345 s->peer->peer = nullptr; in jdwp_socket_close() 346 s->peer->close(s->peer); in jdwp_socket_close() 347 s->peer = nullptr; in jdwp_socket_close() 350 remove_socket(s); in jdwp_socket_close() 351 delete s; in jdwp_socket_close() 354 static int jdwp_socket_enqueue(asocket* s, apacket::payload_type) { in jdwp_socket_enqueue() argument [all …]
|
D | file_sync_service.cpp | 150 static bool do_lstat_v1(int s, const char* path) { in do_lstat_v1() argument 159 return WriteFdExactly(s, &msg.stat_v1, sizeof(msg.stat_v1)); in do_lstat_v1() 162 static bool do_stat_v2(int s, uint32_t id, const char* path) { in do_stat_v2() argument 190 return WriteFdExactly(s, &msg.stat_v2, sizeof(msg.stat_v2)); in do_stat_v2() 194 static bool do_list(int s, const char* path) { in do_list() argument 242 if (!WriteFdExactly(s, &msg, sizeof(msg)) || in do_list() 243 !WriteFdExactly(s, de->d_name, d_name_length)) { in do_list() 251 return WriteFdExactly(s, &msg, sizeof(msg)); in do_list() 254 static bool do_list_v1(int s, const char* path) { in do_list_v1() argument 255 return do_list<false>(s, path); in do_list_v1() [all …]
|
/packages/services/Car/cpp/vhal/client/src/ |
D | IVhalClient.cpp | 68 } s; in getValueSync() local 71 [&s](VhalClientResult<std::unique_ptr<IHalPropValue>> r) { in getValueSync() 73 std::lock_guard<std::mutex> lockGuard(s.lock); in getValueSync() 74 s.result = std::move(r); in getValueSync() 75 s.gotResult = true; in getValueSync() 76 s.cv.notify_one(); in getValueSync() 82 std::unique_lock<std::mutex> lk(s.lock); in getValueSync() 83 s.cv.wait(lk, [&s] { return s.gotResult; }); in getValueSync() 85 return std::move(s.result); in getValueSync() 94 } s; in setValueSync() local [all …]
|
/packages/modules/Connectivity/service/native/libs/libclat/ |
D | clatutils.cpp | 39 const int s = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); in isIpv4AddressFree() local 40 if (s == -1) return 0; in isIpv4AddressFree() 50 const bool inuse = !connect(s, (struct sockaddr*)&sin, sizeof(sin)) && in isIpv4AddressFree() 51 !getsockname(s, (struct sockaddr*)&sin, &len) && in isIpv4AddressFree() 55 close(s); in isIpv4AddressFree() 118 const int s = socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0); in generateIpv6Address() local 119 if (s == -1) return -errno; in generateIpv6Address() 123 if (setsockopt(s, SOL_SOCKET, SO_MARK, &mark, sizeof(mark))) { in generateIpv6Address() 126 close(s); in generateIpv6Address() 130 if (setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, iface, strlen(iface) + 1)) { in generateIpv6Address() [all …]
|
/packages/apps/Camera2/src/com/android/camera/ui/ |
D | MarginDrawable.java | 58 RectF s = mScreen; in draw() local 59 if (s.top < s.bottom && s.left < s.right) { in draw() 61 if (s.top > 0) { in draw() 62 canvas.drawRect(0, 0, cb.right, s.top + 1, mPaint); in draw() 64 if (s.left > 0) { in draw() 65 canvas.drawRect(0, s.top, s.left + 1, s.bottom, mPaint); in draw() 67 if (s.right < cb.right) { in draw() 68 canvas.drawRect(s.right - 1, s.top, cb.right, s.bottom, mPaint); in draw() 70 if (s.bottom < cb.bottom) { in draw() 71 canvas.drawRect(0, s.bottom - 1, cb.right, cb.bottom, mPaint); in draw()
|