1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Making 4.1 tree compile with -ansi -pedantic

This commit is contained in:
konstantin@mysql.com
2004-12-16 16:16:28 +03:00
parent 9c60cd3818
commit ba69a5b7e8
33 changed files with 57 additions and 56 deletions

View File

@@ -32,9 +32,6 @@ C_MODE_END
#endif #endif
#if defined(USE_RAID) #if defined(USE_RAID)
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
#endif
#include "my_dir.h" #include "my_dir.h"
/* Trap all occurences of my_...() in source and use our wrapper around this function */ /* Trap all occurences of my_...() in source and use our wrapper around this function */
@@ -92,6 +89,10 @@ extern "C" {
#ifdef __cplusplus #ifdef __cplusplus
} }
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
#endif
class RaidName { class RaidName {
public: public:
RaidName(const char *FileName); RaidName(const char *FileName);

View File

@@ -475,14 +475,14 @@ struct CreateEvntRef {
} }
}; };
inline bool CreateEvntRef::isTemporary() const inline bool CreateEvntRef::isTemporary() const
{ return (errorCode & CreateEvntRef::Temporary) > 0; }; { return (errorCode & CreateEvntRef::Temporary) > 0; }
inline void CreateEvntRef::setTemporary() inline void CreateEvntRef::setTemporary()
{ errorCode |= CreateEvntRef::Temporary; }; { errorCode |= CreateEvntRef::Temporary; }
inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec) inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec)
{ return (CreateEvntRef::ErrorCode) { return (CreateEvntRef::ErrorCode)
(errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }; (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }
inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec) inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec)
{ return (CreateEvntRef::ErrorCode) { return (CreateEvntRef::ErrorCode)
( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }; ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }
#endif #endif

View File

@@ -38,6 +38,6 @@ class PackedSignal {
}; };
inline inline
Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; }; Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; }
#endif #endif

View File

@@ -159,12 +159,12 @@ public:
Uint32 subscriberRef; Uint32 subscriberRef;
}; };
inline bool SubStartRef::isTemporary() const inline bool SubStartRef::isTemporary() const
{ return (errorCode & SubStartRef::Temporary) > 0; }; { return (errorCode & SubStartRef::Temporary) > 0; }
inline void SubStartRef::setTemporary() inline void SubStartRef::setTemporary()
{ errorCode |= SubStartRef::Temporary; }; { errorCode |= SubStartRef::Temporary; }
inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec) inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec)
{ return (SubStartRef::ErrorCode) { return (SubStartRef::ErrorCode)
(errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }; (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }
class SubStartConf { class SubStartConf {
/** /**
@@ -239,12 +239,12 @@ public:
}; };
}; };
inline bool SubStopRef::isTemporary() const inline bool SubStopRef::isTemporary() const
{ return (errorCode & SubStopRef::Temporary) > 0; }; { return (errorCode & SubStopRef::Temporary) > 0; }
inline void SubStopRef::setTemporary() inline void SubStopRef::setTemporary()
{ errorCode |= SubStopRef::Temporary; }; { errorCode |= SubStopRef::Temporary; }
inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec) inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec)
{ return (SubStopRef::ErrorCode) { return (SubStopRef::ErrorCode)
(errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }; (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }
class SubStopConf { class SubStopConf {
/** /**
@@ -515,12 +515,12 @@ public:
}; };
}; };
inline bool SubRemoveRef::isTemporary() const inline bool SubRemoveRef::isTemporary() const
{ return (err & SubRemoveRef::Temporary) > 0; }; { return (err & SubRemoveRef::Temporary) > 0; }
inline void SubRemoveRef::setTemporary() inline void SubRemoveRef::setTemporary()
{ err |= SubRemoveRef::Temporary; }; { err |= SubRemoveRef::Temporary; }
inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec) inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec)
{ return (SubRemoveRef::ErrorCode) { return (SubRemoveRef::ErrorCode)
(errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }; (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }
class SubRemoveConf { class SubRemoveConf {
/** /**

View File

@@ -152,4 +152,4 @@ DictTabInfo::Attribute::init(){
AttributeExtLength = 0, AttributeExtLength = 0,
AttributeAutoIncrement = false; AttributeAutoIncrement = false;
memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0; memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0;
}; }

View File

@@ -41,4 +41,4 @@ printNF_COMPLETE_REP(FILE * output,
sig->from); sig->from);
return true; return true;
}; }

View File

@@ -198,7 +198,7 @@ FileLogHandler::setFilename(const BaseString &filename) {
m_pLogFile = new File_class(filename.c_str(), "a+"); m_pLogFile = new File_class(filename.c_str(), "a+");
open(); open();
return true; return true;
}; }
bool bool
FileLogHandler::setMaxSize(const BaseString &size) { FileLogHandler::setMaxSize(const BaseString &size) {
@@ -214,7 +214,7 @@ FileLogHandler::setMaxSize(const BaseString &size) {
m_maxFileSize = val; m_maxFileSize = val;
return true; return true;
}; }
bool bool
FileLogHandler::setMaxFiles(const BaseString &files) { FileLogHandler::setMaxFiles(const BaseString &files) {
@@ -225,7 +225,7 @@ FileLogHandler::setMaxFiles(const BaseString &files) {
m_maxNoFiles = val; m_maxNoFiles = val;
return true; return true;
}; }
bool bool
FileLogHandler::checkParams() { FileLogHandler::checkParams() {

View File

@@ -205,7 +205,7 @@ Backup::~Backup()
{ {
} }
BLOCK_FUNCTIONS(Backup); BLOCK_FUNCTIONS(Backup)
template class ArrayPool<Backup::Page32>; template class ArrayPool<Backup::Page32>;
template class ArrayPool<Backup::Attribute>; template class ArrayPool<Backup::Attribute>;

View File

@@ -1110,7 +1110,7 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
}//Cmvmi::execDUMP_STATE_ORD() }//Cmvmi::execDUMP_STATE_ORD()
BLOCK_FUNCTIONS(Cmvmi); BLOCK_FUNCTIONS(Cmvmi)
static Uint32 g_print; static Uint32 g_print;
static LinearSectionPtr g_test[3]; static LinearSectionPtr g_test[3];

View File

@@ -264,4 +264,4 @@ Dbacc::~Dbacc()
}//Dbacc::~Dbacc() }//Dbacc::~Dbacc()
BLOCK_FUNCTIONS(Dbacc); BLOCK_FUNCTIONS(Dbacc)

View File

@@ -1192,7 +1192,7 @@ Dbdict::~Dbdict()
{ {
}//Dbdict::~Dbdict() }//Dbdict::~Dbdict()
BLOCK_FUNCTIONS(Dbdict); BLOCK_FUNCTIONS(Dbdict)
void Dbdict::initCommonData() void Dbdict::initCommonData()
{ {

View File

@@ -314,7 +314,7 @@ Dbdih::~Dbdih()
}//Dbdih::~Dbdih() }//Dbdih::~Dbdih()
BLOCK_FUNCTIONS(Dbdih); BLOCK_FUNCTIONS(Dbdih)

View File

@@ -454,5 +454,5 @@ Dblqh::~Dblqh()
ctcNodeFailrecFileSize); ctcNodeFailrecFileSize);
}//Dblqh::~Dblqh() }//Dblqh::~Dblqh()
BLOCK_FUNCTIONS(Dblqh); BLOCK_FUNCTIONS(Dblqh)

View File

@@ -365,5 +365,5 @@ Dbtc::~Dbtc()
capiConnectFilesize); capiConnectFilesize);
}//Dbtc::~Dbtc() }//Dbtc::~Dbtc()
BLOCK_FUNCTIONS(Dbtc); BLOCK_FUNCTIONS(Dbtc)

View File

@@ -215,7 +215,7 @@ Dbtup::~Dbtup()
}//Dbtup::~Dbtup() }//Dbtup::~Dbtup()
BLOCK_FUNCTIONS(Dbtup); BLOCK_FUNCTIONS(Dbtup)
/* **************************************************************** */ /* **************************************************************** */
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */

View File

@@ -1066,7 +1066,7 @@ Dbtux::Index::Index() :
m_fragId[i] = ZNIL; m_fragId[i] = ZNIL;
m_fragPtrI[i] = RNIL; m_fragPtrI[i] = RNIL;
}; };
}; }
// Dbtux::Frag // Dbtux::Frag
@@ -1103,7 +1103,7 @@ Dbtux::FragOp::FragOp() :
m_fragNo(ZNIL), m_fragNo(ZNIL),
m_numAttrsRecvd(ZNIL) m_numAttrsRecvd(ZNIL)
{ {
}; }
// Dbtux::NodeHandle // Dbtux::NodeHandle

View File

@@ -293,4 +293,4 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2
#endif #endif
} }
BLOCK_FUNCTIONS(Dbtux); BLOCK_FUNCTIONS(Dbtux)

View File

@@ -158,7 +158,7 @@ DbUtil::~DbUtil()
{ {
} }
BLOCK_FUNCTIONS(DbUtil); BLOCK_FUNCTIONS(DbUtil)
void void
DbUtil::releasePrepare(PreparePtr prepPtr) { DbUtil::releasePrepare(PreparePtr prepPtr) {

View File

@@ -132,7 +132,7 @@ Grep::~Grep()
{ {
} }
BLOCK_FUNCTIONS(Grep); BLOCK_FUNCTIONS(Grep)
Grep::PSPart::PSPart(Grep * sb) : Grep::PSPart::PSPart(Grep * sb) :
BlockComponent(sb), BlockComponent(sb),

View File

@@ -114,4 +114,4 @@ Ndbcntr::~Ndbcntr()
}//Ndbcntr::~Ndbcntr() }//Ndbcntr::~Ndbcntr()
BLOCK_FUNCTIONS(Ndbcntr); BLOCK_FUNCTIONS(Ndbcntr)

View File

@@ -1010,7 +1010,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal)
BLOCK_FUNCTIONS(Ndbfs); BLOCK_FUNCTIONS(Ndbfs)
template class Vector<AsyncFile*>; template class Vector<AsyncFile*>;
template class Vector<OpenFiles::OpenFileItem>; template class Vector<OpenFiles::OpenFileItem>;

View File

@@ -196,5 +196,5 @@ VoidFs::execDUMP_STATE_ORD(Signal* signal)
BLOCK_FUNCTIONS(VoidFs); BLOCK_FUNCTIONS(VoidFs)

View File

@@ -100,4 +100,4 @@ Qmgr::~Qmgr()
}//Qmgr::~Qmgr() }//Qmgr::~Qmgr()
BLOCK_FUNCTIONS(Qmgr); BLOCK_FUNCTIONS(Qmgr)

View File

@@ -3553,7 +3553,7 @@ Suma::Restart::Restart(Suma& s) : suma(s) {
c_okToStart[i] = false; c_okToStart[i] = false;
c_waitingToStart[i] = false; c_waitingToStart[i] = false;
} }
}; }
void void
Suma::Restart::resetNode(Uint32 sumaRef) Suma::Restart::resetNode(Uint32 sumaRef)

View File

@@ -188,6 +188,6 @@ Suma::~Suma()
{ {
} }
BLOCK_FUNCTIONS(Suma); BLOCK_FUNCTIONS(Suma)
BLOCK_FUNCTIONS(SumaParticipant); BLOCK_FUNCTIONS(SumaParticipant)

View File

@@ -962,6 +962,6 @@ void Trix::checkParallelism(Signal* signal, SubscriptionRecord* subRec)
} }
} }
BLOCK_FUNCTIONS(Trix); BLOCK_FUNCTIONS(Trix)
template void append(DataBuffer<15>&,SegmentedSectionPtr,SectionSegmentPool&); template void append(DataBuffer<15>&,SegmentedSectionPtr,SectionSegmentPool&);

View File

@@ -130,7 +130,7 @@ MgmtSrvr::signalRecvThreadRun()
(this->*handler->function)(signal); (this->*handler->function)(signal);
} }
} }
}; }
EventLogger g_EventLogger; EventLogger g_EventLogger;

View File

@@ -121,5 +121,5 @@ NdbEventOperation::wait(void *p, int aMillisecondNumber)
} }
NdbEventOperation::NdbEventOperation(NdbEventOperationImpl& impl) NdbEventOperation::NdbEventOperation(NdbEventOperationImpl& impl)
: m_impl(impl) {}; : m_impl(impl) {}

View File

@@ -397,7 +397,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
(m_operation->* branch)(4, 5, m_current.m_ownLabel); (m_operation->* branch)(4, 5, m_current.m_ownLabel);
return 0; return 0;
}; }
int int
NdbScanFilter::eq(int AttrId, Uint32 value){ NdbScanFilter::eq(int AttrId, Uint32 value){
@@ -478,7 +478,7 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){
Branch1 branch = table2[op].m_branches[m_current.m_group]; Branch1 branch = table2[op].m_branches[m_current.m_group];
(m_operation->* branch)(AttrId, m_current.m_ownLabel); (m_operation->* branch)(AttrId, m_current.m_ownLabel);
return 0; return 0;
}; }
int int
NdbScanFilter::isnull(int AttrId){ NdbScanFilter::isnull(int AttrId){

View File

@@ -260,16 +260,16 @@ TupleS & TupleS::operator=(const TupleS& tuple)
memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData)); memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData));
return *this; return *this;
}; }
int TupleS::getNoOfAttributes() const { int TupleS::getNoOfAttributes() const {
if (m_currentTable == 0) if (m_currentTable == 0)
return 0; return 0;
return m_currentTable->getNoOfAttributes(); return m_currentTable->getNoOfAttributes();
}; }
TableS * TupleS::getTable() const { TableS * TupleS::getTable() const {
return m_currentTable; return m_currentTable;
}; }
const AttributeDesc * TupleS::getDesc(int i) const { const AttributeDesc * TupleS::getDesc(int i) const {
return m_currentTable->allAttributesDesc[i]; return m_currentTable->allAttributesDesc[i];
@@ -277,7 +277,7 @@ const AttributeDesc * TupleS::getDesc(int i) const {
AttributeData * TupleS::getData(int i) const{ AttributeData * TupleS::getData(int i) const{
return &(allAttrData[i]); return &(allAttrData[i]);
}; }
bool bool
TupleS::prepareRecord(TableS & tab){ TupleS::prepareRecord(TableS & tab){

View File

@@ -87,7 +87,7 @@ Item *create_func_soundex(Item* a);
Item *create_func_space(Item *); Item *create_func_space(Item *);
Item *create_func_sqrt(Item* a); Item *create_func_sqrt(Item* a);
Item *create_func_strcmp(Item* a, Item *b); Item *create_func_strcmp(Item* a, Item *b);
Item *create_func_tan(Item* a);; Item *create_func_tan(Item* a);
Item *create_func_time_format(Item *a, Item *b); Item *create_func_time_format(Item *a, Item *b);
Item *create_func_time_to_sec(Item* a); Item *create_func_time_to_sec(Item* a);
Item *create_func_to_days(Item* a); Item *create_func_to_days(Item* a);

View File

@@ -374,7 +374,7 @@ inline Query_cache_block * Query_cache_block_table::block()
return (Query_cache_block *)(((byte*)this) - return (Query_cache_block *)(((byte*)this) -
ALIGN_SIZE(sizeof(Query_cache_block_table)*n) - ALIGN_SIZE(sizeof(Query_cache_block_table)*n) -
ALIGN_SIZE(sizeof(Query_cache_block))); ALIGN_SIZE(sizeof(Query_cache_block)));
}; }
/***************************************************************************** /*****************************************************************************
Query_cache_block method(s) Query_cache_block method(s)

View File

@@ -11320,7 +11320,7 @@ static void test_bug4172()
MYSQL_ROW row; MYSQL_ROW row;
int rc; int rc;
char f[100], d[100], e[100]; char f[100], d[100], e[100];
long f_len, d_len, e_len; ulong f_len, d_len, e_len;
myheader("test_bug4172"); myheader("test_bug4172");
@@ -11411,8 +11411,8 @@ static void test_conversion()
mysql_stmt_bind_param(stmt, bind); mysql_stmt_bind_param(stmt, bind);
buff[0]= 0xC3; buff[0]= (uchar) 0xC3;
buff[1]= 0xA0; buff[1]= (uchar) 0xA0;
length= 2; length= 2;
rc= mysql_stmt_execute(stmt); rc= mysql_stmt_execute(stmt);