changeset 36641:598ef7d90b78

Document switch case fallthroughs.
author reimar
date Sat, 25 Jan 2014 16:55:09 +0000
parents e648bb154916
children aa717fdfa806
files command.c libmpdemux/demux_lmlm4.c libmpdemux/demux_mkv.c libmpdemux/muxer_mpeg.c libvo/vo_fbdev2.c libvo/vo_xvidix.c libvo/x11_common.c vidix/s3_vid.c vidix/sis_vid.c vidix/unichrome_vid.c
diffstat 10 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/command.c	Sat Jan 25 16:55:09 2014 +0000
@@ -1067,6 +1067,7 @@
         M_PROPERTY_CLAMP(prop, *(int *) arg);
         if (vo_fs == !!*(int *) arg)
             return M_PROPERTY_OK;
+        /* Fallthrough to toggle */
     case M_PROPERTY_STEP_UP:
     case M_PROPERTY_STEP_DOWN:
 #ifdef CONFIG_GUI
@@ -1211,6 +1212,7 @@
         M_PROPERTY_CLAMP(prop, *(int *) arg);
         if (*vo_var == !!*(int *) arg)
             return M_PROPERTY_OK;
+        /* Fallthrough to toggle */
     case M_PROPERTY_STEP_UP:
     case M_PROPERTY_STEP_DOWN:
         if (vo_config_count)
@@ -3442,6 +3444,7 @@
             af_uninit(mpctx->mixer.afilter);
             af_init(mpctx->mixer.afilter);
         }
+        /* Fallthrough to add filters like for af_add */
     case MP_CMD_AF_ADD:
     case MP_CMD_AF_DEL:
         if (!sh_audio)
--- a/libmpdemux/demux_lmlm4.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/libmpdemux/demux_lmlm4.c	Sat Jan 25 16:55:09 2014 +0000
@@ -264,6 +264,7 @@
             video = 1;
             mp_dbg(MSGT_DEMUX, MSGL_DBG2, "First Video Packet\n");
         }
+        /* Fallthrough to common handling */
     case FRAMETYPE_P:
 	frames=(frames+1)&(1024*1024-1); // wrap around at 4 hrs to avoid inaccurate float calculations
         if (!video)
--- a/libmpdemux/demux_mkv.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/libmpdemux/demux_mkv.c	Sat Jan 25 16:55:09 2014 +0000
@@ -2095,6 +2095,7 @@
 
         default:
             cont = 1;
+            /* Fallthrough to skip data */
         case EBML_ID_VOID:
             ebml_read_skip(s, NULL);
             break;
--- a/libmpdemux/muxer_mpeg.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/libmpdemux/muxer_mpeg.c	Sat Jan 25 16:55:09 2014 +0000
@@ -2077,6 +2077,7 @@
 		{
 		default:
 			mp_msg(MSGT_MUXER, MSGL_ERR, "Unknown audio format, assuming MP2/3, use -fafmttag!\n");
+			/* Fallthrough to treat like MP2/3 */
 		case AUDIO_MP2:
 		case AUDIO_MP3:
 			{
--- a/libvo/vo_fbdev2.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/libvo/vo_fbdev2.c	Sat Jan 25 16:55:09 2014 +0000
@@ -59,6 +59,7 @@
 		case 32:
 			p->transp.offset = 24;
 			p->transp.length = 8;
+			/* Fallthrough, rest matches 24 bit */
 		case 24:
 			p->red.offset = 16;
 			p->red.length = 8;
--- a/libvo/vo_xvidix.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/libvo/vo_xvidix.c	Sat Jan 25 16:55:09 2014 +0000
@@ -396,6 +396,7 @@
             return VO_TRUE;
         case VOCTRL_FULLSCREEN:
             vo_x11_fullscreen();
+            /* Fallthrough to reconfigure panscan */
         case VOCTRL_SET_PANSCAN:
             if (vo_fs && (vo_panscan != vo_panscan_amount))
             {
--- a/libvo/x11_common.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/libvo/x11_common.c	Sat Jan 25 16:55:09 2014 +0000
@@ -894,6 +894,7 @@
                 return VO_EVENT_MOUSE;
             case ButtonPress:
                 key = MP_KEY_DOWN;
+                /* Fallthrough, treat like release otherwise */
             case ButtonRelease:
 #ifdef CONFIG_GUI
                 // Ignore mouse button 1-3 under GUI.
--- a/vidix/s3_vid.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/vidix/s3_vid.c	Sat Jan 25 16:55:09 2014 +0000
@@ -667,6 +667,7 @@
     if ((VGAIN8 (vgaCRReg) & 0xC0) == (0x01 << 6))
       RamSavage4[1] = 8;
 
+    /* Otherwise the same, so fallthrough */
   case S3_SAVAGE2000:
     videoRam = RamSavage4[(cr36 & 0xE0) >> 5] * 1024;
     break;
--- a/vidix/sis_vid.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/vidix/sis_vid.c	Sat Jan 25 16:55:09 2014 +0000
@@ -276,12 +276,14 @@
 		case DEVICE_SIS_300:
 		case DEVICE_SIS_630_VGA:
 		    sis_has_two_overlays = 1;
+                    /* Fallthrough, same as next otherwise */
 		case DEVICE_SIS_540_VGA:
 		    sis_vga_engine = SIS_300_VGA;
 		    break;
 		case DEVICE_SIS_330:
 		case DEVICE_SIS_550_VGA:
 		    sis_has_two_overlays = 1;
+                    /* Fallthrough, same as next otherwise */
 		case DEVICE_SIS_315H:
 		case DEVICE_SIS_315:
 		case DEVICE_SIS_315PRO:
--- a/vidix/unichrome_vid.c	Sat Jan 25 16:55:08 2014 +0000
+++ b/vidix/unichrome_vid.c	Sat Jan 25 16:55:09 2014 +0000
@@ -787,6 +787,7 @@
     {
     case IMGFMT_YV12:
       swap_uv = 1;
+      /* Fallthrough, same as the following otherwise */
     case IMGFMT_I420:
     case IMGFMT_UYVY:
     case IMGFMT_YVYU: