mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Made my_snprintf() behavior snprintf() compatible when printing %x arguments (it should
produce hex digits in lower case). (fixed version) Replaced _dig_vec array with two _dig_vec_upper/_dig_vec_lower arrays. Added extra argument to int2str function which controls case of digits you get. Replaced lot of invocations of int2str for decimal radix with more optimized int10_to_str() function. Removed unused my_itoa/my_ltoa functions. client/mysql.cc: Replaced int2str invocations with radix argument equal to 10 with optimized int10_to_str() call. client/mysqladmin.c: Replaced int2str invocations with radix argument equal to 10 with optimized int10_to_str() call. dbug/dbug.c: _dig_vec became _dig_vec_upper. include/m_string.h: _dig_vec is obsoleted by _dig_vec_upper/_dig_vec_lower. my_itoa()/my_ltoa() functions were removed because they were never used in our code. int2str() now has one more argument which controls case of digits it will produce. include/my_global.h: my_itoa()/my_ltoa() functions were removed because they were never used in our code. isam/isamchk.c: Replaced int2str invocations with radix argument equal to 10 with optimized int10_to_str() call. libmysql/libmysql.def: _dig_vec is obsoleted by _dig_vec_upper/_dig_vec_lower. myisam/myisamchk.c: Replaced int2str invocation with radix argument equal to 10 with optimized int10_to_str() call. mysys/mf_tempfile.c: _dig_vec became _dig_vec_upper. mysys/my_error.c: Replaced int2str invocations with radix argument equal to 10 with optimized int10_to_str() call. mysys/my_tempnam.c: _dig_vec became _dig_vec_upper. sql-common/client.c: Replaced int2str invocation with radix argument equal to 10 with optimized int10_to_str() call. sql/item_strfunc.cc: _dig_vec became _dig_vec_upper. Also we don't need hex[] array in this file now because we have _dig_vec_lower instead. sql/mysqld.cc: Replaced int2str invocations with radix argument equal to 10 with optimized int10_to_str() call. sql/password.c: _dig_vec became _dig_vec_upper. sql/sql_bitmap.h: _dig_vec became _dig_vec_upper. strings/int2str.c: Replaced _dig_vec by _dig_vec_upper/_dig_vec_lower pair. int2str() now has one more argument which controls case of digits it will produce. my_itoa()/my_ltoa() functions were removed because they were never used in our code. strings/longlong2str-x86.s: _dig_vec became _dig_vec_upper. strings/longlong2str.c: _dig_vec became _dig_vec_upper. strings/my_vsnprintf.c: If my_snprintf() is printing %x argument it should produce lower case hexadecimal digits to be snprintf() compatible.
This commit is contained in:
@ -95,7 +95,9 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern char NEAR _dig_vec[]; /* Declared in int2str() */
|
||||
/* Declared in int2str() */
|
||||
extern char NEAR _dig_vec_upper[];
|
||||
extern char NEAR _dig_vec_lower[];
|
||||
|
||||
#ifdef BAD_STRING_COMPILER
|
||||
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
|
||||
@ -113,8 +115,6 @@ extern char NEAR _dig_vec[]; /* Declared in int2str() */
|
||||
#ifdef MSDOS
|
||||
#undef bmove_align
|
||||
#define bmove512(A,B,C) bmove_align(A,B,C)
|
||||
#define my_itoa(A,B,C) itoa(A,B,C)
|
||||
#define my_ltoa(A,B,C) ltoa(A,B,C)
|
||||
extern void bmove_align(gptr dst,const gptr src,uint len);
|
||||
#endif
|
||||
|
||||
@ -219,24 +219,19 @@ extern int is_prefix(const char *, const char *);
|
||||
double my_strtod(const char *str, char **end);
|
||||
double my_atof(const char *nptr);
|
||||
|
||||
#ifdef USE_MY_ITOA
|
||||
extern char *my_itoa(int val,char *dst,int radix);
|
||||
extern char *my_ltoa(long val,char *dst,int radix);
|
||||
#endif
|
||||
|
||||
extern char *llstr(longlong value,char *buff);
|
||||
#ifndef HAVE_STRTOUL
|
||||
extern long strtol(const char *str, char **ptr, int base);
|
||||
extern ulong strtoul(const char *str, char **ptr, int base);
|
||||
#endif
|
||||
|
||||
extern char *int2str(long val,char *dst,int radix);
|
||||
extern char *int2str(long val, char *dst, int radix, char upcase);
|
||||
extern char *int10_to_str(long val,char *dst,int radix);
|
||||
extern char *str2int(const char *src,int radix,long lower,long upper,
|
||||
long *val);
|
||||
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
|
||||
#if SIZEOF_LONG == SIZEOF_LONG_LONG
|
||||
#define longlong2str(A,B,C) int2str((A),(B),(C))
|
||||
#define longlong2str(A,B,C) int2str((A),(B),(C),1)
|
||||
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
|
||||
#undef strtoll
|
||||
#define strtoll(A,B,C) strtol((A),(B),(C))
|
||||
|
Reference in New Issue
Block a user