ICU-22621 Clang-Tidy: readability-redundant-control-flow

https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/redundant-control-flow.html
This commit is contained in:
Fredrik Roubert 2024-03-18 17:44:23 +01:00 committed by Fredrik Roubert
parent e017edc97d
commit 6ad78a08c7
43 changed files with 0 additions and 83 deletions

View file

@ -999,7 +999,6 @@ MessagePattern::parseDouble(int32_t start, int32_t limit, UBool allowInfinity,
}
setParseError(parseError, start /*, limit*/); // Bad syntax for numeric value.
errorCode=U_PATTERN_SYNTAX_ERROR;
return;
}
int32_t

View file

@ -1498,7 +1498,6 @@ static void U_CALLCONV dataDirectoryInitFn() {
}
u_setDataDirectory(path);
return;
}
U_CAPI const char * U_EXPORT2

View file

@ -246,7 +246,6 @@ void RuleBasedBreakIterator::BreakCache::following(int32_t startPos, UErrorCode
fBI->fDone = false;
next();
}
return;
}
@ -265,7 +264,6 @@ void RuleBasedBreakIterator::BreakCache::preceding(int32_t startPos, UErrorCode
current();
}
}
return;
}
@ -277,7 +275,6 @@ void RuleBasedBreakIterator::BreakCache::nextOL() {
fBI->fDone = !populateFollowing();
fBI->fPosition = fTextIdx;
fBI->fRuleStatusIndex = fStatuses[fBufIdx];
return;
}
@ -297,7 +294,6 @@ void RuleBasedBreakIterator::BreakCache::previous(UErrorCode &status) {
fBI->fDone = (fBufIdx == initialBufIdx);
fBI->fPosition = fTextIdx;
fBI->fRuleStatusIndex = fStatuses[fBufIdx];
return;
}

View file

@ -811,8 +811,6 @@ void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, Unicode
el->key = tkey;
el->val = usetNode;
uhash_put(fSetTable, el->key, el, fRB->fStatus);
return;
}

View file

@ -244,7 +244,6 @@ ubidi_setLine(const UBiDi *pParaBiDi,
}
}
pLineBiDi->pParaBiDi=pParaBiDi; /* mark successful setLine */
return;
}
U_CAPI UBiDiLevel U_EXPORT2

View file

@ -473,8 +473,6 @@ ucnv_setSubstChars (UConverter * converter,
* we set subChar1 to 0.
*/
converter->subChar1 = 0;
return;
}
U_CAPI void U_EXPORT2

View file

@ -109,7 +109,6 @@ UCNV_FROM_U_CALLBACK_STOP (
*err = U_ZERO_ERROR;
}
/* the caller must have set the error code accordingly */
return;
}
@ -125,7 +124,6 @@ UCNV_TO_U_CALLBACK_STOP (
{
/* the caller must have set the error code accordingly */
(void)context; (void)toUArgs; (void)codePoints; (void)length; (void)reason; (void)err;
return;
}
U_CAPI void U_EXPORT2
@ -353,8 +351,6 @@ UCNV_FROM_U_CALLBACK_ESCAPE (
*err = err2;
return;
}
return;
}

View file

@ -455,7 +455,6 @@ unicodeMode:
pArgs->source=(const char *)source;
pArgs->target=target;
pArgs->offsets=offsets;
return;
}
static void U_CALLCONV
@ -731,7 +730,6 @@ unicodeMode:
pArgs->source=source;
pArgs->target=(char *)target;
pArgs->offsets=offsets;
return;
}
static const char * U_CALLCONV
@ -1156,7 +1154,6 @@ endloop:
pArgs->source=(const char *)source;
pArgs->target=target;
pArgs->offsets=offsets;
return;
}
static void U_CALLCONV
@ -1443,7 +1440,6 @@ unicodeMode:
pArgs->source=source;
pArgs->target=(char *)target;
pArgs->offsets=offsets;
return;
}
U_CDECL_END

View file

