Loading include/my_sys.h +7 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,13 @@ extern my_string my_strdup(const char *from,myf MyFlags); #define ORIG_CALLER_INFO /* nothing */ #endif #ifdef HAVE_ALLOCA #ifdef __GNUC__ /* Remove any previous definitions. */ #undef alloca #define alloca(size) __builtin_alloca (size) #else /* xlc */ #pragma alloca #endif /* GCC. */ #define my_alloca(SZ) alloca((size_t) (SZ)) #define my_afree(PTR) {} #else Loading mysys/my_getopt.c +7 −7 Original line number Diff line number Diff line Loading @@ -293,7 +293,7 @@ int handle_options(int *argc, char ***argv, */ *((my_bool*) optp->value)= (my_bool) (!optend || *optend == '1'); (*argc)--; continue; // For GET_BOOL get_one_option() shouldn't be called continue; /* For GET_BOOL get_one_option() shouldn't be called */ } argument= optend; } Loading Loading @@ -341,16 +341,16 @@ int handle_options(int *argc, char ***argv, if (optp->var_type == GET_BOOL && optp->arg_type == NO_ARG) { *((my_bool*) optp->value)= (my_bool) 1; continue; // For GET_BOOL get_one_option() shouldn't be called continue; /* For GET_BOOL get_one_option() shouldn't be called */ } else if (optp->arg_type == REQUIRED_ARG || optp->arg_type == OPT_ARG) { if (*(optend + 1)) { // The rest of the option is option argument /* The rest of the option is option argument */ argument= optend + 1; // This is in effect a jump out of the outer loop /* This is in effect a jump out of the outer loop */ optend= (char*) " "; } else if (optp->arg_type == REQUIRED_ARG) Loading Loading @@ -573,7 +573,7 @@ static longlong getopt_ll (char *arg, const struct my_option *optp, int *err) if (num < (longlong) optp->min_value) num= (longlong) optp->min_value; else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value && optp->max_value) // if max value is not set -> no upper limit && optp->max_value) /* if max value is not set -> no upper limit */ num= (longlong) (ulong) optp->max_value; num= ((num - (longlong) optp->sub_size) / (optp->block_size ? (ulonglong) optp->block_size : Loading @@ -597,7 +597,7 @@ static ulonglong getopt_ull (char *arg, const struct my_option *optp, int *err) if (num < (ulonglong) optp->min_value) num= (ulonglong) optp->min_value; else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value && optp->max_value) // if max value is not set -> no upper limit && optp->max_value) /* if max value is not set -> no upper limit */ num= (ulonglong) (ulong) optp->max_value; num= ((num - (ulonglong) optp->sub_size) / (optp->block_size ? (ulonglong) optp->block_size : Loading Loading @@ -717,7 +717,7 @@ void my_print_help(const struct my_option *options) for (line_end= comment + comment_space; *line_end != ' '; line_end--); for (; comment != line_end; comment++) putchar(*comment); comment++; // skip the space, as a newline will take it's place now comment++; /* skip the space, as a newline will take it's place now */ putchar('\n'); for (col= 0; col < name_space; col++) putchar(' '); Loading strings/ctype-latin1_de.c +2 −2 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ my_bool my_like_range_latin1_de(const char *ptr, uint ptr_length, *min_length = (uint)(min_str - min_org); *max_length = res_length; do { *min_str++ = ' '; // Because if key compression *min_str++ = ' '; /* Because if key compression */ *max_str++ = max_sort_char; } while (min_str != min_end); return 0; Loading @@ -356,6 +356,6 @@ my_bool my_like_range_latin1_de(const char *ptr, uint ptr_length, } while (min_str != min_end) *min_str++ = *max_str++ = ' '; // Because if key compression *min_str++ = *max_str++ = ' '; /* Because if key compression */ return 0; } strings/ctype-tis620.c +15 −15 Original line number Diff line number Diff line Loading @@ -460,8 +460,8 @@ static uchar* thai2sortable(const uchar * tstr,uint len) const uchar* p = tstr; uchar *outBuf; // uchar *pRight1, *pRight2, *pRight3, *pRight4; // uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4; /* uchar *pRight1, *pRight2, *pRight3, *pRight4; */ /* uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4; */ uchar *pRight1, *pRight2, *pRight3; uchar *pLeft1, *pLeft2, *pLeft3; uint bufSize; Loading Loading @@ -496,11 +496,11 @@ static uchar* thai2sortable(const uchar * tstr,uint len) *pRight1++ = t_ctype[p[1]][0]; *pRight2++ = t_ctype[p[1]][1]; *pRight3++ = t_ctype[p[1]][2]; // *pRight4++ = t_ctype[p[1]][3]; /* *pRight4++ = t_ctype[p[1]][3]; */ *pRight1++ = t_ctype[*p][0]; *pRight2++ = t_ctype[*p][1]; *pRight3++ = t_ctype[*p][2]; // *pRight4++ = t_ctype[*p][3]; /* *pRight4++ = t_ctype[*p][3]; */ len--; p += 2; } else { Loading @@ -517,17 +517,17 @@ static uchar* thai2sortable(const uchar * tstr,uint len) } *pRight1++ = L2_BLANK; *pRight2++ = L3_BLANK; // *pRight3++ = L4_BLANK; /* *pRight3++ = L4_BLANK; */ *pRight3++ = '\0'; // *pRight4++ = '\0'; /* *pRight4++ = '\0'; */ memcpy(pRight1, pLeft2, pRight2 - pLeft2); pRight1 += pRight2 - pLeft2; memcpy(pRight1, pLeft3, pRight3 - pLeft3); // pRight1 += pRight3 - pLeft3; // memcpy(pRight1, pLeft4, pRight4 - pLeft4); /* pRight1 += pRight3 - pLeft3; */ /* memcpy(pRight1, pLeft4, pRight4 - pLeft4); */ free(pLeft2); free(pLeft3); // free(pLeft4); /* free(pLeft4); */ return(outBuf); } Loading Loading @@ -619,22 +619,22 @@ my_bool my_like_range_tis620(const char *ptr, uint ptr_length, pchar escape, { if (*ptr == escape && ptr+1 != end) { ptr++; // Skipp escape ptr++; /* Skipp escape */ *min_str++= *max_str++ = *ptr; continue; } if (*ptr == wild_one) // '_' in SQL if (*ptr == wild_one) /* '_' in SQL */ { *min_str++='\0'; // This should be min char *min_str++='\0'; /* This should be min char */ *max_str++=max_sort_chr; continue; } if (*ptr == wild_many) // '%' in SQL if (*ptr == wild_many) /* '%' in SQL */ { *min_length= (uint) (min_str - min_org); *max_length=res_length; do { *min_str++ = ' '; // Because if key compression *min_str++ = ' '; /* Because if key compression */ *max_str++ = max_sort_chr; } while (min_str != min_end); return 0; Loading @@ -644,7 +644,7 @@ my_bool my_like_range_tis620(const char *ptr, uint ptr_length, pchar escape, *min_length= *max_length = (uint) (min_str - min_org); while (min_str != min_end) *min_str++ = *max_str++ = ' '; // Because if key compression *min_str++ = *max_str++ = ' '; /* Because if key compression */ return 0; } Loading Loading
include/my_sys.h +7 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,13 @@ extern my_string my_strdup(const char *from,myf MyFlags); #define ORIG_CALLER_INFO /* nothing */ #endif #ifdef HAVE_ALLOCA #ifdef __GNUC__ /* Remove any previous definitions. */ #undef alloca #define alloca(size) __builtin_alloca (size) #else /* xlc */ #pragma alloca #endif /* GCC. */ #define my_alloca(SZ) alloca((size_t) (SZ)) #define my_afree(PTR) {} #else Loading
mysys/my_getopt.c +7 −7 Original line number Diff line number Diff line Loading @@ -293,7 +293,7 @@ int handle_options(int *argc, char ***argv, */ *((my_bool*) optp->value)= (my_bool) (!optend || *optend == '1'); (*argc)--; continue; // For GET_BOOL get_one_option() shouldn't be called continue; /* For GET_BOOL get_one_option() shouldn't be called */ } argument= optend; } Loading Loading @@ -341,16 +341,16 @@ int handle_options(int *argc, char ***argv, if (optp->var_type == GET_BOOL && optp->arg_type == NO_ARG) { *((my_bool*) optp->value)= (my_bool) 1; continue; // For GET_BOOL get_one_option() shouldn't be called continue; /* For GET_BOOL get_one_option() shouldn't be called */ } else if (optp->arg_type == REQUIRED_ARG || optp->arg_type == OPT_ARG) { if (*(optend + 1)) { // The rest of the option is option argument /* The rest of the option is option argument */ argument= optend + 1; // This is in effect a jump out of the outer loop /* This is in effect a jump out of the outer loop */ optend= (char*) " "; } else if (optp->arg_type == REQUIRED_ARG) Loading Loading @@ -573,7 +573,7 @@ static longlong getopt_ll (char *arg, const struct my_option *optp, int *err) if (num < (longlong) optp->min_value) num= (longlong) optp->min_value; else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value && optp->max_value) // if max value is not set -> no upper limit && optp->max_value) /* if max value is not set -> no upper limit */ num= (longlong) (ulong) optp->max_value; num= ((num - (longlong) optp->sub_size) / (optp->block_size ? (ulonglong) optp->block_size : Loading @@ -597,7 +597,7 @@ static ulonglong getopt_ull (char *arg, const struct my_option *optp, int *err) if (num < (ulonglong) optp->min_value) num= (ulonglong) optp->min_value; else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value && optp->max_value) // if max value is not set -> no upper limit && optp->max_value) /* if max value is not set -> no upper limit */ num= (ulonglong) (ulong) optp->max_value; num= ((num - (ulonglong) optp->sub_size) / (optp->block_size ? (ulonglong) optp->block_size : Loading Loading @@ -717,7 +717,7 @@ void my_print_help(const struct my_option *options) for (line_end= comment + comment_space; *line_end != ' '; line_end--); for (; comment != line_end; comment++) putchar(*comment); comment++; // skip the space, as a newline will take it's place now comment++; /* skip the space, as a newline will take it's place now */ putchar('\n'); for (col= 0; col < name_space; col++) putchar(' '); Loading
strings/ctype-latin1_de.c +2 −2 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ my_bool my_like_range_latin1_de(const char *ptr, uint ptr_length, *min_length = (uint)(min_str - min_org); *max_length = res_length; do { *min_str++ = ' '; // Because if key compression *min_str++ = ' '; /* Because if key compression */ *max_str++ = max_sort_char; } while (min_str != min_end); return 0; Loading @@ -356,6 +356,6 @@ my_bool my_like_range_latin1_de(const char *ptr, uint ptr_length, } while (min_str != min_end) *min_str++ = *max_str++ = ' '; // Because if key compression *min_str++ = *max_str++ = ' '; /* Because if key compression */ return 0; }
strings/ctype-tis620.c +15 −15 Original line number Diff line number Diff line Loading @@ -460,8 +460,8 @@ static uchar* thai2sortable(const uchar * tstr,uint len) const uchar* p = tstr; uchar *outBuf; // uchar *pRight1, *pRight2, *pRight3, *pRight4; // uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4; /* uchar *pRight1, *pRight2, *pRight3, *pRight4; */ /* uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4; */ uchar *pRight1, *pRight2, *pRight3; uchar *pLeft1, *pLeft2, *pLeft3; uint bufSize; Loading Loading @@ -496,11 +496,11 @@ static uchar* thai2sortable(const uchar * tstr,uint len) *pRight1++ = t_ctype[p[1]][0]; *pRight2++ = t_ctype[p[1]][1]; *pRight3++ = t_ctype[p[1]][2]; // *pRight4++ = t_ctype[p[1]][3]; /* *pRight4++ = t_ctype[p[1]][3]; */ *pRight1++ = t_ctype[*p][0]; *pRight2++ = t_ctype[*p][1]; *pRight3++ = t_ctype[*p][2]; // *pRight4++ = t_ctype[*p][3]; /* *pRight4++ = t_ctype[*p][3]; */ len--; p += 2; } else { Loading @@ -517,17 +517,17 @@ static uchar* thai2sortable(const uchar * tstr,uint len) } *pRight1++ = L2_BLANK; *pRight2++ = L3_BLANK; // *pRight3++ = L4_BLANK; /* *pRight3++ = L4_BLANK; */ *pRight3++ = '\0'; // *pRight4++ = '\0'; /* *pRight4++ = '\0'; */ memcpy(pRight1, pLeft2, pRight2 - pLeft2); pRight1 += pRight2 - pLeft2; memcpy(pRight1, pLeft3, pRight3 - pLeft3); // pRight1 += pRight3 - pLeft3; // memcpy(pRight1, pLeft4, pRight4 - pLeft4); /* pRight1 += pRight3 - pLeft3; */ /* memcpy(pRight1, pLeft4, pRight4 - pLeft4); */ free(pLeft2); free(pLeft3); // free(pLeft4); /* free(pLeft4); */ return(outBuf); } Loading Loading @@ -619,22 +619,22 @@ my_bool my_like_range_tis620(const char *ptr, uint ptr_length, pchar escape, { if (*ptr == escape && ptr+1 != end) { ptr++; // Skipp escape ptr++; /* Skipp escape */ *min_str++= *max_str++ = *ptr; continue; } if (*ptr == wild_one) // '_' in SQL if (*ptr == wild_one) /* '_' in SQL */ { *min_str++='\0'; // This should be min char *min_str++='\0'; /* This should be min char */ *max_str++=max_sort_chr; continue; } if (*ptr == wild_many) // '%' in SQL if (*ptr == wild_many) /* '%' in SQL */ { *min_length= (uint) (min_str - min_org); *max_length=res_length; do { *min_str++ = ' '; // Because if key compression *min_str++ = ' '; /* Because if key compression */ *max_str++ = max_sort_chr; } while (min_str != min_end); return 0; Loading @@ -644,7 +644,7 @@ my_bool my_like_range_tis620(const char *ptr, uint ptr_length, pchar escape, *min_length= *max_length = (uint) (min_str - min_org); while (min_str != min_end) *min_str++ = *max_str++ = ' '; // Because if key compression *min_str++ = *max_str++ = ' '; /* Because if key compression */ return 0; } Loading