*: let libfmt quote strings

This commit is contained in:
Max Kellermann
2024-04-16 11:06:34 +02:00
parent 39c9e92f42
commit 0c1ecc96a8
71 changed files with 160 additions and 160 deletions

View File

@@ -145,10 +145,10 @@ decoder_plugin_init_all(const ConfigData &config)
decoder_plugins_enabled[i] = true;
} catch (const PluginUnavailable &e) {
FmtError(decoder_domain,
"Decoder plugin '{}' is unavailable: {}",
"Decoder plugin {:?} is unavailable: {}",
plugin.name, std::current_exception());
} catch (...) {
std::throw_with_nested(FmtRuntimeError("Failed to initialize decoder plugin '{}'",
std::throw_with_nested(FmtRuntimeError("Failed to initialize decoder plugin {:?}",
plugin.name));
}
}

View File

@@ -481,7 +481,7 @@ FfmpegDecode(DecoderClient &client, InputStream *input,
const AVCodecDescriptor *codec_descriptor =
avcodec_descriptor_get(codec_params.codec_id);
if (codec_descriptor != nullptr)
FmtDebug(ffmpeg_domain, "codec '{}'",
FmtDebug(ffmpeg_domain, "codec {:?}",
codec_descriptor->name);
const AVCodec *codec = avcodec_find_decoder(codec_params.codec_id);
@@ -590,10 +590,10 @@ ffmpeg_decode(DecoderClient &client, InputStream &input)
const auto *input_format = format_context->iformat;
if (input_format->long_name == nullptr)
FmtDebug(ffmpeg_domain, "detected input format '{}'",
FmtDebug(ffmpeg_domain, "detected input format {:?}",
input_format->name);
else
FmtDebug(ffmpeg_domain, "detected input format '{}' ({})",
FmtDebug(ffmpeg_domain, "detected input format {:?} ({:?})",
input_format->name, input_format->long_name);
FfmpegDecode(client, &input, *format_context);
@@ -665,10 +665,10 @@ ffmpeg_uri_decode(DecoderClient &client, const char *uri)
const auto *input_format = format_context->iformat;
if (input_format->long_name == nullptr)
FmtDebug(ffmpeg_domain, "detected input format '{}'",
FmtDebug(ffmpeg_domain, "detected input format {:?}",
input_format->name);
else
FmtDebug(ffmpeg_domain, "detected input format '{}' ({})",
FmtDebug(ffmpeg_domain, "detected input format {:?} ({:?})",
input_format->name, input_format->long_name);
FfmpegDecode(client, nullptr, *format_context);

View File

@@ -142,7 +142,7 @@ gme_file_decode(DecoderClient &client, Path path_fs)
AtScopeExit(emu) { gme_delete(emu); };
FmtDebug(gme_domain, "emulator type '{}'",
FmtDebug(gme_domain, "emulator type {:?}",
gme_type_system(gme_type(emu)));
if (gme_accuracy >= 0)

View File

@@ -529,7 +529,7 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
&lame->version.major, &lame->version.minor) != 2)
return false;
FmtDebug(mad_domain, "detected LAME version {}.{} (\"{}\")",
FmtDebug(mad_domain, "detected LAME version {}.{} ({:?})",
lame->version.major, lame->version.minor, lame->encoder);
/* The reference volume was changed from the 83dB used in the

View File

@@ -62,7 +62,7 @@ static void loadRom(const Path rom_path, uint8_t *dump)
{
FileReader romDump(rom_path);
if (romDump.Read(std::as_writable_bytes(std::span{dump, rom_size})) != rom_size)
throw FmtRuntimeError("Could not load rom dump '{}'", rom_path);
throw FmtRuntimeError("Could not load rom dump {:?}", rom_path);
}
/**
@@ -74,7 +74,7 @@ sidplay_load_songlength_db(const Path path)
auto db = std::make_unique<SidDatabase>();
bool error = !db->open(path.c_str());
if (error)
throw FmtRuntimeError("unable to read songlengths file {}: {}",
throw FmtRuntimeError("unable to read songlengths file {:?}: {}",
path, db->error());
return db;

View File

@@ -41,7 +41,7 @@ WavpackOpenInput(Path path, int flags, int norm_offset)
auto wpc = WavpackOpenFileInput(np, error,
flags, norm_offset);
if (wpc == nullptr)
throw FmtRuntimeError("failed to open WavPack file \"{}\": {}",
throw FmtRuntimeError("failed to open WavPack file {:?}: {}",
path, error);
return wpc;