Skip to content

Commit cb14d61

Browse files
committed
add explicit fallthrough comments
1 parent 66455c3 commit cb14d61

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

inst/include/Rcpp/algo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ inline bool __any( RandomAccessIterator __first, RandomAccessIterator __last, co
6464
if (*__first == __val)
6565
return true;
6666
++__first;
67+
// fallthrough
6768
case 2:
6869
if (*__first == __val)
6970
return true;
7071
++__first;
72+
// fallthrough
7173
case 1:
7274
if (*__first == __val)
7375
return true;
7476
++__first;
77+
// fallthrough
7578
case 0:
7679
default:
7780
return false;

inst/include/Rcpp/macros/unroll.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ for ( ; __trip_count > 0 ; --__trip_count) { \
3333
} \
3434
switch (n - i){ \
3535
case 3: \
36-
*TARGET++ = SOURCE[i++] ; \
36+
*TARGET++ = SOURCE[i++] ; /* fallthrough */ \
3737
case 2: \
38-
*TARGET++ = SOURCE[i++] ; \
38+
*TARGET++ = SOURCE[i++] ; /* fallthrough */ \
3939
case 1: \
40-
*TARGET++ = SOURCE[i++] ; \
40+
*TARGET++ = SOURCE[i++] ; /* fallthrough */ \
4141
case 0: \
4242
default: \
4343
{} \

inst/include/Rcpp/vector/RangeIndexer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
} \
3636
switch (size_ - i){ \
3737
case 3: \
38-
start[i] OP input[i] ; i++ ; \
38+
start[i] OP input[i] ; i++ ; /* fallthrough */ \
3939
case 2: \
40-
start[i] OP input[i] ; i++ ; \
40+
start[i] OP input[i] ; i++ ; /* fallthrough */ \
4141
case 1: \
42-
start[i] OP input[i] ; i++ ; \
42+
start[i] OP input[i] ; i++ ; /* fallthrough */ \
4343
case 0: \
4444
default: \
4545
return *this ; \

0 commit comments

Comments
 (0)