[rtems-tools commit] rtemstoolkit: Remove warnings generated on Windows for fall-thru.

Chris Johns chrisj at rtems.org
Mon Apr 30 05:51:59 UTC 2018


Module:    rtems-tools
Branch:    master
Commit:    e0a52a4fe49da602245f6b306a7d7c7c8db9aa32
Changeset: http://git.rtems.org/rtems-tools/commit/?id=e0a52a4fe49da602245f6b306a7d7c7c8db9aa32

Author:    Chris Johns <chrisj at rtems.org>
Date:      Mon Apr 30 15:50:03 2018 +1000

rtemstoolkit: Remove warnings generated on Windows for fall-thru.

---

 rtemstoolkit/ConvertUTF.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/rtemstoolkit/ConvertUTF.c b/rtemstoolkit/ConvertUTF.c
index 9b3deeb..fa1b8ed 100644
--- a/rtemstoolkit/ConvertUTF.c
+++ b/rtemstoolkit/ConvertUTF.c
@@ -446,9 +446,10 @@ ConversionResult ConvertUTF32toUTF8 (
 	}
 	switch (bytesToWrite) { /* note: everything falls through. */
 	    case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
-	    case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
-	    case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
-	    case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
+	    /* fall-thru */
+	    case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; /* fall-thru */
+	    case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; /* fall-thru */
+	    case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);    /* fall-thru */
 	}
 	target += bytesToWrite;
     }
@@ -480,12 +481,12 @@ ConversionResult ConvertUTF8toUTF32 (
 	 * The cases all fall through. See "Note A" below.
 	 */
 	switch (extraBytesToRead) {
-	    case 5: ch += *source++; ch <<= 6;
-	    case 4: ch += *source++; ch <<= 6;
-	    case 3: ch += *source++; ch <<= 6;
-	    case 2: ch += *source++; ch <<= 6;
-	    case 1: ch += *source++; ch <<= 6;
-	    case 0: ch += *source++;
+	    case 5: ch += *source++; ch <<= 6; /* fall-thru */
+	    case 4: ch += *source++; ch <<= 6; /* fall-thru */
+	    case 3: ch += *source++; ch <<= 6; /* fall-thru */
+	    case 2: ch += *source++; ch <<= 6; /* fall-thru */
+	    case 1: ch += *source++; ch <<= 6; /* fall-thru */
+	    case 0: ch += *source++;           /* fall-thru */
 	}
 	ch -= offsetsFromUTF8[extraBytesToRead];
 



More information about the vc mailing list