Compiling 100% with Types change approach - still does not build.

This commit is contained in:
Cekis
2021-10-21 17:45:04 -04:00
parent f838d31a26
commit 60c8c1fcbf
54 changed files with 347 additions and 297 deletions
@@ -32,7 +32,7 @@ namespace DB {
// following alternate getValue's are provided for convenience, particularly in
// the auto-generated code:
void getValue(unsigned int &buffer) const;
void getValue(uint32 &buffer) const; // for some reason, our compiler is convinced that uint32 != unsigned int
// void getValue(uint32 &buffer) const; // for some reason, our compiler is convinced that uint32 != unsigned int
void getValue(long int &buffer) const;
void getValue(int &buffer) const;
void getValue(int8 &buffer) const;
@@ -57,10 +57,10 @@ inline void DB::BindableLong::getValue(unsigned int &buffer) const
// ----------------------------------------------------------------------
inline void DB::BindableLong::getValue(uint32 &buffer) const
{
buffer=static_cast<uint32>(getValue());
}
//inline void DB::BindableLong::getValue(uint32 &buffer) const
//{
// buffer=static_cast<uint32>(getValue());
//}
// ----------------------------------------------------------------------
@@ -154,22 +154,22 @@ bool BindableVarrayNumber::push_back(long int value)
return true;
}
// ----------------------------------------------------------------------
bool BindableVarrayNumber::push_back(int64 value)
{
OCINumber buffer;
OCIInd buffer_indicator (OCI_IND_NOTNULL);
OCISession *localSession = safe_cast<OCISession*>(m_session);
if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer))))
return false;
if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data))))
return false;
return true;
}
//
//bool BindableVarrayNumber::push_back(int64 value)
//{
// OCINumber buffer;
//
// OCIInd buffer_indicator (OCI_IND_NOTNULL);
//
// OCISession *localSession = safe_cast<OCISession*>(m_session);
//
// if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer))))
// return false;
// if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data))))
// return false;
//
// return true;
//}
// ----------------------------------------------------------------------
@@ -255,31 +255,31 @@ bool BindableVarrayNumber::push_back(bool IsNULL, long int value)
return true;
}
// ----------------------------------------------------------------------
bool BindableVarrayNumber::push_back(bool IsNULL, int64 value)
{
OCINumber buffer;
OCIInd buffer_indicator;
if ( IsNULL )
{
buffer_indicator = OCI_IND_NULL;
}
else
{
buffer_indicator = OCI_IND_NOTNULL;
}
OCISession *localSession = safe_cast<OCISession*>(m_session);
if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer))))
return false;
if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data))))
return false;
return true;
}
//
//bool BindableVarrayNumber::push_back(bool IsNULL, int64 value)
//{
// OCINumber buffer;
//
// OCIInd buffer_indicator;
//
// if ( IsNULL )
// {
// buffer_indicator = OCI_IND_NULL;
// }
// else
// {
// buffer_indicator = OCI_IND_NOTNULL;
// }
//
// OCISession *localSession = safe_cast<OCISession*>(m_session);
//
// if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer))))
// return false;
// if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data))))
// return false;
//
// return true;
//}
// ----------------------------------------------------------------------
@@ -60,11 +60,11 @@ namespace DB
bool push_back(bool IsNULL, int value);
bool push_back(bool IsNULL, double value);
bool push_back(bool IsNULL, long int value);
bool push_back(bool IsNULL, int64 value);
// bool push_back(bool IsNULL, int64 value);
bool push_back(int value);
bool push_back(double value);
bool push_back(long int value);
bool push_back(int64 value);
// bool push_back(int64 value);
virtual std::string outputValue() const;
};
@@ -174,6 +174,14 @@ inline unsigned int dwarfGet(char const *src, u_int32_t &dest)
// ----------------------------------------------------------------------
inline unsigned int dwarfGet(char const *src, u_int64_t &dest)
{
memcpy(&dest, src, sizeof(u_int64_t));
return sizeof(u_int64_t);
}
// ----------------------------------------------------------------------
class LEB128
{
public:
@@ -294,7 +302,7 @@ static bool dwarfSearch(char const *dwarfLines, unsigned int linesLength, void c
{
int progFile = 0;
int progLine = 1;
u_int32_t progAddr = 0;
u_int64_t progAddr = 0;
bool done = false;
bool valid = false;
@@ -384,9 +392,9 @@ static bool dwarfSearch(char const *dwarfLines, unsigned int linesLength, void c
if (valid)
{
unsigned int addrOffset = 0;
if (progAddr < reinterpret_cast<unsigned int>(info.dli_fbase))
addrOffset = reinterpret_cast<unsigned int>(info.dli_fbase);
u_int64_t addrOffset = 0;
if (progAddr < reinterpret_cast<u_int64_t>(info.dli_fbase))
addrOffset = reinterpret_cast<u_int64_t>(info.dli_fbase);
const void *testAddr = reinterpret_cast<const void *>(progAddr+addrOffset);
if (testAddr >= addr)
{
@@ -509,12 +517,12 @@ static bool stabSearch(Stab const *stab, unsigned int stabSize, char const *stab
if (reinterpret_cast<void const *>(stab->n_value) > info.dli_fbase)
funcBase = reinterpret_cast<void const *>(stab->n_value);
else
funcBase = reinterpret_cast<void const *>(reinterpret_cast<unsigned int>(info.dli_fbase)+stab->n_value);
funcBase = reinterpret_cast<void const *>(reinterpret_cast<u_int64_t>(info.dli_fbase)+stab->n_value);
foundSrcLine = -1;
}
else if (stab->n_type == N_SLINE && addr >= funcBase) // source line
{
if (stab->n_value < reinterpret_cast<unsigned int>(addr)-reinterpret_cast<unsigned int>(funcBase))
if (stab->n_value < reinterpret_cast<u_int64_t>(addr)-reinterpret_cast<u_int64_t>(funcBase))
foundSrcLine = stab->n_desc;
else
{
@@ -667,7 +675,7 @@ void DebugHelp::remove()
// ----------------------------------------------------------------------
bool DebugHelp::lookupAddress(uint32 address, char *libName, char *fileName, int fileNameLength, int &line)
bool DebugHelp::lookupAddress(uint64 address, char *libName, char *fileName, int fileNameLength, int &line)
{
return lookupAddressInfo(reinterpret_cast<void const *>(address), libName, fileName, line, fileNameLength);
}
@@ -20,7 +20,7 @@ public:
static void remove();
static void getCallStack(uint32 *callStack, int sizeOfCallStack);
static bool lookupAddress(uint32 address, char *libName, char *fileName, int fileNameLength, int &line);
static bool lookupAddress(uint64 address, char *libName, char *fileName, int fileNameLength, int &line);
};
// ======================================================================
@@ -10,7 +10,7 @@
// ======================================================================
typedef unsigned long uint32;
typedef uint32_t uint32;
// ======================================================================
@@ -10,7 +10,7 @@
#include <pthread.h>
typedef unsigned short int WORD;
typedef unsigned long int DWORD;
typedef uint32_t DWORD;
typedef bool BOOL;
typedef long long __int64; //lint !e13 !e19 // Error: 13 (Bad type), Error: 19 (Useless declaration) // -TRF- Lint preprocessor discrepency, @todo look into this.
typedef __int64 LARGE_INTEGER;
@@ -18,8 +18,8 @@ public:
FormattedString();
char const * sprintf(char const * format, ...);
char const * vsprintf(char const * format, va_list const & va);
char const * sprintf(const char * format, ...);
char const * vsprintf(const char * format, va_list va);
private:
@@ -40,7 +40,7 @@ inline FormattedString<bufferSize>::FormattedString()
//-----------------------------------------------------------------------------
template <int bufferSize>
inline char const * FormattedString<bufferSize>::sprintf(char const * const format, ...)
inline char const * FormattedString<bufferSize>::sprintf(const char * format, ...)
{
char const * result = nullptr;
va_list va;
@@ -56,7 +56,7 @@ inline char const * FormattedString<bufferSize>::sprintf(char const * const form
// ----------------------------------------------------------------------
template <int bufferSize>
inline char const * FormattedString<bufferSize>::vsprintf(char const * const format, va_list const & va)
inline char const * FormattedString<bufferSize>::vsprintf(const char * format, va_list va)
{
// Format the string
@@ -230,7 +230,7 @@ inline void *memmove(void *destination, const void *source, int length)
{
DEBUG_FATAL(!destination, ("nullptr destination arg"));
DEBUG_FATAL(!source, ("nullptr source arg"));
return memmove(destination, source, static_cast<uint>(length));
return memmove(destination, source, static_cast<size_t>(length));
}
// ----------------------------------------------------------------------
@@ -68,8 +68,8 @@ private:
friend class DB::BindableNetworkId;
private:
explicit NetworkId(int value); // catch people who incorrectly try to construct one of these from an int
// private:
// explicit NetworkId(int value); // catch people who incorrectly try to construct one of these from an int
// also makes constructing one of these from any other incorrect numeric type ambiguous
};
@@ -10,18 +10,19 @@
#define PLATFORM_LINUX
#include <cstdio>
#include <stdint.h>
// ======================================================================
// basic types that we assume to be around
typedef unsigned int uint;
typedef uint32_t uint;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned long uint32;
typedef uint32_t uint32;
typedef signed char int8;
typedef signed short int16;
typedef signed long int32;
typedef signed long long int int64;
typedef unsigned long long int uint64;
typedef int32_t int32;
typedef int64_t int64;
typedef uint64_t uint64;
typedef float real;
typedef FILE* FILE_HANDLE;
@@ -15,17 +15,18 @@
#define PLATFORM_WIN32
#include <stdint.h>
// ======================================================================
// basic types that we assume to be around
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned long uint32;
typedef unsigned __int64 uint64;
typedef uint32_t uint32;
typedef uint64_t uint64;
typedef signed char int8;
typedef signed short int16;
typedef signed long int32;
typedef signed __int64 int64;
typedef int32_t int32;
typedef int64_t int64;
typedef int FILE_HANDLE;
// ======================================================================
@@ -313,7 +313,7 @@ void AlterSchedulerNamespace::validateObject(Object const *object)
}
catch (...)
{ //lint !e1775 // catch block does not declare any exception // that's right: I want to catch it all.
WARNING(true, ("validateObject(): Object-derived class with address [%x] failed to return valid C++ type info; likely a deleted Object.", reinterpret_cast<unsigned int const>(object)));
WARNING(true, ("validateObject(): Object-derived class with address [%x] failed to return valid C++ type info; likely a deleted Object.", reinterpret_cast<unsigned uint64_t const>(object)));
isInvalid = true;
}
}
@@ -67,8 +67,8 @@ public:
int getUserId ( void ) const;
void setUserId ( int newId ) const;
int getMark ( int whichMark ) const;
void setMark ( int whichMark, int newValue ) const;
int64_t getMark ( int whichMark ) const;
void setMark ( int whichMark, int64_t newValue ) const;
void clearMarks ( void ) const;
// ----------
@@ -95,8 +95,8 @@ protected:
// These are used to speed up some algorithms. They're not persisted.
// Code that uses the marks MUST clear them after use.
mutable int m_userId;
mutable int m_marks[4];
mutable int m_userId;
mutable int64_t m_marks[4];
};
// ----------------------------------------------------------------------
@@ -214,12 +214,12 @@ inline void PathNode::setUserId ( int newId ) const
// ----------
inline int PathNode::getMark ( int whichMark ) const
inline int64_t PathNode::getMark ( int whichMark ) const
{
return m_marks[whichMark];
}
inline void PathNode::setMark ( int whichMark, int newMark ) const
inline void PathNode::setMark ( int whichMark, int64_t newMark ) const
{
m_marks[whichMark] = newMark;
}
@@ -182,7 +182,7 @@ PathSearchNode * PathSearchNode::createSearchNode( PathNode const * node )
PathSearchNode * oldNode = nullptr;
int mark = node->getMark(3);
int64_t mark = node->getMark(3);
if(mark != -1)
{
@@ -193,7 +193,7 @@ PathSearchNode * PathSearchNode::createSearchNode( PathNode const * node )
PathSearchNode * searchNode = new PathSearchNode(m_search,m_graph,node);
node->setMark( 3, (int)((void*)searchNode) );
node->setMark( 3, (int64)((void*)searchNode) );
m_search->m_visitedNodes->push_back(node);
@@ -208,7 +208,7 @@ PathSearchNode * PathSearchNode::getSearchNode( PathNode const * node )
PathSearchNode * searchNode = nullptr;
int mark = node->getMark(3);
int64_t mark = node->getMark(3);
if(mark != -1)
{
@@ -493,7 +493,7 @@ void PathSearch::cleanup ( void )
{
PathNode const * visitedNode = m_visitedNodes->at(i);
int mark = visitedNode->getMark(3);
int64_t mark = visitedNode->getMark(3);
if(mark != -1)
{