From 7959a49f75271433719cf8b287dfcb52e43e86db Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Sat, 27 Feb 2021 18:11:14 +0800 Subject: [PATCH] src: fix some compiler warnings --- src/llv8-inl.h | 2 +- src/llv8.cc | 8 ++++---- src/printer.cc | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/llv8-inl.h b/src/llv8-inl.h index f32fdf05..989621e6 100644 --- a/src/llv8-inl.h +++ b/src/llv8-inl.h @@ -65,7 +65,7 @@ inline T LLV8::LoadValue(int64_t addr, Error& err) { #else #define _s "value" #endif - err = Error(true, "The value %lx is not a valid %s", addr, _s); + err = Error(true, "The value %" PRId64 " is not a valid %s", addr, _s); #undef _s return T(); } diff --git a/src/llv8.cc b/src/llv8.cc index c3a331ab..5dcca749 100644 --- a/src/llv8.cc +++ b/src/llv8.cc @@ -937,7 +937,7 @@ std::vector> JSObject::DescriptorEntries(Map map, for (int64_t i = 0; i < own_descriptors_count; i++) { Smi details = descriptors.GetDetails(i); if (!details.Check()) { - PRINT_DEBUG("Failed to get details for index %ld", i); + PRINT_DEBUG("Failed to get details for index %" PRId64, i); entries.push_back(std::pair(Value(), Value())); continue; } @@ -1043,7 +1043,7 @@ void JSObject::DescriptorKeys(std::vector& keys, Map map, for (int64_t i = 0; i < own_descriptors_count; i++) { Smi details = descriptors.GetDetails(i); if (!details.Check()) { - PRINT_DEBUG("Failed to get details for index %ld", i); + PRINT_DEBUG("Failed to get details for index %" PRId64, i); keys.push_back("???"); continue; } @@ -1145,7 +1145,7 @@ Value JSObject::GetDescriptorProperty(std::string key_name, Map map, for (int64_t i = 0; i < own_descriptors_count; i++) { Smi details = descriptors.GetDetails(i); if (!details.Check()) { - PRINT_DEBUG("Failed to get details for index %ld", i); + PRINT_DEBUG("Failed to get details for index %" PRId64, i); continue; } @@ -1322,7 +1322,7 @@ StackTrace::StackTrace(JSArray frame_array, Error& err) ((frame_array_.GetArrayLength(err) - 1) % multiplier_ != 0)) { PRINT_DEBUG( "JSArray doesn't look like a Stack Frames array. stack_len: %d " - "array_len: %ld", + "array_len: %" PRId64, len_, frame_array_.GetArrayLength(err)); len_ = -1; multiplier_ = -1; diff --git a/src/printer.cc b/src/printer.cc index 377adc34..66cf14d2 100644 --- a/src/printer.cc +++ b/src/printer.cc @@ -999,7 +999,7 @@ std::string Printer::StringifyDescriptors(v8::JSObject js_object, v8::Map map, if (key.Check()) { ss << key.ToString(err); } else { - PRINT_DEBUG("Failed to get key for index %ld", i); + PRINT_DEBUG("Failed to get key for index %" PRId64, i); ss << "???"; } ss << rang::fg::reset << rang::style::reset; @@ -1009,7 +1009,7 @@ std::string Printer::StringifyDescriptors(v8::JSObject js_object, v8::Map map, v8::Smi details = descriptors.GetDetails(i); if (!details.Check()) { - PRINT_DEBUG("Failed to get details for index %ld", i); + PRINT_DEBUG("Failed to get details for index %" PRId64, i); res += "???"; continue; }