~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.cc

  • Committer: Andrey Hristov
  • Date: 2008-08-06 00:04:45 UTC
  • mto: (264.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: ahristov@mysql.com-20080806000445-84urmltikgwk9v5d
Constify the usage of CHARSET_INFO almost to the last place in the code.
99% of the parameters are const CHARSET_INFO * const cs.
Wherever possible stack variables are also double consted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
Field_blob::Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
37
37
                       enum utype unireg_check_arg, const char *field_name_arg,
38
38
                       TABLE_SHARE *share, uint blob_pack_length,
39
 
                       CHARSET_INFO *cs)
 
39
                       const CHARSET_INFO * const cs)
40
40
  :Field_longstr(ptr_arg, BLOB_PACK_LENGTH_TO_MAX_LENGH(blob_pack_length),
41
41
                 null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
42
42
                 cs),
149
149
}
150
150
 
151
151
 
152
 
int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
 
152
int Field_blob::store(const char *from,uint length, const CHARSET_INFO * const cs)
153
153
{
154
154
  uint copy_length, new_length;
155
155
  const char *well_formed_error_pos;
225
225
 
226
226
int Field_blob::store(double nr)
227
227
{
228
 
  CHARSET_INFO *cs=charset();
 
228
  const CHARSET_INFO * const cs=charset();
229
229
  value.set_real(nr, NOT_FIXED_DEC, cs);
230
230
  return Field_blob::store(value.ptr(),(uint) value.length(), cs);
231
231
}
233
233
 
234
234
int Field_blob::store(int64_t nr, bool unsigned_val)
235
235
{
236
 
  CHARSET_INFO *cs=charset();
 
236
  const CHARSET_INFO * const cs=charset();
237
237
  value.set_int(nr, unsigned_val, cs);
238
238
  return Field_blob::store(value.ptr(), (uint) value.length(), cs);
239
239
}
244
244
  int not_used;
245
245
  char *end_not_used, *blob;
246
246
  uint32_t length;
247
 
  CHARSET_INFO *cs;
 
247
  const CHARSET_INFO *cs;
248
248
 
249
249
  memcpy(&blob,ptr+packlength,sizeof(char*));
250
250
  if (!blob)
382
382
  uchar *blob1;
383
383
  uint blob_length=get_length(ptr);
384
384
  memcpy(&blob1,ptr+packlength,sizeof(char*));
385
 
  CHARSET_INFO *cs= charset();
 
385
  const CHARSET_INFO * const cs= charset();
386
386
  uint local_char_length= max_key_length / cs->mbmaxlen;
387
387
  local_char_length= my_charpos(cs, blob1, blob1+blob_length,
388
388
                                local_char_length);