@ -1165,7 +1165,6 @@ endloop:
pArgs->source=(const char *)source;
pArgs->target=target;
pArgs->offsets=offsets;
return;
}
/*
@ -1363,7 +1362,6 @@ endloop:
/* write back the updated pointers */
pArgs->source=(const char *)source;
pArgs->target=target;
return;
}
/* miscellaneous ------------------------------------------------------------ */

View file

@ -572,7 +572,6 @@ endloop:
pArgs->source=(const char *)source;
pArgs->target=target;
pArgs->offsets=offsets;
return;
}
/*
@ -864,7 +863,6 @@ endloop:
/* write back the updated pointers */
pArgs->source=(const char *)source;
pArgs->target=target;
return;
}
U_CDECL_END
/* SCSU-from-Unicode conversion functions ----------------------------------- */

View file

@ -1364,7 +1364,6 @@ searchCurrencyName(const CurrencyNameStruct* currencyNames,
break;
}
}
return;
}
//========================= currency name cache =====================

View file

@ -189,7 +189,6 @@ u_setMutexFunctions(const void * /*context */, UMtxInitFn *, UMtxFn *,
if (U_SUCCESS(*status)) {
*status = U_UNSUPPORTED_ERROR;
}
return;
}
@ -200,5 +199,4 @@ u_setAtomicIncDecFunctions(const void * /*context */, UMtxAtomicFn *, UMtxAtomic
if (U_SUCCESS(*status)) {
*status = U_UNSUPPORTED_ERROR;
}
return;
}

View file

@ -880,8 +880,6 @@ utrie2_setRange32(UTrie2 *trie,
fillBlock(newTrie->data+block, 0, rest, value, newTrie->initialValue, overwrite);
}
return;
}
/* compaction --------------------------------------------------------------- */

View file

@ -511,7 +511,6 @@ BasicTimeZone::getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial,
// Set the results
initial = res_initial.orphan();
transitionRules = filteredRules.orphan();
return;
}
void

View file

@ -3795,7 +3795,6 @@ static void decToString(const decNumber *dn, char *string, Flag eng) {
} /* cut */
}
*c='\0'; /* terminate the string (all paths) */
return;
} /* decToString */
/* ------------------------------------------------------------------ */
@ -6712,7 +6711,6 @@ static void decReverse(Unit *ulo, Unit *uhi) {
*ulo=*uhi;
*uhi=temp;
}
return;
} /* decReverse */
/* ------------------------------------------------------------------ */
@ -7079,7 +7077,6 @@ static void decSetCoeff(decNumber *dn, decContext *set, const Unit *lsu,
} /* not unit boundary */
if (*residue!=0) *status|=DEC_Inexact; /* record inexactitude */
return;
} /* decSetCoeff */
/* ------------------------------------------------------------------ */
@ -7378,7 +7375,6 @@ static void decFinalize(decNumber *dn, decContext *set, Int *residue,
}
dn->exponent-=shift; /* adjust the exponent to match */
*status|=DEC_Clamped; /* and record the dirty deed */
return;
} /* decFinalize */
/* ------------------------------------------------------------------ */
@ -7795,7 +7791,6 @@ static void decStatus(decNumber *dn, uInt status, decContext *set) {
}
}
uprv_decContextSetStatus(set, status); /* [may not return] */
return;
} /* decStatus */
/* ------------------------------------------------------------------ */

View file

