Document intentional fallthroughs.

Found by: Coverity scan.
This commit is contained in:
Vladimir Serbinenko 2015-01-27 17:17:58 +01:00
parent 8f95eae423
commit 9ee5ae1fae
11 changed files with 17 additions and 2 deletions

View file

@ -71,10 +71,12 @@ is_lv_readable (struct grub_diskfilter_lv *lv, int easily)
case GRUB_DISKFILTER_RAID6:
if (!easily)
need--;
/* Fallthrough. */
case GRUB_DISKFILTER_RAID4:
case GRUB_DISKFILTER_RAID5:
if (!easily)
need--;
/* Fallthrough. */
case GRUB_DISKFILTER_STRIPED:
break;
@ -584,6 +586,7 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector,
if (seg->node_count == 1)
return grub_diskfilter_read_node (&seg->nodes[0],
sector, size, buf);
/* Fallthrough. */
case GRUB_DISKFILTER_MIRROR:
case GRUB_DISKFILTER_RAID10:
{

View file

@ -1286,7 +1286,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
- grub_font_get_xheight (combining_glyphs[i]->font) - 1;
if (space <= 0)
space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
/* Fallthrough. */
case GRUB_UNICODE_STACK_ATTACHED_ABOVE:
do_blit (combining_glyphs[i], targetx,
-(ctx.bounds.height + ctx.bounds.y + space
@ -1327,6 +1327,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
+ combining_glyphs[i]->height);
if (space <= 0)
space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
/* Fallthrough. */
case GRUB_UNICODE_STACK_ATTACHED_BELOW:
do_blit (combining_glyphs[i], targetx, -(ctx.bounds.y - space),

View file

@ -986,6 +986,7 @@ grub_udf_read_symlink (grub_fshelp_node_t node)
case 1:
if (ptr[1])
goto fail;
/* Fallthrough. */
case 2:
/* in 4 bytes. out: 1 byte. */
optr = out;

View file

@ -664,6 +664,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix)
{
case TYPE_FILE_NO_CONSUME:
hold_arg = 1;
/* Fallthrough. */
case TYPE_PARTITION:
case TYPE_FILE:
args[i] = adjust_file (curarg, curarglen);

View file

@ -280,10 +280,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
{
case 'g':
shift += 10;
/* Fallthrough. */
case 'm':
shift += 10;
/* Fallthrough. */
case 'k':
shift += 10;
/* Fallthrough. */
default:
break;
}

View file

@ -929,6 +929,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,
case GRUB_BIDI_TYPE_R:
case GRUB_BIDI_TYPE_AL:
bidi_needed = 1;
/* Fallthrough. */
default:
{
if (join_state == JOIN_FORCE)

View file

@ -359,6 +359,7 @@ grub_video_bochs_setup (unsigned int width, unsigned int height,
case 32:
framebuffer.mode_info.reserved_mask_size = 8;
framebuffer.mode_info.reserved_field_pos = 24;
/* Fallthrough. */
case 24:
framebuffer.mode_info.red_mask_size = 8;

View file

@ -440,6 +440,7 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height,
case 32:
framebuffer.mode_info.reserved_mask_size = 8;
framebuffer.mode_info.reserved_field_pos = 24;
/* Fallthrough. */
case 24:
framebuffer.mode_info.red_mask_size = 8;

View file

@ -874,6 +874,7 @@ vbe2videoinfo (grub_uint32_t mode,
/* CGA is basically 4-bit packed pixel. */
case GRUB_VBE_MEMORY_MODEL_CGA:
mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_CGA;
/* Fallthrough. */
case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL:
mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;
break;
@ -886,6 +887,7 @@ vbe2videoinfo (grub_uint32_t mode,
/* Non chain 4 is a special case of planar. */
case GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256:
mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_NONCHAIN4;
/* Fallthrough. */
case GRUB_VBE_MEMORY_MODEL_PLANAR:
mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_PLANAR
| GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;

View file

@ -107,6 +107,7 @@ grub_util_pull_device (const char *os_dev)
default:
if (grub_util_pull_device_os (os_dev, ab))
return;
/* Fallthrough. */
case GRUB_DEV_ABSTRACTION_NONE:
free (grub_util_biosdisk_get_grub_dev (os_dev));
return;

View file

@ -1809,7 +1809,7 @@ main (int argc, char *argv[])
grub_install_copy_file (imgfile, dst, 1);
free (dst);
}
/* Fallthrough. */
case GRUB_INSTALL_PLATFORM_X86_64_EFI:
if (efidir_is_mac)
{