From a88a75c37977ce19f944c31865f0b48db6c64f09 Mon Sep 17 00:00:00 2001 From: deanlee Date: Sun, 23 Jul 2023 00:54:07 +0800 Subject: [PATCH] correct format string --- common/clutil.cc | 2 +- selfdrive/boardd/boardd.cc | 4 ++-- system/loggerd/encoderd.cc | 2 +- system/loggerd/loggerd.cc | 2 +- system/ubloxd/ublox_msg.cc | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/clutil.cc b/common/clutil.cc index 78f8462b07e4445..fab1649ee1fb941 100644 --- a/common/clutil.cc +++ b/common/clutil.cc @@ -39,7 +39,7 @@ void cl_print_info(cl_platform_id platform, cl_device_id device) { LOGD("name: %s", get_device_info(device, CL_DEVICE_NAME).c_str()); LOGD("device version: %s", get_device_info(device, CL_DEVICE_VERSION).c_str()); LOGD("max work group size: %zu", work_group_size); - LOGD("type = %lu = %s", device_type, type_str); + LOGD("type = %d, %s", (int)device_type, type_str); } void cl_print_build_errors(cl_program program, cl_device_id device) { diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index f2696ccd819173b..8cb5dcdc5f227de 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -237,7 +237,7 @@ void can_send_thread(std::vector pandas, bool fake_send) { LOGT("sendcan sent to panda: %s", (panda->hw_serial()).c_str()); } } else { - LOGE("sendcan too old to send: %lu, %lu", nanos_since_boot(), event.getLogMonoTime()); + LOGE("sendcan too old to send: %" PRIu64 ", %" PRIu64, nanos_since_boot(), event.getLogMonoTime()); } } } @@ -277,7 +277,7 @@ void can_recv_thread(std::vector pandas) { std::this_thread::sleep_for(std::chrono::nanoseconds(remaining)); } else { if (ignition) { - LOGW("missed cycles (%lu) %ld", (int)-1*remaining/dt, remaining); + LOGW("missed cycles (%lu) %lld", (unsigned long)(-1*remaining/dt), (long long)remaining); } next_frame_time = cur_time; } diff --git a/system/loggerd/encoderd.cc b/system/loggerd/encoderd.cc index 456b9868c49feb6..1646b1ec087423b 100644 --- a/system/loggerd/encoderd.cc +++ b/system/loggerd/encoderd.cc @@ -81,7 +81,7 @@ void encoder_thread(EncoderdState *s, const LogCameraInfo &cam_info) { // detect loop around and drop the frames if (buf->get_frame_id() != extra.frame_id) { if (!lagging) { - LOGE("encoder %s lag buffer id: %lu extra id: %d", cam_info.thread_name, buf->get_frame_id(), extra.frame_id); + LOGE("encoder %s lag buffer id: %" PRIu64 " extra id: %d", cam_info.thread_name, buf->get_frame_id(), extra.frame_id); lagging = true; } continue; diff --git a/system/loggerd/loggerd.cc b/system/loggerd/loggerd.cc index ced95958964c4c7..284e0ef532593a9 100644 --- a/system/loggerd/loggerd.cc +++ b/system/loggerd/loggerd.cc @@ -260,7 +260,7 @@ void loggerd_thread() { if ((++msg_count % 1000) == 0) { double seconds = (millis_since_boot() - start_ts) / 1000.0; - LOGD("%lu messages, %.2f msg/sec, %.2f KB/sec", msg_count, msg_count / seconds, bytes_count * 0.001 / seconds); + LOGD("%" PRIu64 " messages, %.2f msg/sec, %.2f KB/sec", msg_count, msg_count / seconds, bytes_count * 0.001 / seconds); } count++; diff --git a/system/ubloxd/ublox_msg.cc b/system/ubloxd/ublox_msg.cc index 9e3c63d1340e529..7cecf58bed7d8a3 100644 --- a/system/ubloxd/ublox_msg.cc +++ b/system/ubloxd/ublox_msg.cc @@ -390,7 +390,7 @@ kj::Array UbloxMsgParser::parse_glonass_ephemeris(ubx_t::rxm_sfrbx_ eph.setP4(data->p4()); eph.setSvURA(glonass_URA_lookup.at(data->f_t())); if (msg->sv_id() != data->n()) { - LOGE("SV_ID != SLOT_NUMBER: %d %lu", msg->sv_id(), data->n()); + LOGE("SV_ID != SLOT_NUMBER: %d %" PRIu64, msg->sv_id(), data->n()); } eph.setSvType(data->m()); }