Skip to content

Commit

Permalink
Fix unannotated fallthroughs
Browse files Browse the repository at this point in the history
  • Loading branch information
cjee21 committed Jan 30, 2025
1 parent 4d23dd7 commit f3ac7a0
Show file tree
Hide file tree
Showing 23 changed files with 40 additions and 24 deletions.
1 change: 1 addition & 0 deletions Source/MediaInfo/Audio/File_Aac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ void File_Aac::Streams_Accept()
case Mode_ADTS :
if (!IsSub)
TestContinuousFileNames();
break;
default : ;
}
if (Frame_Count_NotParsedIncluded==(int64u)-1)
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Audio/File_Aac_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ void File_Aac::AudioSpecificConfig (size_t End)
Frame_Count=(size_t)-1; //Forcing not to parse following data anymore
}
}
break;
default : ;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/MediaInfo/Audio/File_Adm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2923,7 +2923,7 @@ static void CheckErrors_Attributes(file_adm_private* File_Adm_Private, item Item
break;
default:
Item.AddError(Error, ':' + CraftName(item_Infos[Item_Type].Name) + to_string(i) + ":" + CraftName(Attribute_Infos[j].Name) + ":" + string(Attribute_Infos[j].Name) + " attribute shall be unique");
// Fallthrough
[[fallthrough]];
case 1:
{
Attributes_Present[j] = true;
Expand Down Expand Up @@ -3572,7 +3572,7 @@ void audioBlockFormat_Check(file_adm_private* File_Adm_Private) {
BlockFormat.AddError(Error, ":GeneralCompliance:jumpPosition subelement count " + to_string(jumpPositions.size()) + " is not permitted, max is 1", Source_Atmos_1_0);
break;
}
// Fallthrough
[[fallthrough]];
case 1:
switch (Type) {
case Type_Objects: {
Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/Audio/File_Flac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void File_Flac::Data_Parse()
CASE_INFO(CUESHEET);
CASE_INFO(PICTURE);
case (int8u)-1: Element_Name("Frame");
// Fallthrough
[[fallthrough]];
default : Skip_XX(Element_Size, "Data");
}

Expand Down
3 changes: 2 additions & 1 deletion Source/MediaInfo/Audio/File_Opus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void File_Opus::Identification()
case 0 : // Mono/Stereo
if (ch_count>2)
break; // Not in spec
// else it is as Vorbis specs, no break
[[fallthrough]]; // else it is as Vorbis specs, no break
case 1 : // Vorbis order
if (ch_count && ch_count<=Opus_ChannelLayout_Max)
{
Expand All @@ -174,6 +174,7 @@ void File_Opus::Identification()
if (ChannelLayout2!=Retrieve(Stream_Audio, 0, Audio_ChannelLayout))
Fill(Stream_Audio, 0, Audio_ChannelLayout, ChannelLayout2);
}
break;
default: ; //Unknown
}

Expand Down
7 changes: 4 additions & 3 deletions Source/MediaInfo/Export/Export_Mpeg7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ Ztring Mpeg7_ContentCS_Name(int32u termID, MediaInfo_Internal &MI, size_t) //xxy
case 2 : return __T("Video");
case 3 : return __T("Graphics");
}
case 50: return __T("Text");
default : return MI.Get(Stream_General, 0, General_FileExtension);
break;
case 50 : return __T("Text");
}
return MI.Get(Stream_General, 0, General_FileExtension);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -2668,7 +2669,7 @@ Ztring Export_Mpeg7::Transform(MediaInfo_Internal &MI, size_t Version)
|| !MI.Get(Stream_Video, 0, Video_Language).empty()
|| (!Mpeg7_AudioPresentationCS_termID(MI, 0) && !MI.Get(Stream_Audio, 0, Audio_ChannelLayout).empty()))
Extended=1;
//fall through
[[fallthrough]];
case Export_Mpeg7::Version_BestEffort_Strict:
if (Video_Count>1
|| Audio_Count>1
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/File__Analyze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,7 @@ size_t File__Analyze::Read_Buffer_Seek_OneFramePerFile (size_t Method, int64u Va
if (Config->Demux_Rate_Get()==0)
return (size_t)-1; //Not supported
Value=float64_int64s(((float64)Value)/1000000000*Config->Demux_Rate_Get());
return 1;
#else //MEDIAINFO_DEMUX
return (size_t)-1; //Not supported
#endif //MEDIAINFO_DEMUX
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/File__Analyze_Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,7 @@ void File__Analyze::Get_VL(const vlc Vlc[], size_t &Info, const char* Name)
if (BS->GetB())
Value++;
CountOfBits++;
break;
case 0 : ;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/File__Analyze_Streams_Finish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ void File__Analyze::Streams_Finish_StreamOnly_Video(size_t Pos)
{
case Video_HDR_Format_Version: Summary[j]+=__T(", Version "); break;
case Video_HDR_Format_Level: Summary[j]+=__T('.'); break;
case Video_HDR_Format_Compression: ToAdd[j][0]+=0x20; if (ToAdd[j].size()==4) ToAdd[j].resize(2); ToAdd[j]+=__T(" metadata compression"); // Fallthrough
case Video_HDR_Format_Compression: ToAdd[j][0]+=0x20; if (ToAdd[j].size()==4) ToAdd[j].resize(2); ToAdd[j]+=__T(" metadata compression"); [[fallthrough]];
default: Summary[j] += __T(", ");
}
Summary[j]+=ToAdd[j];
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Image/File_Jpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ bool File_Jpeg::Demux_UnpacketizeContainer_Test()
{
case Elements::SOD : //JPEG-2000 start
StartIsFound=true;
break;
case Elements::TEM :
case Elements::RST0 :
case Elements::RST1 :
Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/Image/File_Png.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void File_Png::IHDR()
{
case 3:
Bit_depth=8; // From spec: "indexed-colour PNG images (colour type 3), in which the sample depth is always 8 bits" (sample depth is our bit depth
// Fallthrough
[[fallthrough]];
case 0 :
case 2:
case 4:
Expand Down
10 changes: 5 additions & 5 deletions Source/MediaInfo/MediaInfo_Config_MediaInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3689,19 +3689,19 @@ Ztring MediaInfo_Config_MediaInfo::File_ProbeCaption_Set (const Ztring& NewValue
{
case 'E':
Value_Int <<= 10;
// Fall through
[[fallthrough]];
case 'P':
Value_Int <<= 10;
// Fall through
[[fallthrough]];
case 'T':
Value_Int <<= 10;
// Fall through
[[fallthrough]];
case 'G':
Value_Int <<= 10;
// Fall through
[[fallthrough]];
case 'M':
Value_Int <<= 10;
// Fall through
[[fallthrough]];
default:
Value_Int <<= 10;
}
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Multiple/File_Bdmv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,7 @@ void File_Bdmv::Mpls_ExtensionData_SubPath_entries()
for (int8u Pos=0; Pos<number_of_SubPlayItems; Pos++)
Mpls_PlayList_SubPlayItem(SubPath_type, Pos);
}
break;
default : ;
}
if (SubPath_extension_End-Element_Offset)
Expand Down
3 changes: 2 additions & 1 deletion Source/MediaInfo/Multiple/File_DvDif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ void File_DvDif::Streams_Fill()
case 7 : Fill(Stream_Video, 0, Video_DisplayAspectRatio, 4.0/3.0, 3, true); break;
default: ; //No indication of aspect ratio?
}
break;
default: ;
}
}
Expand Down Expand Up @@ -935,7 +936,7 @@ size_t File_DvDif::Read_Buffer_Seek (size_t Method, int64u Value, int64u /*ID*/)
//We transform TimeStamp to a frame number
Value=float64_int64s(((float64)Value)*(DSF?25.000:(30.000*1000/1001))/1000000000);
}
//No break;
[[fallthrough]];
case 3 : //FrameNumber
if (!FSP_WasNotSet)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/Multiple/File_Gxf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ size_t File_Gxf::Read_Buffer_Seek (size_t Method, int64u Value, int64u)
else
Value=float64_int64s(((float64)(Value-Delay))/1000000000*Gxf_FrameRate(Streams[0x00].FrameRate_Code));
}
//No break;
[[fallthrough]];
case 3 : //FrameNumber
{
if (Seeks.empty())
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Multiple/File_MpegPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4032,6 +4032,7 @@ void File_MpegPs::xxx_stream_Parse(ps_stream &Temp, int8u &stream_Count)
Temp.Searching_TimeStamp_Start=false;
}
}
break;
default : ;
}

Expand Down
2 changes: 2 additions & 0 deletions Source/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3266,6 +3266,7 @@ void File_Mpeg_Descriptors::Descriptor_7B()
{
Complete_Stream->Streams[elementary_PID]->descriptor_tag=0x7B;
}
break;
default : ;
}
FILLING_END();
Expand Down Expand Up @@ -3304,6 +3305,7 @@ void File_Mpeg_Descriptors::Descriptor_7C()
Complete_Stream->Streams[elementary_PID]->descriptor_tag=0x7C;
Complete_Stream->Streams[elementary_PID]->Infos["Format_Profile"]=Mpeg_Descriptors_MPEG_4_audio_profile_and_level(Profile_and_level);
}
break;
default : ;
}
FILLING_END();
Expand Down
3 changes: 2 additions & 1 deletion Source/MediaInfo/Multiple/File_Mxf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5132,7 +5132,7 @@ size_t File_Mxf::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
}
Value=float64_int64s(((float64)Value)/1000000000*Descriptor->second.SampleRate);
}
//No break;
[[fallthrough]];
case 3 : //FrameNumber
Value+=Config->File_IgnoreEditsBefore;

Expand Down Expand Up @@ -14321,6 +14321,7 @@ void File_Mxf::ChooseParser__FromCodingScheme(const essences::iterator &Essence,
ChooseParser_SmpteSt0337(Essence, Descriptor);
if (Descriptor->second.ChannelCount>=2 && Descriptor->second.ChannelCount!=(int32u)-1) //PCM, but one file is found with Dolby E in it
ChooseParser_ChannelSplitting(Essence, Descriptor);
[[fallthrough]];
default : return ChooseParser_Pcm(Essence, Descriptor);
}
case 0x02 : //Compressed coding
Expand Down
3 changes: 2 additions & 1 deletion Source/MediaInfo/Multiple/File_Riff_Elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ static std::string Riff_CodePage(int16u CodePage)
case 28591: return "ISO-8859-1";
case 28592: return "ISO-8859-2";
case 65001: return "UTF-8";
default: return to_string(CodePage);
default: return to_string(CodePage);
}
}

Expand Down Expand Up @@ -2169,6 +2169,7 @@ void File_Riff::AVI__hdlr_strl_vprp()
Fill(Stream_Video, 0, Video_ScanOrder, "TFF");
if (VideoYValidStartLines.size()==2 && VideoYValidStartLines[0]>VideoYValidStartLines[1])
Fill(Stream_Video, 0, Video_ScanOrder, "BFF");
break;
default: ;
}
FILLING_END();
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Text/File_Eia608.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ void File_Eia608::Special_14(int8u cc_data_2)
case 0x2F : //EOC - end of Caption
TextMode=false;
StreamPos=TextMode*2+DataChannelMode;
break;
default: ;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/TimeCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ TimeCode TimeCode::ToRescaled(uint32_t FramesMax, flags Flags, rounding Rounding
{
case Nearest:
Result += FrameRate / 2;
//fall through
[[fallthrough]];
case Floor:
Result /= FrameRate;
break;
Expand Down
5 changes: 3 additions & 2 deletions Source/MediaInfo/Video/File_Avc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ void File_Avc::Streams_Fill(std::vector<seq_parameter_set_struct*>::iterator seq
case Video_MasteringDisplay_Luminance:
if (Retrieve_Const(Stream_Video, 0, Item->first) == Item->second)
break;
// Fallthrough
[[fallthrough]];
default:
Fill(Stream_Video, 0, Item->first, Item->second);
}
Expand Down Expand Up @@ -2950,7 +2950,7 @@ void File_Avc::dec_ref_pic_marking(std::vector<int8u> &memory_management_control
break;
case 3 :
Skip_UE( "difference_of_pic_nums_minus1");
//break; 3 --> difference_of_pic_nums_minus1 then long_term_frame_idx
[[fallthrough]]; // 3 --> difference_of_pic_nums_minus1 then long_term_frame_idx
case 6 :
Skip_UE( "long_term_frame_idx");
break;
Expand Down Expand Up @@ -4796,6 +4796,7 @@ void File_Avc::SPS_PPS()
Element_End0();
}
}
break;
default:;
}
}
Expand Down
6 changes: 3 additions & 3 deletions Source/ThirdParty/tinyxml2/tinyxml2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,17 @@ void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
input >>= 6;
//fall through
[[fallthrough]];
case 3:
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
input >>= 6;
//fall through
[[fallthrough]];
case 2:
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
input >>= 6;
//fall through
[[fallthrough]];
case 1:
--output;
*output = (char)(input | FIRST_BYTE_MARK[*length]);
Expand Down

0 comments on commit f3ac7a0

Please sign in to comment.