Commit 59ee75bd authored by unknown's avatar unknown

wl1744 - fix compiler problems


ndb/include/debugger/GrepError.hpp:
  prexif
ndb/include/kernel/LogLevel.hpp:
  fix correct type prototype
ndb/include/kernel/signaldata/FsCloseReq.hpp:
  remove usage of true
ndb/include/mgmapi/mgmapi.h:
  use Uint64 instead of long long
ndb/include/mgmcommon/IPCConfig.hpp:
  correct type
ndb/include/portlib/NdbTCP.h:
  fix #elif
ndb/include/transporter/TransporterRegistry.hpp:
  correct type
ndb/include/util/Parser.hpp:
  correct type
  made stuff public as vc++ couldn't handle template friends
ndb/include/util/SimpleProperties.hpp:
  correct type
ndb/src/common/debugger/EventLogger.cpp:
  Prefix GrepError::Code as GrepError::GE_Code
ndb/src/common/debugger/GrepError.cpp:
  Prefix GrepError::Code as GrepError::GE_Code
ndb/src/common/debugger/signaldata/FsCloseReq.cpp:
  removed usage of true
ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp:
  removed usage of true
ndb/src/common/logger/LogHandlerList.hpp:
  use ndb_global
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  removed ConfigRetriever::get_config(file) from windows
ndb/src/common/transporter/TransporterRegistry.cpp:
  interface is a reserved word in vc++
ndb/src/kernel/blocks/grep/Grep.hpp:
  Prefix GrepError::Code as GrepError::GE_Code
ndb/src/kernel/vm/Configuration.cpp:
  Use BaseString::snprintf
ndb/src/kernel/vm/Configuration.hpp:
  correct type
ndb/src/kernel/vm/SimplePropertiesSection.cpp:
  correct type
ndb/src/mgmapi/mgmapi_configuration.cpp:
  use Uin6t4
ndb/src/mgmapi/mgmapi_configuration.hpp:
  use Uin6t4
ndb/src/mgmsrv/ConfigInfo.cpp:
  Prefix
ndb/src/mgmsrv/ConfigInfo.hpp:
  prefix
ndb/src/ndbapi/Ndb.cpp:
  removed usued include
ndb/src/ndbapi/NdbImpl.hpp:
  prefix
ndb/src/ndbapi/ObjectMap.hpp:
  Better typecast
