Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: Source/platform/text/UnicodeRange.cpp

Issue 207783002: Omit "int" when using "unsigned" modifier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/image-encoders/skia/JPEGImageEncoder.cpp ('k') | Source/web/WebCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Computer, Inc. 2 * Copyright (C) 2007 Apple Computer, Inc.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public 7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version. 9 * version 2.1 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 }; 420 };
421 421
422 // A two level index is almost enough for locating a range, with the 422 // A two level index is almost enough for locating a range, with the
423 // exception of u03xx and u05xx. Since we don't really care about range for 423 // exception of u03xx and u05xx. Since we don't really care about range for
424 // combining diacritical marks in our font application, they are 424 // combining diacritical marks in our font application, they are
425 // not discriminated further. Future adoption of this method for other use 425 // not discriminated further. Future adoption of this method for other use
426 // should be aware of this limitation. The implementation can be extended if 426 // should be aware of this limitation. The implementation can be extended if
427 // there is such a need. 427 // there is such a need.
428 // For Indic, Southeast Asian scripts and some other scripts between 428 // For Indic, Southeast Asian scripts and some other scripts between
429 // U+0700 and U+16FF, it's extended to the third level. 429 // U+0700 and U+16FF, it's extended to the third level.
430 unsigned int findCharUnicodeRange(UChar32 ch) 430 unsigned findCharUnicodeRange(UChar32 ch)
431 { 431 {
432 if (ch >= 0xFFFF) 432 if (ch >= 0xFFFF)
433 return 0; 433 return 0;
434 434
435 unsigned int range; 435 unsigned range;
436 436
437 //search the first table 437 //search the first table
438 range = gUnicodeSubrangeTable[0][ch >> 12]; 438 range = gUnicodeSubrangeTable[0][ch >> 12];
439 439
440 if (range < cRangeTableBase) 440 if (range < cRangeTableBase)
441 // we try to get a specific range 441 // we try to get a specific range
442 return range; 442 return range;
443 443
444 // otherwise, we have one more table to look at 444 // otherwise, we have one more table to look at
445 range = gUnicodeSubrangeTable[range - cRangeTableBase][(ch & 0x0f00) >> 8]; 445 range = gUnicodeSubrangeTable[range - cRangeTableBase][(ch & 0x0f00) >> 8];
446 if (range < cRangeTableBase) 446 if (range < cRangeTableBase)
447 return range; 447 return range;
448 if (range < cRangeTertiaryTable) 448 if (range < cRangeTertiaryTable)
449 return gUnicodeSubrangeTable[range - cRangeTableBase][(ch & 0x00f0) >> 4 ]; 449 return gUnicodeSubrangeTable[range - cRangeTableBase][(ch & 0x00f0) >> 4 ];
450 450
451 // Yet another table to look at : U+0700 - U+16FF : 128 code point blocks 451 // Yet another table to look at : U+0700 - U+16FF : 128 code point blocks
452 return gUnicodeTertiaryRangeTable[(ch - 0x0700) >> 7]; 452 return gUnicodeTertiaryRangeTable[(ch - 0x0700) >> 7];
453 } 453 }
454 454
455 const char* langGroupFromUnicodeRange(unsigned char unicodeRange) 455 const char* langGroupFromUnicodeRange(unsigned char unicodeRange)
456 { 456 {
457 if (cRangeSpecificItemNum > unicodeRange) 457 if (cRangeSpecificItemNum > unicodeRange)
458 return gUnicodeRangeToLangGroupTable[unicodeRange]; 458 return gUnicodeRangeToLangGroupTable[unicodeRange];
459 return 0; 459 return 0;
460 } 460 }
461 461
462 } 462 }
OLDNEW
« no previous file with comments | « Source/platform/image-encoders/skia/JPEGImageEncoder.cpp ('k') | Source/web/WebCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698