mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
Removed unneeded file.
git-svn-id: file:///svn/tokudb@640 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
8bd397bc80
commit
15552fec29
1 changed files with 0 additions and 75 deletions
|
@ -1,75 +0,0 @@
|
|||
void outputbyte(unsigned char ch, bool plaintext)
|
||||
{
|
||||
if (plaintext) {
|
||||
if (ch != '\n' && isprint(ch)) {
|
||||
switch (ch) {
|
||||
case ('\\'): {
|
||||
printf("\\\\");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
printf("%c", ch);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf(
|
||||
"\\%c%c",
|
||||
"0123456789abcdef"[(ch & 0xf0) >> 4],
|
||||
"0123456789abcdef"[ch & 0x0f]
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf(
|
||||
"%c%c",
|
||||
"0123456789abcdef"[(ch & 0xf0) >> 4],
|
||||
"0123456789abcdef"[ch & 0x0f]
|
||||
);
|
||||
}
|
||||
}
|
||||
/*
|
||||
The above code is too long, since printf isn't being used effectively.
|
||||
*/
|
||||
void outputbyte(unsigned char ch, bool plaintext)
|
||||
{
|
||||
if (plaintext) {
|
||||
if (ch != '\n' && isprint(ch)) {
|
||||
switch (ch) {
|
||||
case ('\\'): {
|
||||
printf("\\\\");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
printf("%c", ch);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("%02x", ch);
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("%02x", ch);
|
||||
}
|
||||
}
|
||||
/*
|
||||
I don't understand the control flow for the plaintext case, since \n isn't a printable character.
|
||||
Also using a switch for a two-way branch seems overkill.
|
||||
Switch is quite dangerous because one can forget the break, and control falls through.
|
||||
For one-liner conditionsals, there is no need to put in { }
|
||||
*/
|
||||
void outputbyte(unsigned char ch, bool plaintext)
|
||||
{
|
||||
if (plaintext) {
|
||||
if (ch == '\\') printf("\\\\");
|
||||
else if (isprint(ch)) printf("%c", ch);
|
||||
else printf("%02x", ch);
|
||||
} else {
|
||||
printf("%02x", ch);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue