8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:43:04 +01:00

Renamed functions in new interfaces according to Vlad's suggestion

This commit is contained in:
AlexPeshkoff 2017-04-05 19:39:55 +03:00
parent 1b8b7d37f5
commit 56b70d34db
4 changed files with 78 additions and 78 deletions

View File

@ -1374,18 +1374,18 @@ interface DecFloat16 : Versioned
{
const uint BCD_SIZE = 16;
const uint STRING_SIZE = 25; // includes terminating \0
void scatter(const FB_DEC16* from, int* sign, uchar* bcd, int* exp);
void toStr(const FB_DEC16* from, string to);
void gather(int sign, const uchar* bcd, int exp, FB_DEC16* to);
void fromStr(Status status, const string from, FB_DEC16* to);
void toBcd(const FB_DEC16* from, int* sign, uchar* bcd, int* exp);
void toString(const FB_DEC16* from, string to);
void fromBcd(int sign, const uchar* bcd, int exp, FB_DEC16* to);
void fromString(Status status, const string from, FB_DEC16* to);
}
interface DecFloat34 : Versioned
{
const uint BCD_SIZE = 34;
const uint STRING_SIZE = 43; // includes terminating \0
void scatter(const FB_DEC34* from, int* sign, uchar* bcd, int* exp);
void toStr(const FB_DEC34* from, string to);
void gather(int sign, const uchar* bcd, int exp, FB_DEC34* to);
void fromStr(Status status, const string from, FB_DEC34* to);
void toBcd(const FB_DEC34* from, int* sign, uchar* bcd, int* exp);
void toString(const FB_DEC34* from, string to);
void fromBcd(int sign, const uchar* bcd, int exp, FB_DEC34* to);
void fromString(Status status, const string from, FB_DEC34* to);
}

View File

