5.请指出下面代码的错误 int handle_message(int message_id) { int result = 0; switch (message_id) { case MSG_ID_NOTIFY: route_to_notify_thread (message_id); break; case MSG_ID_SHUTDOWN: case MSG_ID_REBOOT: LOGI("System Message %d =====\n", message_id) send_msg_to_sys_thread(message_id); break; default: LOGE ("===== Kaka Wrone Message %d =======\n", message_id) break; } return result;
时间: 2023-12-03 22:45:30 浏览: 67
Android Build.VERSION.SDK_INT
下面代码的错误是在case MSG_ID_SHUTDOWN和case MSG_ID_REBOOT的语句中,缺少了一个分号。正确的代码如下:
```
int handle_message(int message_id) {
int result = 0;
switch (message_id) {
case MSG_ID_NOTIFY:
route_to_notify_thread (message_id);
break;
case MSG_ID_SHUTDOWN:
case MSG_ID_REBOOT:
LOGI("System Message %d =====\n", message_id);
send_msg_to_sys_thread(message_id);
break;
default:
LOGE ("===== Kaka Wrone Message %d =======\n", message_id);
break;
}
return result;
}
```
阅读全文