Home
last modified time | relevance | path

Searched refs:s (Results 1 – 25 of 964) sorted by relevance

12345678910>>...39

/system/bt/gd/packet/parser/
Dpacket_def.cc32 void PacketDef::GenParserDefinition(std::ostream& s) const { in GenParserDefinition()
33 s << "class " << name_ << "View"; in GenParserDefinition()
35 s << " : public " << parent_->name_ << "View {"; in GenParserDefinition()
37 s << " : public PacketView<" << (is_little_endian_ ? "" : "!") << "kLittleEndian> {"; in GenParserDefinition()
39 s << " public:"; in GenParserDefinition()
43 s << "static " << name_ << "View Create(" << parent_->name_ << "View parent)"; in GenParserDefinition()
44 s << "{ return " << name_ << "View(std::move(parent)); }"; in GenParserDefinition()
46s << "static " << name_ << "View Create(PacketView<" << (is_little_endian_ ? "" : "!") << "kLittle… in GenParserDefinition()
47 s << "{ return " << name_ << "View(std::move(packet)); }"; in GenParserDefinition()
50 GenTestingParserFromBytes(s); in GenParserDefinition()
[all …]
Dstruct_def.cc38 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 …]
Dstruct_parser_generator.cc21 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 = dynamic_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()
47s << "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 …]
Dparent_def.cc246 void ParentDef::GenMembers(std::ostream& s) const { in GenMembers()
249 if (fields_[i]->GenBuilderMember(s)) { in GenMembers()
250 s << "_{};"; in GenMembers()
255 void ParentDef::GenSize(std::ostream& s) const { in GenSize()
259 s << "protected:"; in GenSize()
260 s << "size_t BitsOfHeader() const {"; in GenSize()
261 s << "return 0"; in GenSize()
265 s << " + " << parent_->name_ << "Builder::BitsOfHeader() "; in GenSize()
267 s << " + " << parent_->name_ << "::BitsOfHeader() "; in GenSize()
272 s << " + " << field->GetBuilderSize(); in GenSize()
[all …]
Dcustom_field_def.cc42 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()
47s << "#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 …]
Dpacket_def.h34 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 …]
/system/core/adb/
Dsockets.cpp67 for (asocket* s : local_socket_list) { in find_local_socket()
68 if (s->id != local_id) { in find_local_socket()
71 if (peer_id == 0 || (s->peer && s->peer->id == peer_id)) { in find_local_socket()
72 result = s; in find_local_socket()
80 void install_local_socket(asocket* s) { in install_local_socket() argument
83 s->id = local_socket_next_id++; in install_local_socket()
90 local_socket_list.push_back(s); in install_local_socket()
93 void remove_socket(asocket* s) { in remove_socket() argument
96 list->erase(std::remove_if(list->begin(), list->end(), [s](asocket* x) { return x == s; }), in remove_socket()
107 for (asocket* s : local_socket_list) { in close_all_sockets()
[all …]
/system/extras/taskstats/
Dtaskstats.c135 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/
Drpmb_dev.c124 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/bt/gd/packet/parser/fields/
Dcustom_field.cc42 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 …]
Darray_field.cc86 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()
90s << "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 << element_field_->GetDataType() << "* " << element_field_->GetName() << "_ptr = ret_it;"; in GenExtractor()
101 element_field_->GenExtractor(s, num_leading_bits, for_struct); in GenExtractor()
[all …]
Dvector_field.cc110 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()
125s << 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 …]
Dvariable_length_struct_field.cc43 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 …]
Dpayload_field.cc65 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 …]
Dscalar_field.cc50 int ScalarField::GenBounds(std::ostream& s, Size start_offset, Size end_offset, Size size) const { in GenBounds() argument
56 s << "auto " << GetName() << "_it = to_bound + (" << start_offset << ") / 8;"; in GenBounds()
60s << "auto " << GetName() << "_it = to_bound + (to_bound.NumBytesRemaining() - (" << byte_offset <… in GenBounds()
67 void ScalarField::GenExtractor(std::ostream& s, int num_leading_bits, bool) const { in GenExtractor() argument
73 s << "auto extracted_value = " << GetName() << "_it.extract<" << extract_type << ">();"; in GenExtractor()
77 s << "extracted_value >>= " << num_leading_bits << ";"; in GenExtractor()
86 s << "extracted_value &= 0x" << std::hex << mask << std::dec << ";"; in GenExtractor()
88 s << "*" << GetName() << "_ptr = static_cast<" << GetDataType() << ">(extracted_value);"; in GenExtractor()
97 void ScalarField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) const { in GenGetter() argument
98 s << GetDataType() << " " << GetGetterFunctionName() << "() const {"; in GenGetter()
[all …]
/system/core/libpixelflinger/codeflinger/
Dload_store.cpp31 void GGLAssembler::store(const pointer_t& addr, const pixel_t& s, uint32_t flags) in store() argument
37 if (inc) STR(AL, s.reg, addr.reg, immed12_post(4)); in store()
38 else STR(AL, s.reg, addr.reg); in store()
43 STRB(AL, s.reg, addr.reg, immed12_pre(0)); in store()
44 MOV(AL, 0, s.reg, reg_imm(s.reg, ROR, 8)); in store()
45 STRB(AL, s.reg, addr.reg, immed12_pre(1)); in store()
46 MOV(AL, 0, s.reg, reg_imm(s.reg, ROR, 8)); in store()
47 STRB(AL, s.reg, addr.reg, immed12_pre(2)); in store()
48 if (!(s.flags & CORRUPTIBLE)) { in store()
49 MOV(AL, 0, s.reg, reg_imm(s.reg, ROR, 16)); in store()
[all …]
/system/extras/ioshark/
Dcompile_ioshark.c125 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/
Dstrings.cpp31 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 …]
Dparsebool.cpp23 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/
Dsparse.cpp31 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/
Dg722_decode.cc88 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 …]
Dg722_enc_dec.h54 #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 …]
Dg722_encode.cc85 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/
Dsocket_network_client_unix.cpp32 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/
Dparseint.h35 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 …]

12345678910>>...39