~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.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:
690
690
 
691
691
bool check_duplicates_in_interval(const char *set_or_name,
692
692
                                  const char *name, TYPELIB *typelib,
693
 
                                  CHARSET_INFO *cs, unsigned int *dup_val_count)
 
693
                                  const CHARSET_INFO * const cs, unsigned int *dup_val_count)
694
694
{
695
695
  TYPELIB tmp= *typelib;
696
696
  const char **cur_value= typelib->type_names;
731
731
  RETURN VALUES
732
732
    void
733
733
*/
734
 
void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval,
 
734
void calculate_interval_lengths(const CHARSET_INFO * const cs, TYPELIB *interval,
735
735
                                uint32_t *max_length, uint32_t *tot_length)
736
736
{
737
737
  const char **pos;
922
922
 
923
923
  for (field_no=0; (sql_field=it++) ; field_no++)
924
924
  {
925
 
    CHARSET_INFO *save_cs;
 
925
    const CHARSET_INFO *save_cs;
926
926
 
927
927
    /*
928
928
      Initialize length from its original value (number of characters),
986
986
        sql_field->sql_type == DRIZZLE_TYPE_ENUM)
987
987
    {
988
988
      uint32_t dummy;
989
 
      CHARSET_INFO *cs= sql_field->charset;
 
989
      const CHARSET_INFO * const cs= sql_field->charset;
990
990
      TYPELIB *interval= sql_field->interval;
991
991
 
992
992
      /*
2454
2454
  Protocol *protocol= thd->protocol;
2455
2455
  LEX *lex= thd->lex;
2456
2456
  int result_code= 0;
2457
 
  CHARSET_INFO *cs= system_charset_info;
 
2457
  const CHARSET_INFO * const cs= system_charset_info;
2458
2458
 
2459
2459
  if (end_active_trans(thd))
2460
2460
    return(1);