~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/serialize/binlog_encoding.h

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#include <cstdlib>
5
5
#include <cassert>
6
6
#include <cstring>
7
 
#include <stdint.h>
 
7
#include CSTDINT_H
8
8
 
9
9
#define LENGTH_ENCODE_MAX_BYTES (sizeof(size_t) + 1)
10
10
 
 
11
using std::size_t;
 
12
 
11
13
inline unsigned char *
12
 
length_encode(size_t length, unsigned char *buf)
 
14
length_encode(std::size_t length, unsigned char *buf)
13
15
{
14
16
  unsigned char *ptr= buf;
15
17
  assert(length > 1);
38
40
      }
39
41
    }
40
42
    // Clear the remaining bytes up to the next power of two
41
 
    memset(ptr + 1, 0, pow2 - (ptr - buf));
 
43
    std::memset(ptr + 1, 0, pow2 - (ptr - buf));
42
44
    *buf= log2m1;
43
45
    ptr= buf + pow2 + 1;
44
46
  }