OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. |
3 * Copyright © 2012 Google, Inc. | 3 * Copyright © 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 | 732 |
733 public: | 733 public: |
734 DEFINE_SIZE_STATIC (4); | 734 DEFINE_SIZE_STATIC (4); |
735 }; | 735 }; |
736 | 736 |
737 | 737 |
738 /* | 738 /* |
739 * Version Numbers | 739 * Version Numbers |
740 */ | 740 */ |
741 | 741 |
| 742 template <typename FixedType=USHORT> |
742 struct FixedVersion | 743 struct FixedVersion |
743 { | 744 { |
744 inline uint32_t to_int (void) const { return (major << 16) + minor; } | 745 inline uint32_t to_int (void) const { return (major << sizeof(FixedType)) + mi
nor; } |
745 | 746 |
746 inline bool sanitize (hb_sanitize_context_t *c) const | 747 inline bool sanitize (hb_sanitize_context_t *c) const |
747 { | 748 { |
748 TRACE_SANITIZE (this); | 749 TRACE_SANITIZE (this); |
749 return_trace (c->check_struct (this)); | 750 return_trace (c->check_struct (this)); |
750 } | 751 } |
751 | 752 |
752 USHORT major; | 753 FixedType major; |
753 USHORT minor; | 754 FixedType minor; |
754 public: | 755 public: |
755 DEFINE_SIZE_STATIC (4); | 756 DEFINE_SIZE_STATIC (2 * sizeof(FixedType)); |
756 }; | 757 }; |
757 | 758 |
758 | 759 |
759 | 760 |
760 /* | 761 /* |
761 * Template subclasses of Offset that do the dereferencing. | 762 * Template subclasses of Offset that do the dereferencing. |
762 * Use: (base+offset) | 763 * Use: (base+offset) |
763 */ | 764 */ |
764 | 765 |
765 template <typename Type, typename OffsetType=USHORT> | 766 template <typename Type, typename OffsetType=USHORT> |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 } | 1035 } |
1035 return -1; | 1036 return -1; |
1036 } | 1037 } |
1037 }; | 1038 }; |
1038 | 1039 |
1039 | 1040 |
1040 } /* namespace OT */ | 1041 } /* namespace OT */ |
1041 | 1042 |
1042 | 1043 |
1043 #endif /* HB_OPEN_TYPE_PRIVATE_HH */ | 1044 #endif /* HB_OPEN_TYPE_PRIVATE_HH */ |
OLD | NEW |