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

checksrc: complain on == NULL or != 0 checks in conditions #6912

Merged
merged 2 commits into from Apr 22, 2021

Conversation

@bagder
Copy link
Member

@bagder bagder commented Apr 19, 2021

makes these boolean conditional checks consistent throughout the code base. Use if(!var) to check for == NULL and if(var) to check for != 0.

@bagder bagder added the tidy-up label Apr 19, 2021
@bagder bagder force-pushed the bagder/checksrc-conditions branch from 553df23 to da38cd0 Apr 21, 2021
bagder added 2 commits Apr 19, 2021
... remove '== NULL' and '!= 0'

Closes #6912
... to make them all consistenly use if(!var) and if(var)

Also added a few missing warnings to the documentation.

Closes #6912
@bagder bagder force-pushed the bagder/checksrc-conditions branch from da38cd0 to 52fab72 Apr 22, 2021
@bagder bagder closed this in 063d3f3 Apr 22, 2021
@bagder bagder merged commit 52fab72 into master Apr 22, 2021
46 of 51 checks passed
46 of 51 checks passed
@github-actions
codeql
Details
@github-actions
fuzzing
Details
@github-actions
macos normal
Details
@github-actions
macos debug
Details
@github-actions
macos libssh2
Details
@github-actions
macos c-ares
Details
@github-actions
macos HTTP only
Details
@github-actions
macos SecureTransport metalink
Details
@github-actions
macos OpenSSL metalink
Details
@github-actions
macos LibreSSL metalink
Details
@github-actions
macos torture
Details
@github-actions
macos torture-ftp
Details
@github-actions
macos macOS 10.15
Details
@github-actions
macos cmake clang OpenSSL
Details
@github-actions
macos cmake clang LibreSSL
Details
@github-actions
macos cmake gcc-8 OpenSSL
Details
@github-actions
macos cmake gcc-8 LibreSSL
Details
@github-actions
macos cmake gcc-9 OpenSSL
Details
@github-actions
macos cmake gcc-9 LibreSSL
Details
@azure-pipelines
curl.curl Build #20210422.4 had test failures
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw32_debug_schannel) windows windows msys1_mingw32_debug_schannel failed
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw64_debug_openssl) windows windows msys2_mingw64_debug_openssl failed
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw64_debug_schannel) windows windows msys2_mingw64_debug_schannel was canceled
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
@lgtm-com
LGTM analysis: Python No code changes detected
Details
@github-code-scanning
CodeQL No new or fixed alerts
Details
@cirrus-ci
FreeBSD freebsd_instance:family/freebsd-11-4 Task Summary
Details
@cirrus-ci
FreeBSD freebsd_instance:family/freebsd-12-2 Task Summary
Details
@lgtm-com
LGTM analysis: C/C++ No new or fixed alerts
Details
@bagder
buildbot/curl-unthreaded-solaris10-i386 Build done.
Details
@bagder
buildbot/curl-unthreaded-solaris10-sparc Build done.
Details
@mback2k
buildbot/curl_winssl_cross_x64 Build done.
Details
@mback2k
buildbot/curl_winssl_cross_x64_dbg Build done.
Details
@mback2k
buildbot/curl_winssl_cross_x86 Build done.
Details
@mback2k
buildbot/curl_winssl_cross_x86_dbg Build done.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@azure-pipelines
curl.curl (linux ubuntu default) linux ubuntu default succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu disable_http_smtp_imap) linux ubuntu disable_http_smtp_imap succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu disable_ipv6) linux ubuntu disable_ipv6 succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu disable_thredres) linux ubuntu disable_thredres succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu http_only) linux ubuntu http_only succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu torture) linux ubuntu torture succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw32_debug_openssl) windows windows msys1_mingw32_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw64_debug_openssl) windows windows msys1_mingw64_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw64_debug_schannel) windows windows msys1_mingw64_debug_schannel succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw_debug_openssl) windows windows msys1_mingw_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw_debug_schannel) windows windows msys1_mingw_debug_schannel succeeded
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw32_debug_openssl) windows windows msys2_mingw32_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw32_debug_schannel) windows windows msys2_mingw32_debug_schannel succeeded
Details
@deepcode-ci-bot
deepcode-ci-bot Well done, no issues found!
Details
@muse-dev
musedev Complete (14 min, 7/7 checks) no new bugs found
Details
@bagder bagder deleted the bagder/checksrc-conditions branch Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants