Skip to content

Commit

Permalink
ARROW-7896: [C++] Refactor from #include guards to #pragma once
Browse files Browse the repository at this point in the history
Closes #6680 from bkietz/7896-Refactor-from-include-gua

Authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
bkietz authored and kou committed Mar 22, 2020
1 parent 0569da4 commit d542482
Show file tree
Hide file tree
Showing 216 changed files with 221 additions and 813 deletions.
5 changes: 1 addition & 4 deletions cpp/src/arrow/adapters/orc/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_ORC_CONVERTER_H
#define ARROW_ORC_CONVERTER_H
#pragma once

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -148,5 +147,3 @@ class ARROW_EXPORT ORCFileReader {
} // namespace adapters

} // namespace arrow

#endif // ARROW_ORC_CONVERTER_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/adapters/tensorflow/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_TENSORFLOW_CONVERTER_H
#define ARROW_TENSORFLOW_CONVERTER_H
#pragma once

#include <memory>

Expand Down Expand Up @@ -154,5 +153,3 @@ Status GetTensorFlowType(std::shared_ptr<DataType> dtype, ::tensorflow::DataType
} // namespace adapters

} // namespace arrow

#endif // ARROW_TENSORFLOW_CONVERTER_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

// Coarse public API while the library is in development

#ifndef ARROW_API_H
#define ARROW_API_H
#pragma once

#include "arrow/array.h" // IYWU pragma: export
#include "arrow/array/concatenate.h" // IYWU pragma: export
Expand All @@ -41,5 +40,3 @@

/// \brief Top-level namespace for Apache Arrow C++ API
namespace arrow {}

#endif // ARROW_API_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/buffer_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_BUFFER_BUILDER_H
#define ARROW_BUFFER_BUILDER_H
#pragma once

#include <algorithm>
#include <cstdint>
Expand Down Expand Up @@ -389,5 +388,3 @@ class TypedBufferBuilder<bool> {
};

} // namespace arrow

#endif // ARROW_BUFFER_BUILDER_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/compare.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

// Functions for comparing Arrow data structures

#ifndef ARROW_COMPARE_H
#define ARROW_COMPARE_H
#pragma once

#include <cstdint>
#include <iosfwd>
Expand Down Expand Up @@ -113,5 +112,3 @@ bool ARROW_EXPORT TypeEquals(const DataType& left, const DataType& right,
bool ARROW_EXPORT ScalarEquals(const Scalar& left, const Scalar& right);

} // namespace arrow

#endif // ARROW_COMPARE_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/compute/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_COMPUTE_API_H
#define ARROW_COMPUTE_API_H
#pragma once

#include "arrow/compute/context.h" // IWYU pragma: export
#include "arrow/compute/kernel.h" // IWYU pragma: export
Expand All @@ -33,5 +32,3 @@
#include "arrow/compute/kernels/sort_to_indices.h" // IWYU pragma: export
#include "arrow/compute/kernels/sum.h" // IWYU pragma: export
#include "arrow/compute/kernels/take.h" // IWYU pragma: export

#endif // ARROW_COMPUTE_API_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/compute/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_COMPUTE_CONTEXT_H
#define ARROW_COMPUTE_CONTEXT_H
#pragma once

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -78,5 +77,3 @@ class ARROW_EXPORT FunctionContext {

} // namespace compute
} // namespace arrow

#endif // ARROW_COMPUTE_CONTEXT_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/compute/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_COMPUTE_KERNEL_H
#define ARROW_COMPUTE_KERNEL_H
#pragma once

#include <memory>
#include <utility>
Expand Down Expand Up @@ -286,5 +285,3 @@ static inline bool CollectionEquals(const std::vector<Datum>& left,

} // namespace compute
} // namespace arrow

#endif // ARROW_COMPUTE_KERNEL_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/compute/kernels/boolean.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_COMPUTE_KERNELS_BOOLEAN_H
#define ARROW_COMPUTE_KERNELS_BOOLEAN_H
#pragma once

#include "arrow/status.h"
#include "arrow/util/visibility.h"
Expand Down Expand Up @@ -104,5 +103,3 @@ Status Xor(FunctionContext* context, const Datum& left, const Datum& right, Datu

} // namespace compute
} // namespace arrow

#endif // ARROW_COMPUTE_KERNELS_CAST_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/compute/kernels/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_COMPUTE_KERNELS_HASH_H
#define ARROW_COMPUTE_KERNELS_HASH_H
#pragma once

#include <memory>

Expand Down Expand Up @@ -101,5 +100,3 @@ Status DictionaryEncode(FunctionContext* context, const Datum& data, Datum* out)

} // namespace compute
} // namespace arrow

#endif // ARROW_COMPUTE_KERNELS_HASH_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/compute/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_COMPUTE_TEST_UTIL_H
#define ARROW_COMPUTE_TEST_UTIL_H
#pragma once

#include <memory>
#include <vector>
Expand Down Expand Up @@ -104,5 +103,3 @@ struct DatumEqual<Type, enable_if_integer<Type>> {

} // namespace compute
} // namespace arrow

#endif
5 changes: 1 addition & 4 deletions cpp/src/arrow/csv/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_CSV_API_H
#define ARROW_CSV_API_H
#pragma once

