diff --git a/ci-scripts/osx/travis-build.sh b/ci-scripts/osx/travis-build.sh index 2180945..f8bab6b 100644 --- a/ci-scripts/osx/travis-build.sh +++ b/ci-scripts/osx/travis-build.sh @@ -1,4 +1,8 @@ #!/bin/bash +pushd toonz/sources +clang-format --version +git ls-files | egrep \\.\(c\|cpp\|h\|hpp\)$ | xargs clang-format -i && git diff --exit-code || exit 1 +popd pushd thirdparty/tiff-4.0.3 ./configure && make popd diff --git a/ci-scripts/osx/travis-install.sh b/ci-scripts/osx/travis-install.sh index 9f84239..5a2358d 100644 --- a/ci-scripts/osx/travis-install.sh +++ b/ci-scripts/osx/travis-install.sh @@ -1,3 +1,5 @@ #!/bin/bash brew update brew install qt55 glew lz4 lzo libusb +brew tap tcr/tcr +brew install clang-format diff --git a/toonz/sources/beautification.bat b/toonz/sources/beautification.bat deleted file mode 100644 index 46134aa..0000000 --- a/toonz/sources/beautification.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off - -for /R %%F in (*.cpp;*.hpp;*.c;*.h) do ( - clang-format -i "%%F" -) diff --git a/toonz/sources/beautification.sh b/toonz/sources/beautification.sh old mode 100644 new mode 100755 index 1d6939b..b689385 --- a/toonz/sources/beautification.sh +++ b/toonz/sources/beautification.sh @@ -1,2 +1,2 @@ #!/bin/sh -git ls-files | egrep \\.\(c\|cpp\|h\|hpp\)$ | xargs clang-format -i +git diff master --name-only | egrep \\.\(c\|cpp\|h\|hpp\)$ | xargs clang-format -i diff --git a/toonz/sources/common/trop/tblur.cpp b/toonz/sources/common/trop/tblur.cpp index 3361194..d3a21c9 100644 --- a/toonz/sources/common/trop/tblur.cpp +++ b/toonz/sources/common/trop/tblur.cpp @@ -799,7 +799,7 @@ void doBlurRgb(TRasterPT &dstRas, TRasterPT &srcRas, double blur, int dx, r1->lock(); fbuffer = (BlurPixel

*)r1->getRawData(); // new CASM_FPIXEL [llx *ly]; row1 = new T[llx + 2 * brad]; - col1 = new BlurPixel

[lly + 2 * brad]; + col1 = new BlurPixel

[ lly + 2 * brad ]; col2 = new T[lly]; } diff --git a/toonz/sources/common/twain/twain.h b/toonz/sources/common/twain/twain.h index fc05afc..c7dee17 100644 --- a/toonz/sources/common/twain/twain.h +++ b/toonz/sources/common/twain/twain.h @@ -1483,23 +1483,15 @@ typedef struct { 0x0203 /* TW_UINT32 handle to WAV, (AIFF Mac) Added 1.8 */ /* misplaced */ -#define DAT_ICCPROFILE \ - 0x0401 /* TW_MEMORY Added 1.91 This Data Argument is misplaced but \ \ \ \ - \ \ - belongs to the DG_IMAGE Data Group */ -#define DAT_IMAGEMEMFILEXFER \ - 0x0402 /* TW_IMAGEMEMXFER Added 1.91 This Data Argument is misplaced but \ - \ \ - \ \ \ - \ \ \ \ - \ \ \ \ \ - belongs to the DG_IMAGE Data Group */ -#define DAT_ENTRYPOINT \ - 0x0403 /* TW_ENTRYPOINT Added 2.0 This Data Argument is misplaced but \ \ - \ \ - \ \ \ - \ \ \ \ - belongs to the DG_CONTROL Data Group */ +/* TW_MEMORY Added 1.91 This Data Argument is misplaced but belongs to the + * DG_IMAGE Data Group */ +#define DAT_ICCPROFILE 0x0401 +/* TW_IMAGEMEMXFER Added 1.91 This Data Argument is misplaced but belongs to + * the DG_IMAGE Data Group */ +#define DAT_IMAGEMEMFILEXFER 0x0402 +/* TW_ENTRYPOINT Added 2.0 This Data Argument is misplaced but belongs to + * the DG_CONTROL Data Group */ +#define DAT_ENTRYPOINT 0x0403 /**************************************************************************** * Messages * diff --git a/toonz/sources/include/tfx.h b/toonz/sources/include/tfx.h index fe2b81b..c26028b 100644 --- a/toonz/sources/include/tfx.h +++ b/toonz/sources/include/tfx.h @@ -539,7 +539,6 @@ inline std::string TFx::getFxType() const { return getDeclaration()->getId(); } //------------------------------------------------------------------- #define FX_DECLARATION(T) \ - \ public: \ const TPersistDeclaration *getDeclaration() const override; diff --git a/toonz/sources/include/tpersist.h b/toonz/sources/include/tpersist.h index c5b15b8..769c31c 100644 --- a/toonz/sources/include/tpersist.h +++ b/toonz/sources/include/tpersist.h @@ -142,10 +142,9 @@ public: class TPersistDeclarationT */ #define PERSIST_DECLARATION(T) \ - \ private: \ static TPersistDeclarationT m_declaration; \ - \ + \ public: \ const TPersistDeclaration *getDeclaration() const override { \ return &m_declaration; \ diff --git a/toonz/sources/include/trenderresourcemanager.h b/toonz/sources/include/trenderresourcemanager.h index 559274a..cbb6da7 100644 --- a/toonz/sources/include/trenderresourcemanager.h +++ b/toonz/sources/include/trenderresourcemanager.h @@ -132,11 +132,10 @@ static TRenderResourceManagerGenerator* gen(); */ #define T_RENDER_RESOURCE_MANAGER \ - \ public: \ static TRenderResourceManagerGenerator *gen(); \ static TRenderResourceManagerGenerator *deps(); \ - \ + \ private: //-------------------------------------------------------------------------------- diff --git a/toonz/sources/include/tsmartpointer.h b/toonz/sources/include/tsmartpointer.h index 2cebef1..7f14e23 100644 --- a/toonz/sources/include/tsmartpointer.h +++ b/toonz/sources/include/tsmartpointer.h @@ -87,10 +87,9 @@ private: }; #define DECLARE_CLASS_CODE \ - \ private: \ static const TSmartObject::ClassCode m_classCode; \ - \ + \ public: \ inline static TINT32 getInstanceCount() { \ return TSmartObject::getInstanceCount(m_classCode); \ diff --git a/toonz/sources/stdfx/stdfx.h b/toonz/sources/stdfx/stdfx.h index bd0cb0a..d32644d 100644 --- a/toonz/sources/stdfx/stdfx.h +++ b/toonz/sources/stdfx/stdfx.h @@ -15,7 +15,6 @@ class PaletteFilterFxRenderData; static const std::string PLUGIN_PREFIX("STD"); #define FX_PLUGIN_DECLARATION(T) \ - \ public: \ const TPersistDeclaration *getDeclaration() const override;