Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
31efa863
Commit
31efa863
authored
Mar 24, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb -
still some compiler warnings
parent
14ec452b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
7 deletions
+31
-7
storage/ndb/include/util/OutputStream.hpp
storage/ndb/include/util/OutputStream.hpp
+8
-3
storage/ndb/include/util/SimpleProperties.hpp
storage/ndb/include/util/SimpleProperties.hpp
+11
-1
storage/ndb/src/kernel/vm/Pool.hpp
storage/ndb/src/kernel/vm/Pool.hpp
+12
-3
No files found.
storage/ndb/include/util/OutputStream.hpp
View file @
31efa863
...
@@ -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
;}
};
};
...
...
storage/ndb/include/util/SimpleProperties.hpp
View file @
31efa863
...
@@ -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
);
...
...
storage/ndb/src/kernel/vm/Pool.hpp
View file @
31efa863
...
@@ -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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment