Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace CHECK_RETURN_IF_FALSE with RET_CHECK #902

Merged
merged 6 commits into from
Feb 4, 2022

Conversation

pudelkoM
Copy link
Member

@pudelkoM pudelkoM commented Jan 14, 2022

This PR replaces the home-grown CHECK_RETURN_IF_FALSE macro with the more common RET_CHECK one. Semantics and behavior stay the same, no user-code changes needed. Code readability is improved a little, as the new macro is shorter, leading to less line splits.
We hope that this will make migration to absl::Status easier eventually, as we will probably go with whatever solution Google comes up with.

Fixes #579

stratum/lib/macros.h Outdated Show resolved Hide resolved
@pudelkoM pudelkoM force-pushed the replace-check-return-if-false-macro branch from e0d8011 to bf9e9c7 Compare January 14, 2022 01:27
@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #902 (47a694e) into main (4f0133d) will increase coverage by 0.07%.
The diff coverage is 74.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #902      +/-   ##
==========================================
+ Coverage   79.10%   79.17%   +0.07%     
==========================================
  Files         339      339              
  Lines       30938    30915      -23     
==========================================
+ Hits        24474    24478       +4     
+ Misses       6464     6437      -27     
Impacted Files Coverage Δ
stratum/hal/lib/barefoot/bfrt_switch.cc 57.81% <0.00%> (ø)
stratum/hal/lib/bcm/bcm_switch.cc 60.28% <0.00%> (ø)
stratum/hal/lib/common/admin_utils.cc 0.00% <0.00%> (ø)
stratum/hal/lib/np4intel/np4_chassis_manager.cc 42.36% <0.00%> (ø)
stratum/hal/lib/p4/p4_info_manager.cc 81.94% <0.00%> (ø)
stratum/hal/lib/phal/phal.cc 21.50% <0.00%> (+0.45%) ⬆️
stratum/hal/lib/phal/tai/taish_client.cc 1.02% <0.00%> (+<0.01%) ⬆️
stratum/lib/macros.h 94.44% <ø> (ø)
stratum/lib/security/auth_policy_checker.cc 31.03% <ø> (ø)
stratum/hal/lib/phal/onlp/onlp_wrapper.cc 32.16% <3.57%> (ø)
... and 51 more

@pudelkoM pudelkoM force-pushed the replace-check-return-if-false-macro branch from bf9e9c7 to a051503 Compare January 27, 2022 23:56
@pudelkoM pudelkoM marked this pull request as ready for review January 27, 2022 23:56
@pudelkoM pudelkoM force-pushed the replace-check-return-if-false-macro branch from a051503 to 5e77e23 Compare January 28, 2022 01:12
@pudelkoM pudelkoM force-pushed the replace-check-return-if-false-macro branch from 5e77e23 to 9d21185 Compare January 28, 2022 01:12
Yi-Tseng
Yi-Tseng previously approved these changes Jan 28, 2022
@pudelkoM pudelkoM force-pushed the replace-check-return-if-false-macro branch from 72d8248 to 7a2630a Compare January 28, 2022 02:45
@pudelkoM pudelkoM force-pushed the replace-check-return-if-false-macro branch from 91e7903 to fe6083f Compare February 4, 2022 20:44
@pudelkoM pudelkoM force-pushed the replace-check-return-if-false-macro branch from fe6083f to 47a694e Compare February 4, 2022 21:58
@pudelkoM
Copy link
Member Author

pudelkoM commented Feb 4, 2022

Lint failure is expected, as bfrt_table_manager_test.cc and bfrt_table_manager.cc are unformatted.

@pudelkoM pudelkoM merged commit d0cb857 into main Feb 4, 2022
@pudelkoM pudelkoM deleted the replace-check-return-if-false-macro branch February 4, 2022 23:26
ffoulkes added a commit to ipdk-io/stratum-dev that referenced this pull request Jan 15, 2024
Signed-off-by: Derek G Foster <derek.foster@intel.com>
ffoulkes added a commit to ipdk-io/stratum-dev that referenced this pull request Jan 17, 2024
Signed-off-by: Derek G Foster <derek.foster@intel.com>
ffoulkes added a commit to ipdk-io/stratum-dev that referenced this pull request Jan 17, 2024
Signed-off-by: Derek G Foster <derek.foster@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace CHECK_RETURN_IF_FALSE with RET_CHECK
2 participants