@ -489,7 +489,6 @@ void MeasureFormat::parseObject(
const UnicodeString & /*source*/,
Formattable & /*result*/,
ParsePosition& /*pos*/) const {
return;
}
UnicodeString &MeasureFormat::formatMeasurePerUnit(

View file

@ -203,7 +203,6 @@ void SimpleNumberFormatter::initialize(
fPatternModifier = new AdoptingSignumModifierStore(patternModifier.createImmutableForPlural(StandardPlural::COUNT, status));
fGroupingStrategy = groupingStrategy;
return;
}
FormattedNumber SimpleNumberFormatter::format(SimpleNumber value, UErrorCode &status) const {

View file

@ -1287,7 +1287,6 @@ void blueprint_helpers::parseScientificStem(const StringSegment& segment, MacroP
fail: void();
// throw new SkeletonSyntaxException("Invalid scientific stem", segment);
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
return;
}
void blueprint_helpers::parseIntegerStem(const StringSegment& segment, MacroProps& macros, UErrorCode& status) {
@ -1305,7 +1304,6 @@ void blueprint_helpers::parseIntegerStem(const StringSegment& segment, MacroProp
return;
}
macros.integerWidth = IntegerWidth::zeroFillTo(offset);
return;
}
bool blueprint_helpers::parseFracSigOption(const StringSegment& segment, MacroProps& macros,

View file

@ -320,7 +320,6 @@ U_CFUNC void initNumsysNames(UErrorCode &status) {
if (U_SUCCESS(status)) {
gNumsysNames = numsysNames.orphan();
}
return;
}
} // end anonymous namespace

View file

@ -3185,8 +3185,6 @@ void RegexCompile::matchStartType() {
// Matches can start with anything
fRXPat->fStartType = START_NO_INFO;
}
return;
}

View file

@ -4276,7 +4276,6 @@ breakFromLoop:
fFrame = fp; // The active stack frame when the engine stopped.
// Contains the capture group results that we need to
// access later.
return;
}
@ -5718,8 +5717,6 @@ breakFromLoop:
fFrame = fp; // The active stack frame when the engine stopped.
// Contains the capture group results that we need to
// access later.
return;
}

View file

@ -1074,8 +1074,6 @@ TimeZoneNamesImpl::initialize(const Locale& locale, UErrorCode& status) {
loadStrings(UnicodeString(tzID), status);
}
delete tz;
return;
}
/*

View file

@ -1270,7 +1270,6 @@ udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status)
return;
}
((DateFormat*)fmt)->setContext(value, *status);
return;
}
U_CAPI UDisplayContext U_EXPORT2

View file

@ -120,7 +120,6 @@ class ConversionRateDataSink : public ResourceSink {
cr->systems.appendInvariantChars(systems, status);
}
}
return;
}
private:

View file

@ -923,7 +923,6 @@ unum_setContext(UNumberFormat* fmt, UDisplayContext value, UErrorCode* status)
return;
}
((NumberFormat*)fmt)->setContext(value, *status);
return;
}
U_CAPI UDisplayContext U_EXPORT2

View file

@ -393,7 +393,6 @@ void ConfusabledataBuilder::build(const char * confusables, int32_t confusablesL
// All of the intermediate allocated data belongs to the ConfusabledataBuilder
// object (this), and is deleted in the destructor.
return;
}
//

View file

@ -87,8 +87,6 @@ vzone_write(VZone* zone, char16_t* & result, int32_t & resultLength, UErrorCode&
resultLength = s.length();
result = (char16_t*)uprv_malloc(resultLength);
memcpy(result,s.getBuffer(),resultLength);
return;
}
U_CAPI void U_EXPORT2
@ -99,8 +97,6 @@ vzone_writeFromStart(VZone* zone, UDate start, char16_t* & result, int32_t & res
resultLength = s.length();
result = (char16_t*)uprv_malloc(resultLength);
memcpy(result,s.getBuffer(),resultLength);
return;
}
U_CAPI void U_EXPORT2
@ -111,8 +107,6 @@ vzone_writeSimple(VZone* zone, UDate time, char16_t* & result, int32_t & resultL
resultLength = s.length();
result = (char16_t*)uprv_malloc(resultLength);
memcpy(result,s.getBuffer(),resultLength);
return;
}
U_CAPI int32_t U_EXPORT2

View file

@ -45,7 +45,6 @@ zrule_getName(ZRule* rule, char16_t* name, int32_t nameLength) {
s = ((TimeZoneRule*)rule)->TimeZoneRule::getName(s);
nameLength = s.length();
memcpy(name, s.getBuffer(), nameLength);
return;
}
U_CAPI int32_t U_EXPORT2
@ -96,7 +95,6 @@ izrule_getName(IZRule* rule, char16_t* & name, int32_t & nameLength) {
nameLength = s.length();
name = (char16_t*)uprv_malloc(nameLength);
memcpy(name, s.getBuffer(), nameLength);
return;
}
U_CAPI int32_t U_EXPORT2

View file

@ -160,7 +160,6 @@ void GnomeFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
}
advance.fX = fFace->glyph->metrics.horiAdvance >> 6;
return;
}
le_bool GnomeFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const

View file

@ -171,7 +171,6 @@ static void TestInt64Parse(void)
}
unum_close(nf);
return;
}
/* test Number Format API */

