~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_checksum.c

Removed dead variable, sorted authors file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include "myisamdef.h"
19
19
 
20
 
ha_checksum mi_checksum(MI_INFO *info, const unsigned char *buf)
 
20
ha_checksum mi_checksum(MI_INFO *info, const uchar *buf)
21
21
{
22
 
  uint32_t i;
 
22
  uint i;
23
23
  ha_checksum crc=0;
24
24
  MI_COLUMNDEF *rec=info->s->rec;
25
25
 
26
26
  for (i=info->s->base.fields ; i-- ; buf+=(rec++)->length)
27
27
  {
28
 
    const unsigned char *pos;
 
28
    const uchar *pos;
29
29
    ulong length;
30
30
    switch (rec->type) {
31
31
    case FIELD_BLOB:
33
33
      length=_mi_calc_blob_length(rec->length-
34
34
                                        portable_sizeof_char_ptr,
35
35
                                        buf);
36
 
      memcpy(&pos, buf+rec->length - portable_sizeof_char_ptr, sizeof(char*));
 
36
      memcpy((char*) &pos, buf+rec->length- portable_sizeof_char_ptr,
 
37
             sizeof(char*));
37
38
      break;
38
39
    }
39
40
    case FIELD_VARCHAR:
40
41
    {
41
 
      uint32_t pack_length= HA_VARCHAR_PACKLENGTH(rec->length-1);
 
42
      uint pack_length= HA_VARCHAR_PACKLENGTH(rec->length-1);
42
43
      if (pack_length == 1)
43
 
        length= (ulong) *(unsigned char*) buf;
 
44
        length= (ulong) *(uchar*) buf;
44
45
      else
45
46
        length= uint2korr(buf);
46
47
      pos= buf+pack_length;
51
52
      pos=buf;
52
53
      break;
53
54
    }
54
 
    crc=my_checksum(crc, pos ? pos : (unsigned char*) "", length);
 
55
    crc=my_checksum(crc, pos ? pos : (uchar*) "", length);
55
56
  }
56
57
  return crc;
57
58
}
58
59
 
59
60
 
60
 
ha_checksum mi_static_checksum(MI_INFO *info, const unsigned char *pos)
 
61
ha_checksum mi_static_checksum(MI_INFO *info, const uchar *pos)
61
62
{
62
63
  return my_checksum(0, pos, info->s->base.reclength);
63
64
}