diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-09 15:17:00 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-12 09:32:46 +0000 |
commit | cbda01021c561bd061cb03a1c1bab58199ac2307 (patch) | |
tree | 537e8397e84d3ccd4e16753101ded1bf676392b2 /auto_tests | |
parent | 37f8f566d53a3e2603467aa0bbe1e29581ddd561 (diff) |
Fix style in DHT.c.
* Removed `ARRAY_SIZE` and use NULL markers for end of array, instead.
The alternative is + size, but for these arrays, NULL markers made
sense, since they are arrays of non-null pointers.
* Made `INDEX_OF_PK` a self-contained macro, not dependent upon the
naming inside its call site. This is a minor change but makes the code
more local and reviews easier.
* No nested structs.
* Use only named function types ending in `_cb` for callbacks.
* Replaced two macros with functions.
* `++i` instead of `i++`.
* struct member names start with lowercase letters.
* It takes a bit of work to support `/**/` comments in preprocessor
macros, so I've decided not to support these. If a macro is complex
enough to need comments inside it, it's too complex. `//` comments are
allowed at the end of macro definitions.
* Callback typedefs must name their parameters.
Diffstat (limited to 'auto_tests')
-rw-r--r-- | auto_tests/monolith_test.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/auto_tests/monolith_test.cc b/auto_tests/monolith_test.cc index 7511decf..53b4982e 100644 --- a/auto_tests/monolith_test.cc +++ b/auto_tests/monolith_test.cc | |||
@@ -164,7 +164,7 @@ int main(int argc, char *argv[]) { | |||
164 | #if defined(__x86_64__) && defined(__LP64__) | 164 | #if defined(__x86_64__) && defined(__LP64__) |
165 | // toxcore/DHT | 165 | // toxcore/DHT |
166 | CHECK_SIZE(Client_data, 496); | 166 | CHECK_SIZE(Client_data, 496); |
167 | CHECK_SIZE(Cryptopacket_Handles, 16); | 167 | CHECK_SIZE(Cryptopacket_Handler, 16); |
168 | CHECK_SIZE(DHT, 676528); | 168 | CHECK_SIZE(DHT, 676528); |
169 | CHECK_SIZE(DHT_Friend, 5104); | 169 | CHECK_SIZE(DHT_Friend, 5104); |
170 | CHECK_SIZE(Hardening, 144); | 170 | CHECK_SIZE(Hardening, 144); |