View file

@ -1417,8 +1417,6 @@ CalendarTest::TestDOW_LOCALandYEAR_WOY()
if (U_FAILURE(status)) { errln("Error in parse/calculate test for 1582"); return; }
delete sdf;
delete cal;
return;
}
/**
@ -2095,8 +2093,6 @@ void CalendarTest::Test6703()
cal = Calendar::createInstance(loc3, status);
if (failure(status, "Calendar::createInstance")) return;
delete cal;
return;
}
void CalendarTest::Test3785()
@ -2142,8 +2138,6 @@ void CalendarTest::Test3785()
if ( act2 != exp2 ) {
errln("Unexpected result from date 2 format\n");
}
return;
}
void CalendarTest::Test1624() {
@ -2180,7 +2174,6 @@ void CalendarTest::Test1624() {
}
}
}
return;
}
void CalendarTest::TestTimeStamp() {

View file

@ -393,8 +393,6 @@ void DecimalFormatTest::execParseTest(int32_t lineNum,
errln("file dcfmtest.txt, line %d: expected \"%s\", got \"%s\"",
lineNum, expectedResults.data(), decimalResult.data());
}
return;
}

View file

@ -3819,8 +3819,6 @@ void DateFormatTest::Test6726()
delete fmtl;
delete fmtm;
delete fmts;
return;
}
/**

View file

@ -201,7 +201,6 @@ void IdnaConfTest::Call(){
namebase.setToBogus();
namezone.setToBogus();
id.remove();
return;
}
void IdnaConfTest::Test(){

View file

@ -729,7 +729,6 @@ PluralFormatTest::numberFormatTest(PluralFormat* plFmt,
}
}
}
return;
}

View file

@ -1548,7 +1548,6 @@ void PluralRulesTest::testParseErrors() {
errln("file %s, line %d, expected nullptr. Rules: \"%s\"", __FILE__, __LINE__, rules);
}
}
return;
}

View file

@ -2609,7 +2609,6 @@ int32_t RBBISentMonkey::next(int32_t prevPos) {
}
setAppliedRule(p2, "SB12 Any x Any");
continue;
}
breakPos = p2;

View file

@ -207,7 +207,6 @@ void TestArabicShapeThreads::doTailTest() {
return;
}
}
return;
}

View file

@ -187,7 +187,6 @@ PortableFontInstance::PortableFontInstance(const char *fileName, float pointSize
error_exit:
fclose(fFile);
fFile = nullptr;
return;
}
PortableFontInstance::~PortableFontInstance()

View file

@ -34,8 +34,6 @@ SimpleFontInstance::SimpleFontInstance(float pointSize, LEErrorCode &status)
fAscent = (le_int32) yUnitsToPoints(2000.0);
fDescent = (le_int32) yUnitsToPoints(600.0);
return;
}
SimpleFontInstance::~SimpleFontInstance()

View file

@ -190,7 +190,6 @@ PortableFontInstance::PortableFontInstance(const char *fileName, float pointSize
error_exit:
fclose(fFile);
fFile = nullptr;
return;
}
PortableFontInstance::~PortableFontInstance()

View file

@ -35,8 +35,6 @@ SimpleFontInstance::SimpleFontInstance(float pointSize, LEErrorCode &status)
fAscent = (le_int32) yUnitsToPoints(2000.0);
fDescent = (le_int32) yUnitsToPoints(600.0);
return;
}
SimpleFontInstance::~SimpleFontInstance()

View file

@ -844,7 +844,6 @@ resolveAliasToConverter(uint16_t alias, uint16_t *tagNum, uint16_t *converterNum
fprintf(stderr, "%s: warning: alias %s not found\n",
path,
GET_ALIAS_STR(alias));
return;
}
/* The knownAliases should be sorted before calling this function */