~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.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:
245
245
 
246
246
void Lex_input_stream::body_utf8_append_literal(THD *thd,
247
247
                                                const LEX_STRING *txt,
248
 
                                                CHARSET_INFO *txt_cs,
 
248
                                                const CHARSET_INFO * const txt_cs,
249
249
                                                const char *end_ptr)
250
250
{
251
251
  if (!m_cpp_utf8_processed_ptr)
479
479
{
480
480
  register uchar c,sep;
481
481
  uint found_escape=0;
482
 
  CHARSET_INFO *cs= lip->m_thd->charset();
 
482
  const CHARSET_INFO * const cs= lip->m_thd->charset();
483
483
 
484
484
  lip->tok_bitmap= 0;
485
485
  sep= lip->yyGetLast();                        // String should end with this
765
765
  Lex_input_stream *lip= thd->m_lip;
766
766
  LEX *lex= thd->lex;
767
767
  YYSTYPE *yylval=(YYSTYPE*) arg;
768
 
  CHARSET_INFO *cs= thd->charset();
 
768
  const CHARSET_INFO * const cs= thd->charset();
769
769
  uchar *state_map= cs->state_map;
770
770
  uchar *ident_map= cs->ident_map;
771
771
 
911
911
 
912
912
      if (yylval->lex_str.str[0] == '_')
913
913
      {
914
 
        CHARSET_INFO *cs= get_charset_by_csname(yylval->lex_str.str + 1,
915
 
                                                MY_CS_PRIMARY, MYF(0));
 
914
        const CHARSET_INFO * const cs= get_charset_by_csname(yylval->lex_str.str + 1,
 
915
                                                             MY_CS_PRIMARY, MYF(0));
916
916
        if (cs)
917
917
        {
918
918
          yylval->charset= cs;
1475
1475
}
1476
1476
 
1477
1477
 
1478
 
void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str)
 
1478
void trim_whitespace(const CHARSET_INFO * const cs, LEX_STRING *str)
1479
1479
{
1480
1480
  /*
1481
1481
    TODO: