| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2007,2008,2009 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009 Red Hat, Inc. |
| 3 * Copyright © 2011,2012 Google, Inc. | 3 * Copyright © 2011,2012 Google, Inc. |
| 4 * | 4 * |
| 5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
| 6 * | 6 * |
| 7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
| 8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
| 9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
| 10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 */ | 510 */ |
| 511 | 511 |
| 512 #define hb_be_uint16_put(v,V) HB_STMT_START { v[0] = (V>>8); v[1] = (V); } HB_
STMT_END | 512 #define hb_be_uint16_put(v,V) HB_STMT_START { v[0] = (V>>8); v[1] = (V); } HB_
STMT_END |
| 513 #define hb_be_uint16_get(v) (uint16_t) ((v[0] << 8) + v[1]) | 513 #define hb_be_uint16_get(v) (uint16_t) ((v[0] << 8) + v[1]) |
| 514 #define hb_be_uint16_eq(a,b) (a[0] == b[0] && a[1] == b[1]) | 514 #define hb_be_uint16_eq(a,b) (a[0] == b[0] && a[1] == b[1]) |
| 515 | 515 |
| 516 #define hb_be_uint32_put(v,V) HB_STMT_START { v[0] = (V>>24); v[1] = (V>>16);
v[2] = (V>>8); v[3] = (V); } HB_STMT_END | 516 #define hb_be_uint32_put(v,V) HB_STMT_START { v[0] = (V>>24); v[1] = (V>>16);
v[2] = (V>>8); v[3] = (V); } HB_STMT_END |
| 517 #define hb_be_uint32_get(v) (uint32_t) ((v[0] << 24) + (v[1] << 16) + (v[2]
<< 8) + v[3]) | 517 #define hb_be_uint32_get(v) (uint32_t) ((v[0] << 24) + (v[1] << 16) + (v[2]
<< 8) + v[3]) |
| 518 #define hb_be_uint32_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2] &&
a[3] == b[3]) | 518 #define hb_be_uint32_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2] &&
a[3] == b[3]) |
| 519 | 519 |
| 520 #define hb_be_uint24_put(v,V)» HB_STMT_START { v[0] = (V>>16); v[1] = (V>>8); v
[2] (V); } HB_STMT_END | 520 #define hb_be_uint24_put(v,V)» HB_STMT_START { v[0] = (V>>16); v[1] = (V>>8); v
[2] = (V); } HB_STMT_END |
| 521 #define hb_be_uint24_get(v) (uint32_t) ((v[0] << 16) + (v[1] << 8) + v[2]) | 521 #define hb_be_uint24_get(v) (uint32_t) ((v[0] << 16) + (v[1] << 8) + v[2]) |
| 522 #define hb_be_uint24_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2]) | 522 #define hb_be_uint24_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2]) |
| 523 | 523 |
| 524 | 524 |
| 525 /* ASCII tag/character handling */ | 525 /* ASCII tag/character handling */ |
| 526 | 526 |
| 527 static inline bool ISALPHA (unsigned char c) | 527 static inline bool ISALPHA (unsigned char c) |
| 528 { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } | 528 { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } |
| 529 static inline bool ISALNUM (unsigned char c) | 529 static inline bool ISALNUM (unsigned char c) |
| 530 { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '
9'); } | 530 { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '
9'); } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 556 #define HB_DEBUG 0 | 556 #define HB_DEBUG 0 |
| 557 #endif | 557 #endif |
| 558 | 558 |
| 559 static inline bool | 559 static inline bool |
| 560 _hb_debug (unsigned int level, | 560 _hb_debug (unsigned int level, |
| 561 unsigned int max_level) | 561 unsigned int max_level) |
| 562 { | 562 { |
| 563 return level < max_level; | 563 return level < max_level; |
| 564 } | 564 } |
| 565 | 565 |
| 566 #define DEBUG_LEVEL(WHAT, LEVEL) (_hb_debug ((LEVEL), HB_DEBUG_##WHAT)) | 566 #define DEBUG_LEVEL_ENABLED(WHAT, LEVEL) (_hb_debug ((LEVEL), HB_DEBUG_##WHAT)) |
| 567 #define DEBUG(WHAT) (DEBUG_LEVEL (WHAT, 0)) | 567 #define DEBUG_ENABLED(WHAT) (DEBUG_LEVEL_ENABLED (WHAT, 0)) |
| 568 | 568 |
| 569 template <int max_level> static inline void | 569 template <int max_level> static inline void |
| 570 _hb_debug_msg_va (const char *what, | 570 _hb_debug_msg_va (const char *what, |
| 571 const void *obj, | 571 const void *obj, |
| 572 const char *func, | 572 const char *func, |
| 573 bool indented, | 573 bool indented, |
| 574 unsigned int level, | 574 unsigned int level, |
| 575 int level_dir, | 575 int level_dir, |
| 576 const char *message, | 576 const char *message, |
| 577 va_list ap) | 577 va_list ap) |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 hb_options (void) | 892 hb_options (void) |
| 893 { | 893 { |
| 894 if (unlikely (!_hb_options.i)) | 894 if (unlikely (!_hb_options.i)) |
| 895 _hb_options_init (); | 895 _hb_options_init (); |
| 896 | 896 |
| 897 return _hb_options.opts; | 897 return _hb_options.opts; |
| 898 } | 898 } |
| 899 | 899 |
| 900 | 900 |
| 901 #endif /* HB_PRIVATE_HH */ | 901 #endif /* HB_PRIVATE_HH */ |
| OLD | NEW |