Skip to content

Commit

Permalink
apply clang-format to fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjoon-hyun committed Dec 9, 2023
1 parent 494259c commit 5f38535
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 253 deletions.
62 changes: 31 additions & 31 deletions c++/src/Adaptor.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#cmakedefine HAS_BUILTIN_OVERFLOW_CHECK
#cmakedefine NEEDS_Z_PREFIX

#include "orc/orc-config.hh"
#include <string>
#include "orc/orc-config.hh"

#ifdef _MSC_VER
#include <BaseTsd.h>
Expand All @@ -42,62 +42,62 @@ typedef SSIZE_T ssize_t;
#endif

#ifndef HAS_STRPTIME
char* strptime(const char* buf, const char* format, struct tm* tm);
char* strptime(const char* buf, const char* format, struct tm* tm);
#endif

#ifndef HAS_PREAD
ssize_t pread(int fd, void* buf, size_t count, off_t offset);
ssize_t pread(int fd, void* buf, size_t count, off_t offset);
#endif

#ifdef HAS_DIAGNOSTIC_PUSH
#ifdef __clang__
#define DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
#define DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
#elif defined(__GNUC__)
#define DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
#define DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
#elif defined(_MSC_VER)
#define DIAGNOSTIC_PUSH __pragma(warning(push))
#define DIAGNOSTIC_POP __pragma(warning(pop))
#else
#error("Unknown compiler")
#endif
#ifdef __clang__
#define DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
#define DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
#elif defined(__GNUC__)
#define DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
#define DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
#elif defined(_MSC_VER)
#define DIAGNOSTIC_PUSH __pragma(warning(push))
#define DIAGNOSTIC_POP __pragma(warning(pop))
#else
#error("Unknown compiler")
#endif
#else
#define DIAGNOSTIC_PUSH
#define DIAGNOSTIC_POP
#define DIAGNOSTIC_PUSH
#define DIAGNOSTIC_POP
#endif

#define PRAGMA(TXT) _Pragma(#TXT)

#ifdef __clang__
#define DIAGNOSTIC_IGNORE(XXX) PRAGMA(clang diagnostic ignored XXX)
#define DIAGNOSTIC_IGNORE(XXX) PRAGMA(clang diagnostic ignored XXX)
#elif defined(__GNUC__)
#define DIAGNOSTIC_IGNORE(XXX) PRAGMA(GCC diagnostic ignored XXX)
#define DIAGNOSTIC_IGNORE(XXX) PRAGMA(GCC diagnostic ignored XXX)
#elif defined(_MSC_VER)
#define DIAGNOSTIC_IGNORE(XXX) __pragma(warning(disable : XXX))
#define DIAGNOSTIC_IGNORE(XXX) __pragma(warning(disable : XXX))
#else
#define DIAGNOSTIC_IGNORE(XXX)
#define DIAGNOSTIC_IGNORE(XXX)
#endif

#ifndef UINT32_MAX
#define UINT32_MAX 0xffffffff
#define UINT32_MAX 0xffffffff
#endif

#ifndef INT64_MAX
#define INT64_MAX 0x7fffffffffffffff
#define INT64_MAX 0x7fffffffffffffff
#endif

#ifndef INT64_MIN
#define INT64_MIN (-0x7fffffffffffffff - 1)
#define INT64_MIN (-0x7fffffffffffffff - 1)
#endif

#define GTEST_LANG_CXX11 0

#ifndef HAS_STD_ISNAN
#include <math.h>
#define std::isnan(XXX) isnan(XXX)
#include <math.h>
#define std ::isnan(XXX) isnan(XXX)
#else
#include <cmath>
#include <cmath>
#endif

#include <mutex>
Expand All @@ -109,11 +109,11 @@ typedef SSIZE_T ssize_t;
namespace orc {
std::string to_string(double val);
std::string to_string(int64_t val);
}
} // namespace orc

#ifdef HAS_BUILTIN_OVERFLOW_CHECK
#define multiplyExact !__builtin_mul_overflow
#define addExact !__builtin_add_overflow
#define multiplyExact !__builtin_mul_overflow
#define addExact !__builtin_add_overflow
#else
namespace orc {
/**
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace orc {
*result = r;
return true;
}
}
} // namespace orc
#endif

#endif /* ADAPTER_HH */
Loading

0 comments on commit 5f38535

Please sign in to comment.