Mailing List Archive

[MythTV/mythtv] 03dac0: tidy: Simple fixes for "assignment in if statement...
Branch: refs/heads/master
Home: https://github.com/MythTV/mythtv
Commit: 03dac0f845c2e41c3468c3624c32c43d5df829d8
https://github.com/MythTV/mythtv/commit/03dac0f845c2e41c3468c3624c32c43d5df829d8
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-25 (Mon, 25 Mar 2024)

Changed paths:
M mythplugins/mytharchive/mytharchivehelper/external/pxsup2dast.c
M mythplugins/mytharchive/mytharchivehelper/mytharchivehelper.cpp
M mythplugins/mythmusic/mythmusic/decoderhandler.cpp
M mythplugins/mythmusic/mythmusic/playlist.cpp
M mythplugins/mythzoneminder/mythzmserver/mythzmserver.cpp
M mythplugins/mythzoneminder/mythzmserver/zmserver.cpp

Log Message:
-----------
tidy: Simple fixes for "assignment in if statement" warnings. (plugins)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

This commit contains only fixes where it is simple to pull the
assignment out of the conditional statement. They should make the
code easier to understand and less likely to hide bugs.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: f8a3fdf3a425e06777e15b277944a7410916fa74
https://github.com/MythTV/mythtv/commit/f8a3fdf3a425e06777e15b277944a7410916fa74
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-25 (Mon, 25 Mar 2024)

Changed paths:
M mythtv/programs/mythbackend/autoexpire.cpp
M mythtv/programs/mythbackend/mainserver.cpp
M mythtv/programs/mythbackend/mythbackend.cpp
M mythtv/programs/mythcommflag/TemplateFinder.cpp
M mythtv/programs/mythcommflag/TemplateMatcher.cpp
M mythtv/programs/mythfilldatabase/xmltvparser.cpp
M mythtv/programs/mythjobqueue/mythjobqueue.cpp
M mythtv/programs/mythlcdserver/mythlcdserver.cpp
M mythtv/programs/mythmediaserver/mythmediaserver.cpp
M mythtv/programs/mythscreenwizard/mythscreenwizard.cpp
M mythtv/programs/mythtranscode/external/replex/element.cpp
M mythtv/programs/mythtranscode/external/replex/ringbuffer.cpp
M mythtv/programs/mythtranscode/mpeg2fix.cpp

Log Message:
-----------
tidy: Simple fixes for "assignment in if statement" warnings. (programs)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

This commit contains only fixes where it is simple to pull the
assignment out of the conditional statement. They should make the
code easier to understand and less likely to hide bugs.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: d03bc4d7c0cb2afe48a508256d8cdd4f5b8297c0
https://github.com/MythTV/mythtv/commit/d03bc4d7c0cb2afe48a508256d8cdd4f5b8297c0
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M mythtv/libs/libmyth/audio/audiooutput.cpp
M mythtv/libs/libmyth/audio/audiooutputalsa.cpp
M mythtv/libs/libmyth/audio/audiooutputbase.cpp
M mythtv/libs/libmyth/audio/audiooutputdigitalencoder.cpp
M mythtv/libs/libmythbase/lcddevice.cpp
M mythtv/libs/libmythbase/mythcommandlineparser.cpp
M mythtv/libs/libmythbase/programtypes.cpp
M mythtv/libs/libmythmetadata/musicfilescanner.cpp
M mythtv/libs/libmythmpeg2/header.c
M mythtv/libs/libmythtv/Bluray/mythbdiowrapper.cpp
M mythtv/libs/libmythtv/captions/teletextreader.cpp
M mythtv/libs/libmythtv/cardutil.cpp
M mythtv/libs/libmythtv/channelscan/channelscanner.cpp
M mythtv/libs/libmythtv/channelscan/externrecscanner.cpp
M mythtv/libs/libmythtv/channelutil.cpp
M mythtv/libs/libmythtv/decoders/mythcodeccontext.cpp
M mythtv/libs/libmythtv/eitfixup.cpp
M mythtv/libs/libmythtv/io/mythavformatwriter.cpp
M mythtv/libs/libmythtv/io/mythiowrapper.cpp
M mythtv/libs/libmythtv/mpeg/AVCParser.cpp
M mythtv/libs/libmythtv/mythpreviewplayer.cpp
M mythtv/libs/libmythtv/opengl/mythvaapiinterop.cpp
M mythtv/libs/libmythtv/previewgeneratorqueue.cpp
M mythtv/libs/libmythtv/recorders/HLS/HLSReader.cpp
M mythtv/libs/libmythtv/recorders/HLS/HLSStream.cpp
M mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp
M mythtv/libs/libmythtv/recorders/audioinputalsa.cpp
M mythtv/libs/libmythtv/recorders/dvbdev/dvbci.cpp
M mythtv/libs/libmythtv/recorders/v4l2encstreamhandler.cpp
M mythtv/libs/libmythtv/recorders/vbitext/lang.cpp
M mythtv/libs/libmythtv/recorders/vbitext/vbi.cpp
M mythtv/libs/libmythtv/tv_play.cpp
M mythtv/libs/libmythtv/tv_rec.cpp
M mythtv/libs/libmythtv/videosource.cpp
M mythtv/libs/libmythtv/visualisations/goom/ifs.cpp
M mythtv/libs/libmythui/devices/lirc_client.cpp
M mythtv/libs/libmythui/mythmainwindow.cpp
M mythtv/libs/libmythui/mythmainwindowprivate.cpp
M mythtv/libs/libmythui/mythuitext.cpp
M mythtv/libs/libmythupnp/httprequest.cpp
M mythtv/libs/libmythupnp/ssdp.cpp
M mythtv/libs/libmythupnp/upnp.cpp
M mythtv/libs/libmythupnp/upnpcds.cpp

