Mailing List Archive

[MythTV/mythtv] 57cd22: clazy: Fix static analyzer warnings in latest web-...
Branch: refs/heads/master
Home: https://github.com/MythTV/mythtv
Commit: 57cd225b7ae16dcc04d60041d72c67501f56ef19
https://github.com/MythTV/mythtv/commit/57cd225b7ae16dcc04d60041d72c67501f56ef19
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/channelscanner_web.cpp
M mythtv/libs/libmythtv/channelscan/channelscanner_web.h
M mythtv/programs/mythbackend/servicesv2/v2channel.cpp

Log Message:
-----------
clazy: Fix static analyzer warnings in latest web-app commits.

QStrings are nontrivial and should be passed as const reference
instead of copying.

Convert a nontrivial range-for variable into a const reference.

Change a variable declaration from "auto" to "auto*" to make it
obvious that its a a pointer to something.


Commit: e92deafa6a88c8af54983ac6e7a7a55d2dd73584
https://github.com/MythTV/mythtv/commit/e92deafa6a88c8af54983ac6e7a7a55d2dd73584
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/programs/mythbackend/servicesv2/v2captureCard.h
M mythtv/programs/mythbackend/servicesv2/v2channelScan.h
M mythtv/programs/mythbackend/servicesv2/v2databaseStatus.h

Log Message:
-----------
tidy: Remove redundant initializers from constructor functions.

Remove any zero or false initializers, since that is the default value
for those types of variables.

This has the added advantage of making any non-default values stand
out, instead of being lost in a long list of default values.

See https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html


Commit: f175b6c4743813a69d0c9bad71989badd960d869
https://github.com/MythTV/mythtv/commit/f175b6c4743813a69d0c9bad71989badd960d869
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M .clang-tidy

Log Message:
-----------
tidy: Silence a new warning in clang-tidy 16.


Commit: f3eb3cf33e2543770192dd2626fcdf7b9cfc392e
https://github.com/MythTV/mythtv/commit/f3eb3cf33e2543770192dd2626fcdf7b9cfc392e
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythbase/http/mythhttpsocket.cpp
M mythtv/libs/libmythmetadata/dbaccess.cpp
M mythtv/libs/libmythmetadata/metadatafactory.cpp
M mythtv/libs/libmythmetadata/videometadata.cpp
M mythtv/libs/libmythmetadata/videoscan.cpp
M mythtv/libs/libmythtv/DVD/mythdvddecoder.cpp
M mythtv/libs/libmythtv/channelsettings.cpp
M mythtv/libs/libmythtv/channelutil.cpp
M mythtv/libs/libmythtv/decoders/mythvdpauhelper.cpp
M mythtv/libs/libmythtv/dtvconfparser.cpp
M mythtv/programs/mythfrontend/editvideometadata.cpp
M mythtv/programs/mythfrontend/videodlg.cpp
M mythtv/programs/mythfrontend/videolist.cpp

Log Message:
-----------
tidy: Use emplace_back instead of passing a temporary object to push_back.

This check has been around for some time, but clang 16 finds a couple
of additional instances passing a temporary object that can be
modernized.

All changes made by clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-emplace.html


Commit: a1b5052f185dd5f438680de2ca5288041d4f2ad0
https://github.com/MythTV/mythtv/commit/a1b5052f185dd5f438680de2ca5288041d4f2ad0
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythbase/mythcommandlineparser.h

Log Message:
-----------
tidy: Convert a function parameter to use a const reference in the command line parser.

This check has been around for some time, but clang 16 finds a new
instance of passing a value instead of a const reference.

https://clang.llvm.org/extra/clang-tidy/checks/performance/unnecessary-value-param.html


Commit: 478c9a622cb8b891c93c17ead979db8409f440a7
https://github.com/MythTV/mythtv/commit/478c9a622cb8b891c93c17ead979db8409f440a7
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythui/platforms/mythdrmdevice.h

Log Message:
-----------
tidy: Add a couple of default member initializers.

This check has been around for some time, but clang 16 finds three new
instance where an object member fields aren't initialized. These can
be fixed by adding default initializes to the object definition.

https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-type-member-init.html


Commit: dfea14276495d297dc86cf6b2f84419c913602d6
https://github.com/MythTV/mythtv/commit/dfea14276495d297dc86cf6b2f84419c913602d6
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/programs/mythbackend/services/video.cpp
M mythtv/programs/mythbackend/servicesv2/v2video.cpp

Log Message:
-----------
tidy: Modernize a couple of loops to be range-for loops.

This check has been around for some time, but clang 16 finds two new
instances of loops that can be modernized into range-for loops.

https://clang.llvm.org/extra/clang-tidy/checks/modernize/loop-convert.html


