~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/short.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:
28
28
 Field type short int (2 byte)
29
29
****************************************************************************/
30
30
 
31
 
int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
 
31
int Field_short::store(const char *from,uint len, const CHARSET_INFO * const cs)
32
32
{
33
33
  int store_tmp;
34
34
  int error;
181
181
String *Field_short::val_str(String *val_buffer,
182
182
                             String *val_ptr __attribute__((unused)))
183
183
{
184
 
  CHARSET_INFO *cs= &my_charset_bin;
 
184
  const CHARSET_INFO * const cs= &my_charset_bin;
185
185
  uint length;
186
186
  uint mlength=max(field_length+1,7*cs->mbmaxlen);
187
187
  val_buffer->alloc(mlength);
257
257
 
258
258
void Field_short::sql_type(String &res) const
259
259
{
260
 
  CHARSET_INFO *cs=res.charset();
 
260
  const CHARSET_INFO * const cs= res.charset();
261
261
  res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(), "smallint"));
262
262
  add_unsigned(res);
263
263
}