Tíquete #45001

generate_packets.py: check for errors when sending all fields

: 2022-07-04 05:55 Última Atualização: 2022-07-06 04:01

Relator:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
1

Details

Part of #43927. Follow-up to #45000. Check return values of dio_put_*() for everything that is sent and move common parts out of Field.get_put_real() into Field.get_put() or (where applicable) Variant.get_send().

Ticket History (3/5 Histories)

2022-07-04 05:55 Updated by: alienvalkyrie
  • New Ticket "generate_packets.py: check for errors when all fields" created
2022-07-04 06:08 Updated by: alienvalkyrie
  • Summary Updated
2022-07-04 06:37 Updated by: alienvalkyrie
  • Resolução Update from Nenhum to Accepted
Comentário

Note: This patch puts simplicity of the generation code over simplicity of the generated code, producing clunky-looking code for simple fields, like

  1. e = 0;
  2. e |= DIO_PUT(...);
  3. if (e) {
  4. log_packet_detailed("... field error detected");
  5. }
instead of the simpler
  1. if (DIO_PUT(...)) {
  2. log_packet_detailed("... field error detected");
  3. }
This will be a trend in further patches – the advantage being that the e |= DIO_PUT(...); line can be reused in other places (such as for array elements) in the future, and the surrounding code works equally well for less-simple fields (i.e. arrays).

2022-07-06 04:01 Updated by: alienvalkyrie
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Login