@ -5306,10 +5306,10 @@ namespace Firebird
public:
struct VTable : public IVersioned::VTable
{
void (CLOOP_CARG *scatter)(IDecFloat16* self, const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp) throw();
void (CLOOP_CARG *toStr)(IDecFloat16* self, const FB_DEC16* from, char* to) throw();
void (CLOOP_CARG *gather)(IDecFloat16* self, int sign, const unsigned char* bcd, int exp, FB_DEC16* to) throw();
void (CLOOP_CARG *fromStr)(IDecFloat16* self, IStatus* status, const char* from, FB_DEC16* to) throw();
void (CLOOP_CARG *toBcd)(IDecFloat16* self, const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp) throw();
void (CLOOP_CARG *toString)(IDecFloat16* self, const FB_DEC16* from, char* to) throw();
void (CLOOP_CARG *fromBcd)(IDecFloat16* self, int sign, const unsigned char* bcd, int exp, FB_DEC16* to) throw();
void (CLOOP_CARG *fromString)(IDecFloat16* self, IStatus* status, const char* from, FB_DEC16* to) throw();
};
protected:
@ -5328,25 +5328,25 @@ namespace Firebird
static const unsigned BCD_SIZE = 16;
static const unsigned STRING_SIZE = 25;
void scatter(const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp)
void toBcd(const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp)
{
static_cast<VTable*>(this->cloopVTable)->scatter(this, from, sign, bcd, exp);
static_cast<VTable*>(this->cloopVTable)->toBcd(this, from, sign, bcd, exp);
}
void toStr(const FB_DEC16* from, char* to)
void toString(const FB_DEC16* from, char* to)
{
static_cast<VTable*>(this->cloopVTable)->toStr(this, from, to);
static_cast<VTable*>(this->cloopVTable)->toString(this, from, to);
}
void gather(int sign, const unsigned char* bcd, int exp, FB_DEC16* to)
void fromBcd(int sign, const unsigned char* bcd, int exp, FB_DEC16* to)
{
static_cast<VTable*>(this->cloopVTable)->gather(this, sign, bcd, exp, to);
static_cast<VTable*>(this->cloopVTable)->fromBcd(this, sign, bcd, exp, to);
}
template <typename StatusType> void fromStr(StatusType* status, const char* from, FB_DEC16* to)
template <typename StatusType> void fromString(StatusType* status, const char* from, FB_DEC16* to)
{
StatusType::clearException(status);
static_cast<VTable*>(this->cloopVTable)->fromStr(this, status, from, to);
static_cast<VTable*>(this->cloopVTable)->fromString(this, status, from, to);
StatusType::checkException(status);
}
};
@ -5356,10 +5356,10 @@ namespace Firebird
public:
struct VTable : public IVersioned::VTable
{
void (CLOOP_CARG *scatter)(IDecFloat34* self, const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp) throw();
void (CLOOP_CARG *toStr)(IDecFloat34* self, const FB_DEC34* from, char* to) throw();
void (CLOOP_CARG *gather)(IDecFloat34* self, int sign, const unsigned char* bcd, int exp, FB_DEC34* to) throw();
void (CLOOP_CARG *fromStr)(IDecFloat34* self, IStatus* status, const char* from, FB_DEC34* to) throw();
void (CLOOP_CARG *toBcd)(IDecFloat34* self, const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp) throw();
void (CLOOP_CARG *toString)(IDecFloat34* self, const FB_DEC34* from, char* to) throw();
void (CLOOP_CARG *fromBcd)(IDecFloat34* self, int sign, const unsigned char* bcd, int exp, FB_DEC34* to) throw();
void (CLOOP_CARG *fromString)(IDecFloat34* self, IStatus* status, const char* from, FB_DEC34* to) throw();
};
protected:
@ -5378,25 +5378,25 @@ namespace Firebird
static const unsigned BCD_SIZE = 34;
static const unsigned STRING_SIZE = 43;
void scatter(const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp)
void toBcd(const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp)
{
static_cast<VTable*>(this->cloopVTable)->scatter(this, from, sign, bcd, exp);
static_cast<VTable*>(this->cloopVTable)->toBcd(this, from, sign, bcd, exp);
}
void toStr(const FB_DEC34* from, char* to)
void toString(const FB_DEC34* from, char* to)
{
static_cast<VTable*>(this->cloopVTable)->toStr(this, from, to);
static_cast<VTable*>(this->cloopVTable)->toString(this, from, to);
}
void gather(int sign, const unsigned char* bcd, int exp, FB_DEC34* to)
void fromBcd(int sign, const unsigned char* bcd, int exp, FB_DEC34* to)
{
static_cast<VTable*>(this->cloopVTable)->gather(this, sign, bcd, exp, to);
static_cast<VTable*>(this->cloopVTable)->fromBcd(this, sign, bcd, exp, to);
}
template <typename StatusType> void fromStr(StatusType* status, const char* from, FB_DEC34* to)
template <typename StatusType> void fromString(StatusType* status, const char* from, FB_DEC34* to)
{
StatusType::clearException(status);
static_cast<VTable*>(this->cloopVTable)->fromStr(this, status, from, to);
static_cast<VTable*>(this->cloopVTable)->fromString(this, status, from, to);
StatusType::checkException(status);
}
};
@ -16536,21 +16536,21 @@ namespace Firebird
VTableImpl()
{
this->version = Base::VERSION;
this->scatter = &Name::cloopscatterDispatcher;
this->toStr = &Name::clooptoStrDispatcher;
this->gather = &Name::cloopgatherDispatcher;
this->fromStr = &Name::cloopfromStrDispatcher;
this->toBcd = &Name::clooptoBcdDispatcher;
this->toString = &Name::clooptoStringDispatcher;
this->fromBcd = &Name::cloopfromBcdDispatcher;
this->fromString = &Name::cloopfromStringDispatcher;
}
} vTable;
this->cloopVTable = &vTable;
}
static void CLOOP_CARG cloopscatterDispatcher(IDecFloat16* self, const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp) throw()
static void CLOOP_CARG clooptoBcdDispatcher(IDecFloat16* self, const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp) throw()
{
try
{
static_cast<Name*>(self)->Name::scatter(from, sign, bcd, exp);
static_cast<Name*>(self)->Name::toBcd(from, sign, bcd, exp);
}
catch (...)
{
@ -16558,11 +16558,11 @@ namespace Firebird
}
}
static void CLOOP_CARG clooptoStrDispatcher(IDecFloat16* self, const FB_DEC16* from, char* to) throw()
static void CLOOP_CARG clooptoStringDispatcher(IDecFloat16* self, const FB_DEC16* from, char* to) throw()
{
try
{
static_cast<Name*>(self)->Name::toStr(from, to);
static_cast<Name*>(self)->Name::toString(from, to);
}
catch (...)
{
@ -16570,11 +16570,11 @@ namespace Firebird
}
}
static void CLOOP_CARG cloopgatherDispatcher(IDecFloat16* self, int sign, const unsigned char* bcd, int exp, FB_DEC16* to) throw()
static void CLOOP_CARG cloopfromBcdDispatcher(IDecFloat16* self, int sign, const unsigned char* bcd, int exp, FB_DEC16* to) throw()
{
try
{
static_cast<Name*>(self)->Name::gather(sign, bcd, exp, to);
static_cast<Name*>(self)->Name::fromBcd(sign, bcd, exp, to);
}
catch (...)
{
@ -16582,13 +16582,13 @@ namespace Firebird
}
}
static void CLOOP_CARG cloopfromStrDispatcher(IDecFloat16* self, IStatus* status, const char* from, FB_DEC16* to) throw()
static void CLOOP_CARG cloopfromStringDispatcher(IDecFloat16* self, IStatus* status, const char* from, FB_DEC16* to) throw()
{
StatusType status2(status);
try
{
static_cast<Name*>(self)->Name::fromStr(&status2, from, to);
static_cast<Name*>(self)->Name::fromString(&status2, from, to);
}
catch (...)
{
@ -16610,10 +16610,10 @@ namespace Firebird
{
}
virtual void scatter(const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp) = 0;
virtual void toStr(const FB_DEC16* from, char* to) = 0;
virtual void gather(int sign, const unsigned char* bcd, int exp, FB_DEC16* to) = 0;
virtual void fromStr(StatusType* status, const char* from, FB_DEC16* to) = 0;
virtual void toBcd(const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp) = 0;
virtual void toString(const FB_DEC16* from, char* to) = 0;
virtual void fromBcd(int sign, const unsigned char* bcd, int exp, FB_DEC16* to) = 0;
virtual void fromString(StatusType* status, const char* from, FB_DEC16* to) = 0;
};
template <typename Name, typename StatusType, typename Base>
@ -16629,21 +16629,21 @@ namespace Firebird
VTableImpl()
{
this->version = Base::VERSION;
this->scatter = &Name::cloopscatterDispatcher;
this->toStr = &Name::clooptoStrDispatcher;
this->gather = &Name::cloopgatherDispatcher;
this->fromStr = &Name::cloopfromStrDispatcher;
this->toBcd = &Name::clooptoBcdDispatcher;
this->toString = &Name::clooptoStringDispatcher;
this->fromBcd = &Name::cloopfromBcdDispatcher;
this->fromString = &Name::cloopfromStringDispatcher;
}
} vTable;
this->cloopVTable = &vTable;
}
static void CLOOP_CARG cloopscatterDispatcher(IDecFloat34* self, const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp) throw()
static void CLOOP_CARG clooptoBcdDispatcher(IDecFloat34* self, const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp) throw()
{
try
{
static_cast<Name*>(self)->Name::scatter(from, sign, bcd, exp);
static_cast<Name*>(self)->Name::toBcd(from, sign, bcd, exp);
}
catch (...)
{
@ -16651,11 +16651,11 @@ namespace Firebird
}
}
static void CLOOP_CARG clooptoStrDispatcher(IDecFloat34* self, const FB_DEC34* from, char* to) throw()
static void CLOOP_CARG clooptoStringDispatcher(IDecFloat34* self, const FB_DEC34* from, char* to) throw()
{
try
{
static_cast<Name*>(self)->Name::toStr(from, to);
static_cast<Name*>(self)->Name::toString(from, to);
}
catch (...)
{
@ -16663,11 +16663,11 @@ namespace Firebird
}
}
static void CLOOP_CARG cloopgatherDispatcher(IDecFloat34* self, int sign, const unsigned char* bcd, int exp, FB_DEC34* to) throw()
static void CLOOP_CARG cloopfromBcdDispatcher(IDecFloat34* self, int sign, const unsigned char* bcd, int exp, FB_DEC34* to) throw()
{
try
{
static_cast<Name*>(self)->Name::gather(sign, bcd, exp, to);
static_cast<Name*>(self)->Name::fromBcd(sign, bcd, exp, to);
}
catch (...)
{
@ -16675,13 +16675,13 @@ namespace Firebird
}
}
static void CLOOP_CARG cloopfromStrDispatcher(IDecFloat34* self, IStatus* status, const char* from, FB_DEC34* to) throw()
static void CLOOP_CARG cloopfromStringDispatcher(IDecFloat34* self, IStatus* status, const char* from, FB_DEC34* to) throw()
{
StatusType status2(status);
try
{
static_cast<Name*>(self)->Name::fromStr(&status2, from, to);
static_cast<Name*>(self)->Name::fromString(&status2, from, to);
}
catch (...)
{
@ -16703,10 +16703,10 @@ namespace Firebird
{
}
virtual void scatter(const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp) = 0;
virtual void toStr(const FB_DEC34* from, char* to) = 0;
virtual void gather(int sign, const unsigned char* bcd, int exp, FB_DEC34* to) = 0;
virtual void fromStr(StatusType* status, const char* from, FB_DEC34* to) = 0;
virtual void toBcd(const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp) = 0;
virtual void toString(const FB_DEC34* from, char* to) = 0;
virtual void fromBcd(int sign, const unsigned char* bcd, int exp, FB_DEC34* to) = 0;
virtual void fromString(StatusType* status, const char* from, FB_DEC34* to) = 0;
};
};

