Skip to content

Commit 4937796

Browse files
committed
Protect comments in sup_service.cpp from clang-format
Protect the ASCII art tables and lists in sup_service.cpp with clang-format off/on directives so they remain readable while allowing the rest of the file to be formatted. Bug: b/512215781 Assisted-by: Jetski:Gemini Next
1 parent 734c5fb commit 4937796

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

base/cvd/cuttlefish/host/commands/modem_simulator/sup_service.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void SupService::InitializeServiceState() {
6161
};
6262
}
6363

64+
// clang-format off
6465
/**
6566
* AT+CUSD
6667
* This command allows control of the Unstructured Supplementary Service Data (USSD)
@@ -82,10 +83,12 @@ void SupService::InitializeServiceState() {
8283
*
8384
* see RIL_REQUEST_SEND_USSD or RIL_REQUEST_CANCEL_USSD in RIL
8485
*/
86+
// clang-format on
8587
void SupService::HandleUSSD(const Client& client, std::string& /*command*/) {
8688
client.SendCommandResponse("OK");
8789
}
8890

91+
// clang-format off
8992
/**
9093
* AT+CLIR
9194
* This command refers to CLIR‑service according to 3GPP TS 22.081 that allows
@@ -109,6 +112,7 @@ void SupService::HandleUSSD(const Client& client, std::string& /*command*/) {
109112
*
110113
* see RIL_REQUEST_SET_CLIR or RIL_REQUEST_GET_CLIR in RIL
111114
*/
115+
// clang-format on
112116
void SupService::HandleCLIR(const Client& client, std::string& command) {
113117
std::vector<std::string> responses;
114118
std::stringstream ss;
@@ -125,6 +129,7 @@ void SupService::HandleCLIR(const Client& client, std::string& command) {
125129
client.SendCommandResponse(responses);
126130
}
127131

132+
// clang-format off
128133
/**
129134
* AT+CLIP
130135
* This command refers to the supplementary service CLIP (Calling Line
@@ -146,11 +151,13 @@ void SupService::HandleCLIR(const Client& client, std::string& command) {
146151
*
147152
* see RIL_REQUEST_QUERY_CLIP in RIL
148153
*/
154+
// clang-format on
149155
void SupService::HandleCLIP(const Client& client) {
150156
std::vector<std::string> responses = {"+CLIP: 0, 0", "OK"};
151157
client.SendCommandResponse(responses);
152158
}
153159

160+
// clang-format off
154161
/**
155162
* AT+CSSN
156163
* This command refers to supplementary service related network initiated
@@ -171,10 +178,12 @@ void SupService::HandleCLIP(const Client& client) {
171178
*
172179
* see RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION in RIL
173180
*/
181+
// clang-format on
174182
void SupService::HandleSuppServiceNotifications(const Client& client, std::string& /*command*/) {
175183
client.SendCommandResponse("OK");
176184
}
177185

186+
// clang-format off
178187
/**
179188
* AT+CCFCU
180189
* The command allows control of the communication forwarding supplementary service
@@ -191,6 +200,7 @@ void SupService::HandleSuppServiceNotifications(const Client& client, std::strin
191200
*
192201
* see RIL_REQUEST_SET_CALL_FORWARD or RIL_REQUEST_QUERY_CALL_FORWARD_STATUS in RIL
193202
*/
203+
// clang-format on
194204
void SupService::HandleCallForward(const Client& client, std::string& command) {
195205
std::vector<std::string> responses;
196206
std::stringstream ss;
@@ -264,6 +274,7 @@ void SupService::HandleCallForward(const Client& client, std::string& command) {
264274
client.SendCommandResponse(responses);
265275
}
266276

277+
// clang-format off
267278
/**
268279
* AT+CCWA
269280
* This command allows control of the supplementary service Call Waiting
@@ -290,6 +301,7 @@ void SupService::HandleCallForward(const Client& client, std::string& command) {
290301
*
291302
* see RIL_REQUEST_QUERY_CALL_WAITING and RIL_REQUEST_SET_CALL_WAITING in RIL
292303
*/
304+
// clang-format on
293305
void SupService::HandleCallWaiting(const Client& client, std::string& command) {
294306
std::vector<std::string> responses;
295307
std::stringstream ss;

base/cvd/cuttlefish/host/libs/config/kernel_args.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,24 @@ std::vector<std::string> VmManagerKernelCmdline(
4242
if (instance.enable_kernel_log()) {
4343
vm_manager_cmdline.push_back("console=hvc0");
4444

45+
// clang-format off
4546
// To update the pl011 address:
4647
// $ qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine dumpdtb=virt.dtb
4748
// $ dtc -O dts -o virt.dts -I dtb virt.dtb
4849
// In the virt.dts file, look for a uart node
50+
// clang-format on
4951
vm_manager_cmdline.push_back("earlycon=pl011,mmio32,0x9000000");
5052
}
5153
} else if (target_arch == Arch::RiscV64) {
5254
vm_manager_cmdline.push_back("console=hvc0");
5355

56+
// clang-format off
5457
// To update the uart8250 address:
5558
// $ qemu-system-riscv64 -machine virt -machine dumpdtb=virt.dtb
5659
// $ dtc -O dts -o virt.dts -I dtb virt.dtb
5760
// In the virt.dts file, look for a uart node
5861
// Only 'mmio' mode works; mmio32 does not
62+
// clang-format on
5963
vm_manager_cmdline.push_back("earlycon=uart8250,mmio,0x10000000");
6064

6165
// The kernel defaults to Sv57. Disable 5-level paging to set the mode
@@ -65,9 +69,11 @@ std::vector<std::string> VmManagerKernelCmdline(
6569
if (instance.enable_kernel_log()) {
6670
vm_manager_cmdline.push_back("console=hvc0");
6771

72+
// clang-format off
6873
// To update the uart8250 address:
6974
// $ qemu-system-x86_64 -kernel bzImage -serial stdio | grep ttyS0
7075
// Only 'io' mode works; mmio and mmio32 do not
76+
// clang-format on
7177
vm_manager_cmdline.push_back("earlycon=uart8250,io,0x3f8");
7278
}
7379

0 commit comments

Comments
 (0)