~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/fstring.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:
34
34
****************************************************************************/
35
35
 
36
36
/* Copy a string and fill with space */
37
 
int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
 
37
int Field_string::store(const char *from,uint length, const CHARSET_INFO * const cs)
38
38
{
39
39
  uint copy_length;
40
40
  const char *well_formed_error_pos;
70
70
{
71
71
  char buff[64];
72
72
  int  l;
73
 
  CHARSET_INFO *cs=charset();
 
73
  const CHARSET_INFO * const cs= charset();
74
74
  l= (cs->cset->int64_t10_to_str)(cs,buff,sizeof(buff),
75
75
                                   unsigned_val ? 10 : -10, nr);
76
76
  return Field_string::store(buff,(uint)l,cs);
81
81
{
82
82
  int error;
83
83
  char *end;
84
 
  CHARSET_INFO *cs= charset();
 
84
  const CHARSET_INFO * const cs= charset();
85
85
  double result;
86
86
  
87
87
  result=  my_strntod(cs,(char*) ptr,field_length,&end,&error);
106
106
{
107
107
  int error;
108
108
  char *end;
109
 
  CHARSET_INFO *cs= charset();
 
109
  const CHARSET_INFO * const cs= charset();
110
110
  int64_t result;
111
111
 
112
112
  result= my_strntoll(cs, (char*) ptr,field_length,10,&end,&error);
151
151
  if (!table->in_use->no_errors && err)
152
152
  {
153
153
    char buf[DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE];
154
 
    CHARSET_INFO *cs= charset();
 
154
    const CHARSET_INFO * const cs= charset();
155
155
    String tmp(buf, sizeof(buf), cs);
156
156
    tmp.copy((char*) ptr, field_length, cs);
157
157
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
199
199
void Field_string::sql_type(String &res) const
200
200
{
201
201
  THD *thd= table->in_use;
202
 
  CHARSET_INFO *cs=res.charset();
 
202
  const CHARSET_INFO * const cs= res.charset();
203
203
  ulong length;
204
204
 
205
205
  length= cs->cset->snprintf(cs,(char*) res.ptr(),