~ubuntu-branches/ubuntu/trusty/harfbuzz/trusty

« back to all changes in this revision

Viewing changes to src/hb-open-type-private.hh

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-12-09 11:03:19 UTC
  • mfrom: (2.1.16 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131209110319-rsy56xzp01r9wqzx
Tags: 0.9.24-2ubuntu1
* Merge with Debian, remaining changes
  - Build using dh-autoreconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
642
642
/* CheckSum */
643
643
struct CheckSum : ULONG
644
644
{
645
 
  static uint32_t CalcTableChecksum (ULONG *Table, uint32_t Length)
 
645
  /* This is reference implementation from the spec. */
 
646
  static inline uint32_t CalcTableChecksum (const ULONG *Table, uint32_t Length)
646
647
  {
647
648
    uint32_t Sum = 0L;
648
 
    ULONG *EndPtr = Table+((Length+3) & ~3) / ULONG::static_size;
 
649
    const ULONG *EndPtr = Table+((Length+3) & ~3) / ULONG::static_size;
649
650
 
650
651
    while (Table < EndPtr)
651
652
      Sum += *Table++;
652
653
    return Sum;
653
654
  }
 
655
 
 
656
  /* Note: data should be 4byte aligned and have 4byte padding at the end. */
 
657
  inline void set_for_data (const void *data, unsigned int length)
 
658
  { set (CalcTableChecksum ((const ULONG *) data, length)); }
 
659
 
654
660
  public:
655
661
  DEFINE_SIZE_STATIC (4);
656
662
};