[message] improve scoping of Buffer constants (#11885)

This commit moves two global constants, `kBufferSize` and
`kNumBuffers`, into their respective class scopes to improve
encapsulation and avoid potential name conflicts.

The `kBufferSize` constant is moved into the `Buffer` class as
`Buffer::kSize`. As `kBufferSize` is a generic and commonly used
name, this change prevents potential symbol collisions.

Similarly, the `kNumBuffers` constant is moved into the `MessagePool`
class, as it is exclusively used within that class.

All usages of these constants have been updated throughout the
codebase to reflect their new names.
This commit is contained in:
Abtin Keshavarzian
2025-08-29 18:21:04 -07:00
committed by GitHub
parent 269268fbf6
commit 4d1ae8552a
5 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ namespace ot {
void TestMessage(void)
{
static constexpr uint16_t kMaxSize = (kBufferSize * 3 + 24);
static constexpr uint16_t kMaxSize = (Buffer::kSize * 3 + 24);
static constexpr uint16_t kOffsetStep = 101;
static constexpr uint16_t kLengthStep = 21;