Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 86c917a

Browse files
committed
[[ Cleanup ]] Remove some unreachable breaks
1 parent b217038 commit 86c917a

File tree

9 files changed

+2
-27
lines changed

9 files changed

+2
-27
lines changed

engine/src/cmdsm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,6 @@ void MCArrayOp::exec_ctxt(MCExecContext &ctxt)
833833
default:
834834
ctxt . Throw();
835835
return;
836-
break;
837836
}
838837

839838
MCAutoPointer<MCContainer> t_container;

engine/src/customprinter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ bool MCCustomMetaContext::candomark(MCMark *p_mark)
318318
// we support for this kind of printing (yet?)
319319
return true;
320320
}
321-
break;
322321
case MARK_TYPE_IMAGE:
323322
{
324323
// Devices have to support unmasked images (otherwise we couldn't
@@ -340,7 +339,6 @@ bool MCCustomMetaContext::candomark(MCMark *p_mark)
340339

341340
return m_device -> CanRenderImage(t_image);
342341
}
343-
break;
344342
case MARK_TYPE_METAFILE:
345343
case MARK_TYPE_EPS:
346344
case MARK_TYPE_THEME:
@@ -364,7 +362,6 @@ bool MCCustomMetaContext::candomark(MCMark *p_mark)
364362
t_group . opacity = p_mark -> group . opacity / 255.0;
365363
return m_device -> CanRenderGroup(t_group);
366364
}
367-
break;
368365
case MARK_TYPE_LINK:
369366
// We can always render links natively - even if this is a no-op.
370367
return true;

engine/src/date.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,13 +918,11 @@ static bool MCD_decompose_convert_format(MCExecContext &ctxt, int p_form, const
918918
r_format = MCValueRetain(MCtwelvetime ? r_locale -> time_formats[0] : r_locale -> time24_formats[0]);
919919
return true;
920920
//r_is_date = false;
921-
break;
922921

923922
case CF_LONG_TIME:
924923
r_format = MCValueRetain(MCtwelvetime ? r_locale -> time_formats[1] : r_locale -> time24_formats[1]);
925924
return true;
926925
//r_is_date = false;
927-
break;
928926

929927
case CF_DATE:
930928
case CF_SHORT_DATE:

engine/src/externalv1.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ MCExternalError MCExternalVariable::ConvertToString(MCValueRef p_value, MCExtern
683683
case kMCValueTypeCodeArray:
684684
// An array is never a string (from the point of view of the externals API).
685685
return kMCExternalErrorNotAString;
686-
break;
687686
default:
688687
assert(false);
689688
}
@@ -1297,7 +1296,6 @@ static MCExternalError MCExternalContextQuery(MCExternalContextQueryTag op, MCEx
12971296
return MCExternalConvertStringToValueType(MCECptr -> GetColumnDelimiter(), p_option, result);
12981297
case kMCExternalContextQueryRowDelimiter:
12991298
return MCExternalConvertStringToValueType(MCECptr -> GetRowDelimiter(), p_option, result);
1300-
break;
13011299

13021300
case kMCExternalContextQueryHasLicenseCheck:
13031301
*(bool *)result = true;
@@ -2010,7 +2008,6 @@ static MCExternalError MCExternalVariableAppend(MCExternalVariableRef var, MCExt
20102008
else
20112009
return var -> AppendInteger(p_options, t_integer);
20122010
}
2013-
break;
20142011
}
20152012
case kMCExternalValueOptionAsNSString:
20162013
{
@@ -2184,13 +2181,10 @@ static bool MCExternalIsCaseSensitive(MCExternalValueOptions p_options)
21842181
{
21852182
case kMCExternalValueOptionDefaultCaseSensitive:
21862183
return MCECptr -> GetCaseSensitive();
2187-
break;
21882184
case kMCExternalValueOptionCaseSensitive:
21892185
return true;
2190-
break;
21912186
case kMCExternalValueOptionNotCaseSensitive:
21922187
return false;
2193-
break;
21942188
default:
21952189
return false;
21962190
}
@@ -2827,7 +2821,6 @@ MCExternalError MCExternalLicenseCheckEdition(unsigned int p_options, unsigned i
28272821

28282822
default:
28292823
MCUnreachableReturn(kMCExternalErrorUnlicensed);
2830-
break;
28312824
}
28322825

28332826
if (t_current_edition < p_min_edition)

engine/src/ide.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,6 @@ static bool match_comment(const unsigned char *p_text, uint4 p_length, uint4 &x_
706706
}
707707
else
708708
return false;
709-
break;
710709
}
711710

712711
case ST_COM:
@@ -715,7 +714,6 @@ static bool match_comment(const unsigned char *p_text, uint4 p_length, uint4 &x_
715714
;
716715

717716
return true;
718-
break;
719717

720718
case ST_OP:
721719
{
@@ -766,7 +764,6 @@ static bool match_comment(const unsigned char *p_text, uint4 p_length, uint4 &x_
766764
}
767765
else
768766
return false;
769-
break;
770767
}
771768
default:
772769
return false;
@@ -1063,7 +1060,6 @@ static bool match_comment_stringref(MCStringRef p_string, uint4 &x_index, MCColo
10631060
}
10641061
else
10651062
return false;
1066-
break;
10671063
}
10681064

10691065
case ST_COM:
@@ -1072,7 +1068,6 @@ static bool match_comment_stringref(MCStringRef p_string, uint4 &x_index, MCColo
10721068
;
10731069

10741070
return true;
1075-
break;
10761071

10771072
case ST_OP:
10781073
{
@@ -1123,7 +1118,6 @@ static bool match_comment_stringref(MCStringRef p_string, uint4 &x_index, MCColo
11231118
}
11241119
else
11251120
return false;
1126-
break;
11271121
}
11281122
default:
11291123
return false;

engine/src/keywords.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,12 +1212,10 @@ Parse_stat MCTry::parse(MCScriptPoint &sp)
12121212
return PS_ERROR;
12131213
}
12141214
continue;
1215-
break;
12161215
case TT_FINALLY:
12171216
state = TS_FINALLY;
12181217
curstatement = NULL;
12191218
continue;
1220-
break;
12211219
case TT_END:
12221220
if (sp.skip_token(SP_COMMAND, TT_STATEMENT, S_TRY) != PS_NORMAL)
12231221
{

libfoundation/src/foundation-chunk.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,15 +854,14 @@ MCTextChunkIterator *MCChunkCreateTextChunkIterator(MCStringRef p_text, MCRange
854854
else
855855
t_iterator = new MCTextChunkIterator_Delimited(p_text, p_chunk_type, t_delimiter);
856856
break;
857-
858-
break;
857+
859858
case kMCChunkTypeParagraph:
860859
if (p_range != nil)
861860
t_iterator = new MCTextChunkIterator_Delimited(p_text, p_chunk_type, MCSTR("\n"), *p_range);
862861
else
863862
t_iterator = new MCTextChunkIterator_Delimited(p_text, p_chunk_type, MCSTR("\n"));
864863
break;
865-
break;
864+
866865
case kMCChunkTypeWord:
867866
// AL-2015-10-08: [[ Bug 16161 ]] Word chunk needs to be passed line delimiter
868867
// as words are also delimited by line breaks.

libfoundation/src/foundation-string.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ bool MCStringCreateWithBytes(const byte_t *p_bytes, uindex_t p_byte_count, MCStr
342342
}
343343
return true;
344344
}
345-
break;
346345
case kMCStringEncodingUTF32:
347346
case kMCStringEncodingUTF32LE:
348347
case kMCStringEncodingUTF32BE:
@@ -391,7 +390,6 @@ bool MCStringCreateWithBytes(const byte_t *p_bytes, uindex_t p_byte_count, MCStr
391390

392391
return MCStringCreateWithChars(t_buffer.Ptr(), t_out_offset, r_string);
393392
}
394-
break;
395393
#if !defined(__ISO_8859_1__)
396394
case kMCStringEncodingISO8859_1:
397395
break;

libgraphics/src/legacygradients.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,6 @@ MCGradientAffineCombiner *MCGradientFillCreateCombiner(MCGGradientRef p_gradient
949949
default:
950950
return NULL;
951951
}
952-
break;
953952
}
954953
}
955954

0 commit comments

Comments
 (0)