Ticket #48786

specenum generator: Value prefix in header

Eröffnet am: 2023-10-02 05:51 Letztes Update: 2023-10-05 18:14

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
1

Details

Currently each value in specenum generator .def file contains the prefix, e.g., MANUAL_SETTINGS, MANUAL_COMMANDS ...

Should we move the prefix to header part, and define values simply as SETTINGS, COMMANDS ... ?

Ticket-Verlauf (3/8 Historien)

2023-10-02 05:51 Aktualisiert von: cazfi
  • New Ticket "specenum generator: Valure prefix in header" created
2023-10-02 05:56 Aktualisiert von: cazfi
Kommentar

Having support for prefix in header would not prevent one from leaving prefix empty, and still writing all of it to individual values.

2023-10-02 06:02 Aktualisiert von: cazfi
  • Summary Updated
2023-10-02 16:45 Aktualisiert von: alienvalkyrie
Kommentar

This was something I'd been thinking of from the start (but left out for the sake of minimal initial implementation). The only reservation I have about this is that when searching source files (e.g. git grep or just searching on github) for one of the enum constants, right now you'd still find the corresponding line in the .def at least; if we change this, then once the generated headers are no longer checked into git, you wouldn't be able to find the definition at all if you don't already know where to look.

Then again, the same is already true for all the auxiliary functions; and you would still be able to find the name of the enum type itself.

2023-10-02 18:07 Aktualisiert von: alienvalkyrie
  • Verantwortlicher Update from (Keine) to alienvalkyrie
  • Lösung Update from Keine to Accepted
Kommentar

Attached patch. Using the prefix is optional, so it's backwards compatible with other enums converted to the new format in the interim (e.g. #48785).

I don't like that this now leads to writing count COUNT a bunch; will make a follow-up for that.

2023-10-02 18:37 Aktualisiert von: alienvalkyrie
Kommentar

Reply To alienvalkyrie

I don't like that this now leads to writing count COUNT a bunch; will make a follow-up for that.

~> #48789

2023-10-05 18:14 Aktualisiert von: alienvalkyrie
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

Please login to add comment to this ticket » Anmelden