~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_timefunc.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:
57
57
                          String *str)
58
58
{
59
59
  char *buff;
60
 
  CHARSET_INFO *cs= &my_charset_bin;
 
60
  const CHARSET_INFO * const cs= &my_charset_bin;
61
61
  uint length= MAX_DATE_STRING_REP_LENGTH;
62
62
 
63
63
  if (str->alloc(length))
285
285
  const char *val_end= val + length;
286
286
  const char *ptr= format->format.str;
287
287
  const char *end= ptr + format->format.length;
288
 
  CHARSET_INFO *cs= &my_charset_bin;
 
288
  const CHARSET_INFO * const cs= &my_charset_bin;
289
289
 
290
290
  if (!sub_pattern_end)
291
291
    memset(l_time, 0, sizeof(*l_time));
855
855
                         For example, '1.1' -> '1.100000'
856
856
*/
857
857
 
858
 
static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
 
858
static bool get_interval_info(const char *str,uint length, const CHARSET_INFO * const cs,
859
859
                              uint count, uint64_t *values,
860
860
                              bool transform_msec)
861
861
{
1297
1297
  int64_t value= 0;
1298
1298
  const char *str= NULL;
1299
1299
  size_t length= 0;
1300
 
  CHARSET_INFO *cs=str_value->charset();
 
1300
  const CHARSET_INFO * const cs= str_value->charset();
1301
1301
 
1302
1302
  memset(interval, 0, sizeof(*interval));
1303
1303
  if ((int) int_type <= INTERVAL_MICROSECOND)
1765
1765
  Item *arg1= args[1]->this_item();
1766
1766
 
1767
1767
  decimals=0;
1768
 
  CHARSET_INFO *cs= thd->variables.collation_connection;
 
1768
  const CHARSET_INFO * const cs= thd->variables.collation_connection;
1769
1769
  uint32_t repertoire= arg1->collation.repertoire;
1770
1770
  if (!thd->variables.lc_time_names->is_ascii)
1771
1771
    repertoire|= MY_REPERTOIRE_EXTENDED;