Skip to content

Commit ebca1af

Browse files
committed
ARROW-1452: [C++] Make macros in arrow/util/macros.h more unique
This fixes a bug encounted in third party use: https://github.com/mapd/mapd-core/blob/master/QueryEngine/ResultSet.h#L37 cc @asuhan Author: Wes McKinney <wes.mckinney@twosigma.com> Closes apache#1030 from wesm/ARROW-1452 and squashes the following commits: ab7611c [Wes McKinney] Disallow copy and assign in ArrayBuilder 2a4db73 [Wes McKinney] Remove DISALLOW_COPY_AND_ASSIGN from some abstract classes. Revert MANUALLY_ALIGNED_STRUCT 39f10d6 [Wes McKinney] Remove UNLIKELY, LIKELY macros as they may conflict with thirdparty projects, consolidate compiler-util.h with macros.h 994f5bf [Wes McKinney] Add unique prefix to DISALLOW_COPY_AND_ASSIGN c3121df [Wes McKinney] Rename UNUSED to ARROW_UNUSED
1 parent 1a8dafb commit ebca1af

21 files changed

Lines changed: 62 additions & 84 deletions

cpp/src/arrow/array.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,6 @@ class ARROW_EXPORT Array {
254254
}
255255
data_ = data;
256256
}
257-
258-
private:
259-
DISALLOW_COPY_AND_ASSIGN(Array);
260257
};
261258

262259
static inline std::ostream& operator<<(std::ostream& os, const Array& x) {

cpp/src/arrow/buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ARROW_EXPORT Buffer {
9797
std::shared_ptr<Buffer> parent_;
9898

9999
private:
100-
DISALLOW_COPY_AND_ASSIGN(Buffer);
100+
ARROW_DISALLOW_COPY_AND_ASSIGN(Buffer);
101101
};
102102

103103
/// \brief Create Buffer referencing std::string memory

cpp/src/arrow/builder.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,8 @@ Status DictionaryBuilder<T>::Append(const Scalar& value) {
793793
hash_slots_[j] = index;
794794
RETURN_NOT_OK(AppendDictionary(value));
795795

796-
if (UNLIKELY(static_cast<int32_t>(dict_builder_.length()) >
797-
hash_table_size_ * kMaxHashTableLoad)) {
796+
if (ARROW_PREDICT_FALSE(static_cast<int32_t>(dict_builder_.length()) >
797+
hash_table_size_ * kMaxHashTableLoad)) {
798798
RETURN_NOT_OK(DoubleTableSize());
799799
}
800800
}

cpp/src/arrow/builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class ARROW_EXPORT ArrayBuilder {
156156
void UnsafeSetNotNull(int64_t length);
157157

158158
private:
159-
DISALLOW_COPY_AND_ASSIGN(ArrayBuilder);
159+
ARROW_DISALLOW_COPY_AND_ASSIGN(ArrayBuilder);
160160
};
161161

162162
class ARROW_EXPORT NullBuilder : public ArrayBuilder {

cpp/src/arrow/compare.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class RangeEqualsVisitor {
261261
}
262262

263263
Status Visit(const NullArray& left) {
264-
UNUSED(left);
264+
ARROW_UNUSED(left);
265265
result_ = true;
266266
return Status::OK();
267267
}

cpp/src/arrow/io/hdfs.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class ARROW_EXPORT HadoopFileSystem : public FileSystem {
169169
std::unique_ptr<HadoopFileSystemImpl> impl_;
170170

171171
HadoopFileSystem();
172-
DISALLOW_COPY_AND_ASSIGN(HadoopFileSystem);
172+
ARROW_DISALLOW_COPY_AND_ASSIGN(HadoopFileSystem);
173173
};
174174

175175
#ifndef ARROW_NO_DEPRECATED_API
@@ -211,7 +211,7 @@ class ARROW_EXPORT HdfsReadableFile : public RandomAccessFile {
211211

212212
friend class HadoopFileSystem::HadoopFileSystemImpl;
213213

214-
DISALLOW_COPY_AND_ASSIGN(HdfsReadableFile);
214+
ARROW_DISALLOW_COPY_AND_ASSIGN(HdfsReadableFile);
215215
};
216216

217217
// Naming this file OutputStream because it does not support seeking (like the
@@ -238,7 +238,7 @@ class ARROW_EXPORT HdfsOutputStream : public OutputStream {
238238

239239
HdfsOutputStream();
240240

241-
DISALLOW_COPY_AND_ASSIGN(HdfsOutputStream);
241+
ARROW_DISALLOW_COPY_AND_ASSIGN(HdfsOutputStream);
242242
};
243243

244244
Status ARROW_EXPORT HaveLibHdfs();

cpp/src/arrow/io/interfaces.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ class ARROW_EXPORT FileInterface {
7979
FileInterface() {}
8080
FileMode::type mode_;
8181
void set_mode(FileMode::type mode) { mode_ = mode; }
82-
83-
private:
84-
DISALLOW_COPY_AND_ASSIGN(FileInterface);
8582
};
8683

8784
class ARROW_EXPORT Seekable {

cpp/src/arrow/ipc/dictionary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ARROW_EXPORT DictionaryMemo {
6868
// Map of dictionary id to dictionary array
6969
DictionaryMap id_to_dictionary_;
7070

71-
DISALLOW_COPY_AND_ASSIGN(DictionaryMemo);
71+
ARROW_DISALLOW_COPY_AND_ASSIGN(DictionaryMemo);
7272
};
7373

7474
} // namespace ipc

cpp/src/arrow/ipc/message.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class ARROW_EXPORT Message {
117117
class MessageImpl;
118118
std::unique_ptr<MessageImpl> impl_;
119119

120-
DISALLOW_COPY_AND_ASSIGN(Message);
120+
ARROW_DISALLOW_COPY_AND_ASSIGN(Message);
121121
};
122122

123123
ARROW_EXPORT std::string FormatMessageType(Message::Type type);

cpp/src/arrow/python/arrow_to_pandas.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class PandasBlock {
260260
int64_t* placement_data_;
261261

262262
private:
263-
DISALLOW_COPY_AND_ASSIGN(PandasBlock);
263+
ARROW_DISALLOW_COPY_AND_ASSIGN(PandasBlock);
264264
};
265265

266266
template <typename T>

0 commit comments

Comments
 (0)