clang-format re-run

Re-run clang-format to pick up some missed changes over the past
few CLs. Also update the .clang-format file to break after ternary
operator.

Change-Id: Ia4ba4e58362c2dbe36aeb33894f0411af33ef17d
This commit is contained in:
Vignesh Venkatasubramanian 2015-06-04 16:48:48 -07:00
parent d6d04acdcc
commit 7affc5c3f8
5 changed files with 35 additions and 36 deletions

View File

@ -12,7 +12,7 @@ AllowShortFunctionsOnASingleLine: true
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80

View File

@ -328,7 +328,7 @@ bool Cues::AddCue(CuePoint* cue) {
return false;
CuePoint** const cues =
new (std::nothrow) CuePoint* [new_capacity]; // NOLINT
new (std::nothrow) CuePoint*[new_capacity]; // NOLINT
if (!cues)
return false;
@ -589,7 +589,7 @@ bool Track::AddContentEncoding() {
const uint32 count = content_encoding_entries_size_ + 1;
ContentEncoding** const content_encoding_entries =
new (std::nothrow) ContentEncoding* [count]; // NOLINT
new (std::nothrow) ContentEncoding*[count]; // NOLINT
if (!content_encoding_entries)
return false;
@ -1082,7 +1082,7 @@ bool Tracks::AddTrack(Track* track, int32 number) {
const uint32 count = track_entries_size_ + 1;
Track** const track_entries = new (std::nothrow) Track* [count]; // NOLINT
Track** const track_entries = new (std::nothrow) Track*[count]; // NOLINT
if (!track_entries)
return false;
@ -1539,9 +1539,7 @@ bool Cluster::Init(IMkvWriter* ptr_writer) {
return true;
}
bool Cluster::AddFrame(const Frame* const frame) {
return DoWriteFrame(frame);
}
bool Cluster::AddFrame(const Frame* const frame) { return DoWriteFrame(frame); }
bool Cluster::AddFrame(const uint8* data, uint64 length, uint64 track_number,
uint64 abs_timecode, bool is_key) {
@ -2711,7 +2709,7 @@ bool Segment::MakeNewCluster(uint64 frame_timestamp_ns) {
const int32 new_capacity =
(cluster_list_capacity_ <= 0) ? 1 : cluster_list_capacity_ * 2;
Cluster** const clusters =
new (std::nothrow) Cluster* [new_capacity]; // NOLINT
new (std::nothrow) Cluster*[new_capacity]; // NOLINT
if (!clusters)
return false;
@ -2848,7 +2846,8 @@ bool Segment::CheckHeaderInfo() {
void Segment::UpdateDocTypeVersion() {
for (uint32 index = 0; index < tracks_.track_entries_size(); ++index) {
const Track* track = tracks_.GetTrackByIndex(index);
if (track == NULL) break;
if (track == NULL)
break;
if ((track->codec_delay() || track->seek_pre_roll()) &&
doc_type_version_ < 4) {
doc_type_version_ = 4;
@ -2916,7 +2915,7 @@ bool Segment::QueueFrame(Frame* frame) {
if (new_capacity < 1)
return false;
Frame** const frames = new (std::nothrow) Frame* [new_capacity]; // NOLINT
Frame** const frames = new (std::nothrow) Frame*[new_capacity]; // NOLINT
if (!frames)
return false;

View File

@ -542,10 +542,10 @@ uint64 WriteFrame(IMkvWriter* writer, const Frame* const frame,
if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode)
return 0;
return frame->CanBeSimpleBlock()
? WriteSimpleBlock(writer, frame, relative_timecode)
: WriteBlock(writer, frame, relative_timecode,
cluster->timecode_scale());
return frame->CanBeSimpleBlock() ?
WriteSimpleBlock(writer, frame, relative_timecode) :
WriteBlock(writer, frame, relative_timecode,
cluster->timecode_scale());
}
uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) {

View File

@ -1236,7 +1236,7 @@ void Segment::AppendCluster(Cluster* pCluster) {
if (count >= size) {
const long n = (size <= 0) ? 2048 : 2 * size;
Cluster** const qq = new Cluster* [n];
Cluster** const qq = new Cluster*[n];
Cluster** q = qq;
Cluster** p = m_clusters;
@ -1290,7 +1290,7 @@ void Segment::PreloadCluster(Cluster* pCluster, ptrdiff_t idx) {
if (count >= size) {
const long n = (size <= 0) ? 2048 : 2 * size;
Cluster** const qq = new Cluster* [n];
Cluster** const qq = new Cluster*[n];
Cluster** q = qq;
Cluster** p = m_clusters;
@ -1788,7 +1788,7 @@ void Cues::PreloadCuePoint(long& cue_points_size, long long pos) const {
if (m_preload_count >= cue_points_size) {
const long n = (cue_points_size <= 0) ? 2048 : 2 * cue_points_size;
CuePoint** const qq = new CuePoint* [n];
CuePoint** const qq = new CuePoint*[n];
CuePoint** q = qq; // beginning of target
CuePoint** p = m_cue_points; // beginning of source
@ -2180,7 +2180,7 @@ bool CuePoint::Load(IMkvReader* pReader) {
const long long id = ReadUInt(pReader, pos, len);
if ((id < 0) || (pos + len > stop)) {
return false;
return false;
}
pos += len; // consume ID
@ -2192,7 +2192,7 @@ bool CuePoint::Load(IMkvReader* pReader) {
pos += len; // consume Size field
if ((pos + size) > stop) {
return false;
return false;
}
if (id == 0x33) // CueTime ID
@ -2250,7 +2250,7 @@ bool CuePoint::Load(IMkvReader* pReader) {
m_element_start = element_start;
m_element_size = element_size;
return true;
}
@ -3702,7 +3702,7 @@ ContentEncoding::~ContentEncoding() {
}
const ContentEncoding::ContentCompression*
ContentEncoding::GetCompressionByIndex(unsigned long idx) const {
ContentEncoding::GetCompressionByIndex(unsigned long idx) const {
const ptrdiff_t count = compression_entries_end_ - compression_entries_;
assert(count >= 0);
@ -3798,7 +3798,7 @@ long ContentEncoding::ParseContentEncodingEntry(long long start, long long size,
if (compression_count > 0) {
compression_entries_ =
new (std::nothrow) ContentCompression* [compression_count];
new (std::nothrow) ContentCompression*[compression_count];
if (!compression_entries_)
return -1;
compression_entries_end_ = compression_entries_;
@ -3806,7 +3806,7 @@ long ContentEncoding::ParseContentEncodingEntry(long long start, long long size,
if (encryption_count > 0) {
encryption_entries_ =
new (std::nothrow) ContentEncryption* [encryption_count];
new (std::nothrow) ContentEncryption*[encryption_count];
if (!encryption_entries_) {
delete[] compression_entries_;
return -1;
@ -3947,7 +3947,7 @@ long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
return E_FILE_FORMAT_INVALID;
} else if (id == 0x7E2) {
// ContentEncKeyID
delete[] encryption -> key_id;
delete[] encryption->key_id;
encryption->key_id = NULL;
encryption->key_id_len = 0;
@ -3971,7 +3971,7 @@ long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
encryption->key_id_len = buflen;
} else if (id == 0x7E3) {
// ContentSignature
delete[] encryption -> signature;
delete[] encryption->signature;
encryption->signature = NULL;
encryption->signature_len = 0;
@ -3995,7 +3995,7 @@ long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
encryption->signature_len = buflen;
} else if (id == 0x7E4) {
// ContentSigKeyID
delete[] encryption -> sig_key_id;
delete[] encryption->sig_key_id;
encryption->sig_key_id = NULL;
encryption->sig_key_id_len = 0;
@ -4520,7 +4520,7 @@ long Track::ParseContentEncodingsEntry(long long start, long long size) {
if (count <= 0)
return -1;
content_encoding_entries_ = new (std::nothrow) ContentEncoding* [count];
content_encoding_entries_ = new (std::nothrow) ContentEncoding*[count];
if (!content_encoding_entries_)
return -1;
@ -4615,22 +4615,22 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
if (height <= 0)
return E_FILE_FORMAT_INVALID;
} else if (id == 0x14B0) { // display width
} else if (id == 0x14B0) { // display width
display_width = UnserializeUInt(pReader, pos, size);
if (display_width <= 0)
return E_FILE_FORMAT_INVALID;
} else if (id == 0x14BA) { // display height
} else if (id == 0x14BA) { // display height
display_height = UnserializeUInt(pReader, pos, size);
if (display_height <= 0)
return E_FILE_FORMAT_INVALID;
} else if (id == 0x14B2) { // display unit
} else if (id == 0x14B2) { // display unit
display_unit = UnserializeUInt(pReader, pos, size);
if (display_unit < 0)
return E_FILE_FORMAT_INVALID;
} else if (id == 0x13B8) { // stereo mode
} else if (id == 0x13B8) { // stereo mode
stereo_mode = UnserializeUInt(pReader, pos, size);
if (stereo_mode < 0)
@ -4919,7 +4919,7 @@ long Tracks::Parse() {
if (count <= 0)
return 0; // success
m_trackEntries = new (std::nothrow) Track* [count];
m_trackEntries = new (std::nothrow) Track*[count];
if (m_trackEntries == NULL)
return -1;
@ -6376,7 +6376,7 @@ long Cluster::CreateBlock(long long id,
assert(m_entries_size == 0);
m_entries_size = 1024;
m_entries = new BlockEntry* [m_entries_size];
m_entries = new BlockEntry*[m_entries_size];
m_entries_count = 0;
} else {
@ -6387,7 +6387,7 @@ long Cluster::CreateBlock(long long id,
if (m_entries_count >= m_entries_size) {
const long entries_size = 2 * m_entries_size;
BlockEntry** const entries = new BlockEntry* [entries_size];
BlockEntry** const entries = new BlockEntry*[entries_size];
assert(entries);
BlockEntry** src = m_entries;

View File

@ -494,8 +494,8 @@ int main(int argc, char* argv[]) {
mkvmuxer::Frame muxer_frame;
if (!muxer_frame.Init(data, data_len))
return EXIT_FAILURE;
muxer_frame.set_track_number(
track_type == Track::kAudio ? aud_track : vid_track);
muxer_frame.set_track_number(track_type == Track::kAudio ? aud_track :
vid_track);
if (block->GetDiscardPadding())
muxer_frame.set_discard_padding(block->GetDiscardPadding());
muxer_frame.set_timestamp(time_ns);