Ticket #45001

generate_packets.py: check for errors when sending all fields

Date d'ouverture: 2022-07-04 05:55 Dernière mise à jour: 2022-07-06 04:01

Rapporteur:
Propriétaire:
Type:
État:
Atteints
Composant:
Jalon:
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
1

Détails

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
  • Résolution Update from Aucun to Accepted
Commentaire

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
  • État Update from Ouvert to Atteints
  • Résolution Update from Accepted to Fixed

Modifier

Please login to add comment to this ticket » Connexion