View File

@ -2304,7 +2304,7 @@ static processing_state add_row(TEXT* tabname)
case SQL_DEC16:
d64value = (FB_DEC16*) datap;
if (isqlGlob.df16)
isqlGlob.df16->fromStr(fbStatus, lastInputLine, d64value);
isqlGlob.df16->fromString(fbStatus, lastInputLine, d64value);
if ((!isqlGlob.df16) || (fbStatus->getState() & Firebird::IStatus::STATE_ERRORS))
{
STDERROUT("Input parsing problem");
@ -2315,7 +2315,7 @@ static processing_state add_row(TEXT* tabname)
case SQL_DEC34:
d128value = (FB_DEC34*) datap;
if (isqlGlob.df34)
isqlGlob.df34->fromStr(fbStatus, lastInputLine, d128value);
isqlGlob.df34->fromString(fbStatus, lastInputLine, d128value);
if ((!isqlGlob.df34) || (fbStatus->getState() & Firebird::IStatus::STATE_ERRORS))
{
STDERROUT("Input parsing problem");
@ -3076,7 +3076,7 @@ static processing_state bulk_insert_hack(const char* command)
case SQL_DEC16:
d64value = (FB_DEC16*) datap;
if (isqlGlob.df16)
isqlGlob.df16->fromStr(fbStatus, lastInputLine, d64value);
isqlGlob.df16->fromString(fbStatus, lastInputLine, d64value);
if ((!isqlGlob.df16) || (fbStatus->getState() & Firebird::IStatus::STATE_ERRORS))
{
STDERROUT("Input parsing problem");
@ -3087,7 +3087,7 @@ static processing_state bulk_insert_hack(const char* command)
case SQL_DEC34:
d128value = (FB_DEC34*) datap;
if (isqlGlob.df34)
isqlGlob.df34->fromStr(fbStatus, lastInputLine, d128value);
isqlGlob.df34->fromString(fbStatus, lastInputLine, d128value);
if ((!isqlGlob.df34) || (fbStatus->getState() & Firebird::IStatus::STATE_ERRORS))
{
STDERROUT("Input parsing problem");
@ -7236,7 +7236,7 @@ static unsigned print_item(TEXT** s, const IsqlVar* var, const unsigned length)
{
char decStr[Firebird::IDecFloat16::STRING_SIZE];
if (isqlGlob.df16)
isqlGlob.df16->toStr(var->value.asDec16, decStr);
isqlGlob.df16->toString(var->value.asDec16, decStr);
else
strcpy(decStr, "Conversion error");
@ -7251,7 +7251,7 @@ static unsigned print_item(TEXT** s, const IsqlVar* var, const unsigned length)
{
char decStr[Firebird::IDecFloat34::STRING_SIZE];
if (isqlGlob.df34)
isqlGlob.df34->toStr(var->value.asDec34, decStr);
isqlGlob.df34->toString(var->value.asDec34, decStr);
else
strcpy(decStr, "Conversion error");

View File

@ -1061,22 +1061,22 @@ class DecFloat16 FB_FINAL : public AutoIface<IDecFloat16Impl<DecFloat16, CheckSt
{
public:
// IDecFloat16 implementation
void scatter(const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp)
void toBcd(const FB_DEC16* from, int* sign, unsigned char* bcd, int* exp)
{
*sign = decDoubleToBCD(reinterpret_cast<const decDouble*>(from), exp, bcd);
}
void toStr(const FB_DEC16* from, char* to)
void toString(const FB_DEC16* from, char* to)
{
decDoubleToString(reinterpret_cast<const decDouble*>(from), to);
}
void gather(int sign, const unsigned char* bcd, int exp, FB_DEC16* to)
void fromBcd(int sign, const unsigned char* bcd, int exp, FB_DEC16* to)
{
decDoubleFromBCD(reinterpret_cast<decDouble*>(to), exp, bcd, sign ? DECFLOAT_Sign : 0);
}
void fromStr(CheckStatusWrapper* status, const char* from, FB_DEC16* to)
void fromString(CheckStatusWrapper* status, const char* from, FB_DEC16* to)
{
try
{
@ -1101,22 +1101,22 @@ class DecFloat34 FB_FINAL : public AutoIface<IDecFloat34Impl<DecFloat34, CheckSt
{
public:
// IDecFloat34 implementation
void scatter(const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp)
void toBcd(const FB_DEC34* from, int* sign, unsigned char* bcd, int* exp)
{
*sign = decQuadToBCD(reinterpret_cast<const decQuad*>(from), exp, bcd);
}
void toStr(const FB_DEC34* from, char* to)
void toString(const FB_DEC34* from, char* to)
{
decQuadToString(reinterpret_cast<const decQuad*>(from), to);
}
void gather(int sign, const unsigned char* bcd, int exp, FB_DEC34* to)
void fromBcd(int sign, const unsigned char* bcd, int exp, FB_DEC34* to)
{
decQuadFromBCD(reinterpret_cast<decQuad*>(to), exp, bcd, sign ? DECFLOAT_Sign : 0);
}
void fromStr(CheckStatusWrapper* status, const char* from, FB_DEC34* to)
void fromString(CheckStatusWrapper* status, const char* from, FB_DEC34* to)
{
try
{