You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/12/03 17:48:35 UTC

[GitHub] [incubator-kvrocks] MaximSmolskiy opened a new pull request, #1156: Fix modernize-use-nullptr warning reported by clang-tidy

MaximSmolskiy opened a new pull request, #1156:
URL: https://github.com/apache/incubator-kvrocks/pull/1156

   Fix #1100


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] MaximSmolskiy commented on a diff in pull request #1156: Fix modernize-use-nullptr warning reported by clang-tidy

Posted by GitBox <gi...@apache.org>.
MaximSmolskiy commented on code in PR #1156:
URL: https://github.com/apache/incubator-kvrocks/pull/1156#discussion_r1038821050


##########
src/types/geohash.cc:
##########
@@ -166,7 +166,7 @@ void geohashGetCoordRange(GeoHashRange *long_range, GeoHashRange *lat_range) {
 int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range, double longitude, double latitude,
                   uint8_t step, GeoHashBits *hash) {
   /* Check basic arguments sanity. */
-  if (hash == NULL || step > 32 || step == 0 || RANGEPISZERO(lat_range) || RANGEPISZERO(long_range)) return 0;
+  if (hash == nullptr || step > 32 || step == 0 || RANGEPISZERO(lat_range) || RANGEPISZERO(long_range)) return 0;

Review Comment:
   Replaced



##########
src/types/geohash.cc:
##########
@@ -203,7 +203,7 @@ int geohashEncodeWGS84(double longitude, double latitude, uint8_t step, GeoHashB
 
 int geohashDecode(const GeoHashRange &long_range, const GeoHashRange &lat_range, const GeoHashBits &hash,
                   GeoHashArea *area) {
-  if (HASHISZERO(hash) || NULL == area || RANGEISZERO(lat_range) || RANGEISZERO(long_range)) {
+  if (HASHISZERO(hash) || nullptr == area || RANGEISZERO(lat_range) || RANGEISZERO(long_range)) {

Review Comment:
   Replaced



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on pull request #1156: Fix modernize-use-nullptr warning reported by clang-tidy

Posted by GitBox <gi...@apache.org>.
git-hulk commented on PR #1156:
URL: https://github.com/apache/incubator-kvrocks/pull/1156#issuecomment-1336301013

   Thanks all, merging...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk merged pull request #1156: Fix modernize-use-nullptr warning reported by clang-tidy

Posted by GitBox <gi...@apache.org>.
git-hulk merged PR #1156:
URL: https://github.com/apache/incubator-kvrocks/pull/1156


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] torwig commented on a diff in pull request #1156: Fix modernize-use-nullptr warning reported by clang-tidy

Posted by GitBox <gi...@apache.org>.
torwig commented on code in PR #1156:
URL: https://github.com/apache/incubator-kvrocks/pull/1156#discussion_r1038820615


##########
src/types/geohash.cc:
##########
@@ -166,7 +166,7 @@ void geohashGetCoordRange(GeoHashRange *long_range, GeoHashRange *lat_range) {
 int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range, double longitude, double latitude,
                   uint8_t step, GeoHashBits *hash) {
   /* Check basic arguments sanity. */
-  if (hash == NULL || step > 32 || step == 0 || RANGEPISZERO(lat_range) || RANGEPISZERO(long_range)) return 0;
+  if (hash == nullptr || step > 32 || step == 0 || RANGEPISZERO(lat_range) || RANGEPISZERO(long_range)) return 0;

Review Comment:
   You can go further an replace `hash == nullptr` with `!hash`.



##########
src/types/geohash.cc:
##########
@@ -203,7 +203,7 @@ int geohashEncodeWGS84(double longitude, double latitude, uint8_t step, GeoHashB
 
 int geohashDecode(const GeoHashRange &long_range, const GeoHashRange &lat_range, const GeoHashBits &hash,
                   GeoHashArea *area) {
-  if (HASHISZERO(hash) || NULL == area || RANGEISZERO(lat_range) || RANGEISZERO(long_range)) {
+  if (HASHISZERO(hash) || nullptr == area || RANGEISZERO(lat_range) || RANGEISZERO(long_range)) {

Review Comment:
   And the same trick here: `nullptr == area` => `!area`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org