1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Add LENGTH_OF() macro.

Determining the length of arrays that could be calculated at compile time was a bit piecemeal, with special macros used sometimes and with the math done directly other times.

This macro makes the task easier, uses less space, and automatically adjusts when the type changes.
This commit is contained in:
David Steele
2022-04-07 19:00:15 -04:00
parent 8be11d32e4
commit 571dceefec
29 changed files with 60 additions and 59 deletions

View File

@ -23,7 +23,7 @@ testRun(void)
// Install local command handler shim
static const ProtocolServerHandler testLocalHandlerList[] = {PROTOCOL_SERVER_HANDLER_VERIFY_LIST};
hrnProtocolLocalShimInstall(testLocalHandlerList, PROTOCOL_SERVER_HANDLER_LIST_SIZE(testLocalHandlerList));
hrnProtocolLocalShimInstall(testLocalHandlerList, LENGTH_OF(testLocalHandlerList));
StringList *argListBase = strLstNew();
hrnCfgArgRawZ(argListBase, cfgOptStanza, "db");