Log Message:
-----------
tidy: Simple fixes for "assignment in if statement" warnings. (libs)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

This commit contains only fixes where it is simple to pull the
assignment out of the conditional statement. They should make the
code easier to understand and less likely to hide bugs.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: f79af032713b601516e5c084290faad3aed0bef2
https://github.com/MythTV/mythtv/commit/f79af032713b601516e5c084290faad3aed0bef2
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M mythplugins/mytharchive/mytharchivehelper/external/pxsup2dast.c
M mythplugins/mythgame/mythgame/gamehandler.cpp

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (plugins)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

One fix in this commit is simply to pull the assignment out of the
conditional statement, but the code is in the middle of a large macro.
The other commit rewrites a short if/elseif chain to make the code
easier to understand.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: 97ac9ee02c8f723c93444a4f320417dfd3a575c8
https://github.com/MythTV/mythtv/commit/97ac9ee02c8f723c93444a4f320417dfd3a575c8
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M mythtv/programs/mythbackend/mainserver.cpp
M mythtv/programs/mythcommflag/BorderDetector.cpp
M mythtv/programs/mythcommflag/HistogramAnalyzer.cpp
M mythtv/programs/mythfrontend/mythcontrols.cpp
M mythtv/programs/mythfrontend/playbackbox.cpp

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (programs)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

These fixes involve simple rewrites of "if" statements to pull an
assignment statement out of the middle of a complex conditional.
This should make the code easier to understand.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: a7a713d9180f775ea099b6574ed583fe34b0d1f0
https://github.com/MythTV/mythtv/commit/a7a713d9180f775ea099b6574ed583fe34b0d1f0
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

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

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (programinfo.cpp)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

Rewrite the ProgramInfo::QueryStartMark function to convert a chain of
"if/elseif" statements into a simpler chain of "if" statements. This
removes all the assignments from the middle of the conditional
statements. This should make the code easier to understand.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: 770335da4f4ea985c9759569186f3ec05a1943dd
https://github.com/MythTV/mythtv/commit/770335da4f4ea985c9759569186f3ec05a1943dd
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M mythtv/libs/libmythmetadata/musicmetadata.cpp

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (musicmetadata.cpp)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

Rewrite the MusicMetadata::getAlbumArtFile function from a chain of
"if/elseif" statements with embedded assignment statements, into a
much simpler loop. This should make the code easier to understand.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: e548a6c644d99ecffee186cb2680a186099aebce
https://github.com/MythTV/mythtv/commit/e548a6c644d99ecffee186cb2680a186099aebce
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M mythtv/libs/libmyth/audio/audiooutputbase.cpp
M mythtv/libs/libmyth/audio/audiooutputbase.h
M mythtv/libs/libmythbase/configuration.cpp
M mythtv/libs/libmythbase/housekeeper.cpp
M mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
M mythtv/libs/libmythtv/eitfixup.cpp
M mythtv/libs/libmythtv/mheg/netstream.cpp
M mythtv/libs/libmythtv/recorders/ExternalStreamHandler.cpp
M mythtv/libs/libmythtv/recorders/audioinputoss.cpp
M mythtv/libs/libmythtv/tv_rec.cpp
M mythtv/libs/libmythui/mythuitype.cpp

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (libs)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

These fixes involve simple rewrites of "if" statements to pull an
assignment statement out of the middle of a complex conditional.
This should make the code easier to understand.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: 079d39b5a71b23f0c42525e50a1c4f90629bd2e4
https://github.com/MythTV/mythtv/commit/079d39b5a71b23f0c42525e50a1c4f90629bd2e4
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M mythtv/libs/libmythtv/cardutil.cpp
M mythtv/libs/libmythtv/eitfixup.cpp

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (libs 2)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

These fixes involve simple rewrites of "if" statements to pull an
assignment statement out of the middle of a complex conditional. This
should make the code easier to understand. They do move a call to
QString::indexOf before a conditional so that it will be executed when
it might not have been called before. This should be harmless, and
doing it this way reduces the size of the necessary change.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: d6c026c4984f3414f35e5312b7349e0ea35004d4
https://github.com/MythTV/mythtv/commit/d6c026c4984f3414f35e5312b7349e0ea35004d4
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M .clang-tidy
M mythtv/libs/libmythtv/decoders/avformatdecoder.cpp

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (libs 3)

These assignments are bug-prone because they may have been intended as
equality tests. Moving the assignments outside of the if/then/else
logic makes the decision path becomes easier to follow.

Rewrites an "if" statements to pull two assignment statement out of
the middle of a complex conditional. This should make the code easier
to understand.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html


Commit: d04cc8a030e6a30324cfd718d904af9b5dbc4722
https://github.com/MythTV/mythtv/commit/d04cc8a030e6a30324cfd718d904af9b5dbc4722
Author: David Hampton <mythtv@love2code.net>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Changed paths:
M mythtv/libs/libmythtv/decoders/avformatdecoder.cpp

Log Message:
-----------
tidy: Fixes for "assignment in if statement" warnings. (indentation)

The previous commit didn't change the code indentation to minimize the
size of the change, and to highlight the actual changes. This commit
only changes the indentation.


Compare: https://github.com/MythTV/mythtv/compare/0ad35e97cd65...d04cc8a030e6

To unsubscribe from these emails, change your notification settings at https://github.com/MythTV/mythtv/settings/notifications
_______________________________________________
mythtv-commits mailing list
mythtv-commits@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-commits