Skip to content

Commit 4a92b6d

Browse files
gmMizuhaHimuraki
authored andcommitted
reformat source code
according to code styles, 'AccessModifierOffset' should be -2.
1 parent 8c4a2f2 commit 4a92b6d

File tree

3,314 files changed

+23186
-23456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,314 files changed

+23186
-23456
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Language: Cpp
33
# BasedOnStyle: LLVM
44
SortIncludes: false
5-
AccessModifierOffset: -4
5+
AccessModifierOffset: -2
66
AlignAfterOpenBracket: DontAlign
77
AlignConsecutiveAssignments: false
88
AlignConsecutiveDeclarations: false

deps/easy/src/packet/easy_tbnet.h

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static uint64_t addrv_to_server_id(easy_addr_t addr)
4343
class IServerAdapter;
4444
class Transport;
4545
class DataBuffer {
46-
public:
46+
public:
4747
DataBuffer(easy_buf_t* pb)
4848
{
4949
b = pb;
@@ -180,22 +180,22 @@ class DataBuffer {
180180
return true;
181181
}
182182

183-
private:
183+
private:
184184
easy_pool_t* pool;
185185
easy_list_t* l;
186186
easy_buf_t* b;
187187
int wl;
188188
};
189189

190190
class PacketHeader {
191-
public:
191+
public:
192192
uint32_t _chid;
193193
int _pcode;
194194
int _dataLen;
195195
};
196196

197197
class Packet {
198-
public:
198+
public:
199199
Packet()
200200
{
201201
memset(&_packetHeader, 0, sizeof(PacketHeader));
@@ -241,13 +241,13 @@ class Packet {
241241
virtual bool encode(DataBuffer* output) = 0;
242242
virtual bool decode(DataBuffer* input, PacketHeader* header) = 0;
243243

244-
public:
244+
public:
245245
PacketHeader _packetHeader;
246246
easy_request_t* r;
247247
};
248248

249249
class ControlPacket : public Packet {
250-
public:
250+
public:
251251
enum { CMD_BAD_PACKET = 1, CMD_TIMEOUT_PACKET, CMD_DISCONN_PACKET };
252252
ControlPacket(int c) : _command(c)
253253
{}
@@ -268,12 +268,12 @@ class ControlPacket : public Packet {
268268
return false;
269269
}
270270

271-
private:
271+
private:
272272
int _command;
273273
};
274274

275275
class IOComponent {
276-
public:
276+
public:
277277
IOComponent()
278278
{}
279279
~IOComponent()
@@ -283,12 +283,12 @@ class IOComponent {
283283
this->l = l;
284284
}
285285

286-
private:
286+
private:
287287
easy_listen_t* l;
288288
};
289289

290290
class IPacketFactory {
291-
public:
291+
public:
292292
IPacketFactory()
293293
{
294294
flag = 0x416e4574;
@@ -304,7 +304,7 @@ class IPacketFactory {
304304

305305
class IPacketStreamer {
306306

307-
public:
307+
public:
308308
IPacketStreamer()
309309
{
310310
_factory = NULL;
@@ -410,12 +410,12 @@ class IPacketStreamer {
410410
return EASY_OK;
411411
}
412412

413-
protected:
413+
protected:
414414
IPacketFactory* _factory;
415415
};
416416

417417
class IPacketHandler {
418-
public:
418+
public:
419419
enum HPRetCode {
420420
KEEP_CHANNEL = 0, // easy_ok
421421
CLOSE_CHANNEL = -1, // easy_error
@@ -482,13 +482,13 @@ class IPacketHandler {
482482
{}
483483
virtual HPRetCode handlePacket(Packet* packet, void* args) = 0;
484484

485-
protected:
485+
protected:
486486
IPacketStreamer* client_streamer;
487487
easy_io_handler_pt client_handler;
488488
};
489489

490490
class PacketQueue {
491-
public:
491+
public:
492492
PacketQueue(easy_message_t* pm)
493493
{
494494
m = pm;
@@ -502,7 +502,7 @@ class PacketQueue {
502502

503503
class Connection {
504504

505-
public:
505+
public:
506506
Connection()
507507
{}
508508
Connection(easy_connection_t* c, easy_request_t* r)
@@ -565,14 +565,14 @@ class Connection {
565565
return htons(((addr.addr >> 32) & 0xffff));
566566
}
567567

568-
protected:
568+
protected:
569569
easy_addr_t addr;
570570
easy_connection_t* c;
571571
easy_request_t* r;
572572
};
573573

574574
class IServerAdapter {
575-
public:
575+
public:
576576
IServerAdapter()
577577
{
578578
memset(&server_handler, 0, sizeof(easy_io_handler_pt));
@@ -646,14 +646,14 @@ class IServerAdapter {
646646
return false;
647647
}
648648

649-
protected:
649+
protected:
650650
IPacketStreamer* server_streamer;
651651
easy_io_handler_pt server_handler;
652652
};
653653

654654
class DefaultPacketStreamer : public IPacketStreamer {
655655

656-
public:
656+
public:
657657
DefaultPacketStreamer()
658658
{}
659659

@@ -673,7 +673,7 @@ class DefaultPacketStreamer : public IPacketStreamer {
673673

674674
class Transport {
675675

676-
public:
676+
public:
677677
Transport()
678678
{
679679
_eio = easy_eio_create(NULL, 1);
@@ -742,19 +742,19 @@ class Transport {
742742
return _eio;
743743
}
744744

745-
private:
745+
private:
746746
easy_io_t* _eio;
747747
};
748748

749749
class IPacketQueueHandler {
750-
public:
750+
public:
751751
virtual ~IPacketQueueHandler()
752752
{}
753753
virtual bool handlePacketQueue(Packet* packet, void* args) = 0;
754754
};
755755

756756
class PacketQueueThread {
757-
public:
757+
public:
758758
PacketQueueThread()
759759
{
760760
_threadPool = NULL;
@@ -794,13 +794,13 @@ class PacketQueueThread {
794794
return easy_thread_pool_push_message(_threadPool, queue.m, (int64_t)(long)queue.m);
795795
}
796796

797-
private:
797+
private:
798798
IPacketQueueHandler* _handler;
799799
easy_thread_pool_t* _threadPool;
800800
};
801801

802802
class ConnectionManager {
803-
public:
803+
public:
804804
ConnectionManager(Transport* transport, IPacketStreamer* streamer, IPacketHandler* packetHandler)
805805
{
806806
_transport = transport;
@@ -871,7 +871,7 @@ class ConnectionManager {
871871
return true;
872872
}
873873

874-
private:
874+
private:
875875
Transport* _transport;
876876
IPacketHandler* _packetHandler;
877877
easy_client_t* _cl;

deps/oblib/src/common/cell/ob_cell_reader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
namespace oceanbase {
1919
namespace common {
2020
class ObCellReader {
21-
public:
21+
public:
2222
ObCellReader();
2323
virtual ~ObCellReader()
2424
{}
@@ -38,7 +38,7 @@ class ObCellReader {
3838
}
3939
int read_cell(common::ObObj& obj);
4040

41-
private:
41+
private:
4242
inline int read_oracle_timestamp(
4343
const ObObjType obj_type, const uint8_t meta_attr, const ObOTimestampMetaAttrType otmat, ObObj& obj);
4444
int read_interval_ds(ObObj& obj);
@@ -49,7 +49,7 @@ class ObCellReader {
4949
int read(const T*& ptr);
5050
inline int is_es_end_object(const common::ObObj& obj, bool& is_end_obj);
5151

52-
private:
52+
private:
5353
const char* buf_;
5454
int64_t buf_size_;
5555
int64_t pos_;

deps/oblib/src/common/cell/ob_cell_writer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum ObCompactStoreType {
3636
const uint8_t TEXT_CELL_META_VERSION = 1;
3737

3838
class ObCellWriter {
39-
public:
39+
public:
4040
struct CellMeta {
4141
static const uint64_t SF_BIT_TYPE = 6;
4242
static const uint64_t SF_BIT_ATTR = 2;
@@ -66,7 +66,7 @@ class ObCellWriter {
6666
EV_LOCK_ROW = 5
6767
};
6868

69-
public:
69+
public:
7070
ObCellWriter();
7171
virtual ~ObCellWriter()
7272
{}
@@ -111,7 +111,7 @@ class ObCellWriter {
111111
return true;
112112
}
113113

114-
private:
114+
private:
115115
template <class T>
116116
int append(const T& value);
117117
inline int write_int(const ObObj& obj, const enum common::ObObjType meta_type, const int64_t value);
@@ -133,7 +133,7 @@ class ObCellWriter {
133133
return old_text_format_;
134134
}
135135

136-
private:
136+
private:
137137
char* buf_;
138138
int64_t buf_size_;
139139
int64_t pos_;

deps/oblib/src/common/data_buffer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace oceanbase {
2222
namespace common {
2323
class ObDataBuffer : public ObIAllocator {
24-
public:
24+
public:
2525
ObDataBuffer() : data_(NULL), capacity_(0), position_(0), limit_(0)
2626
{}
2727

@@ -138,7 +138,7 @@ class ObDataBuffer : public ObIAllocator {
138138

139139
OB_UNIS_VERSION(1);
140140

141-
protected:
141+
protected:
142142
char* data_;
143143
int64_t capacity_;
144144
int64_t position_;

deps/oblib/src/common/log/ob_direct_log_reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
namespace oceanbase {
1919
namespace common {
2020
class ObDirectLogReader : public ObSingleLogReader {
21-
public:
21+
public:
2222
ObDirectLogReader();
2323
virtual ~ObDirectLogReader();
2424

deps/oblib/src/common/log/ob_log_cursor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ struct ObLogCursor {
4444

4545
ObLogCursor& set_cursor(ObLogCursor& cursor, const int64_t file_id, const int64_t log_id, const int64_t offset);
4646
class ObAtomicLogCursor {
47-
public:
47+
public:
4848
ObAtomicLogCursor()
4949
{}
5050
~ObAtomicLogCursor()
5151
{}
5252
int get_cursor(ObLogCursor& cursor) const;
5353
int set_cursor(ObLogCursor& cursor);
5454

55-
private:
55+
private:
5656
ObLogCursor log_cursor_;
5757
mutable common::SpinRWLock cursor_lock_;
5858
};

deps/oblib/src/common/log/ob_log_data_writer.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace common {
2222
int myfallocate(int fd, int mode, off_t offset, off_t len);
2323

2424
class MinAvailFileIdGetter {
25-
public:
25+
public:
2626
MinAvailFileIdGetter()
2727
{}
2828
virtual ~MinAvailFileIdGetter()
@@ -31,27 +31,27 @@ class MinAvailFileIdGetter {
3131
};
3232

3333
class ObLogDataWriter {
34-
public:
34+
public:
3535
static const int OPEN_FLAG = O_WRONLY | O_DIRECT;
3636
static const int OPEN_MODE = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
3737
static const int CREATE_FLAG = OPEN_FLAG | O_CREAT;
3838
class AppendBuffer {
39-
public:
39+
public:
4040
static const int64_t DEFAULT_BUF_SIZE = 1 << 22;
4141
AppendBuffer();
4242
~AppendBuffer();
4343
int write(const char* buf, int64_t len, int64_t pos);
4444
int flush(int fd);
4545
void destroy();
4646

47-
private:
47+
private:
4848
int64_t file_pos_;
4949
char* buf_;
5050
int64_t buf_end_;
5151
int64_t buf_limit_;
5252
};
5353

54-
public:
54+
public:
5555
ObLogDataWriter();
5656
~ObLogDataWriter();
5757
int init(const char* log_dir, const int64_t file_size, const int64_t du_percent, const int64_t log_sync_type,
@@ -67,13 +67,13 @@ class ObLogDataWriter {
6767
}
6868
int64_t to_string(char* buf, const int64_t len) const;
6969

70-
protected:
70+
protected:
7171
int check_eof_after_log_cursor(const ObLogCursor& cursor);
7272
int prepare_fd(const int64_t file_id);
7373
int reuse(const char* pool_file, const char* fname);
7474
const char* select_pool_file(char* fname, const int64_t limit);
7575

76-
private:
76+
private:
7777
AppendBuffer write_buffer_;
7878
const char* log_dir_;
7979
int64_t file_size_;

0 commit comments

Comments
 (0)