mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibEDID: Format PNP ID data a little more cleanly
Namely, do not append unnecessary new lines between PNP ID entries. This just makes the generated code a bit easier to look through.
This commit is contained in:
parent
763b08c23f
commit
936e97b066
Notes:
sideshowbarker
2024-07-17 06:46:15 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/936e97b066 Pull-request: https://github.com/SerenityOS/serenity/pull/21839 Reviewed-by: https://github.com/shannonbooth ✅
1 changed files with 5 additions and 7 deletions
|
@ -197,9 +197,9 @@ namespace PnpIDs {
|
|||
StringView manufacturer_id;
|
||||
StringView manufacturer_name;
|
||||
struct {
|
||||
u16 year{};
|
||||
u8 month{};
|
||||
u8 day{};
|
||||
u16 year { 0 };
|
||||
u8 month { 0 };
|
||||
u8 day { 0 };
|
||||
} approval_date;
|
||||
};
|
||||
|
||||
|
@ -223,8 +223,7 @@ static ErrorOr<void> generate_source(Core::File& file, HashMap<DeprecatedString,
|
|||
|
||||
namespace PnpIDs {
|
||||
|
||||
static constexpr PnpIDData s_pnp_ids[] = {
|
||||
)~~~");
|
||||
static constexpr PnpIDData s_pnp_ids[] = {)~~~");
|
||||
|
||||
for (auto& pnp_id_data : pnp_ids) {
|
||||
generator.set("manufacturer_id", pnp_id_data.key);
|
||||
|
@ -234,8 +233,7 @@ static constexpr PnpIDData s_pnp_ids[] = {
|
|||
generator.set("approval_day", DeprecatedString::formatted("{}", pnp_id_data.value.approval_date.day));
|
||||
|
||||
generator.append(R"~~~(
|
||||
{ "@manufacturer_id@"sv, "@manufacturer_name@"sv, { @approval_year@, @approval_month@, @approval_day@ } },
|
||||
)~~~");
|
||||
{ "@manufacturer_id@"sv, "@manufacturer_name@"sv, { @approval_year@, @approval_month@, @approval_day@ } },)~~~");
|
||||
}
|
||||
|
||||
generator.append(R"~~~(
|
||||
|
|
Loading…
Add table
Reference in a new issue