Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
40711b57
Commit
40711b57
authored
May 20, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB cleanup: Remove unused functions ut_sprintf() and ut_fprintf()
parent
192eb65e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
180 deletions
+0
-180
innobase/include/ut0ut.h
innobase/include/ut0ut.h
+0
-32
innobase/ut/ut0ut.c
innobase/ut/ut0ut.c
+0
-148
No files found.
innobase/include/ut0ut.h
View file @
40711b57
...
...
@@ -17,38 +17,6 @@ Created 1/20/1994 Heikki Tuuri
typedef
time_t
ib_time_t
;
/************************************************************
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
(
/*=======*/
/* out: the number of characters written, or
negative in case of an error */
char
*
buf
,
/* in: buffer where to print */
const
char
*
format
,
/* in: format of prints */
...);
/* in: arguments to be printed */
/************************************************************
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_fprintf
(
/*=======*/
/* out: the number of characters written, or
negative in case of an error */
FILE
*
stream
,
/* in: stream where to print */
const
char
*
format
,
/* in: format of prints */
...)
/* in: arguments to be printed */
__attribute__
((
__format__
(
__printf__
,
2
,
3
)));
/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
...
...
innobase/ut/ut0ut.c
View file @
40711b57
...
...
@@ -29,154 +29,6 @@ mysql_get_identifier_quote_char(void);
/* out: quote character to be
used in SQL identifiers */
/************************************************************
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
(
/*=======*/
/* out: the number of characters written, or
negative in case of an error */
char
*
buf
,
/* in: buffer where to print */
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
=
vsprintf
(
buf
,
(
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_fprintf
(
/*=======*/
/* out: the number of characters written, or
negative in case of an error */
FILE
*
stream
,
/* in: stream where to print */
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
=
vfprintf
(
stream
,
(
const
char
*
)
newformat
,
args
);
va_end
(
args
);
if
(
newformat
!=
format_buf_in_stack
)
{
free
(
newformat
);
}
return
(
ret
);
}
/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment