Commit ce04b6fa authored by unknown's avatar unknown

Reverting facist C++ comment cleanup

parent db57cb7f
...@@ -37,20 +37,20 @@ public: ...@@ -37,20 +37,20 @@ public:
static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); } static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); }
static void operator delete(void *ptr_arg, size_t size) {} /*lint -e715 */ static void operator delete(void *ptr_arg, size_t size) {} /*lint -e715 */
char *ptr; /* Position to field in record */ char *ptr; // Position to field in record
uchar *null_ptr; /* Byte where null_bit is */ uchar *null_ptr; // Byte where null_bit is
struct st_table *table; /* Pointer for table */ struct st_table *table; // Pointer for table
const char *table_name,*field_name; const char *table_name,*field_name;
ulong query_id; /* For quick test of used fields */ ulong query_id; // For quick test of used fields
/* Field is part of the following keys */ /* Field is part of the following keys */
key_map key_start,part_of_key,part_of_sortkey; key_map key_start,part_of_key,part_of_sortkey;
enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL, enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL,
CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD, CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD,
BIT_FIELD, TIMESTAMP_FIELD,CAPITALIZE,BLOB_FIELD}; BIT_FIELD, TIMESTAMP_FIELD,CAPITALIZE,BLOB_FIELD};
utype unireg_check; utype unireg_check;
uint32 field_length; /* Length of field */ uint32 field_length; // Length of field
uint16 flags; uint16 flags;
uchar null_bit; /* Bit used to test null bit */ uchar null_bit; // Bit used to test null bit
Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,uchar null_bit_arg, Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,uchar null_bit_arg,
utype unireg_check_arg, const char *field_name_arg, utype unireg_check_arg, const char *field_name_arg,
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
ptr() to see if it changed if you are using your own buffer ptr() to see if it changed if you are using your own buffer
in str and restore it with set() if needed in str and restore it with set() if needed
*/ */
virtual uint size_of() const =0; /* For new field */ virtual uint size_of() const =0; // For new field
inline bool is_null(uint row_offset=0) inline bool is_null(uint row_offset=0)
{ return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : table->null_row; } { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : table->null_row; }
inline bool is_real_null(uint row_offset=0) inline bool is_real_null(uint row_offset=0)
...@@ -191,7 +191,7 @@ public: ...@@ -191,7 +191,7 @@ public:
{ return cmp(a,b); } { return cmp(a,b); }
virtual int pack_cmp(const char *b, uint key_length_arg) virtual int pack_cmp(const char *b, uint key_length_arg)
{ return cmp(ptr,b); } { return cmp(ptr,b); }
uint offset(); /* Should be inline ... */ uint offset(); // Should be inline ...
void copy_from_tmp(int offset); void copy_from_tmp(int offset);
uint fill_cache_field(struct st_cache_field *copy); uint fill_cache_field(struct st_cache_field *copy);
virtual bool get_date(TIME *ltime,bool fuzzydate); virtual bool get_date(TIME *ltime,bool fuzzydate);
...@@ -216,7 +216,7 @@ public: ...@@ -216,7 +216,7 @@ public:
class Field_num :public Field { class Field_num :public Field {
public: public:
const uint8 dec; const uint8 dec;
bool zerofill,unsigned_flag; /* Purify cannot handle bit fields */ bool zerofill,unsigned_flag; // Purify cannot handle bit fields
Field_num(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg, Field_num(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg, uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, const char *field_name_arg,
...@@ -832,7 +832,7 @@ public: ...@@ -832,7 +832,7 @@ public:
class Field_blob :public Field_str { class Field_blob :public Field_str {
uint packlength; uint packlength;
String value; /* For temporaries */ String value; // For temporaries
bool binary_flag; bool binary_flag;
public: public:
Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
...@@ -990,17 +990,17 @@ public: ...@@ -990,17 +990,17 @@ public:
class create_field :public Sql_alloc { class create_field :public Sql_alloc {
public: public:
const char *field_name; const char *field_name;
const char *change; /* If done with alter table */ const char *change; // If done with alter table
const char *after; /* Put column after this one */ const char *after; // Put column after this one
Item *def; /* Default value */ Item *def; // Default value
enum enum_field_types sql_type; enum enum_field_types sql_type;
uint32 length; uint32 length;
uint decimals,flags,pack_length; uint decimals,flags,pack_length;
Field::utype unireg_check; Field::utype unireg_check;
TYPELIB *interval; /* Which interval to use */ TYPELIB *interval; // Which interval to use
Field *field; /* For alter table */ Field *field; // For alter table
uint8 row,col,sc_length,interval_id; /* For rea_create_table */ uint8 row,col,sc_length,interval_id; // For rea_create_table
uint offset,pack_flag; uint offset,pack_flag;
create_field() :after(0) {} create_field() :after(0) {}
create_field(Field *field, Field *orig_field); create_field(Field *field, Field *orig_field);
...@@ -1021,7 +1021,7 @@ class Send_field { ...@@ -1021,7 +1021,7 @@ class Send_field {
/* /*
** A class for quick copying data to fields A class for quick copying data to fields
*/ */
class Copy_field :public Sql_alloc { class Copy_field :public Sql_alloc {
...@@ -1033,14 +1033,14 @@ public: ...@@ -1033,14 +1033,14 @@ public:
uint from_bit,to_bit; uint from_bit,to_bit;
uint from_length,to_length; uint from_length,to_length;
Field *from_field,*to_field; Field *from_field,*to_field;
String tmp; /* For items */ String tmp; // For items
Copy_field() {} Copy_field() {}
~Copy_field() {} ~Copy_field() {}
void set(Field *to,Field *from,bool save); /* Field to field */ void set(Field *to,Field *from,bool save); // Field to field
void set(char *to,Field *from); /* Field to string */ void set(char *to,Field *from); // Field to string
void (*do_copy)(Copy_field *); void (*do_copy)(Copy_field *);
void (*do_copy2)(Copy_field *); /* Used to handle null values */ void (*do_copy2)(Copy_field *); // Used to handle null values
}; };
...@@ -1057,22 +1057,22 @@ ulonglong find_set(TYPELIB *typelib,const char *x, uint length); ...@@ -1057,22 +1057,22 @@ ulonglong find_set(TYPELIB *typelib,const char *x, uint length);
bool test_if_int(const char *str,int length); bool test_if_int(const char *str,int length);
/* /*
** The following are for the interface with the .frm file The following are for the interface with the .frm file
*/ */
#define FIELDFLAG_DECIMAL 1 #define FIELDFLAG_DECIMAL 1
#define FIELDFLAG_BINARY 1 /*Shares same flag */ #define FIELDFLAG_BINARY 1 // Shares same flag
#define FIELDFLAG_NUMBER 2 #define FIELDFLAG_NUMBER 2
#define FIELDFLAG_ZEROFILL 4 #define FIELDFLAG_ZEROFILL 4
#define FIELDFLAG_PACK 120 /* Bits used for packing */ #define FIELDFLAG_PACK 120 // Bits used for packing
#define FIELDFLAG_INTERVAL 256 #define FIELDFLAG_INTERVAL 256
#define FIELDFLAG_BITFIELD 512 /* mangled with dec! */ #define FIELDFLAG_BITFIELD 512 // mangled with dec!
#define FIELDFLAG_BLOB 1024 /* mangled with dec! */ #define FIELDFLAG_BLOB 1024 // mangled with dec!
#define FIELDFLAG_LEFT_FULLSCREEN 8192 #define FIELDFLAG_LEFT_FULLSCREEN 8192
#define FIELDFLAG_RIGHT_FULLSCREEN 16384 #define FIELDFLAG_RIGHT_FULLSCREEN 16384
#define FIELDFLAG_FORMAT_NUMBER 16384 /* predit: ###,,## in output */ #define FIELDFLAG_FORMAT_NUMBER 16384 // predit: ###,,## in output
#define FIELDFLAG_SUM ((uint) 32768)/* predit: +#fieldflag */ #define FIELDFLAG_SUM ((uint) 32768)// predit: +#fieldflag
#define FIELDFLAG_MAYBE_NULL ((uint) 32768)/* sql */ #define FIELDFLAG_MAYBE_NULL ((uint) 32768)// sql
#define FIELDFLAG_PACK_SHIFT 3 #define FIELDFLAG_PACK_SHIFT 3
#define FIELDFLAG_DEC_SHIFT 8 #define FIELDFLAG_DEC_SHIFT 8
#define FIELDFLAG_MAX_DEC 31 #define FIELDFLAG_MAX_DEC 31
......
...@@ -84,7 +84,7 @@ long my_gmt_sec(TIME *t) ...@@ -84,7 +84,7 @@ long my_gmt_sec(TIME *t)
/* Get difference in days */ /* Get difference in days */
int days= t->day - l_time->tm_mday; int days= t->day - l_time->tm_mday;
if (days < -1) if (days < -1)
days= 1; /* Month has wrapped */ days= 1; // Month has wrapped
else if (days > 1) else if (days > 1)
days= -1; days= -1;
diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) + diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) +
...@@ -100,15 +100,15 @@ long my_gmt_sec(TIME *t) ...@@ -100,15 +100,15 @@ long my_gmt_sec(TIME *t)
{ {
int days= t->day - l_time->tm_mday; int days= t->day - l_time->tm_mday;
if (days < -1) if (days < -1)
days=1; /* Month has wrapped */ days=1; // Month has wrapped
else if (days > 1) else if (days > 1)
days= -1; days= -1;
diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+ diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+
(long) (60*((int) t->minute - (int) l_time->tm_min))); (long) (60*((int) t->minute - (int) l_time->tm_min)));
if (diff == 3600) if (diff == 3600)
tmp+=3600 - t->minute*60 - t->second; /* Move to next hour */ tmp+=3600 - t->minute*60 - t->second; // Move to next hour
else if (diff == -3600) else if (diff == -3600)
tmp-=t->minute*60 + t->second; /* Move to next hour */ tmp-=t->minute*60 + t->second; // Move to next hour
} }
if ((my_time_zone >=0 ? my_time_zone: -my_time_zone) > 3600L*12) if ((my_time_zone >=0 ? my_time_zone: -my_time_zone) > 3600L*12)
my_time_zone=0; /* Wrong date */ my_time_zone=0; /* Wrong date */
...@@ -183,7 +183,7 @@ uint calc_week(TIME *l_time, bool with_year, bool sunday_first_day_of_week, ...@@ -183,7 +183,7 @@ uint calc_week(TIME *l_time, bool with_year, bool sunday_first_day_of_week,
/* Last week of the previous year */ /* Last week of the previous year */
if (!with_year) if (!with_year)
return 0; return 0;
with_year=0; /* Don't check the week again */ with_year=0; // Don't check the week again
(*year)--; (*year)--;
first_daynr-= (days=calc_days_in_year(*year)); first_daynr-= (days=calc_days_in_year(*year));
weekday= (weekday + 53*7- days) % 7; weekday= (weekday + 53*7- days) % 7;
...@@ -198,7 +198,7 @@ uint calc_week(TIME *l_time, bool with_year, bool sunday_first_day_of_week, ...@@ -198,7 +198,7 @@ uint calc_week(TIME *l_time, bool with_year, bool sunday_first_day_of_week,
/* Check if we are on the first week of the next year (or week 53) */ /* Check if we are on the first week of the next year (or week 53) */
weekday= (weekday + calc_days_in_year(*year)) % 7; weekday= (weekday + calc_days_in_year(*year)) % 7;
if (weekday < 4) if (weekday < 4)
{ /* We are at first week on next year */ { // We are at first week on next year
(*year)++; (*year)++;
return 1; return 1;
} }
...@@ -434,7 +434,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) ...@@ -434,7 +434,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
DBUG_ENTER("str_to_TIME"); DBUG_ENTER("str_to_TIME");
DBUG_PRINT("enter",("str: %.*s",length,str)); DBUG_PRINT("enter",("str: %.*s",length,str));
for (; str != end && !isdigit(*str) ; str++) ; /* Skip garbage */ for (; str != end && !isdigit(*str) ; str++) ; // Skip garbage
if (str == end) if (str == end)
DBUG_RETURN(TIMESTAMP_NONE); DBUG_RETURN(TIMESTAMP_NONE);
/* /*
...@@ -456,18 +456,18 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) ...@@ -456,18 +456,18 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
} }
date[i]=tmp_value; date[i]=tmp_value;
if (i == 2 && str != end && *str == 'T') if (i == 2 && str != end && *str == 'T')
str++; /* ISO8601: CCYYMMDDThhmmss */ str++; // ISO8601: CCYYMMDDThhmmss
else if ( i != 5 ) /* Skip inter-field delimiters */ else if ( i != 5 ) // Skip inter-field delimiters
{ {
while (str != end && (ispunct(*str) || isspace(*str))) while (str != end && (ispunct(*str) || isspace(*str)))
{ {
/* Only allow space between days and hours */ // Only allow space between days and hours
if (isspace(*str) && i != 2) if (isspace(*str) && i != 2)
DBUG_RETURN(TIMESTAMP_NONE); DBUG_RETURN(TIMESTAMP_NONE);
str++; str++;
} }
} }
field_length=1; /* Rest fields can only be 2 */ field_length=1; // Rest fields can only be 2
} }
/* Handle second fractions */ /* Handle second fractions */
if (i == 6 && (uint) (end-str) >= 2 && *str == '.' && isdigit(str[1])) if (i == 6 && (uint) (end-str) >= 2 && *str == '.' && isdigit(str[1]))
...@@ -572,9 +572,9 @@ bool str_to_time(const char *str,uint length,TIME *l_time) ...@@ -572,9 +572,9 @@ bool str_to_time(const char *str,uint length,TIME *l_time)
/* Check first if this is a full TIMESTAMP */ /* Check first if this is a full TIMESTAMP */
if (length >= 12) if (length >= 12)
{ /* Probably full timestamp */ { // Probably full timestamp
if (str_to_TIME(str,length,l_time,1) == TIMESTAMP_FULL) if (str_to_TIME(str,length,l_time,1) == TIMESTAMP_FULL)
return 0; /* Was an ok timestamp */ return 0; // Was an ok timestamp
} }
/* Not a timestamp. Try to get this as a DAYS_TO_SECOND string */ /* Not a timestamp. Try to get this as a DAYS_TO_SECOND string */
...@@ -590,19 +590,19 @@ bool str_to_time(const char *str,uint length,TIME *l_time) ...@@ -590,19 +590,19 @@ bool str_to_time(const char *str,uint length,TIME *l_time)
LINT_INIT(state); LINT_INIT(state);
found_days=found_hours=0; found_days=found_hours=0;
if ((uint) (end-str) > 1 && (*str == ' ' && isdigit(str[1]))) if ((uint) (end-str) > 1 && (*str == ' ' && isdigit(str[1])))
{ /* days ! */ { // days !
date[0]=value; date[0]=value;
state=1; /* Assume next is hours */ state=1; // Assume next is hours
found_days=1; found_days=1;
str++; /* Skip space; */ str++; // Skip space;
} }
else if ((end-str) > 1 && *str == ':' && isdigit(str[1])) else if ((end-str) > 1 && *str == ':' && isdigit(str[1]))
{ {
date[0]=0; /* Assume we found hours */ date[0]=0; // Assume we found hours
date[1]=value; date[1]=value;
state=2; state=2;
found_hours=1; found_hours=1;
str++; /* skip ':' */ str++; // skip ':'
} }
else else
{ {
...@@ -623,11 +623,11 @@ bool str_to_time(const char *str,uint length,TIME *l_time) ...@@ -623,11 +623,11 @@ bool str_to_time(const char *str,uint length,TIME *l_time)
date[state++]=value; date[state++]=value;
if (state == 4 || (end-str) < 2 || *str != ':' || !isdigit(str[1])) if (state == 4 || (end-str) < 2 || *str != ':' || !isdigit(str[1]))
break; break;
str++; /* Skip ':' */ str++; // Skip ':'
} }
if (state != 4) if (state != 4)
{ /* Not HH:MM:SS */ { // Not HH:MM:SS
/* Fix the date to assume that seconds was given */ /* Fix the date to assume that seconds was given */
if (!found_hours && !found_days) if (!found_hours && !found_days)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment