diff options
author | monty@mysql.com/narttu.mysql.fi <> | 2006-12-15 00:51:37 +0200 |
---|---|---|
committer | monty@mysql.com/narttu.mysql.fi <> | 2006-12-15 00:51:37 +0200 |
commit | 88dd873de0d5dc6e8f262268f925596a60b58704 (patch) | |
tree | 142bd488523fec48817d9fb2194f1a608eec00fc /sql/field.h | |
parent | 601e6f4b2a78921304bc1d779991c615ee229f89 (diff) | |
download | mariadb-git-88dd873de0d5dc6e8f262268f925596a60b58704.tar.gz |
Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments
Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c
I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/sql/field.h b/sql/field.h index 709630218b2..da23e7a55b5 100644 --- a/sql/field.h +++ b/sql/field.h @@ -154,12 +154,12 @@ public: virtual void reset_fields() {} virtual void set_default() { - my_ptrdiff_t offset = (my_ptrdiff_t) (table->s->default_values - + my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->s->default_values - table->record[0]); - memcpy(ptr, ptr + offset, pack_length()); + memcpy(ptr, ptr + l_offset, pack_length()); if (null_ptr) *null_ptr= ((*null_ptr & (uchar) ~null_bit) | - null_ptr[offset] & null_bit); + null_ptr[l_offset] & null_bit); } virtual bool binary() const { return 1; } virtual bool zero_pack() const { return 1; } @@ -236,7 +236,7 @@ public: { memcpy(buff,ptr,length); } inline void set_image(char *buff,uint length, CHARSET_INFO *cs) { memcpy(ptr,buff,length); } - virtual void get_key_image(char *buff, uint length, imagetype type) + virtual void get_key_image(char *buff, uint length, imagetype type_arg) { get_image(buff,length, &my_charset_bin); } virtual void set_key_image(char *buff,uint length) { set_image(buff,length, &my_charset_bin); } @@ -301,10 +301,10 @@ public: virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; } virtual CHARSET_INFO *sort_charset(void) const { return charset(); } virtual bool has_charset(void) const { return FALSE; } - virtual void set_charset(CHARSET_INFO *charset) { } + virtual void set_charset(CHARSET_INFO *charset_arg) { } virtual enum Derivation derivation(void) const { return DERIVATION_IMPLICIT; } - virtual void set_derivation(enum Derivation derivation) { } + virtual void set_derivation(enum Derivation derivation_arg) { } bool set_warning(MYSQL_ERROR::enum_warning_level, unsigned int code, int cuted_increment); bool check_int(const char *str, int length, const char *int_end, @@ -323,7 +323,7 @@ public: } int warn_if_overflow(int op_result); /* maximum possible display length */ - virtual uint32 max_length()= 0; + virtual uint32 max_display_length()= 0; /* convert decimal to longlong with overflow check */ longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag, int *err); @@ -390,12 +390,12 @@ public: int store(const char *to,uint length,CHARSET_INFO *cs)=0; uint size_of() const { return sizeof(*this); } CHARSET_INFO *charset(void) const { return field_charset; } - void set_charset(CHARSET_INFO *charset) { field_charset=charset; } + void set_charset(CHARSET_INFO *charset_arg) { field_charset= charset_arg; } enum Derivation derivation(void) const { return field_derivation; } virtual void set_derivation(enum Derivation derivation_arg) { field_derivation= derivation_arg; } bool binary() const { return field_charset == &my_charset_bin; } - uint32 max_length() { return field_length; } + uint32 max_display_length() { return field_length; } friend class create_field; my_decimal *val_decimal(my_decimal *); }; @@ -409,9 +409,9 @@ public: Field_longstr(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, const char *field_name_arg, - struct st_table *table_arg,CHARSET_INFO *charset) + struct st_table *table_arg, CHARSET_INFO *charset_arg) :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, - field_name_arg, table_arg, charset) + field_name_arg, table_arg, charset_arg) {} int store_decimal(const my_decimal *d); @@ -462,7 +462,7 @@ public: void overflow(bool negative); bool zero_pack() const { return 0; } void sql_type(String &str) const; - uint32 max_length() { return field_length; } + uint32 max_display_length() { return field_length; } }; @@ -506,7 +506,7 @@ public: void sort_string(char *buff, uint length); bool zero_pack() const { return 0; } void sql_type(String &str) const; - uint32 max_length() { return field_length; } + uint32 max_display_length() { return field_length; } uint size_of() const { return sizeof(*this); } uint32 pack_length() const { return (uint32) bin_size; } }; @@ -539,7 +539,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 1; } void sql_type(String &str) const; - uint32 max_length() { return 4; } + uint32 max_display_length() { return 4; } }; @@ -575,7 +575,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 2; } void sql_type(String &str) const; - uint32 max_length() { return 6; } + uint32 max_display_length() { return 6; } }; @@ -606,7 +606,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 3; } void sql_type(String &str) const; - uint32 max_length() { return 8; } + uint32 max_display_length() { return 8; } }; @@ -642,7 +642,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 4; } void sql_type(String &str) const; - uint32 max_length() { return 11; } + uint32 max_display_length() { return 11; } }; @@ -681,7 +681,7 @@ public: uint32 pack_length() const { return 8; } void sql_type(String &str) const; bool can_be_compared_as_longlong() const { return TRUE; } - uint32 max_length() { return 20; } + uint32 max_display_length() { return 20; } }; #endif @@ -716,7 +716,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return sizeof(float); } void sql_type(String &str) const; - uint32 max_length() { return 24; } + uint32 max_display_length() { return 24; } }; @@ -750,7 +750,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return sizeof(double); } void sql_type(String &str) const; - uint32 max_length() { return 53; } + uint32 max_display_length() { return 53; } }; @@ -782,7 +782,7 @@ public: uint32 pack_length() const { return 0; } void sql_type(String &str) const; uint size_of() const { return sizeof(*this); } - uint32 max_length() { return 4; } + uint32 max_display_length() { return 4; } }; @@ -1153,10 +1153,10 @@ public: packlength= 4; if (set_packlength) { - uint32 char_length= len_arg/cs->mbmaxlen; - packlength= char_length <= 255 ? 1 : - char_length <= 65535 ? 2 : - char_length <= 16777215 ? 3 : 4; + uint32 l_char_length= len_arg/cs->mbmaxlen; + packlength= l_char_length <= 255 ? 1 : + l_char_length <= 65535 ? 2 : + l_char_length <= 16777215 ? 3 : 4; } } enum_field_types type() const { return FIELD_TYPE_BLOB;} @@ -1234,7 +1234,7 @@ public: uint size_of() const { return sizeof(*this); } bool has_charset(void) const { return charset() == &my_charset_bin ? FALSE : TRUE; } - uint32 max_length(); + uint32 max_display_length(); }; @@ -1350,7 +1350,7 @@ public: enum_field_types type() const { return FIELD_TYPE_BIT; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_BIT; } uint32 key_length() const { return (uint32) (field_length + 7) / 8; } - uint32 max_length() { return field_length; } + uint32 max_display_length() { return field_length; } uint size_of() const { return sizeof(*this); } Item_result result_type () const { return INT_RESULT; } void reset(void) { bzero(ptr, bytes_in_rec); } |