Changeset b0b9366 in rtems-tools for rtemstoolkit/ConvertUTF.c
- Timestamp:
- 05/06/18 03:21:18 (6 years ago)
- Branches:
- 5, master
- Children:
- 70dac81
- Parents:
- feafa6f
- git-author:
- Chris Johns <chrisj@…> (05/06/18 03:21:18)
- git-committer:
- Chris Johns <chrisj@…> (05/06/18 03:35:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rtemstoolkit/ConvertUTF.c
rfeafa6f rb0b9366 268 268 } 269 269 switch (bytesToWrite) { /* note: everything falls through. */ 270 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; 271 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; 272 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; 273 case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); 270 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; /* fall-thru */ 271 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; /* fall-thru */ 272 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; /* fall-thru */ 273 case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); /* fall-thru */ 274 274 } 275 275 target += bytesToWrite; … … 299 299 default: return false; 300 300 /* Everything else falls through when "true"... */ 301 case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; 302 case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; 303 case 2: if ((a = (*--srcptr)) > 0xBF) return false; 301 case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; /* fall-thru */ 302 case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; /* fall-thru */ 303 case 2: if ((a = (*--srcptr)) > 0xBF) return false; /* fall-thru */ 304 304 305 305 switch (*source) { … … 309 309 case 0xF0: if (a < 0x90) return false; break; 310 310 case 0xF4: if (a > 0x8F) return false; break; 311 default: if (a < 0x80) return false; 312 } 313 314 case 1: if (*source >= 0x80 && *source < 0xC2) return false; 311 default: if (a < 0x80) return false; break; 312 } 313 314 case 1: if (*source >= 0x80 && *source < 0xC2) return false; /* fall-thru */ 315 315 } 316 316 if (*source > 0xF4) return false; … … 355 355 */ 356 356 switch (extraBytesToRead) { 357 case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ 358 case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ 359 case 3: ch += *source++; ch <<= 6; 360 case 2: ch += *source++; ch <<= 6; 361 case 1: ch += *source++; ch <<= 6; 362 case 0: ch += *source++; 357 case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ /* fall-thru */ 358 case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ /* fall-thru */ 359 case 3: ch += *source++; ch <<= 6; /* fall-thru */ 360 case 2: ch += *source++; ch <<= 6; /* fall-thru */ 361 case 1: ch += *source++; ch <<= 6; /* fall-thru */ 362 case 0: ch += *source++; /* fall-thru */ 363 363 } 364 364 ch -= offsetsFromUTF8[extraBytesToRead];
Note: See TracChangeset
for help on using the changeset viewer.