~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/csv/transparent_file.cc

Merged in changes from Andrey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
Transparent_file::Transparent_file() : lower_bound(0), buff_size(IO_SIZE)
24
24
25
 
  buff= (uchar *) my_malloc(buff_size*sizeof(uchar),  MYF(MY_WME)); 
 
25
  buff= (unsigned char *) my_malloc(buff_size*sizeof(unsigned char),  MYF(MY_WME)); 
26
26
}
27
27
 
28
28
Transparent_file::~Transparent_file()
29
29
30
 
  my_free((uchar*)buff, MYF(MY_ALLOW_ZERO_PTR)); 
 
30
  free((unsigned char*)buff); 
31
31
}
32
32
 
33
33
void Transparent_file::init_buff(File filedes_arg)
35
35
  filedes= filedes_arg;
36
36
  /* read the beginning of the file */
37
37
  lower_bound= 0;
38
 
  VOID(my_seek(filedes, 0, MY_SEEK_SET, MYF(0)));
 
38
  my_seek(filedes, 0, MY_SEEK_SET, MYF(0));
39
39
  if (filedes && buff)
40
40
    upper_bound= my_read(filedes, buff, buff_size, MYF(0));
41
41
}
42
42
 
43
 
uchar *Transparent_file::ptr()
 
43
unsigned char *Transparent_file::ptr()
44
44
45
45
  return buff; 
46
46
}
85
85
  if ((lower_bound <= offset) && (offset < upper_bound))
86
86
    return buff[offset - lower_bound];
87
87
 
88
 
  VOID(my_seek(filedes, offset, MY_SEEK_SET, MYF(0)));
 
88
  my_seek(filedes, offset, MY_SEEK_SET, MYF(0));
89
89
  /* read appropriate portion of the file */
90
90
  if ((bytes_read= my_read(filedes, buff, buff_size,
91
91
                           MYF(0))) == MY_FILE_ERROR)