Commit: 0a6a75a5a2e6779a552e938b3c9943ada50334ec
https://github.com/MythTV/mythtv/commit/0a6a75a5a2e6779a552e938b3c9943ada50334ec
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythui/mythnotificationcenter.cpp
M mythtv/programs/mythtranscode/transcode.cpp

Log Message:
-----------
tidy: Remove a couple of variable assignment that are immediately overwritten.

This check has been around for some time, but clang 16 finds two new
instances of code that assigns a variable that is never used.

https://clang.llvm.org/docs/analyzer/checkers.html#deadcode-deadstores


Commit: ff94a62d76f43170b2226aa12e2b13ad6653ec31
https://github.com/MythTV/mythtv/commit/ff94a62d76f43170b2226aa12e2b13ad6653ec31
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythui/platforms/mythdrmdevice.cpp

Log Message:
-----------
tidy: Quiet a couple of false "repeated branch" warnings.

These seem obviously different.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/branch-clone.html


Commit: e688d9113b97806560c98e748de6954fd28854c9
https://github.com/MythTV/mythtv/commit/e688d9113b97806560c98e748de6954fd28854c9
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/hdhrchannelfetcher.cpp
M mythtv/libs/libmythtv/channelscan/hdhrchannelfetcher.h

Log Message:
-----------
tidy/clazy: A couple of minor performance improvements to hdhrchannelfetcher.

1) A QString is a non-trivial parameter and should be passed by
reference when possible.

2) Use a static const QRegularExpression so it doesn't have to be
recreated at every invocation.

3) A constructor should initialize all variables.


Commit: 63ee028a53ce967acd4fbeb05194c1562312be6e
https://github.com/MythTV/mythtv/commit/63ee028a53ce967acd4fbeb05194c1562312be6e
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythbase/mythcorecontext.cpp

Log Message:
-----------
clazy: Disable warning about connecting non-signal.


Commit: feb4379fb538bd617cb75f6c29eae519c066e7d0
https://github.com/MythTV/mythtv/commit/feb4379fb538bd617cb75f6c29eae519c066e7d0
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/hdhrchannelfetcher.h

Log Message:
-----------
tidy: Remove unused variable.


Commit: 461e3fd811298a1fd57a0e29571d74f619ad532d
https://github.com/MythTV/mythtv/commit/461e3fd811298a1fd57a0e29571d74f619ad532d
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/channelscanner_web.cpp

Log Message:
-----------
tidy: Add braces around clauses of an if/ifelse/else statement.

For readability purposes, its recommended that if any clause of an
if/elseif/else statement is big enough to require curly braces around
it, then all the clauses of that compound statement should use curly
braces.

https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html


Commit: 5281966b1ed0de7e9d0d962c6250e01e8945f64e
https://github.com/MythTV/mythtv/commit/5281966b1ed0de7e9d0d962c6250e01e8945f64e
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/hdhrchannelfetcher.cpp

Log Message:
-----------
tidy: Make local variable a const reference since its only ever used that way.

channelscan/hdhrchannelfetcher.cpp:364:17: warning: the variable
'channum' is copy-constructed from a const reference but is only used
as const reference; consider making it a const reference
[performance-unnecessary-copy-initialization]


Commit: dc76b4f933ae16d001254ba63286846888c0165a
https://github.com/MythTV/mythtv/commit/dc76b4f933ae16d001254ba63286846888c0165a
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/channelscanner_web.h

Log Message:
-----------
tidy: Fix parameter names in function declarations.

Fix inconsistencies between parameter names in the function
declaration and its definition (excluding capitalization). This was
done by changing the names in the declaration to match their actual
use in the definition. In this case four parameter names were changed
slightly, but one was a completely different name.


Commit: 58bae233219fe1e4a9ccf12146cb965cb5dd9942
https://github.com/MythTV/mythtv/commit/58bae233219fe1e4a9ccf12146cb965cb5dd9942
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/channelscanner_web.cpp

Log Message:
-----------
tidy: Eliminate uninitialized variable and duplicated branch warning.

Move the value from the final "else" clause up to become the
initializer for the variable. The first if clause could also be
dropped, but its helpful to have an explicit statement of the
requirements for TV.


Commit: 15190b60e79d1ae8d2388ab7249eb9a383031f0e
https://github.com/MythTV/mythtv/commit/15190b60e79d1ae8d2388ab7249eb9a383031f0e
Author: David Hampton <mythtv@love2code.net>
Date: 2023-05-13 (Sat, 13 May 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/hdhrchannelfetcher.cpp

Log Message:
-----------
tidy: Quiet a warning about duplicated else clauses.


Compare: https://github.com/MythTV/mythtv/compare/299de4980182...15190b60e79d
_______________________________________________
mythtv-commits mailing list
mythtv-commits@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-commits