/system/bt/gd/packet/parser/ |
D | packet_def.cc | 33 void PacketDef::GenParserDefinition(std::ostream& s) const { in GenParserDefinition() 34 s << "class " << name_ << "View"; in GenParserDefinition() 36 s << " : public " << parent_->name_ << "View {"; in GenParserDefinition() 38 s << " : public PacketView<" << (is_little_endian_ ? "" : "!") << "kLittleEndian> {"; in GenParserDefinition() 40 s << " public:"; in GenParserDefinition() 44 s << "static " << name_ << "View Create(" << parent_->name_ << "View parent)"; in GenParserDefinition() 45 s << "{ return " << name_ << "View(std::move(parent)); }"; in GenParserDefinition() 47 …s << "static " << name_ << "View Create(PacketView<" << (is_little_endian_ ? "" : "!") << "kLittle… in GenParserDefinition() 48 s << "{ return " << name_ << "View(std::move(packet)); }"; in GenParserDefinition() 51 GenTestingParserFromBytes(s); 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() {"; 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 | packet_def.h | 34 void GenParserDefinition(std::ostream& s) 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) const; 50 void GenBuilderDefinitionPybind11(std::ostream& s) const; 52 void GenTestDefine(std::ostream& s) const; 54 void GenFuzzTestDefine(std::ostream& s) const; [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 | custom_field_def.cc | 42 void CustomFieldDef::GenInclude(std::ostream& s) const { in GenInclude() 43 s << "#include \"" << include_ << util::CamelCaseToUnderScore(GetTypeName()) << ".h\"\n"; in GenInclude() 46 void CustomFieldDef::GenPyBind11Include(std::ostream& s) const { in GenPyBind11Include() 47 …s << "#include \"" << include_ << util::CamelCaseToUnderScore(GetTypeName()) << "_pybind11_type_ca… in GenPyBind11Include() 50 void CustomFieldDef::GenUsing(std::ostream& s) const { in GenUsing() 51 s << "using ::bluetooth::"; in GenUsing() 55 s << "::"; in GenUsing() 58 s << c; in GenUsing() 61 s << GetTypeName() << ";"; in GenUsing() 64 void CustomFieldDef::GenFixedSizeCustomFieldCheck(std::ostream& s) const { in GenFixedSizeCustomFieldCheck() [all …]
|
/system/bt/gd/packet/parser/fields/ |
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() 125 … s << element_field_->GetName() << "_it.NumBytesRemaining() >= " << element_size_.bytes() << ") {"; in GenExtractor() 127 s << element_field_->GetName() << "_it.NumBytesRemaining() > 0) {"; in GenExtractor() 130 s << element_field_->GetDataType() << " " << element_field_->GetName() << "_ptr;"; 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 | 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 | 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 …]
|
D | packet_field.cc | 43 int PacketField::GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const { in GenBounds() argument 55 s << "size_t field_begin = (" << start_offset << ") / 8;"; in GenBounds() 57 s << "size_t field_begin = end_index - (" << end_offset << " + " << size << ") / 8;"; in GenBounds() 61 s << "size_t field_end = end_index - (" << end_offset << ") / 8;"; in GenBounds() 64 s << "size_t field_sized_end = field_begin + (" << size << ") / 8;"; in GenBounds() 65 s << "if (field_sized_end < field_end) { field_end = field_sized_end; }"; in GenBounds() 68 s << "size_t field_end = field_begin + (" << size << ") / 8;"; in GenBounds() 69 s << "if (field_end > end_index) { field_end = end_index; }"; in GenBounds() 71 s << "auto " << name_ << "_it = to_bound.Subrange(field_begin, field_end - field_begin); "; in GenBounds() 75 bool PacketField::GenBuilderParameter(std::ostream& s) const { in GenBuilderParameter() [all …]
|
D | payload_field.cc | 65 void PayloadField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument 66 s << "PacketView<kLittleEndian> " << GetGetterFunctionName() << "() const {"; in GenGetter() 67 s << "ASSERT(was_validated_);"; in GenGetter() 68 s << "size_t end_index = size();"; in GenGetter() 69 s << "auto to_bound = begin();"; in GenGetter() 70 GenBounds(s, start_offset, end_offset, GetSize()); in GenGetter() 71 s << "return GetLittleEndianSubview(field_begin, field_end);"; in GenGetter() 72 s << "}\n\n"; in GenGetter() 74 s << "PacketView<!kLittleEndian> " << GetGetterFunctionName() << "BigEndian() const {"; in GenGetter() 75 s << "ASSERT(was_validated_);"; in GenGetter() [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 …]
|
/system/extras/taskstats/ |
D | taskstats.c | 135 const struct taskstats* s = &stats->stats; in print_task_stats() local 138 printf("%-25s%d\n", "Stats version:", s->version); in print_task_stats() 139 printf("%-25s%d\n", "Exit code:", s->ac_exitcode); in print_task_stats() 140 printf("%-25s0x%x\n", "Flags:", s->ac_flag); in print_task_stats() 141 printf("%-25s%d\n", "Nice value:", s->ac_nice); in print_task_stats() 142 printf("%-25s%s\n", "Command name:", s->ac_comm); in print_task_stats() 143 printf("%-25s%d\n", "Scheduling discipline:", s->ac_sched); in print_task_stats() 144 printf("%-25s%d\n", "UID:", s->ac_uid); in print_task_stats() 145 printf("%-25s%d\n", "GID:", s->ac_gid); in print_task_stats() 146 printf("%-25s%d\n", "PID:", s->ac_pid); in print_task_stats() [all …]
|
/system/core/trusty/utils/rpmb_dev/ |
D | rpmb_dev.c | 124 static int rpmb_file_seek(struct rpmb_dev_state* s, uint16_t addr) { in rpmb_file_seek() argument 126 int pos = addr * RPMB_PACKET_DATA_SIZE + sizeof(s->header); in rpmb_file_seek() 127 ret = lseek(s->data_fd, pos, SEEK_SET); in rpmb_file_seek() 135 static uint16_t rpmb_dev_program_key(struct rpmb_dev_state* s) { in rpmb_dev_program_key() argument 138 if (s->header.key_programmed) { in rpmb_dev_program_key() 142 s->header.key = s->cmd[0].key_mac; in rpmb_dev_program_key() 143 s->header.key_programmed = 1; in rpmb_dev_program_key() 145 ret = lseek(s->data_fd, 0, SEEK_SET); in rpmb_dev_program_key() 151 ret = write(s->data_fd, &s->header, sizeof(s->header)); in rpmb_dev_program_key() 152 if (ret != sizeof(s->header)) { in rpmb_dev_program_key() [all …]
|
/system/extras/ioshark/ |
D | compile_ioshark.c | 125 char *s, *s2; in get_tracetype() local 128 s = strchr(buf, ' '); in get_tracetype() 129 if (s == NULL) { in get_tracetype() 135 while (*s == ' ') in get_tracetype() 136 s++; in get_tracetype() 137 if (sscanf(s, "%s", trace_type) != 1) { in get_tracetype() 153 s2 = strchr(s, ' '); in get_tracetype() 172 bcopy(s2, s, strlen(s2) + 1); in get_tracetype() 178 char *s, *s2, save; in get_pathname() local 181 s = strchr(buf, '/'); in get_pathname() [all …]
|
/system/libbase/ |
D | strings.cpp | 31 std::vector<std::string> Split(const std::string& s, in Split() argument 40 found = s.find_first_of(delimiters, base); in Split() 41 result.push_back(s.substr(base, found - base)); in Split() 42 if (found == s.npos) break; in Split() 49 std::string Trim(const std::string& s) { in Trim() argument 52 if (s.size() == 0) { in Trim() 57 size_t end_index = s.size() - 1; in Trim() 60 while (start_index < s.size()) { in Trim() 61 if (!isspace(s[start_index])) { in Trim() 69 if (!isspace(s[end_index])) { in Trim() [all …]
|
D | parsebool.cpp | 23 ParseBoolResult ParseBool(std::string_view s) { in ParseBool() argument 24 if (s == "1" || s == "y" || s == "yes" || s == "on" || s == "true") { in ParseBool() 27 if (s == "0" || s == "n" || s == "no" || s == "off" || s == "false") { in ParseBool()
|
/system/core/libsparse/ |
D | sparse.cpp | 31 struct sparse_file* s = reinterpret_cast<sparse_file*>(calloc(sizeof(struct sparse_file), 1)); in sparse_file_new() local 32 if (!s) { in sparse_file_new() 36 s->backed_block_list = backed_block_list_new(block_size); in sparse_file_new() 37 if (!s->backed_block_list) { in sparse_file_new() 38 free(s); in sparse_file_new() 42 s->block_size = block_size; in sparse_file_new() 43 s->len = len; in sparse_file_new() 45 return s; in sparse_file_new() 48 void sparse_file_destroy(struct sparse_file* s) { in sparse_file_destroy() argument 49 backed_block_list_destroy(s->backed_block_list); in sparse_file_destroy() [all …]
|
/system/bt/embdrv/g722/ |
D | g722_decode.cc | 88 band->r[0] = __ssat16(band->s + d); in block4() 168 band->s = __ssat16(band->sp + band->sz); in block4() 172 g722_decode_state_t *g722_decode_init(g722_decode_state_t *s, unsigned int rate, int options) in g722_decode_init() argument 174 if (s == NULL) in g722_decode_init() 177 if ((s = (g722_decode_state_t *) malloc(sizeof(*s))) == NULL) in g722_decode_init() 181 memset(s, 0, sizeof(*s)); in g722_decode_init() 183 s->bits_per_sample = 6; in g722_decode_init() 185 s->bits_per_sample = 7; in g722_decode_init() 187 s->bits_per_sample = 8; in g722_decode_init() 188 s->dac_pcm = options & G722_FORMAT_DAC12; in g722_decode_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 …]
|
D | g722_encode.cc | 85 band->r[0] = saturate(band->s + d); in block4() 162 band->s = saturate(band->sp + band->sz); in block4() 166 g722_encode_state_t *g722_encode_init(g722_encode_state_t *s, in g722_encode_init() argument 169 if (s == NULL) in g722_encode_init() 172 if ((s = (g722_encode_state_t *) malloc(sizeof(*s))) == NULL) in g722_encode_init() 176 memset(s, 0, sizeof(*s)); in g722_encode_init() 178 s->bits_per_sample = 6; in g722_encode_init() 180 s->bits_per_sample = 7; in g722_encode_init() 182 s->bits_per_sample = 8; in g722_encode_init() 183 s->band[0].det = 32; in g722_encode_init() [all …]
|
/system/core/libcutils/ |
D | socket_network_client_unix.cpp | 32 static int toggle_O_NONBLOCK(int s) { in toggle_O_NONBLOCK() argument 33 int flags = fcntl(s, F_GETFL); in toggle_O_NONBLOCK() 34 if (flags == -1 || fcntl(s, F_SETFL, flags ^ O_NONBLOCK) == -1) { in toggle_O_NONBLOCK() 35 close(s); in toggle_O_NONBLOCK() 38 return s; in toggle_O_NONBLOCK() 65 int s = socket(addr->ai_family, type, addr->ai_protocol); in socket_network_client_timeout() local 66 if (s == -1 || toggle_O_NONBLOCK(s) == -1) break; in socket_network_client_timeout() 68 int rc = connect(s, addr->ai_addr, addr->ai_addrlen); in socket_network_client_timeout() 70 result = toggle_O_NONBLOCK(s); in socket_network_client_timeout() 73 close(s); in socket_network_client_timeout() [all …]
|
/system/libbase/include/android-base/ |
D | parseint.h | 35 bool ParseUint(const char* s, T* out, T max = std::numeric_limits<T>::max(), 38 while (isspace(*s)) { 39 s++; 42 if (s[0] == '-') { 47 int base = (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) ? 16 : 10; 50 unsigned long long int result = strtoull(s, &end, base); 52 if (end == s) { 77 bool ParseUint(const std::string& s, T* out, T max = std::numeric_limits<T>::max(), 79 return ParseUint(s.c_str(), out, max, allow_suffixes); 83 bool ParseByteCount(const char* s, T* out, T max = std::numeric_limits<T>::max()) { [all …]
|
/system/iorap/src/db/ |
D | app_component_name.h | 34 static bool HasAppComponentName(const std::string& s) { in HasAppComponentName() 35 return s.find('/') != std::string::npos; in HasAppComponentName() 39 static AppComponentName FromString(const std::string& s) { in FromString() 42 if (!HasAppComponentName(s)) { in FromString() 43 return {std::move(s), ""}; in FromString() 46 std::string package = s.substr(0, s.find(delimiter)); in FromString() 48 std::string activity_name = s; in FromString() 49 activity_name.erase(0, s.find(delimiter) + sizeof(delimiter)); in FromString() 69 static AppComponentName FromUrlEncodedString(const std::string& s) { in FromUrlEncodedString() 70 std::string cpy = s; in FromUrlEncodedString() [all …]
|