Incidencia #48786

specenum generator: Value prefix in header

Abrir Fecha: 2023-10-02 05:51 Última actualización: 2023-10-05 18:14

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Hito:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
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 History (3/8 Histories)

2023-10-02 05:51 Updated by: cazfi
  • New Ticket "specenum generator: Valure prefix in header" created
2023-10-02 05:56 Updated by: cazfi
Comentario

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 Updated by: cazfi
  • Summary Updated
2023-10-02 16:45 Updated by: alienvalkyrie
Comentario

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 Updated by: alienvalkyrie
  • Propietario Update from (Ninguno) to alienvalkyrie
  • Resolución Update from Ninguno to Accepted
Comentario

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 Updated by: alienvalkyrie
Comentario

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 Updated by: alienvalkyrie
  • Estado Update from Open to Cerrado
  • Resolución Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Entrar