Skip to content

Commit

Permalink
exclude generated header from clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jul 20, 2023
1 parent 7a27407 commit 68406a3
Show file tree
Hide file tree
Showing 12 changed files with 293 additions and 298 deletions.
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ repos:
- id: clang-format
args: [-i]
types_or: [c, c++]
exclude: "(^dist/)|(^extensions/nanoarrow_ipc/thirdparty/.*$)|(nanoarrow_ipc_flatcc_generated.h)"
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
Expand All @@ -56,5 +57,3 @@ repos:
- id: isort
types_or: [python]
exclude: "__init__.py$"

exclude: "(^dist/flatcc.*$)|(^extensions/nanoarrow_ipc/thirdparty/.*$)"
2 changes: 1 addition & 1 deletion dist/flatcc/flatcc_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern "C" {
* `FLATCC_NO_ASSERT`.
*/

#ifdef FLATCC_NO_ASSERT
#ifdef FLATCC_NO_ASSERT
/* NOTE: This will not affect inclusion of <assert.h> for static assertions. */
#undef FLATCC_ASSERT
#define FLATCC_ASSERT(x) ((void)0)
Expand Down
1 change: 0 additions & 1 deletion dist/flatcc/flatcc_epilogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
#endif

#include "flatcc/portable/pdiagnostic_pop.h"

4 changes: 2 additions & 2 deletions dist/flatcc/portable/paligned_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extern "C" {
#if defined (__MINGW32__)
/* MingW does not provide aligned_alloc despite defining _ISOC11_SOURCE */
#define PORTABLE_C11_ALIGNED_ALLOC 0
#elif defined (_ISOC11_SOURCE)
#elif defined (_ISOC11_SOURCE)
/* glibc aligned_alloc detection, but MingW is not truthful */
#define PORTABLE_C11_ALIGNED_ALLOC 1
#elif defined (__GLIBC__)
Expand Down Expand Up @@ -178,7 +178,7 @@ static inline void *__portable_aligned_alloc(size_t alignment, size_t size)
static inline void __portable_aligned_free(void *p)
{
char *raw;

if (p) {
raw = (char*)((void **)p)[-1];
free(raw);
Expand Down
1 change: 0 additions & 1 deletion dist/flatcc/portable/pdiagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@
#pragma clang diagnostic ignored "-Wc++11-extensions"
#endif
#endif

2 changes: 1 addition & 1 deletion dist/flatcc/portable/punaligned.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" {
#include <stdint.h>
#endif

#if PORTABLE_UNALIGNED_ACCESS
#if PORTABLE_UNALIGNED_ACCESS

#define unaligned_read_16(p) (*(uint16_t*)(p))
#define unaligned_read_32(p) (*(uint32_t*)(p))
Expand Down
568 changes: 284 additions & 284 deletions extensions/nanoarrow_ipc/src/nanoarrow/nanoarrow_ipc_flatcc_generated.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern "C" {
* `FLATCC_NO_ASSERT`.
*/

#ifdef FLATCC_NO_ASSERT
#ifdef FLATCC_NO_ASSERT
/* NOTE: This will not affect inclusion of <assert.h> for static assertions. */
#undef FLATCC_ASSERT
#define FLATCC_ASSERT(x) ((void)0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
#endif

#include "flatcc/portable/pdiagnostic_pop.h"

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extern "C" {
#if defined (__MINGW32__)
/* MingW does not provide aligned_alloc despite defining _ISOC11_SOURCE */
#define PORTABLE_C11_ALIGNED_ALLOC 0
#elif defined (_ISOC11_SOURCE)
#elif defined (_ISOC11_SOURCE)
/* glibc aligned_alloc detection, but MingW is not truthful */
#define PORTABLE_C11_ALIGNED_ALLOC 1
#elif defined (__GLIBC__)
Expand Down Expand Up @@ -178,7 +178,7 @@ static inline void *__portable_aligned_alloc(size_t alignment, size_t size)
static inline void __portable_aligned_free(void *p)
{
char *raw;

if (p) {
raw = (char*)((void **)p)[-1];
free(raw);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@
#pragma clang diagnostic ignored "-Wc++11-extensions"
#endif
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" {
#include <stdint.h>
#endif

#if PORTABLE_UNALIGNED_ACCESS
#if PORTABLE_UNALIGNED_ACCESS

#define unaligned_read_16(p) (*(uint16_t*)(p))
#define unaligned_read_32(p) (*(uint32_t*)(p))
Expand Down

0 comments on commit 68406a3

Please sign in to comment.