#include "arrow/csv/options.h"
#include "arrow/csv/reader.h"

#endif // ARROW_CSV_API_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/csv/chunker.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_CSV_CHUNKER_H
#define ARROW_CSV_CHUNKER_H
#pragma once

#include <cstdint>
#include <memory>
Expand All @@ -35,5 +34,3 @@ std::unique_ptr<Chunker> MakeChunker(const ParseOptions& options);

} // namespace csv
} // namespace arrow

#endif // ARROW_CSV_CHUNKER_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/csv/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_CSV_OPTIONS_H
#define ARROW_CSV_OPTIONS_H
#pragma once

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -131,5 +130,3 @@ struct ARROW_EXPORT ReadOptions {

} // namespace csv
} // namespace arrow

#endif // ARROW_CSV_OPTIONS_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/filesystem/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_FILESYSTEM_API_H
#define ARROW_FILESYSTEM_API_H
#pragma once

#include "arrow/filesystem/filesystem.h" // IWYU pragma: export
#include "arrow/filesystem/hdfs.h" // IWYU pragma: export
#include "arrow/filesystem/localfs.h" // IWYU pragma: export
#include "arrow/filesystem/mockfs.h" // IWYU pragma: export
#include "arrow/filesystem/s3fs.h" // IWYU pragma: export

#endif // ARROW_FILESYSTEM_API_H
2 changes: 2 additions & 0 deletions cpp/src/arrow/flight/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.

#pragma once

#include <cstdint>
#include <memory>
#include <string>
Expand Down
5 changes: 1 addition & 4 deletions cpp/src/arrow/gpu/cuda_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_GPU_CUDA_API_H
#define ARROW_GPU_CUDA_API_H
#pragma once

#include "arrow/gpu/cuda_arrow_ipc.h"
#include "arrow/gpu/cuda_context.h"
#include "arrow/gpu/cuda_memory.h"
#include "arrow/gpu/cuda_version.h"

#endif // ARROW_GPU_CUDA_API_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/gpu/cuda_arrow_ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_GPU_CUDA_ARROW_IPC_H
#define ARROW_GPU_CUDA_ARROW_IPC_H
#pragma once

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -100,5 +99,3 @@ Status ReadRecordBatch(const std::shared_ptr<Schema>& schema,

} // namespace cuda
} // namespace arrow

#endif // ARROW_GPU_CUDA_ARROW_IPC_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/io/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_IO_API_H
#define ARROW_IO_API_H
#pragma once

#include "arrow/io/buffered.h"
#include "arrow/io/compressed.h"
#include "arrow/io/file.h"
#include "arrow/io/hdfs.h"
#include "arrow/io/interfaces.h"
#include "arrow/io/memory.h"

#endif // ARROW_IO_API_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/io/buffered.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

// Buffered stream implementations

#ifndef ARROW_IO_BUFFERED_H
#define ARROW_IO_BUFFERED_H
#pragma once

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -177,5 +176,3 @@ class ARROW_EXPORT BufferedInputStream

} // namespace io
} // namespace arrow

#endif // ARROW_IO_BUFFERED_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/io/compressed.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

// Compressed stream implementations

#ifndef ARROW_IO_COMPRESSED_H
#define ARROW_IO_COMPRESSED_H
#pragma once

#include <memory>
#include <string>
Expand Down Expand Up @@ -130,5 +129,3 @@ class ARROW_EXPORT CompressedInputStream

} // namespace io
} // namespace arrow

#endif // ARROW_IO_COMPRESSED_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/io/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

// IO interface implementations for OS files

#ifndef ARROW_IO_FILE_H
#define ARROW_IO_FILE_H
#pragma once

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -253,5 +252,3 @@ class ARROW_EXPORT MemoryMappedFile : public ReadWriteFileInterface {

} // namespace io
} // namespace arrow

#endif // ARROW_IO_FILE_H
5 changes: 1 addition & 4 deletions cpp/src/arrow/io/hdfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_IO_HDFS
#define ARROW_IO_HDFS
#pragma once

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -256,5 +255,3 @@ Status ARROW_EXPORT HaveLibHdfs();

} // namespace io
} // namespace arrow

#endif // ARROW_IO_HDFS
5 changes: 1 addition & 4 deletions cpp/src/arrow/io/hdfs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_IO_HDFS_INTERNAL
#define ARROW_IO_HDFS_INTERNAL
#pragma once

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -221,5 +220,3 @@ Status ARROW_EXPORT ConnectLibHdfs(LibHdfsShim** driver);
} // namespace internal
} // namespace io
} // namespace arrow

#endif // ARROW_IO_HDFS_INTERNAL
5 changes: 1 addition & 4 deletions cpp/src/arrow/io/test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#ifndef ARROW_IO_TEST_COMMON_H
#define ARROW_IO_TEST_COMMON_H
#pragma once

#include <memory>
#include <string>
Expand Down Expand Up @@ -57,5 +56,3 @@ class ARROW_EXPORT MemoryMapFixture {

} // namespace io
} // namespace arrow

#endif // ARROW_IO_TEST_COMMON_H
Loading

0 comments on commit d542482

Please sign in to comment.