Commit 6c9618d1 authored by unknown's avatar unknown
Browse files

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
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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,6 +35,7 @@ class FileOutputStream : public OutputStream {
  FILE * f;
public:
  FileOutputStream(FILE * file = stdout);
  virtual ~FileOutputStream() {}

  int print(const char * fmt, ...);
  int println(const char * fmt, ...);
@@ -45,6 +47,7 @@ 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,6 +56,7 @@ public:
class SoftOseOutputStream : public OutputStream {
public:
  SoftOseOutputStream();
  virtual ~SoftOseOutputStream() {}

  int print(const char * fmt, ...);
  int println(const char * fmt, ...);
@@ -60,6 +64,7 @@ public:

class NullOutputStream : public OutputStream {
public:
  virtual ~NullOutputStream() {}
  int print(const char * /* unused */, ...) { return 1;}
  int println(const char * /* unused */, ...) { return 1;}
};
+11 −1
Original line number Diff line number Diff line
@@ -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,6 +206,7 @@ private:
class LinearWriter : public SimpleProperties::Writer {
public:
  LinearWriter(Uint32 * src, Uint32 len);
  virtual ~LinearWriter() {}

  virtual bool reset();
  virtual bool putWord(Uint32 val);
@@ -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,6 +244,8 @@ class SimplePropertiesSectionReader : public SimpleProperties::Reader {
public:
  SimplePropertiesSectionReader(struct SegmentedSectionPtr &,
				class SectionSegmentPool &);
  virtual ~SimplePropertiesSectionReader() {}
  

  virtual void reset();
  virtual bool step(Uint32 len);
@@ -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);
+12 −3
Original line number Diff line number Diff line
@@ -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);
}