Changeset dc12262 in mainline for uspace/app/sbi


Ignore:
Timestamp:
2017-05-04T22:12:27Z (8 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e141281
Parents:
93ad8166
Message:

add standardized case fallthrough comment annotations, add actual missing breaks

GCC 7.1's attribute((fallthrough)) would be more elegant, but unfortunatelly this annotation is incompatible with previous versions of GCC (it generates an empty declaration error)

Location:
uspace/app/sbi/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/ancr.c

    r93ad8166 rdc12262  
    216216                        case csi_struct:
    217217                                assert(b_false); /* XXX */
     218                                /* Fallthrough */
    218219                        case csi_interface:
    219220                                cspan_print(csi->name->cspan);
  • uspace/app/sbi/src/run.c

    r93ad8166 rdc12262  
    207207                /* Break bailout was not caught. */
    208208                assert(b_false);
     209                /* Fallthrough */
    209210        case bm_proc:
    210211                run->thread_ar->bo_mode = bm_none;
     
    18771878                 */
    18781879                assert(b_false);
     1880                /* Fallthrough */
    18791881        case tic_tenum:
    18801882                run_var_new_enum(run, ti->u.tenum, rvar);
     
    19351937        case tpc_nil:
    19361938                assert(b_false);
     1939                /* Fallthrough */
    19371940        case tpc_string:
    19381941                var = rdata_var_new(vc_string);
  • uspace/app/sbi/src/run_expr.c

    r93ad8166 rdc12262  
    285285                /* It is not possible to reference a constructor explicitly. */
    286286                assert(b_false);
     287                /* Fallthrough */
    287288        case sc_enum:
    288289#ifdef DEBUG_RUN_TRACE
     
    765766        case bo_mult:
    766767                assert(b_false);
     768                /* Fallthrough */
    767769
    768770        case bo_equal:
     
    840842        case bo_mult:
    841843                assert(b_false);
     844                /* Fallthrough */
    842845
    843846        case bo_equal:
     
    944947        case bo_mult:
    945948                assert(b_false);
     949                /* Fallthrough */
    946950
    947951        case bo_equal:
     
    12291233        case uo_minus:
    12301234                assert(b_false);
     1235                /* Fallthrough */
    12311236
    12321237        case uo_not:
     
    17611766                /* It is not possible to reference a constructor explicitly. */
    17621767                assert(b_false);
     1768                /* Fallthrough */
    17631769        case sc_deleg:
    17641770                printf("Error: Accessing object member which is a delegate.\n");
     
    18741880                /* It is not possible to reference a constructor explicitly. */
    18751881                assert(b_false);
     1882                /* Fallthrough */
    18761883        case sc_deleg:
    18771884                printf("Error: Accessing object member which is a delegate.\n");
  • uspace/app/sbi/src/run_texpr.c

    r93ad8166 rdc12262  
    154154                /* It is not possible to reference a constructor explicitly. */
    155155                assert(b_false);
     156                /* Fallthrough */
    156157        case sc_deleg:
    157158                /* Fetch stored delegate type. */
     
    362363                /* It is not possible to reference a constructor explicitly. */
    363364                assert(b_false);
     365                /* Fallthrough */
    364366        case sc_deleg:
    365367                /* Fetch stored delegate type. */
  • uspace/app/sbi/src/stype.c

    r93ad8166 rdc12262  
    617617                case csi_struct:
    618618                        assert(b_false);
     619                        /* Fallthrough */
    619620                case csi_interface:
    620621                        /* Store to impl_if_ti for later use. */
     
    742743                 */
    743744                assert(b_false);
     745                /* Fallthrough */
    744746        case sc_fun:
    745747                stype_class_impl_check_fun(stype, cmbr_sym, if_tvv, ifmbr_sym);
     
    751753                 */
    752754                assert(b_false);
     755                /* Fallthrough */
    753756        case sc_prop:
    754757                stype_class_impl_check_prop(stype, cmbr_sym, if_tvv, ifmbr_sym);
     
    13451348                /* Conversion destination should never be enum-base */
    13461349                assert(b_false);
     1350                /* Fallthrough */
    13471351        case tic_tenum:
    13481352                expr = stype_convert_tenum(stype, expr, dest);
     
    13501354        case tic_tfun:
    13511355                assert(b_false);
     1356                /* Fallthrough */
    13521357        case tic_tvref:
    13531358                expr = stype_convert_tvref(stype, expr, dest);
     
    14181423
    14191424        switch (src->u.tprimitive->tpc) {
    1420         case tpc_bool: bp_sym = bi->boxed_bool; break;
    1421         case tpc_char: bp_sym = bi->boxed_char; break;
    1422         case tpc_int: bp_sym = bi->boxed_int; break;
    1423         case tpc_nil: assert(b_false);
    1424         case tpc_string: bp_sym = bi->boxed_string; break;
     1425        case tpc_bool:
     1426                bp_sym = bi->boxed_bool;
     1427                break;
     1428        case tpc_char:
     1429                bp_sym = bi->boxed_char;
     1430                break;
     1431        case tpc_int:
     1432                bp_sym = bi->boxed_int;
     1433                break;
     1434        case tpc_nil:
     1435                assert(b_false);
     1436                /* Fallthrough */
     1437        case tpc_string:
     1438                bp_sym = bi->boxed_string;
     1439                break;
    14251440        case tpc_resource:
    14261441                stype_convert_failure(stype, convc_implicit, expr, dest);
     
    17191734
    17201735        switch (src->u.tprimitive->tpc) {
    1721         case tpc_bool: bp_sym = bi->boxed_bool; break;
    1722         case tpc_char: bp_sym = bi->boxed_char; break;
    1723         case tpc_int: bp_sym = bi->boxed_int; break;
    1724         case tpc_nil: assert(b_false);
    1725         case tpc_string: bp_sym = bi->boxed_string; break;
     1736        case tpc_bool:
     1737                bp_sym = bi->boxed_bool;
     1738                break;
     1739        case tpc_char:
     1740                bp_sym = bi->boxed_char;
     1741                break;
     1742        case tpc_int:
     1743                bp_sym = bi->boxed_int;
     1744                break;
     1745        case tpc_nil:
     1746                assert(b_false);
     1747                /* Fallthrough */
     1748        case tpc_string:
     1749                bp_sym = bi->boxed_string;
     1750                break;
    17261751        case tpc_resource:
    17271752                cspan_print(expr->cspan);
     
    18221847        case csi_struct:
    18231848                assert(b_false);
     1849                /* Fallthrough */
    18241850        case csi_interface:
    18251851                /*
  • uspace/app/sbi/src/stype_expr.c

    r93ad8166 rdc12262  
    308308                /* It is not possible to reference a constructor explicitly. */
    309309                assert(b_false);
     310                /* Fallthrough */
    310311        case sc_deleg:
    311312                deleg = symbol_to_deleg(sym);
     
    12381239                /* It is not possible to reference a constructor explicitly. */
    12391240                assert(b_false);
     1241                /* Fallthrough */
    12401242        case sc_deleg:
    12411243                cspan_print(access->member_name->cspan);
     
    18091811        assert(ptitem->tic == tic_tprimitive);
    18101812        switch (ptitem->u.tprimitive->tpc) {
    1811         case tpc_bool: csi_sym = bi->boxed_bool; break;
    1812         case tpc_char: csi_sym = bi->boxed_char; break;
    1813         case tpc_int: csi_sym = bi->boxed_int; break;
    1814         case tpc_nil: assert(b_false);
    1815         case tpc_string: csi_sym = bi->boxed_string; break;
    1816         case tpc_resource: assert(b_false);
     1813        case tpc_bool:
     1814                csi_sym = bi->boxed_bool;
     1815                break;
     1816        case tpc_char:
     1817                csi_sym = bi->boxed_char;
     1818                break;
     1819        case tpc_int:
     1820                csi_sym = bi->boxed_int;
     1821                break;
     1822        case tpc_nil:
     1823                assert(b_false);
     1824                /* Fallthrough */
     1825        case tpc_string:
     1826                csi_sym = bi->boxed_string;
     1827                break;
     1828        case tpc_resource:
     1829                assert(b_false);
    18171830        }
    18181831
Note: See TracChangeset for help on using the changeset viewer.