mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
InnoDB cleanup: Remove unused function ut_printf()
innobase/ut/ut0ut.c: Remove unused function ut_printf()
This commit is contained in:
parent
f3c06fc789
commit
93168d599d
1 changed files with 0 additions and 73 deletions
|
@ -36,79 +36,6 @@ because we define ulint as unsigned __int64 and lint as __int64 on Windows,
|
|||
and both the Microsoft and Intel C compilers require the format string
|
||||
%I64 in that case instead of %l. */
|
||||
|
||||
int
|
||||
ut_printf(
|
||||
/*======*/
|
||||
/* out: the number of characters written, or
|
||||
negative in case of an error */
|
||||
const char* format, /* in: format of prints */
|
||||
...) /* in: arguments to be printed */
|
||||
{
|
||||
va_list args;
|
||||
ulint len;
|
||||
char* format_end;
|
||||
char* newformat;
|
||||
char* ptr;
|
||||
char* newptr;
|
||||
int ret;
|
||||
char format_buf_in_stack[500];
|
||||
|
||||
len = strlen(format);
|
||||
|
||||
if (len > 250) {
|
||||
newformat = malloc(2 * len);
|
||||
} else {
|
||||
newformat = format_buf_in_stack;
|
||||
}
|
||||
|
||||
format_end = (char*)format + len;
|
||||
|
||||
ptr = (char*)format;
|
||||
newptr = newformat;
|
||||
|
||||
#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64))
|
||||
/* Replace %l with %I64 if it is not preceded with '\' */
|
||||
|
||||
while (ptr < format_end) {
|
||||
if (*ptr == '%' && *(ptr + 1) == 'l'
|
||||
&& (ptr == format || *(ptr - 1) != '\\')) {
|
||||
|
||||
memcpy(newptr, "%I64", 4);
|
||||
ptr += 2;
|
||||
newptr += 4;
|
||||
} else {
|
||||
*newptr = *ptr;
|
||||
ptr++;
|
||||
newptr++;
|
||||
}
|
||||
}
|
||||
|
||||
*newptr = '\0';
|
||||
|
||||
ut_a(newptr < newformat + 2 * len);
|
||||
#else
|
||||
strcpy(newformat, format);
|
||||
#endif
|
||||
va_start(args, format);
|
||||
|
||||
ret = vprintf((const char*)newformat, args);
|
||||
|
||||
va_end(args);
|
||||
|
||||
if (newformat != format_buf_in_stack) {
|
||||
free(newformat);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
On the 64-bit Windows we substitute the format string
|
||||
%l -> %I64
|
||||
because we define ulint as unsigned __int64 and lint as __int64 on Windows,
|
||||
and both the Microsoft and Intel C compilers require the format string
|
||||
%I64 in that case instead of %l. */
|
||||
|
||||
int
|
||||
ut_sprintf(
|
||||
/*=======*/
|
||||
|
|
Loading…
Reference in a new issue