ndb -

  still some compiler warnings
parent 14ec452b
......@@ -25,6 +25,7 @@
*/
class OutputStream {
public:
virtual ~OutputStream() {}
virtual int print(const char * fmt, ...) = 0;
virtual int println(const char * fmt, ...) = 0;
virtual void flush() {};
......@@ -34,7 +35,8 @@ class FileOutputStream : public OutputStream {
FILE * f;
public:
FileOutputStream(FILE * file = stdout);
virtual ~FileOutputStream() {}
int print(const char * fmt, ...);
int println(const char * fmt, ...);
void flush() { fflush(f); }
......@@ -45,7 +47,8 @@ class SocketOutputStream : public OutputStream {
unsigned m_timeout;
public:
SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned writeTimeout = 1000);
virtual ~SocketOutputStream() {}
int print(const char * fmt, ...);
int println(const char * fmt, ...);
};
......@@ -53,13 +56,15 @@ public:
class SoftOseOutputStream : public OutputStream {
public:
SoftOseOutputStream();
virtual ~SoftOseOutputStream() {}
int print(const char * fmt, ...);
int println(const char * fmt, ...);
};
class NullOutputStream : public OutputStream {
public:
virtual ~NullOutputStream() {}
int print(const char * /* unused */, ...) { return 1;}
int println(const char * /* unused */, ...) { return 1;}
};
......
......@@ -92,6 +92,8 @@ public:
*/
class Reader {
public:
virtual ~Reader() {}
/**
* Move to first element
* Return true if element exist
......@@ -164,6 +166,8 @@ public:
*/
class Writer {
public:
virtual ~Writer() {}
bool first();
bool add(Uint16 key, Uint32 value);
bool add(Uint16 key, const char * value);
......@@ -183,6 +187,7 @@ public:
class SimplePropertiesLinearReader : public SimpleProperties::Reader {
public:
SimplePropertiesLinearReader(const Uint32 * src, Uint32 len);
virtual ~SimplePropertiesLinearReader() {}
virtual void reset();
virtual bool step(Uint32 len);
......@@ -201,7 +206,8 @@ private:
class LinearWriter : public SimpleProperties::Writer {
public:
LinearWriter(Uint32 * src, Uint32 len);
virtual ~LinearWriter() {}
virtual bool reset();
virtual bool putWord(Uint32 val);
virtual bool putWords(const Uint32 * src, Uint32 len);
......@@ -218,6 +224,7 @@ private:
class UtilBufferWriter : public SimpleProperties::Writer {
public:
UtilBufferWriter(class UtilBuffer & buf);
virtual ~UtilBufferWriter() {}
virtual bool reset();
virtual bool putWord(Uint32 val);
......@@ -237,7 +244,9 @@ class SimplePropertiesSectionReader : public SimpleProperties::Reader {
public:
SimplePropertiesSectionReader(struct SegmentedSectionPtr &,
class SectionSegmentPool &);
virtual ~SimplePropertiesSectionReader() {}
virtual void reset();
virtual bool step(Uint32 len);
virtual bool getWord(Uint32 * dst);
......@@ -269,6 +278,7 @@ Uint32 SimplePropertiesSectionReader::getSize() const
class SimplePropertiesSectionWriter : public SimpleProperties::Writer {
public:
SimplePropertiesSectionWriter(class SectionSegmentPool &);
virtual ~SimplePropertiesSectionWriter() {}
virtual bool reset();
virtual bool putWord(Uint32 val);
......
......@@ -213,10 +213,15 @@ inline
void
RecordPool<T, P>::init(Uint32 type_id, const Pool_context& pc)
{
T tmp;
const char * off_base = (char*)&tmp;
const char * off_next = (char*)&tmp.nextPool;
const char * off_magic = (char*)&tmp.m_magic;
Record_info ri;
ri.m_size = sizeof(T);
ri.m_offset_next_pool = offsetof(T, nextPool);
ri.m_offset_magic = offsetof(T, m_magic);
ri.m_offset_next_pool = Uint32(off_next - off_base);
ri.m_offset_magic = Uint32(off_magic - off_base);
ri.m_type_id = type_id;
m_pool.init(ri, pc);
}
......@@ -226,10 +231,14 @@ inline
void
RecordPool<T, P>::wo_pool_init(Uint32 type_id, const Pool_context& pc)
{
T tmp;
const char * off_base = (char*)&tmp;
const char * off_magic = (char*)&tmp.m_magic;
Record_info ri;
ri.m_size = sizeof(T);
ri.m_offset_next_pool = 0;
ri.m_offset_magic = offsetof(T, m_magic);
ri.m_offset_magic = Uint32(off_magic - off_base);
ri.m_type_id = type_id;
m_pool.init(ri, pc);
}
......
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