parent f0614a9f
......@@ -24,8 +24,8 @@
*/
class GrepError {
public:
enum Code {
NO_ERROR = 0,
enum GE_Code {
GE_NO_ERROR = 0,
SUBSCRIPTION_ID_NOMEM = 1,
SUBSCRIPTION_ID_NOT_FOUND = 2,
SUBSCRIPTION_ID_NOT_UNIQUE = 3,
......@@ -82,12 +82,12 @@ public:
};
struct ErrorDescription {
Code errCode;
GE_Code errCode;
const char * name;
};
static const ErrorDescription errorDescriptions[];
static const Uint32 noOfErrorDescs;
static const char * getErrorDesc(GrepError::Code err);
static const char * getErrorDesc(GrepError::GE_Code err);
};
......
......@@ -89,7 +89,7 @@ public:
return memcmp(this, &l, sizeof(* this)) == 0;
}
LogLevel& operator=(const class EventSubscribeReq & req);
LogLevel& operator=(const struct EventSubscribeReq & req);
private:
/**
......
......@@ -75,7 +75,7 @@ inline
void
FsCloseReq::setRemoveFileFlag(UintR & fileflag, bool removefile){
// ASSERT_BOOL(removefile, "FsCloseReq::setRemoveFileFlag");
if (removefile == true)
if (removefile)
fileflag = 1;
else
fileflag = 0;
......
......@@ -730,7 +730,7 @@ extern "C" {
int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*,
int param, unsigned * value);
int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*,
int param, unsigned long long * value);
int param, Uint64 * value);
int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*,
int param, const char ** value);
#ifdef __cplusplus
......
......@@ -59,7 +59,7 @@ public:
void print() const { props->print(); }
static Uint32 configureTransporters(Uint32 nodeId,
const class ndb_mgm_configuration &,
const struct ndb_mgm_configuration &,
class TransporterRegistry &);
private:
......
......@@ -40,7 +40,7 @@ typedef int socklen_t;
#define InetErrno (* inet_errno())
#elif NDB_WIN32
#elif defined NDB_WIN32
/**
* Include files needed
......
......@@ -224,7 +224,7 @@ public:
const char *m_interface;
};
Vector<Transporter_interface> m_transporter_interface;
void add_transporter_interface(const char *interface, unsigned short port);
void add_transporter_interface(const char *interf, unsigned short port);
protected:
private:
......
......@@ -23,7 +23,7 @@
#include "NdbOut.hpp"
class ParserImpl;
template<class T> class ParserRow;
template<class T> struct ParserRow;
//#define PARSER_DEBUG
#ifdef PARSER_DEBUG
......@@ -130,11 +130,11 @@ public:
* The void* equivalent implementation
*/
class ParserImpl {
public:
class Dummy {};
typedef ParserRow<Dummy> DummyRow;
typedef Parser<Dummy>::Context Context;
template<class T> friend class Parser;
private:
ParserImpl(const DummyRow rows[], class InputStream & in,
bool b_cmd, bool b_empty, bool b_iarg);
......
......@@ -38,20 +38,20 @@ public:
/**
* Value types
*/
enum ValueType {
enum ValueType {
Uint32Value = 0,
StringValue = 1,
BinaryValue = 2,
InvalidValue = 3
};
};
/**
* Struct for defining mapping to be used with unpack
*/
struct SP2StructMapping {
Uint16 Key;
Uint32 Offset;
SimpleProperties::ValueType Type;
ValueType Type;
Uint32 minValue;
Uint32 maxValue;
Uint32 Length_Offset; // Offset used for looking up length of
......@@ -233,7 +233,7 @@ private:
*/
class SimplePropertiesSectionReader : public SimpleProperties::Reader {
public:
SimplePropertiesSectionReader(class SegmentedSectionPtr &,
SimplePropertiesSectionReader(struct SegmentedSectionPtr &,
class SectionSegmentPool &);
virtual void reset();
......@@ -248,8 +248,8 @@ private:
Uint32 m_pos;
Uint32 m_len;
class SectionSegmentPool & m_pool;
class SectionSegment * m_head;
class SectionSegment * m_currentSegment;
struct SectionSegment * m_head;
struct SectionSegment * m_currentSegment;
};
inline
......@@ -275,15 +275,15 @@ public:
/**
* This "unlinks" the writer from the memory
*/
void getPtr(class SegmentedSectionPtr & dst);
void getPtr(struct SegmentedSectionPtr & dst);
private:
Int32 m_pos;
Uint32 m_sz;
class SectionSegmentPool & m_pool;
class SectionSegment * m_head;
struct SectionSegment * m_head;
Uint32 m_prevPtrI; // Prev to m_currentSegment
class SectionSegment * m_currentSegment;
struct SectionSegment * m_currentSegment;
};
#endif
......@@ -1028,7 +1028,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
"Grep::SSCoord:Error code: %d Error message: %s"
" (subId=%d,SubKey=%d)",
err,
GrepError::getErrorDesc((GrepError::Code)err),
GrepError::getErrorDesc((GrepError::GE_Code)err),
subId,
subKey);
break;
......@@ -1045,7 +1045,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubStartMetaRef:
......@@ -1061,7 +1061,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubStartDataRef:
......@@ -1076,7 +1076,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubSyncMetaRef:
......@@ -1091,7 +1091,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubSyncDataRef:
......@@ -1108,7 +1108,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subKey,
gci,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubRemoveRef:
......@@ -1123,7 +1123,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err)
GrepError::getErrorDesc((GrepError::GE_Code)err)
);
break;
}
......@@ -1137,7 +1137,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
"Grep::PSCoord: Error code: %d Error Message: %s"
" (subId=%d,SubKey=%d)",
err,
GrepError::getErrorDesc((GrepError::Code)err),
GrepError::getErrorDesc((GrepError::GE_Code)err),
subId,
subKey);
break;
......@@ -1154,7 +1154,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubStartMetaRef:
......@@ -1170,7 +1170,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubStartDataRef:
......@@ -1185,7 +1185,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubSyncMetaRef:
......@@ -1200,7 +1200,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubSyncDataRef:
......@@ -1217,7 +1217,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subKey,
gci,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubRemoveRef:
......@@ -1232,7 +1232,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::Rep_Disconnect:
......@@ -1244,7 +1244,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
" Error code: %d Error Message: %s",
nodeId,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
......
......@@ -21,7 +21,7 @@
*/
const GrepError::ErrorDescription GrepError::errorDescriptions[] = {
{ GrepError::NO_ERROR,
{ GrepError::GE_NO_ERROR,
"No error" },
{ GrepError::SUBSCRIPTION_ID_NOMEM,
"Not enough resources to allocate the subscription" },
......@@ -119,7 +119,7 @@ GrepError::noOfErrorDescs = sizeof(GrepError::errorDescriptions) /
* gets the corresponding error message to an err code
*/
const char *
GrepError::getErrorDesc(GrepError::Code err) {
GrepError::getErrorDesc(GrepError::GE_Code err) {
for(Uint32 i = 0; i<noOfErrorDescs; i++){
if(err == errorDescriptions[i].errCode){
......
......@@ -31,7 +31,7 @@ printFSCLOSEREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv
sig->userReference);
fprintf(output, " Flags: H\'%.8x, ", sig->fileFlag);
if (sig->getRemoveFileFlag(sig->fileFlag) == true)
if (sig->getRemoveFileFlag(sig->fileFlag))
fprintf(output, "Remove file");
else
fprintf(output, "Don't remove file");
......
......@@ -31,7 +31,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
fprintf(output, " UserReference: H\'%.8x", sig->userReference);
fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag);
if (sig->getSyncFlag(sig->operationFlag) == true)
if (sig->getSyncFlag(sig->operationFlag))
fprintf(output, "Sync,");
else
fprintf(output, "No sync,");
......
......@@ -18,6 +18,7 @@
#define LOGHANDLERLIST_H
class LogHandler;
#include <ndb_global.h>
/**
* Provides a simple linked list of log handlers.
......
......@@ -178,9 +178,10 @@ ConfigRetriever::getConfig(NdbMgmHandle m_handle){
return conf;
}
ndb_mgm_configuration *
ConfigRetriever::getConfig(const char * filename){
#ifndef NDB_WIN32
struct stat sbuf;
const int res = stat(filename, &sbuf);
......@@ -217,8 +218,10 @@ ConfigRetriever::getConfig(const char * filename){
return 0;
}
delete [] buf2;
return (ndb_mgm_configuration*)cvf.m_cfg;
#else
return 0;
#endif
}
void
......
......@@ -1167,31 +1167,31 @@ TransporterRegistry::stop_clients()
}
void
TransporterRegistry::add_transporter_interface(const char *interface, unsigned short port)
TransporterRegistry::add_transporter_interface(const char *interf, unsigned short port)
{
DBUG_ENTER("TransporterRegistry::add_transporter_interface");
DBUG_PRINT("enter",("interface=%s, port= %d", interface, port));
if (interface && strlen(interface) == 0)
interface= 0;
DBUG_PRINT("enter",("interface=%s, port= %d", interf, port));
if (interf && strlen(interf) == 0)
interf= 0;
for (unsigned i= 0; i < m_transporter_interface.size(); i++)
{
Transporter_interface &tmp= m_transporter_interface[i];
if (port != tmp.m_service_port)
continue;
if (interface != 0 && tmp.m_interface != 0 &&
strcmp(interface, tmp.m_interface) == 0)
if (interf != 0 && tmp.m_interface != 0 &&
strcmp(interf, tmp.m_interface) == 0)
{
DBUG_VOID_RETURN; // found match, no need to insert
}
if (interface == 0 && tmp.m_interface == 0)
if (interf == 0 && tmp.m_interface == 0)
{
DBUG_VOID_RETURN; // found match, no need to insert
}
}
Transporter_interface t;
t.m_service_port= port;
t.m_interface= interface;
t.m_interface= interf;
m_transporter_interface.push_back(t);
DBUG_PRINT("exit",("interface and port added"));
DBUG_VOID_RETURN;
......@@ -1200,7 +1200,7 @@ TransporterRegistry::add_transporter_interface(const char *interface, unsigned s
bool
TransporterRegistry::start_service(SocketServer& socket_server)
{
if (m_transporter_interface.size() > 0 && nodeIdSpecified != true)
if (m_transporter_interface.size() > 0 && !nodeIdSpecified)
{
ndbout_c("TransporterRegistry::startReceiving: localNodeId not specified");
return false;
......
......@@ -380,16 +380,16 @@ public:
Uint32 subId,
Uint32 subKey,
BlockReference to,
GrepError::Code err);
GrepError::GE_Code err);
void sendSubRemoveRef_SS(Signal * signal,
SubCoordinator sub,
GrepError::Code err);
GrepError::GE_Code err);
void sendRefToSS(Signal * signal,
SubCoordinator sub,
GrepError::Code err,
GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
void setRepRef(BlockReference rr) { m_repRef = rr; };
......@@ -496,7 +496,7 @@ public:
void sendRefToPSCoord(Signal * signal,
Subscription sub,
GrepError::Code err,
GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
//protected:
......
......@@ -556,7 +556,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
noOfDBNodes++; // No of NDB processes
if(nodeId > MAX_NDB_NODES){
snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
MAX_NDB_NODES);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
}
......
......@@ -21,7 +21,7 @@
#include <ndb_types.h>
class ConfigRetriever;
class LocalConfig;
struct LocalConfig;
class Configuration {
public:
......
......@@ -19,7 +19,7 @@
#include "LongSignal.hpp"
SimplePropertiesSectionReader::SimplePropertiesSectionReader
(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool)
(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool)
: m_pool(pool)
{
if(ptr.p == 0){
......@@ -190,7 +190,7 @@ SimplePropertiesSectionWriter::putWords(const Uint32 * src, Uint32 len){
}
void
SimplePropertiesSectionWriter::getPtr(class SegmentedSectionPtr & dst){
SimplePropertiesSectionWriter::getPtr(struct SegmentedSectionPtr & dst){
// Set last ptr and size
if(m_pos >= 0){
dst.p = m_head;
......
#include <ndb_types.h>
#include <mgmapi.h>
#include "mgmapi_configuration.hpp"
#include <new>
......@@ -138,7 +139,7 @@ ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator* iter,
extern "C"
int
ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator* iter,
int param, unsigned long long * value){
int param, Uint64 * value){
return iter->get(param, value);
}
......
......@@ -21,7 +21,7 @@ struct ndb_mgm_configuration_iterator {
int find(int param, unsigned value);
int get(int param, unsigned * value) const ;
int get(int param, unsigned long long * value) const ;
int get(int param, Uint64 * value) const ;
int get(int param, const char ** value) const ;
//
......
This diff is collapsed.
......@@ -38,11 +38,11 @@ static const char* UNDEFINED = 0; // Default value for undefined
*/
class ConfigInfo {
public:
enum Type { BOOL, INT, INT64, STRING, SECTION };
enum Status { USED, ///< Active
DEPRICATED, ///< Can be, but shouldn't
NOTIMPLEMENTED, ///< Is ignored.
INTERNAL ///< Not configurable by the user
enum Type { CI_BOOL, CI_INT, CI_INT64, CI_STRING, CI_SECTION };
enum Status { CI_USED, ///< Active
CI_DEPRICATED, ///< Can be, but shouldn't
CI_NOTIMPLEMENTED, ///< Is ignored.
CI_INTERNAL ///< Not configurable by the user
};
/**
......
......@@ -22,7 +22,7 @@ Name: Ndb.cpp
******************************************************************************/
#include <ndb_global.h>
#include <pthread.h>
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
......
......@@ -107,7 +107,7 @@ Uint32 convertEndian(Uint32 Data);
enum WaitSignalType {
NO_WAIT = 0,
WAIT_NODE_FAILURE = 1, // Node failure during wait
WAIT_TIMEOUT = 2, // Timeout during wait
WST_WAIT_TIMEOUT = 2, // Timeout during wait
WAIT_TC_SEIZE = 3,
WAIT_TC_RELEASE = 4,
......
......@@ -29,7 +29,7 @@
class NdbObjectIdMap //: NdbLockable
{
public:
STATIC_CONST( InvalidId = ~0 );
STATIC_CONST( InvalidId = ~(Uint32)0 );
NdbObjectIdMap(Uint32 initalSize = 128, Uint32 expandSize = 10);
~NdbObjectIdMap();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment