Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/blob_serializer_deserializer-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ template <typename T>
std::vector<T> BlobDeserializer<Impl>::ReadVector() {
if (is_debug) {
std::string name = GetName<T>();
Debug("\nReadVector<%s>()(%d-byte)\n", name.c_str(), sizeof(T));
Debug("\nReadVector<%s>()(%d-byte)\n", name, sizeof(T));
}
size_t count = static_cast<size_t>(ReadArithmetic<size_t>());
if (count == 0) {
Expand All @@ -123,7 +123,7 @@ std::vector<T> BlobDeserializer<Impl>::ReadVector() {
if (is_debug) {
std::string str = std::is_arithmetic_v<T> ? "" : ToStr(result);
std::string name = GetName<T>();
Debug("ReadVector<%s>() read %s\n", name.c_str(), str.c_str());
Debug("ReadVector<%s>() read %s\n", name, str);
}
return result;
}
Expand Down Expand Up @@ -163,7 +163,7 @@ void BlobDeserializer<Impl>::ReadArithmetic(T* out, size_t count) {
DCHECK_GT(count, 0); // Should not read contents for vectors of size 0.
if (is_debug) {
std::string name = GetName<T>();
Debug("Read<%s>()(%d-byte), count=%d: ", name.c_str(), sizeof(T), count);
Debug("Read<%s>()(%d-byte), count=%d: ", name, sizeof(T), count);
}

size_t size = sizeof(T) * count;
Expand All @@ -172,7 +172,7 @@ void BlobDeserializer<Impl>::ReadArithmetic(T* out, size_t count) {
if (is_debug) {
std::string str =
"{ " + std::to_string(out[0]) + (count > 1 ? ", ... }" : " }");
Debug("%s, read %zu bytes\n", str.c_str(), size);
Debug("%s, read %zu bytes\n", str, size);
}
read_total += size;
}
Expand Down Expand Up @@ -240,10 +240,10 @@ size_t BlobSerializer<Impl>::WriteVector(const std::vector<T>& data) {
std::string name = GetName<T>();
Debug("\nAt 0x%x: WriteVector<%s>() (%d-byte), count=%d: %s\n",
sink.size(),
name.c_str(),
name,
sizeof(T),
data.size(),
str.c_str());
str);
}

size_t written_total = WriteArithmetic<size_t>(data.size());
Expand All @@ -259,7 +259,7 @@ size_t BlobSerializer<Impl>::WriteVector(const std::vector<T>& data) {

if (is_debug) {
std::string name = GetName<T>();
Debug("WriteVector<%s>() wrote %d bytes\n", name.c_str(), written_total);
Debug("WriteVector<%s>() wrote %d bytes\n", name, written_total);
}

return written_total;
Expand Down Expand Up @@ -319,10 +319,10 @@ size_t BlobSerializer<Impl>::WriteArithmetic(const T* data, size_t count) {
std::string name = GetName<T>();
Debug("At 0x%x: Write<%s>() (%zu-byte), count=%zu: %s",
sink.size(),
name.c_str(),
name,
sizeof(T),
count,
str.c_str());
str);
}

size_t size = sizeof(T) * count;
Expand Down
4 changes: 2 additions & 2 deletions src/compile_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ CompileCacheEntry* CompileCacheHandler::GetOrInsert(Local<String> code,
if (!relative_path.empty()) {
file_path = relative_path;
Debug("[compile cache] using relative path %s from %s\n",
file_path.c_str(),
compile_cache_dir_.c_str());
file_path,
compile_cache_dir_);
}
}
uint32_t key = GetCacheKey(file_path, type);
Expand Down
2 changes: 1 addition & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,7 @@ size_t Environment::NearHeapLimitCallback(void* data,
env->RemoveHeapSnapshotNearHeapLimitCallback(0);
}

FPrintF(stderr, "Wrote snapshot to %s\n", filename.c_str());
FPrintF(stderr, "Wrote snapshot to %s\n", filename);
// Tell V8 to reset the heap limit once the heap usage falls down to
// 95% of the initial limit.
env->isolate()->AutomaticallyRestoreInitialHeapLimit(0.95);
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ uint64_t V8ProfilerConnection::DispatchMessage(const char* method,
Debug(env(),
DebugCategory::INSPECTOR_PROFILER,
"Dispatching message %s\n",
message.c_str());
message);
session_->Dispatch(StringView(message_data, message.length()));
return id;
}
Expand Down
2 changes: 1 addition & 1 deletion src/node_builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ bool BuiltinLoader::CompileAllBuiltinsAndCopyCodeCache(
if (bootstrapCatch.HasCaught()) {
per_process::Debug(DebugCategory::CODE_CACHE,
"Failed to compile code cache for %s\n",
id.data());
id);
all_succeeded = false;
PrintCaughtException(Isolate::GetCurrent(), context, bootstrapCatch);
} else {
Expand Down
32 changes: 14 additions & 18 deletions src/node_config_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ParseResult ConfigReader::ProcessOptionValue(
case options_parser::OptionType::kBoolean: {
bool result;
if (option_value->get_bool().get(result)) {
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}

Expand All @@ -75,13 +75,13 @@ ParseResult ConfigReader::ProcessOptionValue(
std::vector<std::string> result;
simdjson::ondemand::array raw_imports;
if (option_value->get_array().get(raw_imports)) {
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}
for (auto raw_import : raw_imports) {
std::string_view import;
if (raw_import.get_string(import)) {
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}
output->push_back(option_name + "=" + std::string(import));
Expand All @@ -91,22 +91,22 @@ ParseResult ConfigReader::ProcessOptionValue(
case simdjson::ondemand::json_type::string: {
std::string result;
if (option_value->get_string(result)) {
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}
output->push_back(option_name + "=" + result);
break;
}
default:
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}
break;
}
case options_parser::OptionType::kString: {
std::string result;
if (option_value->get_string(result)) {
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}
output->push_back(option_name + "=" + result);
Expand All @@ -115,7 +115,7 @@ ParseResult ConfigReader::ProcessOptionValue(
case options_parser::OptionType::kInteger: {
int64_t result;
if (option_value->get_int64().get(result)) {
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}
output->push_back(option_name + "=" + std::to_string(result));
Expand All @@ -125,22 +125,19 @@ ParseResult ConfigReader::ProcessOptionValue(
case options_parser::OptionType::kUInteger: {
uint64_t result;
if (option_value->get_uint64().get(result)) {
FPrintF(stderr, "Invalid value for %s\n", option_name.c_str());
FPrintF(stderr, "Invalid value for %s\n", option_name);
return ParseResult::InvalidContent;
}
output->push_back(option_name + "=" + std::to_string(result));
break;
}
case options_parser::OptionType::kNoOp: {
FPrintF(stderr,
"No-op flag %s is currently not supported\n",
option_name.c_str());
FPrintF(
stderr, "No-op flag %s is currently not supported\n", option_name);
return ParseResult::InvalidContent;
}
case options_parser::OptionType::kV8Option: {
FPrintF(stderr,
"V8 flag %s is currently not supported\n",
option_name.c_str());
FPrintF(stderr, "V8 flag %s is currently not supported\n", option_name);
return ParseResult::InvalidContent;
}
default:
Expand Down Expand Up @@ -189,8 +186,7 @@ ParseResult ConfigReader::ParseOptions(
if (option != options_map.end()) {
// If the option has already been set, return an error
if (unique_options->contains(option->first)) {
FPrintF(
stderr, "Option %s is already defined\n", option->first.c_str());
FPrintF(stderr, "Option %s is already defined\n", option->first);
return ParseResult::InvalidContent;
}
// Add the option to the unique set to prevent duplicates
Expand All @@ -206,7 +202,7 @@ ParseResult ConfigReader::ParseOptions(
FPrintF(stderr,
"Unknown or not allowed option %s for namespace %s\n",
option_key,
namespace_name.c_str());
namespace_name);
return ParseResult::InvalidContent;
}
}
Expand Down Expand Up @@ -303,7 +299,7 @@ ParseResult ConfigReader::ParseConfig(const std::string_view& config_path) {
if (field_error) {
FPrintF(stderr,
"\"%s\" value unexpected for %s (should be an object)\n",
namespace_name.c_str(),
namespace_name,
config_path.data());
return ParseResult::InvalidContent;
}
Expand Down
6 changes: 2 additions & 4 deletions src/node_errors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,8 @@ static std::string GetErrorSource(Isolate* isolate,
end -= script_start;
}

std::string buf = SPrintF("%s:%i\n%s\n",
filename_string,
linenum,
sourceline.c_str());
std::string buf =
SPrintF("%s:%i\n%s\n", filename_string, linenum, sourceline);
CHECK_GT(buf.size(), 0);
*added_exception_line = true;

Expand Down
2 changes: 1 addition & 1 deletion src/node_sea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ int BuildAssets(const std::unordered_map<std::string, std::string>& config,
int r = ReadFileSync(&blob, path.c_str());
if (r != 0) {
const char* err = uv_strerror(r);
FPrintF(stderr, "Cannot read asset %s: %s\n", path.c_str(), err);
FPrintF(stderr, "Cannot read asset %s: %s\n", path, err);
return r;
}
assets->emplace(key, std::move(blob));
Expand Down
Loading
Loading