Commit 6c9618d1 authored by unknown's avatar unknown

ndb -

  still some compiler warnings


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