From 216b984d394647beff67ea8e9f18268fd99f5bb0 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Fri, 21 Aug 2020 14:36:39 -0500 Subject: [PATCH] delete nullptr,0 section of style guide The nullptr/0 distinction should go without saying, and I think worrying about any of the rest just burns brainpower. Change-Id: I7d0aea300f114e512437c3820f4e80a1408575c1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312472 Reviewed-by: John Stiles Reviewed-by: Brian Salomon Commit-Queue: Mike Klein --- site/dev/contrib/style.md | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/site/dev/contrib/style.md b/site/dev/contrib/style.md index 97d7357a6b..0eac410010 100644 --- a/site/dev/contrib/style.md +++ b/site/dev/contrib/style.md @@ -460,29 +460,6 @@ Summary: Use `int` unless you have need a guarantee on the bit count, then use of using unsigned. Bitfields use `uint32_t` unless they have to be made shorter for packing or performance reasons. -`nullptr`, 0 ------------- - -Use `nullptr` for pointers, 0 for ints. We suggest explicit `nullptr` comparisons when -checking for `nullptr` pointers, as documentation: - - -~~~~ -if (nullptr == x) { // slightly preferred over if (!x) - ... -} -~~~~ - -When checking non-`nullptr` pointers we think implicit comparisons read better than -an explicit comparison's double negative: - - -~~~~ -if (x) { // slightly preferred over if (nullptr != x) - ... -} -~~~~ - Function Parameters -------------------