Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: sync/syncable/syncable_columns.h

Issue 809073005: replace COMPILE_ASSERT with static_assert in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sync/syncable/nigori_util.cc ('k') | sync/syncable/syncable_enum_conversions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_ 5 #ifndef SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_
6 #define SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_ 6 #define SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_
7 7
8 #include "sync/syncable/entry_kernel.h" 8 #include "sync/syncable/entry_kernel.h"
9 #include "sync/syncable/syncable_changes_version.h" 9 #include "sync/syncable/syncable_changes_version.h"
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // AttachmentMetadata is a proto that contains all the metadata associated 65 // AttachmentMetadata is a proto that contains all the metadata associated
66 // with an entry's attachments. Each entry has only one AttachmentMetadata 66 // with an entry's attachments. Each entry has only one AttachmentMetadata
67 // proto. We store a single proto per entry (as opposed to one for each 67 // proto. We store a single proto per entry (as opposed to one for each
68 // attachment) because it simplifies the database schema and implementation of 68 // attachment) because it simplifies the database schema and implementation of
69 // DirectoryBackingStore. 69 // DirectoryBackingStore.
70 {"attachment_metadata", "blob"}, 70 {"attachment_metadata", "blob"},
71 {"server_attachment_metadata", "blob"} 71 {"server_attachment_metadata", "blob"}
72 }; 72 };
73 73
74 // At least enforce that there are equal number of column names and fields. 74 // At least enforce that there are equal number of column names and fields.
75 COMPILE_ASSERT(arraysize(g_metas_columns) >= FIELD_COUNT, missing_column_name); 75 static_assert(arraysize(g_metas_columns) >= FIELD_COUNT, "missing column name");
76 COMPILE_ASSERT(arraysize(g_metas_columns) <= FIELD_COUNT, extra_column_names); 76 static_assert(arraysize(g_metas_columns) <= FIELD_COUNT, "extra column names");
77 77
78 static inline const char* ColumnName(int field) { 78 static inline const char* ColumnName(int field) {
79 DCHECK(field < BEGIN_TEMPS); 79 DCHECK(field < BEGIN_TEMPS);
80 return g_metas_columns[field].name; 80 return g_metas_columns[field].name;
81 } 81 }
82 82
83 } // namespace syncable 83 } // namespace syncable
84 } // namespace syncer 84 } // namespace syncer
85 85
86 #endif // SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_ 86 #endif // SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_
OLDNEW
« no previous file with comments | « sync/syncable/nigori_util.cc ('k') | sync/syncable/syncable_enum_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698