nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
10.02k stars 1.3k forks source link

Rename `*_MAX_SIZE` constants in FpConfig.h #2545

Closed thomas-bc closed 3 months ago

thomas-bc commented 6 months ago
F´ Version v3.4.3
Affected Component FpConfig.h

Problem Description

As noted in https://github.com/nasa/fprime/pull/2497#issuecomment-1964806316, there are some variables in FpConfig.h which are technically incorrectly named. For example,

#define FW_QUEUE_NAME_MAX_SIZE 80  //!< Max size of message queue name

80 is the size of the buffer, which needs to be null-terminated, so the real "name max size" would be 80 - 1 = 79.

We should rename all of these *_MAX_SIZE constants that represent a buffer size to *_BUFFER_SIZE, as it is much more clear what the constant really represents. It's possible renaming some of these might be a lot of effort (e.g. are they coded into FPP?).