OpenToonz - An open-source full-featured 2D animation creation software
C
Enable missing-declarations warning (#643)
Campbell Barton8c6c57f1b450
diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txtindex 3e2316ba7..3cb7ff3a3 100644--- a/toonz/sources/CMakeLists.txt+++ b/toonz/sources/CMakeLists.txt@@ -336,9 +336,11 @@ set(CXX_WARNINGS)if(CMAKE_COMPILER_IS_GNUCC)ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEF -Wundef)+ ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_DECLARATIONS -Wmissing-declarations)ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings)ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)+ ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)endif()diff --git a/toonz/sources/colorfx/regionstyles.cpp b/toonz/sources/colorfx/regionstyles.cppindex e4b904c3b..9a9d472b3 100644--- a/toonz/sources/colorfx/regionstyles.cpp+++ b/toonz/sources/colorfx/regionstyles.cpp@@ -661,7 +661,7 @@ double ShadowStyle2::getParamValue(TColorStyle::double_tag, int index) const {//------------------------------------------------------------------------------int nbDiffVerts(const std::vector<TPointD> &pv) {+static int nbDiffVerts(const std::vector<TPointD> &pv) {std::vector<TPointD> lpv;bool isMissing[4] = {true, true, true, true};if (pv.size() == 0) return 0;diff --git a/toonz/sources/common/expressions/tgrammar.cpp b/toonz/sources/common/expressions/tgrammar.cppindex 818e201ed..9a21c8a80 100644--- a/toonz/sources/common/expressions/tgrammar.cpp+++ b/toonz/sources/common/expressions/tgrammar.cpp@@ -23,9 +23,9 @@#include "tgrammar.h"-const double PI = 4 * atan(1.0);-const double toDeg(double rad) { return rad * 180.0 / PI; }-const double toRad(double deg) { return deg / 180.0 * PI; }+static const double PI = 4 * atan(1.0);+static const double toDeg(double rad) { return rad * 180.0 / PI; }+static const double toRad(double deg) { return deg / 180.0 * PI; }namespace TSyntax {diff --git a/toonz/sources/common/psdlib/psd.cpp b/toonz/sources/common/psdlib/psd.cppindex 9ec24deda..aceb37b72 100644--- a/toonz/sources/common/psdlib/psd.cpp+++ b/toonz/sources/common/psdlib/psd.cpp@@ -41,7 +41,7 @@ void readKey(FILE *f, struct dictentry *parent, TPSDLayerInfo *li);void readLayer16(FILE *f, struct dictentry *parent, TPSDLayerInfo *li);//----end forward declarations-char swapByte(unsigned char src) {+static char swapByte(unsigned char src) {unsigned char out = 0;for (int i = 0; i < 8; ++i) {out = out << 1;diff --git a/toonz/sources/common/tapptools/tcli.cpp b/toonz/sources/common/tapptools/tcli.cppindex 22dab09be..652a9f867 100644--- a/toonz/sources/common/tapptools/tcli.cpp+++ b/toonz/sources/common/tapptools/tcli.cpp@@ -744,7 +744,7 @@ void RangeQualifier::fetch(int index, int &argc, char *argv[]) {}}-std::ostream &operator<<(std::ostream &out, const RangeQualifier &range) {+static std::ostream &operator<<(std::ostream &out, const RangeQualifier &range) {return out << "[" << range.getFrom() << ", " << range.getTo() << "]";}diff --git a/toonz/sources/common/tapptools/tcolorutils.cpp b/toonz/sources/common/tapptools/tcolorutils.cppindex 6b3e0e74a..71ed04ca1 100644--- a/toonz/sources/common/tapptools/tcolorutils.cpp+++ b/toonz/sources/common/tapptools/tcolorutils.cpp@@ -456,7 +456,7 @@ assert(areAlmostEqual(a*v*v*v+b*v*v+c*v+d, 0.0));//-------------------------------------------------------------------------------void clusterize(ClusterContainer &clusters, int clustersCount) {+static void clusterize(ClusterContainer &clusters, int clustersCount) {unsigned int clustersSize = clusters.size();assert(clustersSize >= 1);@@ -737,8 +737,8 @@ void Cluster::getMeanAxis(KEYER_FLOAT axis[3]) {//#define METODO_USATO_SU_TOONZ46-void buildPaletteForBlendedImages(std::set<TPixel32> &palette,- const TRaster32P &raster, int maxColorCount) {+static void buildPaletteForBlendedImages(std::set<TPixel32> &palette,+ const TRaster32P &raster, int maxColorCount) {int lx = raster->getLx();int ly = raster->getLy();diff --git a/toonz/sources/common/tcolor/tpixel.cpp b/toonz/sources/common/tcolor/tpixel.cppindex 30a97ded4..00a64fca7 100644--- a/toonz/sources/common/tcolor/tpixel.cpp+++ b/toonz/sources/common/tcolor/tpixel.cpp@@ -47,17 +47,17 @@ const TPixelGR8 TPixelGR8::Black(0);const TPixelGR16 TPixelGR16::White(maxChannelValue);const TPixelGR16 TPixelGR16::Black(0);-std::ostream &operator<<(std::ostream &out, const TPixel32 &pixel) {+static std::ostream &operator<<(std::ostream &out, const TPixel32 &pixel) {return out << "PixRGBM32(" << (int)pixel.r << ", " << (int)pixel.g << ", "<< (int)pixel.b << ", " << (int)pixel.m << ")";}-std::ostream &operator<<(std::ostream &out, const TPixel64 &pixel) {+static std::ostream &operator<<(std::ostream &out, const TPixel64 &pixel) {return out << "PixRGBM64(" << pixel.r << ", " << pixel.g << ", " << pixel.b<< ", " << pixel.m << ")";}-std::ostream &operator<<(std::ostream &out, const TPixelD &pixel) {+static std::ostream &operator<<(std::ostream &out, const TPixelD &pixel) {return out << "PixD(" << pixel.r << ", " << pixel.g << ", " << pixel.b << ", "<< pixel.m << ")";}diff --git a/toonz/sources/common/tcontenthistory.cpp b/toonz/sources/common/tcontenthistory.cppindex 6eada27f3..8f157fb26 100644--- a/toonz/sources/common/tcontenthistory.cpp+++ b/toonz/sources/common/tcontenthistory.cpp@@ -83,7 +83,7 @@ inline QString getStr(const TFrameId &id) {const QString Fmt = "dd MMM yy hh:mm";-QString getLine(int counter, const QDateTime &date,+static QString getLine(int counter, const QDateTime &date,const set<TFrameId> &frames) {static QString user;static QString machine;@@ -127,7 +127,7 @@ QString getLine(int counter, const QDateTime &date,//---------------------------------------------------------------------int getCurrentCount(const QString &str) {+static int getCurrentCount(const QString &str) {if (str == "") return 0;int from = str.lastIndexOf('#') + 1;diff --git a/toonz/sources/common/tiio/tiio_jpg.cpp b/toonz/sources/common/tiio/tiio_jpg.cppindex 991d5ff2b..c4991bf5f 100644--- a/toonz/sources/common/tiio/tiio_jpg.cpp+++ b/toonz/sources/common/tiio/tiio_jpg.cpp@@ -29,9 +29,11 @@ const std::string Tiio::JpgWriterProperties::QUALITY("Quality");//=========================================================-extern "C" void tnz_error_exit(j_common_ptr cinfo) {+extern "C" {+static void tnz_error_exit(j_common_ptr cinfo) {// throw "merda";}+}#ifdef CICCIOJMETHOD(void, error_exit, (j_common_ptr cinfo));diff --git a/toonz/sources/common/timage_io/timage_io.cpp b/toonz/sources/common/timage_io/timage_io.cppindex 4d8c849bf..613481723 100644--- a/toonz/sources/common/timage_io/timage_io.cpp+++ b/toonz/sources/common/timage_io/timage_io.cpp@@ -527,7 +527,7 @@ void TImageWriter::setProperties(const TPropertyGroup *g) {//------------------------------------------------------------void convertForWriting(TRasterP &ras, const TRasterP &rin, int bpp) {+static void convertForWriting(TRasterP &ras, const TRasterP &rin, int bpp) {switch (bpp) {case 1:case 8:diff --git a/toonz/sources/common/tmeshimage/tmeshimage.cpp b/toonz/sources/common/tmeshimage/tmeshimage.cppindex 2efc17321..a5cd6625f 100644--- a/toonz/sources/common/tmeshimage/tmeshimage.cpp+++ b/toonz/sources/common/tmeshimage/tmeshimage.cpp@@ -34,7 +34,7 @@ static TTextureMeshP cloneMesh_(const TTextureMeshP &other) {return TTextureMeshP(new TTextureMesh(*other));}-void static_check() {+static void static_check() {/* input iterator */static_assert(std::is_same<std::iterator_traits<diff --git a/toonz/sources/common/tparam/tdoubleparam.cpp b/toonz/sources/common/tparam/tdoubleparam.cppindex 556abc4de..646f6641e 100644--- a/toonz/sources/common/tparam/tdoubleparam.cpp+++ b/toonz/sources/common/tparam/tdoubleparam.cpp@@ -103,8 +103,8 @@ inline double getLinearValue(const TActualDoubleKeyframe &k0,//----------------------------------------------------------void truncateSpeeds(double aFrame, double bFrame, TPointD &aSpeedTrunc,- TPointD &bSpeedTrunc) {+static void truncateSpeeds(double aFrame, double bFrame, TPointD &aSpeedTrunc,+ TPointD &bSpeedTrunc) {double deltaX = bFrame - aFrame;if (aSpeedTrunc.x < 0) aSpeedTrunc.x = 0;if (bSpeedTrunc.x > 0) bSpeedTrunc.x = 0;diff --git a/toonz/sources/common/tparam/ttonecurveparam.cpp b/toonz/sources/common/tparam/ttonecurveparam.cppindex 24d95d3af..b2a91c246 100644--- a/toonz/sources/common/tparam/ttonecurveparam.cpp+++ b/toonz/sources/common/tparam/ttonecurveparam.cpp@@ -50,7 +50,7 @@ TToneCurveParam::TToneCurveParam() : TParam() {//----------------------------------------------------------TParamSetP getClonedParamSet(TParamSetP srcParamSet) {+static TParamSetP getClonedParamSet(TParamSetP srcParamSet) {TParamSetP dstParamSet = new TParamSet(srcParamSet->getName());int i;for (i = 0; i < srcParamSet->getParamCount(); i++) {diff --git a/toonz/sources/common/trop/quickput.cpp b/toonz/sources/common/trop/quickput.cppindex e90c3064c..92b3db601 100644--- a/toonz/sources/common/trop/quickput.cpp+++ b/toonz/sources/common/trop/quickput.cpp@@ -3,6 +3,7 @@#include "trop.h"#include "loop_macros.h"#include "tpixelutils.h"+#include "quickputP.h"#ifndef TNZCORE_LIGHT#include "tpalette.h"diff --git a/toonz/sources/common/trop/quickputP.h b/toonz/sources/common/trop/quickputP.hindex a0ce3e0e7..54d4414a2 100644--- a/toonz/sources/common/trop/quickputP.h+++ b/toonz/sources/common/trop/quickputP.h@@ -11,6 +11,11 @@ void quickPut(const TRasterP &dn, const TRasterP &up, const TAffine &aff,bool doPremultiply = false, bool whiteTransp = false,bool firstColumn = false, bool doRasterDarkenBlendedView = false);+void quickPut(const TRasterP &dn, const TRasterP &up, const TAffine &aff,+ TRop::ResampleFilterType filterType, const TPixel32 &colorScale,+ bool doPremultiply, bool whiteTransp, bool firstColumn,+ bool doRasterDarkenBlendedView);+void quickResample(const TRasterP &dn, const TRasterP &up, const TAffine &aff,TRop::ResampleFilterType filterType);diff --git a/toonz/sources/common/trop/tconvert.cpp b/toonz/sources/common/trop/tconvert.cppindex 83fe96ebf..413ae34d9 100644--- a/toonz/sources/common/trop/tconvert.cpp+++ b/toonz/sources/common/trop/tconvert.cpp@@ -11,7 +11,7 @@// Conversion functions//******************************************************************-void do_convert(const TRaster64P &dst, const TRaster32P &src) {+static void do_convert(const TRaster64P &dst, const TRaster32P &src) {assert(dst->getSize() == src->getSize());int lx = src->getLx();for (int y = 0; y < src->getLy(); y++) {@@ -29,7 +29,7 @@ void do_convert(const TRaster64P &dst, const TRaster32P &src) {//------------------------------------------------------------------------------void do_convert(const TRasterGR8P &dst, const TRaster32P &src) {+static void do_convert(const TRasterGR8P &dst, const TRaster32P &src) {assert(dst->getSize() == src->getSize());int lx = src->getLx();@@ -45,7 +45,7 @@ void do_convert(const TRasterGR8P &dst, const TRaster32P &src) {//------------------------------------------------------------------------------void do_convert(const TRasterGR16P &dst, const TRaster32P &src) {+static void do_convert(const TRasterGR16P &dst, const TRaster32P &src) {assert(dst->getSize() == src->getSize());int lx = src->getLx();@@ -62,7 +62,7 @@ void do_convert(const TRasterGR16P &dst, const TRaster32P &src) {//------------------------------------------------------------------------------void do_convert(const TRasterGR16P &dst, const TRaster64P &src) {+static void do_convert(const TRasterGR16P &dst, const TRaster64P &src) {assert(dst->getSize() == src->getSize());int lx = src->getLx();for (int y = 0; y < src->getLy(); y++) {@@ -79,7 +79,7 @@ void do_convert(const TRasterGR16P &dst, const TRaster64P &src) {//------------------------------------------------------------------------------void do_convert(const TRaster32P &dst, const TRasterGR8P &src) {+static void do_convert(const TRaster32P &dst, const TRasterGR8P &src) {assert(dst->getSize() == src->getSize());int lx = src->getLx();for (int y = 0; y < src->getLy(); y++) {@@ -150,7 +150,7 @@ inline void ditherConvert(TRaster64P inRas, TRaster32P outRas) {// Obsolete conversion functions//******************************************************************-void do_convert(const TRasterCM32P &dst, const TRasterGR8P &src) {+static void do_convert(const TRasterCM32P &dst, const TRasterGR8P &src) {assert(dst->getSize() == src->getSize());TPixelCM32 bg = TPixelCM32(0, 0, TPixelCM32::getMaxTone());@@ -169,7 +169,7 @@ void do_convert(const TRasterCM32P &dst, const TRasterGR8P &src) {//------------------------------------------------------------------------------void do_convert(const TRasterCM32P &dst, const TRaster32P &src) {+static void do_convert(const TRasterCM32P &dst, const TRaster32P &src) {assert(dst->getSize() == src->getSize());TPixelCM32 bg = TPixelCM32(0, 0, TPixelCM32::getMaxTone());@@ -220,7 +220,7 @@ void do_convert(const TRasterCM32P &dst, const TRaster32P &src) {//------------------------------------------------------------------------------void do_convert(const TRasterYUV422P &dst, const TRaster32P &src) {+static void do_convert(const TRasterYUV422P &dst, const TRaster32P &src) {assert(src->getLx() & 0);long y1, y2, u, v, u1, u2, v1, v2;TPixel32 *pix = (TPixel32 *)src->pixels();@@ -271,7 +271,7 @@ void do_convert(const TRasterYUV422P &dst, const TRaster32P &src) {//------------------------------------------------------------------------------void do_convert(const TRaster32P &dst, const TRasterYUV422P &src) {+static void do_convert(const TRaster32P &dst, const TRasterYUV422P &src) {int long r, g, b, y1, y2, u, v;TPixel32 *buf = dst->pixels();const UCHAR *in = src->getRawData();diff --git a/toonz/sources/common/trop/tdespeckle.cpp b/toonz/sources/common/trop/tdespeckle.cppindex d7d41ba5f..26c3704ff 100644--- a/toonz/sources/common/trop/tdespeckle.cpp+++ b/toonz/sources/common/trop/tdespeckle.cpp@@ -444,8 +444,8 @@ void doDespeckleGR(const TRasterPT<PIXEL> &ras, int sizeThreshold) {//-----------------------------------------------------void doDespeckleCM32(const TRasterPT<TPixelCM32> &ras, int sizeThreshold,- bool check) {+static void doDespeckleCM32(const TRasterPT<TPixelCM32> &ras, int sizeThreshold,+ bool check) {TRasterCM32P rasCM(ras);rasCM->lock();diff --git a/toonz/sources/common/trop/tover.cpp b/toonz/sources/common/trop/tover.cppindex d03825b5a..aa67fe14b 100644--- a/toonz/sources/common/trop/tover.cpp+++ b/toonz/sources/common/trop/tover.cpp@@ -250,7 +250,7 @@ void do_over(TRasterGR8P rout, const TRaster32P &rup) {//------------------------------------------------------------------------------void do_over(TRaster32P rout, const TRasterGR8P &rup, const TPixel32 &color) {+static void do_over(TRaster32P rout, const TRasterGR8P &rup, const TPixel32 &color) {assert(rout->getSize() == rup->getSize());for (int y = rout->getLy(); --y >= 0;) {TPixel32 *out_pix = rout->pixels(y);diff --git a/toonz/sources/common/trop/tropcm.cpp b/toonz/sources/common/trop/tropcm.cppindex 1e1a80366..fc7ac2d86 100644--- a/toonz/sources/common/trop/tropcm.cpp+++ b/toonz/sources/common/trop/tropcm.cpp@@ -212,8 +212,8 @@ paints[i] = TPixelFloat(paints2[i]);//------------------------------------------------------------------------------------------------void do_convert(const TTile &dst, const TTile &src, const TPaletteP palette,- bool transparencyCheck, bool applyFx) {+static void do_convert(const TTile &dst, const TTile &src, const TPaletteP palette,+ bool transparencyCheck, bool applyFx) {// assert(palette);// assert(_rasOut && _rasIn);// assert(rasOut->getSize() == rasIn->getSize());diff --git a/toonz/sources/common/tsound/tsound_sdl.cpp b/toonz/sources/common/tsound/tsound_sdl.cppindex 898c21897..9756b3f0e 100644--- a/toonz/sources/common/tsound/tsound_sdl.cpp+++ b/toonz/sources/common/tsound/tsound_sdl.cpp@@ -107,7 +107,7 @@ public:extern "C" {-void sdl_fill_audio(void *udata, Uint8 *stream, int len) {+static void sdl_fill_audio(void *udata, Uint8 *stream, int len) {TSoundOutputDeviceImp *_this = (TSoundOutputDeviceImp *)udata;MyData *myData = _this->m_data;diff --git a/toonz/sources/common/tunit/tunit.cpp b/toonz/sources/common/tunit/tunit.cppindex 22d8b990f..2d3820232 100644--- a/toonz/sources/common/tunit/tunit.cpp+++ b/toonz/sources/common/tunit/tunit.cpp@@ -24,7 +24,7 @@ double VerticalCameraFldUnitConverter::m_factor = 1;namespace UnitParameters {-std::pair<double, double> dummyCurrentDpiGetter() {+static std::pair<double, double> dummyCurrentDpiGetter() {return std::make_pair<double, double>(72, 72);}diff --git a/toonz/sources/common/tvectorimage/cornerdetector.cpp b/toonz/sources/common/tvectorimage/cornerdetector.cppindex a735bd8bd..65523695f 100644--- a/toonz/sources/common/tvectorimage/cornerdetector.cpp+++ b/toonz/sources/common/tvectorimage/cornerdetector.cpp@@ -1,6 +1,7 @@#include "tgeometry.h"+#include "cornerdetector.h"//======================================================================@@ -39,8 +40,8 @@ public:};//! Definisce l'operatore meno tra due AlgorithmPointI-AlgorithmPointI operator-(const AlgorithmPointI &op1,- const AlgorithmPointI &op2) {+static AlgorithmPointI operator-(const AlgorithmPointI &op1,+ const AlgorithmPointI &op2) {return AlgorithmPointI(op1.operator-(op2), 0);}@@ -75,7 +76,7 @@ point_container gPoints;\param points Vettore di T3DPoints*/-bool interpolate(const std::vector<T3DPointD> &points) {+static bool interpolate(const std::vector<T3DPointD> &points) {unsigned int curr, next;TPointI currStep, xStep, yStep, guideLine;@@ -193,7 +194,7 @@ inline bool isAdmissibleCorner(int currIndex, int precIndex, int nextIndex) {//----------------------------------------------------------------------//! Trova i possibili angoli tra i punti di gPoints-void findCornerCandidates() {+static void findCornerCandidates() {unsigned int curr, prec, next;curr = gMaxDist;@@ -229,7 +230,7 @@ void findCornerCandidates() {//----------------------------------------------------------------------//! Trova gli angoli tra i punti di gPoints-void findCorners(int neighborLimit, std::vector<int> &cornerIndexes) {+static void findCorners(int neighborLimit, std::vector<int> &cornerIndexes) {unsigned int curr, prec, next;curr = gMaxDist;diff --git a/toonz/sources/common/tvectorimage/cornerdetector.h b/toonz/sources/common/tvectorimage/cornerdetector.hnew file mode 100644index 000000000..6b2387920--- /dev/null+++ b/toonz/sources/common/tvectorimage/cornerdetector.h@@ -0,0 +1,10 @@+#pragma once++#ifndef CORNERDETECTOR_H+#define CORNERDETECTOR_H++void detectCorners(const std::vector<T3DPointD> &inputPoints, int minSampleNum,+ int minDist, int maxDist, double maxAngle,+ std::vector<int> &cornerIndexes);++#endif // CORNERDETECTOR_Hdiff --git a/toonz/sources/common/tvectorimage/outlineApproximation.cpp b/toonz/sources/common/tvectorimage/outlineApproximation.cppindex ee85208f4..2915c41fe 100644--- a/toonz/sources/common/tvectorimage/outlineApproximation.cpp+++ b/toonz/sources/common/tvectorimage/outlineApproximation.cpp@@ -537,8 +537,8 @@ void drawQuadratic(const TQuadratic &quad, double pixelSize) {//------------------------------------------------------------------------------void makeOutline(const TStroke *stroke, int startQuad, int endQuad,- outlineBoundary &ob, double error2) {+static void makeOutline(const TStroke *stroke, int startQuad, int endQuad,+ outlineBoundary &ob, double error2) {// std::ofstream cout("c:\\temp\\outline.txt");assert(stroke);@@ -628,7 +628,7 @@ void makeOutline(const TStroke *stroke, int startQuad, int endQuad,//------------------------------------------------------------------------------void drawOutline(const outlineBoundary &ob, double pixelSize) {+static void drawOutline(const outlineBoundary &ob, double pixelSize) {for (UINT i = 0; i < ob.size(); ++i) {drawQuadratic(*ob[i].first, pixelSize);drawQuadratic(*ob[i].second, pixelSize);diff --git a/toonz/sources/common/tvectorimage/tcomputeregions.cpp b/toonz/sources/common/tvectorimage/tcomputeregions.cppindex 39679d9b7..ceced0720 100644--- a/toonz/sources/common/tvectorimage/tcomputeregions.cpp+++ b/toonz/sources/common/tvectorimage/tcomputeregions.cpp@@ -14,6 +14,7 @@#include "tdebugmessage.h"#include "tthreadmessage.h"#include "tl2lautocloser.h"+#include "tcomputeregions.h"#include <vector>#include "tcurveutil.h"@@ -46,7 +47,7 @@ inline TThickPoint myRound(const TThickPoint &p) {return TThickPoint(myRound(p.x), myRound(p.y), p.thick);}-void roundStroke(TStroke *s) {+static void roundStroke(TStroke *s) {int size = s->getControlPointCount();for (int j = 0; j < (int)s->getControlPointCount(); j++) {@@ -411,13 +412,13 @@ void addIntersection(IntersectionData &intData, const vector<VIStroke *> &s,//------------------------------------------------------------------------------bool sortBBox(const TStroke *s1, const TStroke *s2) {+static bool sortBBox(const TStroke *s1, const TStroke *s2) {return s1->getBBox().x0 < s2->getBBox().x0;}//------------------------------------------------------------------------------void cleanIntersectionMarks(const VIList<Intersection> &interList) {+static void cleanIntersectionMarks(const VIList<Intersection> &interList) {Intersection *p;IntersectedStroke *q;for (p = interList.first(); p; p = p->next())@@ -435,7 +436,7 @@ void cleanIntersectionMarks(const VIList<Intersection> &interList) {//------------------------------------------------------------------------------void cleanNextIntersection(const VIList<Intersection> &interList, TStroke *s) {+static void cleanNextIntersection(const VIList<Intersection> &interList, TStroke *s) {Intersection *p;IntersectedStroke *q;@@ -903,7 +904,7 @@ void TVectorImage::Imp::eraseIntersection(int index) {}//------------------------------------------------------------------------------void findNearestIntersection(VIList<Intersection> &interList) {+static void findNearestIntersection(VIList<Intersection> &interList) {Intersection *p1;IntersectedStroke *p2;@@ -1026,7 +1027,7 @@ void markDeadIntersections(VIList<Intersection> &intList, Intersection *p) {// se cross val era 0, cerco di spostarmi un po' su w per vedere come sono// orientate le tangenti agli stroke...-double nearCrossVal(TStroke *s0, double w0, TStroke *s1, double w1) {+static double nearCrossVal(TStroke *s0, double w0, TStroke *s1, double w1) {double ltot0 = s0->getLength();double ltot1 = s1->getLength();double dl = std::min(ltot1, ltot0) / 1000;@@ -1066,7 +1067,7 @@ inline void insertBranch(Intersection &in, IntersectedStroke &item,//------------------------------------------------------------------------------double getAngle(const TPointD &p0, const TPointD &p1) {+static double getAngle(const TPointD &p0, const TPointD &p1) {double angle1 = atan2(p0.x, p0.y) * M_180_PI;double angle2 = atan2(p1.x, p1.y) * M_180_PI;@@ -1079,8 +1080,8 @@ double getAngle(const TPointD &p0, const TPointD &p1) {//-----------------------------------------------------------------------------// nel caso l'angolo tra due stroke in un certo w sia nullo,// si va un po' avanti per vedere come sono orientate....-double getNearAngle(const TStroke *s1, double w1, bool out1, const TStroke *s2,- double w2, bool out2) {+static double getNearAngle(const TStroke *s1, double w1, bool out1, const TStroke *s2,+ double w2, bool out2) {bool verse1 = (out1 && w1 < 1) || (!out1 && w1 == 0);bool verse2 = (out2 && w2 < 1) || (!out2 && w2 == 0);double ltot1 = s1->getLength();@@ -1105,10 +1106,10 @@ double getNearAngle(const TStroke *s1, double w1, bool out1, const TStroke *s2,//------------------------------------------------------------------------------bool makeEdgeIntersection(Intersection &interList, IntersectedStroke &item1,- IntersectedStroke &item2, const TPointD &p1a,- const TPointD &p1b, const TPointD &p2a,- const TPointD &p2b) {+static bool makeEdgeIntersection(Intersection &interList, IntersectedStroke &item1,+ IntersectedStroke &item2, const TPointD &p1a,+ const TPointD &p1b, const TPointD &p2a,+ const TPointD &p2b) {double angle1 = getAngle(p1a, p1b);double angle2 = getAngle(p1a, p2a);double angle3 = getAngle(p1a, p2b);@@ -1215,9 +1216,9 @@ bool makeEdgeIntersection(Intersection &interList, IntersectedStroke &item1,//------------------------------------------------------------------------------bool makeIntersection(IntersectionData &intData, const vector<VIStroke *> &s,- int ii, int jj, DoublePair inter, int strokeSize,- Intersection &interList) {+static bool makeIntersection(IntersectionData &intData, const vector<VIStroke *> &s,+ int ii, int jj, DoublePair inter, int strokeSize,+ Intersection &interList) {IntersectedStroke item1, item2;interList.m_intersection = s[ii]->m_s->getPoint(inter.first);@@ -1336,9 +1337,9 @@ areAlmostEqual(q->getP2(), p->getP0(), 1e-2))*///------------------------------------------------------------------------------bool addAutocloseIntersection(IntersectionData &intData, vector<VIStroke *> &s,- int ii, int jj, double w0, double w1,- int strokeSize, bool isVectorized) {+static bool addAutocloseIntersection(IntersectionData &intData, vector<VIStroke *> &s,+ int ii, int jj, double w0, double w1,+ int strokeSize, bool isVectorized) {assert(s[ii]->m_groupId == s[jj]->m_groupId);Intersection *rp = intData.m_intList.last();@@ -1418,8 +1419,8 @@ bool addAutocloseIntersection(IntersectionData &intData, vector<VIStroke *> &s,// double g_autocloseTolerance = c_newAutocloseTolerance;-bool isCloseEnoughP2P(double facMin, double facMax, TStroke *s1, double w0,- TStroke *s2, double w1) {+static bool isCloseEnoughP2P(double facMin, double facMax, TStroke *s1, double w0,+ TStroke *s2, double w1) {double autoDistMin, autoDistMax;TThickPoint p0 = s1->getThickPoint(w0);@@ -1495,9 +1496,9 @@ return false;*///------------------------------------------------------------------------------double getCurlW(TStroke *s, bool isBegin) // trova il punto di split su una- // stroke, in prossimita di un- // ricciolo;+static double getCurlW(TStroke *s, bool isBegin) // trova il punto di split su una+ // stroke, in prossimita di un+ // ricciolo;// un ricciolo c'e' se la curva ha un min o max relativo su x seguito da uno su// y, o viceversa.{@@ -1570,8 +1571,8 @@ return -1;#endif//------------------------------------------------------------------------------bool isCloseEnoughP2L(double facMin, double facMax, TStroke *s1, double w1,- TStroke *s2, double &w) {+static bool isCloseEnoughP2L(double facMin, double facMax, TStroke *s1, double w1,+ TStroke *s2, double &w) {if (s1->isSelfLoop()) return false;TThickPoint p0 = s1->getThickPoint(w1);@@ -1880,10 +1881,10 @@ void getClosingPoints(const TRectD &rect, double fac, const TVectorImageP &vi,//--------------------------------------------------------------------------------------------------------void autoclose(double factor, vector<VIStroke *> &s, int ii, int jj,- IntersectionData &IntData, int strokeSize,- TL2LAutocloser &l2lautocloser, vector<DoublePair> *intersections,- bool isVectorized) {+static void autoclose(double factor, vector<VIStroke *> &s, int ii, int jj,+ IntersectionData &IntData, int strokeSize,+ TL2LAutocloser &l2lautocloser, vector<DoublePair> *intersections,+ bool isVectorized) {vector<std::pair<double, double>> segments;getClosingSegments(l2lautocloser, 0, factor, s[ii]->m_s, s[jj]->m_s,intersections, segments);@@ -1938,9 +1939,9 @@ TPointD inline getTangent(const IntersectedStroke &item) {//------------------------------------------------------------------------------void addBranch(IntersectionData &intData, VIList<IntersectedStroke> &strokeList,- const vector<VIStroke *> &s, int ii, double w, int strokeSize,- bool gettingOut) {+static void addBranch(IntersectionData &intData, VIList<IntersectedStroke> &strokeList,+ const vector<VIStroke *> &s, int ii, double w, int strokeSize,+ bool gettingOut) {IntersectedStroke *p1, *p2;TPointD tanRef, lastTan;@@ -2055,9 +2056,9 @@ return;//------------------------------------------------------------------------------void addBranches(IntersectionData &intData, Intersection &intersection,- const vector<VIStroke *> &s, int ii, int jj,- DoublePair intersectionPair, int strokeSize) {+static void addBranches(IntersectionData &intData, Intersection &intersection,+ const vector<VIStroke *> &s, int ii, int jj,+ DoublePair intersectionPair, int strokeSize) {bool foundS1 = false, foundS2 = false;IntersectedStroke *p;@@ -2127,9 +2128,9 @@ IntersectedStroke app;//------------------------------------------------------------------------------void addIntersections(IntersectionData &intData, const vector<VIStroke *> &s,- int ii, int jj, vector<DoublePair> &intersections,- int strokeSize, bool isVectorized) {+static void addIntersections(IntersectionData &intData, const vector<VIStroke *> &s,+ int ii, int jj, vector<DoublePair> &intersections,+ int strokeSize, bool isVectorized) {for (int k = 0; k < (int)intersections.size(); k++) {if (ii >= strokeSize && (areAlmostEqual(intersections[k].first, 0.0) ||areAlmostEqual(intersections[k].first, 1.0)))@@ -2446,8 +2447,8 @@ if (tdistance2(p01, p11)< 2*0.06*0.06)//-----------------------------------------------------------------------------// Trova una possibile regione data una lista di punti di intersezione-TRegion *findRegion(VIList<Intersection> &intList, Intersection *p1,- IntersectedStroke *p2, bool minimizeEdges) {+static TRegion *findRegion(VIList<Intersection> &intList, Intersection *p1,+ IntersectedStroke *p2, bool minimizeEdges) {TRegion *r = new TRegion();int currStyle = 0;@@ -2662,7 +2663,7 @@ void computeRegionFeature(const TRegion &r, TRegionFeatureFormula &formula) {//-----------------------------------------------------------------------------------bool isValidArea(const TRegion &r) {+static bool isValidArea(const TRegion &r) {TRegionClockWiseFormula formula;computeRegionFeature(r, formula);return formula.isClockwise();@@ -2759,7 +2760,7 @@ void transferColors(const list<TEdge *> &oldList, const list<TEdge *> &newList,bool isStrokeChanged, bool isFlipped, bool overwriteColor);//------------------------------------------------------------------------------void printStrokes1(vector<VIStroke *> &v, int size) {+static void printStrokes1(vector<VIStroke *> &v, int size) {UINT i = 0;ofstream of("C:\\temp\\strokes.txt");diff --git a/toonz/sources/common/tvectorimage/tcomputeregions.h b/toonz/sources/common/tvectorimage/tcomputeregions.hnew file mode 100644index 000000000..17100df21--- /dev/null+++ b/toonz/sources/common/tvectorimage/tcomputeregions.h@@ -0,0 +1,9 @@++#pragma once++#ifndef T_COMPUTEREGIONS_H+#define T_COMPUTEREGIONS_H++void invalidateRegionPropAndBBox(TRegion *reg);++#endif // T_COMPUTEREGIONS_Hdiff --git a/toonz/sources/common/tvectorimage/tregion.cpp b/toonz/sources/common/tvectorimage/tregion.cppindex 3adcf9819..42592e501 100644--- a/toonz/sources/common/tvectorimage/tregion.cpp+++ b/toonz/sources/common/tvectorimage/tregion.cpp@@ -34,7 +34,7 @@ void foo()//=============================================================================-bool compareEdge(const TEdge &a, const TEdge &b) { return a.m_s == b.m_s; }+static bool compareEdge(const TEdge &a, const TEdge &b) { return a.m_s == b.m_s; }//-----------------------------------------------------------------------------@@ -527,7 +527,7 @@ void TRegion::draw(const TVectorRenderData &rd)//------------------------------------------------------------------------------void checkPolyline(const std::vector<T3DPointD> &p) {+static void checkPolyline(const std::vector<T3DPointD> &p) {int ret;if (p.size() < 3) return;diff --git a/toonz/sources/common/tvectorimage/tstroke.cpp b/toonz/sources/common/tvectorimage/tstroke.cppindex 8f149d530..fb03365e4 100644--- a/toonz/sources/common/tvectorimage/tstroke.cpp+++ b/toonz/sources/common/tvectorimage/tstroke.cpp@@ -8,6 +8,7 @@#include "tbezier.h"#include "tzerofinder.h"#include "tcurveutil.h"+#include "cornerdetector.h"#include <limits>@@ -32,10 +33,6 @@ typedef std::vector<TThickQuadratic *> QuadStrokeChunkArray;static int numSaved = 0;-void detectCorners(const std::vector<T3DPointD> &points, int minSampleNum,- int minDist, int maxDist, double maxAngle,- std::vector<int> &corners);-namespace {//---------------------------------------------------------------------------diff --git a/toonz/sources/common/tvectorimage/tsweepboundary.cpp b/toonz/sources/common/tvectorimage/tsweepboundary.cppindex 3589de92d..315e0d885 100644--- a/toonz/sources/common/tvectorimage/tsweepboundary.cpp+++ b/toonz/sources/common/tvectorimage/tsweepboundary.cpp@@ -174,10 +174,10 @@ typedef list<TQuadratic> QuadraticList;//----------------------------------------------------------------------------void splitCircularArcIntoQuadraticCurves(const TPointD &Center,- const TPointD &Pstart,- const TPointD &Pend,- vector<TQuadratic *> &quadArray) {+static void splitCircularArcIntoQuadraticCurves(const TPointD &Center,+ const TPointD &Pstart,+ const TPointD &Pend,+ vector<TQuadratic *> &quadArray) {// It splits a circular anticlockwise arc into a sequence of quadratic bezier// curves// Every quadratic curve can approximate an arc no longer than 45 degrees (or@@ -365,7 +365,7 @@ inline void drawPointCross(const TPointD &point, double R, double G, double B) {//--------------------------------------------------------------------TStroke *getOutStroke(LinkedQuadraticList &inputBoundaries) {+static TStroke *getOutStroke(LinkedQuadraticList &inputBoundaries) {vector<TPointD> aux;LinkedQuadraticList::iterator it = inputBoundaries.begin();@@ -427,8 +427,8 @@ inline bool getOutputOutlines(LinkedQuadraticList &inputBoundaries,//--------------------------------------------------------------------bool computeBoundaryStroke(const TStroke &_stroke,- vector<TStroke *> &sweepStrokes) {+static bool computeBoundaryStroke(const TStroke &_stroke,+ vector<TStroke *> &sweepStrokes) {// if(!outlines.empty()) return false;TStroke *oriStroke = const_cast<TStroke *>(&_stroke);diff --git a/toonz/sources/common/tvectorimage/tvectorimage.cpp b/toonz/sources/common/tvectorimage/tvectorimage.cppindex bc14fa161..d8a587774 100644--- a/toonz/sources/common/tvectorimage/tvectorimage.cpp+++ b/toonz/sources/common/tvectorimage/tvectorimage.cpp@@ -14,6 +14,7 @@#include "tpaletteutil.h"#include "tthreadmessage.h"#include "tsimplecolorstyles.h"+#include "tcomputeregions.h"#include <memory>@@ -246,7 +247,7 @@ TRectD TVectorImage::addStroke(const std::vector<TThickPoint> &points)//------------------------------------------------------------------------------bool isRegionWithStroke(TRegion *region, TStroke *s) {+static bool isRegionWithStroke(TRegion *region, TStroke *s) {for (UINT i = 0; i < region->getEdgeCount(); i++)if (region->getEdge(i)->m_s == s) return true;return false;@@ -254,7 +255,7 @@ bool isRegionWithStroke(TRegion *region, TStroke *s) {//------------------------------------------------------------------------------void deleteSubRegionWithStroke(TRegion *region, TStroke *s) {+static void deleteSubRegionWithStroke(TRegion *region, TStroke *s) {for (int i = 0; i < (int)region->getSubregionCount(); i++) {deleteSubRegionWithStroke(region->getSubregion(i), s);if (isRegionWithStroke(region->getSubregion(i), s)) {@@ -1044,7 +1045,6 @@ bool TVectorImage::Imp::areWholeGroups(const std::vector<int> &indexes) const {//-----------------------------------------------------------------------------//--------------------------------------------------------------------void invalidateRegionPropAndBBox(TRegion *reg);void TVectorImage::Imp::notifyChangedStrokes(const std::vector<int> &strokeIndexArray,@@ -1938,9 +1938,9 @@ assert(m_strokes[strokeIndex-wSize+1]->m_edgeList.empty());*///------------------------------------------------------------------------------void computeEdgeList(TStroke *newS, const std::list<TEdge *> &edgeList1,- bool join1AtBegin, const std::list<TEdge *> &edgeList2,- bool join2AtBegin, std::list<TEdge *> &edgeList) {+static void computeEdgeList(TStroke *newS, const std::list<TEdge *> &edgeList1,+ bool join1AtBegin, const std::list<TEdge *> &edgeList2,+ bool join2AtBegin, std::list<TEdge *> &edgeList) {std::list<TEdge *>::const_iterator it;if (!edgeList1.empty()) {diff --git a/toonz/sources/common/tvectorimage/tvectorimageP.h b/toonz/sources/common/tvectorimage/tvectorimageP.hindex 19ce7184b..5a14c1508 100644--- a/toonz/sources/common/tvectorimage/tvectorimageP.h+++ b/toonz/sources/common/tvectorimage/tvectorimageP.h@@ -264,7 +264,14 @@ private:Imp &operator=(const Imp &);};+// Functions+void addRegion(std::vector<TRegion *> ®ionArray, TRegion *region);++void transferColors(const std::list<TEdge *> &oldList,+ const std::list<TEdge *> &newList, bool isStrokeChanged,+ bool isFlipped, bool overwriteColor);+//=============================================================================#endifdiff --git a/toonz/sources/common/tvrender/tcolorstyles.cpp b/toonz/sources/common/tvrender/tcolorstyles.cppindex 6c1813f15..3b18ce5e8 100644--- a/toonz/sources/common/tvrender/tcolorstyles.cpp+++ b/toonz/sources/common/tvrender/tcolorstyles.cpp@@ -451,8 +451,8 @@ void TColorStyle::declare(TColorStyle *style) {//===================================================================-double computeAverageThickness(const TStroke *s, double &minThickness,- double &maxThickness) {+static double computeAverageThickness(const TStroke *s, double &minThickness,+ double &maxThickness) {int count = s->getControlPointCount();minThickness = 1000;diff --git a/toonz/sources/common/tvrender/tflash.cpp b/toonz/sources/common/tvrender/tflash.cppindex 009e09a6c..32057515c 100644--- a/toonz/sources/common/tvrender/tflash.cpp+++ b/toonz/sources/common/tvrender/tflash.cpp@@ -32,13 +32,13 @@ TNZ_LITTLE_ENDIAN undefined !!int Tw = 0;-bool areTwEqual(double x, double y) {+static bool areTwEqual(double x, double y) {assert(Tw != 0);return (int)(Tw * x) == (int)(Tw * y);}-bool areTwEqual(TPointD p0, TPointD p1) {+static bool areTwEqual(TPointD p0, TPointD p1) {assert(Tw != 0);return areTwEqual(p0.x, p1.x) && areTwEqual(p0.y, p1.y);@@ -184,7 +184,7 @@ public:TImageP m_img;};-double computeAverageThickness(const TStroke *s) {+static double computeAverageThickness(const TStroke *s) {int count = s->getControlPointCount();double resThick = 0;int i;@@ -198,8 +198,8 @@ double computeAverageThickness(const TStroke *s) {return resThick / (s->getControlPointCount() - 4);}-void putquads(const TStroke *s, double w0, double w1,- std::vector<TQuadratic *> &quads) {+static void putquads(const TStroke *s, double w0, double w1,+ std::vector<TQuadratic *> &quads) {int chunkIndex0, chunkIndex1, i;double dummy;bool ret;@@ -216,9 +216,9 @@ void putquads(const TStroke *s, double w0, double w1,//--------------------------------------------------------------------void computeOutlineBoundary(std::vector<TStroke *> &outlines,- std::list<FlashPolyline> &polylinesArray,- const TPixel &color) {+static void computeOutlineBoundary(std::vector<TStroke *> &outlines,+ std::list<FlashPolyline> &polylinesArray,+ const TPixel &color) {UINT size = polylinesArray.size();std::vector<std::vector<TQuadratic *>> quads;@@ -273,7 +273,7 @@ bool PolyStyle::operator==(const PolyStyle &p) const {//--------------------------------------------------------------------bool affineMinorThen(const TAffine &m0, const TAffine &m1) {+static bool affineMinorThen(const TAffine &m0, const TAffine &m1) {if (m0.a11 == m1.a11) {if (m0.a12 == m1.a12) {if (m0.a13 == m1.a13) {@@ -323,8 +323,8 @@ bool PolyStyle::operator<(const PolyStyle &p) const {//--------------------------------------------------------------------void computeQuadChain(const TEdge &e, std::vector<TQuadratic *> &quadArray,- std::vector<TQuadratic *> &toBeDeleted) {+static void computeQuadChain(const TEdge &e, std::vector<TQuadratic *> &quadArray,+ std::vector<TQuadratic *> &toBeDeleted) {int chunk_b, chunk_e, chunk = -1;double t_b, t_e, w0, w1;TThickQuadratic *q_b = 0, *q_e = 0;diff --git a/toonz/sources/common/tvrender/tglregions.cpp b/toonz/sources/common/tvrender/tglregions.cppindex 8bf60047b..e489878ea 100644--- a/toonz/sources/common/tvrender/tglregions.cpp+++ b/toonz/sources/common/tvrender/tglregions.cpp@@ -436,7 +436,7 @@ void tglDraw(const TVectorRenderData &rd, const TStroke *s, bool pushAttribs) {//-------------------------------------------------------------------------------------void tglDoDraw(const TVectorRenderData &rd, TRegion *r) {+static void tglDoDraw(const TVectorRenderData &rd, TRegion *r) {bool visible = false;int colorCount = 0;if (!r) return;@@ -462,7 +462,7 @@ void tglDoDraw(const TVectorRenderData &rd, TRegion *r) {//-------------------------------------------------------------------------------------void tglDoDraw(const TVectorRenderData &rd, const TStroke *s) {+static void tglDoDraw(const TVectorRenderData &rd, const TStroke *s) {bool visible = false;int colorCount = 0;diff --git a/toonz/sources/common/tvrender/tinbetween.cpp b/toonz/sources/common/tvrender/tinbetween.cppindex a8faa5bbb..68b85514e 100644--- a/toonz/sources/common/tvrender/tinbetween.cpp+++ b/toonz/sources/common/tvrender/tinbetween.cpp@@ -18,7 +18,7 @@//#include "tdebugmessage.h"//---------------------------------------------------------------------------------------double average(std::vector<double> &values, double range = 2.5) {+static double average(std::vector<double> &values, double range = 2.5) {UINT size = values.size();if (size == 0) return std::numeric_limits<double>::signaling_NaN();@@ -56,8 +56,8 @@ double average(std::vector<double> &values, double range = 2.5) {//---------------------------------------------------------------------------------------double weightedAverage(std::vector<double> &values,- std::vector<double> &weights, double range = 2.5) {+static double weightedAverage(std::vector<double> &values,+ std::vector<double> &weights, double range = 2.5) {UINT size = values.size();if (size == 0) return std::numeric_limits<double>::signaling_NaN();@@ -162,8 +162,8 @@ n^r <= 2^(s-1) < (2^s)-1//---------------------------------------------------------------------------------------void eraseSmallAngles(std::vector<std::pair<int, double>> &corners,- double angle) {+static void eraseSmallAngles(std::vector<std::pair<int, double>> &corners,+ double angle) {std::vector<std::pair<int, double>>::iterator it = corners.begin();while (it != corners.end()) {@@ -180,9 +180,9 @@ void eraseSmallAngles(std::vector<std::pair<int, double>> &corners,// of the corners)// max is tha maximum angle greater or equal to minDegree-void detectCorners(const TStroke *stroke, double minDegree,- std::vector<std::pair<int, double>> &corners, double &min,- double &max) {+static void detectCorners(const TStroke *stroke, double minDegree,+ std::vector<std::pair<int, double>> &corners, double &min,+ double &max) {const double minSin = fabs(sin(minDegree * M_PI_180));double angle, vectorialProduct, metaCornerLen, partialLen;@@ -330,7 +330,7 @@ void detectCorners(const TStroke *stroke, double minDegree,//---------------------------------------------------------------------------------------double variance(std::vector<double> &values) {+static double variance(std::vector<double> &values) {UINT size = values.size();if (size == 0) return std::numeric_limits<double>::signaling_NaN();@@ -352,13 +352,13 @@ double variance(std::vector<double> &values) {//---------------------------------------------------------------------------------------void findBestSolution(const TStroke *stroke1, const TStroke *stroke2,- std::pair<int, double> *partialAngles1,- UINT partialAngles1Size,- const std::vector<std::pair<int, double>> &angles2,- UINT r,- std::list<std::pair<int, double>> &partialSolution,- double &bestValue, std::vector<int> &bestVector) {+static void findBestSolution(const TStroke *stroke1, const TStroke *stroke2,+ std::pair<int, double> *partialAngles1,+ UINT partialAngles1Size,+ const std::vector<std::pair<int, double>> &angles2,+ UINT r,+ std::list<std::pair<int, double>> &partialSolution,+ double &bestValue, std::vector<int> &bestVector) {//-------------------------------------------------------------------if (r == partialAngles1Size) {UINT j;@@ -499,10 +499,10 @@ TDebugMessage::flush();//---------------------------------------------------------------------------------------void findBestSolution(const TStroke *stroke1, const TStroke *stroke2,- std::vector<std::pair<int, double>> &angles1,- const std::vector<std::pair<int, double>> &angles2,- double &bestValue, std::vector<int> &bestVector) {+static void findBestSolution(const TStroke *stroke1, const TStroke *stroke2,+ std::vector<std::pair<int, double>> &angles1,+ const std::vector<std::pair<int, double>> &angles2,+ double &bestValue, std::vector<int> &bestVector) {assert(angles1.size() > angles2.size());std::list<std::pair<int, double>> partialSolution;@@ -513,10 +513,10 @@ void findBestSolution(const TStroke *stroke1, const TStroke *stroke2,//---------------------------------------------------------------------------------------void trivialSolution(const TStroke *stroke1, const TStroke *stroke2,- const std::vector<std::pair<int, double>> &angles1,- const std::vector<std::pair<int, double>> &angles2,- std::vector<int> &solution) {+static void trivialSolution(const TStroke *stroke1, const TStroke *stroke2,+ const std::vector<std::pair<int, double>> &angles1,+ const std::vector<std::pair<int, double>> &angles2,+ std::vector<int> &solution) {assert(angles1.size() > angles2.size());UINT j;@@ -578,7 +578,7 @@ void trivialSolution(const TStroke *stroke1, const TStroke *stroke2,//---------------------------------------------------------------------------------------TStroke *extract(const TStroke *source, UINT firstQuad, UINT lastQuad) {+static TStroke *extract(const TStroke *source, UINT firstQuad, UINT lastQuad) {UINT quadCount = source->getChunkCount();if (firstQuad >= quadCount) {assert(!"bad quadric index");@@ -607,8 +607,8 @@ TStroke *extract(const TStroke *source, UINT firstQuad, UINT lastQuad) {//---------------------------------------------------------------------------------------void sample(const TStroke *stroke, int samplingSize,- std::vector<TPointD> &sampledPoint) {+static void sample(const TStroke *stroke, int samplingSize,+ std::vector<TPointD> &sampledPoint) {double samplingFrequency = 1.0 / (double)samplingSize;sampledPoint.resize(samplingSize);diff --git a/toonz/sources/common/tvrender/tofflinegl.cpp b/toonz/sources/common/tvrender/tofflinegl.cppindex eaab4d92e..000e6df20 100644--- a/toonz/sources/common/tvrender/tofflinegl.cpp+++ b/toonz/sources/common/tvrender/tofflinegl.cpp@@ -485,7 +485,7 @@ Bool ret = glXMakeCurrent(m_dpy,int getLy() const { return m_raster->getLy(); }};-std::shared_ptr<TOfflineGL::Imp> defaultOfflineGLGenerator(+static std::shared_ptr<TOfflineGL::Imp> defaultOfflineGLGenerator(const TDimension &dim, std::shared_ptr<TOfflineGL::Imp> shared) {return std::make_shared<QtOfflineGL>(dim, shared);}diff --git a/toonz/sources/common/tvrender/tsimplecolorstyles.cpp b/toonz/sources/common/tvrender/tsimplecolorstyles.cppindex 42b794c56..bbff67c0e 100644--- a/toonz/sources/common/tvrender/tsimplecolorstyles.cpp+++ b/toonz/sources/common/tvrender/tsimplecolorstyles.cpp@@ -40,7 +40,7 @@ TFilePath TVectorImagePatternStrokeStyle::m_rootDir = TFilePath();//-----------------------------------------------------------------------------#ifndef NDEBUG-void checkGlError() {+static void checkGlError() {GLenum err = glGetError();assert(err != GL_INVALID_ENUM);assert(err != GL_INVALID_VALUE);diff --git a/toonz/sources/common/tvrender/ttessellator.cpp b/toonz/sources/common/tvrender/ttessellator.cppindex eed52855f..9dcafa731 100644--- a/toonz/sources/common/tvrender/ttessellator.cpp+++ b/toonz/sources/common/tvrender/ttessellator.cpp@@ -53,20 +53,23 @@ TglTessellator::GLTess::~GLTess() { gluDeleteTess(m_tess); }namespace {-extern "C" void CALLBACK tessellateTexture(const GLdouble *tex) {+extern "C" {+static void CALLBACK tessellateTexture(const GLdouble *tex) {double u = tex[0] * 0.01;double v = tex[1] * 0.01;glTexCoord2d(u, v);glVertex2dv(tex);}+}//-------------------------------------------------------------------TThread::Mutex CombineDataGuard;-std::list<GLdouble *> Combine_data;+static std::list<GLdouble *> Combine_data;-extern "C" void CALLBACK myCombine(GLdouble coords[3], GLdouble *d[4],+extern "C" {+static void CALLBACK myCombine(GLdouble coords[3], GLdouble *d[4],GLfloat w[4], GLdouble **dataOut) {GLdouble *newCoords = new GLdouble[3];@@ -76,6 +79,7 @@ extern "C" void CALLBACK myCombine(GLdouble coords[3], GLdouble *d[4],Combine_data.push_back(newCoords);*dataOut = newCoords;}+}//===================================================================diff --git a/toonz/sources/image/pli/pli_io.cpp b/toonz/sources/image/pli/pli_io.cppindex d6f97f8ad..b8c37a334 100644--- a/toonz/sources/image/pli/pli_io.cpp+++ b/toonz/sources/image/pli/pli_io.cpp@@ -67,7 +67,7 @@ inline double doubleFromUlong1(TUINT32 hi, TUINT32 lo) {/*=====================================================================*/-TThickPoint operator*(const TAffine &aff, const TThickPoint &p) {+static TThickPoint operator*(const TAffine &aff, const TThickPoint &p) {TPointD p1(p.x, p.y);return TThickPoint(aff * p1, p.thick);}diff --git a/toonz/sources/image/pli/tiio_pli.cpp b/toonz/sources/image/pli/tiio_pli.cppindex f0f51c733..16500670d 100644--- a/toonz/sources/image/pli/tiio_pli.cpp+++ b/toonz/sources/image/pli/tiio_pli.cpp@@ -277,7 +277,7 @@ TImageP TImageReaderPli::load() {//===========================================================================-void readRegionVersion4x(IntersectionDataTag *tag, TVectorImage *img) {+static void readRegionVersion4x(IntersectionDataTag *tag, TVectorImage *img) {#ifndef NEW_REGION_FILLimg->setFillData(tag->m_branchArray, tag->m_branchCount);#endif@@ -316,7 +316,7 @@ void createStroke(ThickQuadraticChainTag *quadTag, TVectorImage *outVectImage,//------------------------------------------------------------------------------void createGroup(GroupTag *groupTag, TVectorImage *vi, CreateStrokeData &data) {+static void createGroup(GroupTag *groupTag, TVectorImage *vi, CreateStrokeData &data) {int count = vi->getStrokeCount();for (int j = 0; j < groupTag->m_numObjects; j++) {if (groupTag->m_object[j]->m_type == PliTag::COLOR_NGOBJ)@@ -443,8 +443,8 @@ TImageWriterPli::TImageWriterPli(const TFilePath &f, const TFrameId &frameId,//------------------------------------------------------------------------------void putStroke(TStroke *stroke, int &currStyleId,- std::vector<PliObjectTag *> &tags) {+static void putStroke(TStroke *stroke, int &currStyleId,+ std::vector<PliObjectTag *> &tags) {double maxThickness = 0;assert(stroke);diff --git a/toonz/sources/image/pli/tiio_pli.h b/toonz/sources/image/pli/tiio_pli.hindex 2a35e6222..418e79112 100644--- a/toonz/sources/image/pli/tiio_pli.h+++ b/toonz/sources/image/pli/tiio_pli.h@@ -7,6 +7,7 @@#include "tlevel_io.h"+class GroupTag;class ParsedPli;class ImageTag;class TImageWriterPli;@@ -149,4 +150,9 @@ private:TLevelReaderPli *m_lrp;};+// Functions++TPalette *readPalette(GroupTag *paletteTag, int majorVersion,+ int minorVersion);+#endif // TTIO_PLI_INCLUDEDdiff --git a/toonz/sources/image/png/tiio_png.cpp b/toonz/sources/image/png/tiio_png.cppindex f330f8cd7..f824d5ddc 100644--- a/toonz/sources/image/png/tiio_png.cpp+++ b/toonz/sources/image/png/tiio_png.cpp@@ -20,9 +20,9 @@ using namespace std;extern "C" {-void tnz_abort(jmp_buf, int) {}+static void tnz_abort(jmp_buf, int) {}-void tnz_error_fun(png_structp pngPtr, png_const_charp error_message) {+static void tnz_error_fun(png_structp pngPtr, png_const_charp error_message) {*(int *)png_get_error_ptr(pngPtr) = 0;}}diff --git a/toonz/sources/image/sgi/filesgi.cpp b/toonz/sources/image/sgi/filesgi.cppindex 23e23b514..b045eb13b 100644--- a/toonz/sources/image/sgi/filesgi.cpp+++ b/toonz/sources/image/sgi/filesgi.cpp@@ -722,7 +722,7 @@ static TINT32 img_rle_compact(unsigned short *expbuf, int ibpp,/*-----------------------------------------------------------------------------*/-void iclose(IMAGERGB *image) {+static void iclose(IMAGERGB *image) {TINT32 tablesize;iflush(image);diff --git a/toonz/sources/image/svg/tiio_svg.cpp b/toonz/sources/image/svg/tiio_svg.cppindex 496051d27..21a344e7f 100644--- a/toonz/sources/image/svg/tiio_svg.cpp+++ b/toonz/sources/image/svg/tiio_svg.cpp@@ -1809,7 +1809,7 @@ TLevelWriterSvg::TLevelWriterSvg(const TFilePath &path, TPropertyGroup *winfo)//------------------------------------------------------------------------------void writeRegion(TRegion *r, TPalette *plt, QTextStream &out, double ly) {+static void writeRegion(TRegion *r, TPalette *plt, QTextStream &out, double ly) {if (r->getEdgeCount() == 0) return;std::vector<const TQuadratic *> quadsOutline;@@ -1872,8 +1872,8 @@ void writeRegion(TRegion *r, TPalette *plt, QTextStream &out, double ly) {//---------------------------------------------------------------------------------------void writeOutlineStroke(TStroke *s, TPalette *plt, QTextStream &out, double ly,- double quality) {+static void writeOutlineStroke(TStroke *s, TPalette *plt, QTextStream &out, double ly,+ double quality) {if (s->getChunkCount() == 0) return;if (s->getMaxThickness() == 0) return;@@ -1898,7 +1898,7 @@ void writeOutlineStroke(TStroke *s, TPalette *plt, QTextStream &out, double ly,//-----------------------------------------------------------double computeAverageThickness(const TStroke *s) {+static double computeAverageThickness(const TStroke *s) {int count = s->getControlPointCount();double resThick = 0;@@ -1914,8 +1914,8 @@ double computeAverageThickness(const TStroke *s) {//-----------------------------------------------------------------void writeCenterlineStroke(TStroke *s, TPalette *plt, QTextStream &out,- double ly) {+static void writeCenterlineStroke(TStroke *s, TPalette *plt, QTextStream &out,+ double ly) {if (s->getChunkCount() == 0) return;if (s->getMaxThickness() == 0) return;diff --git a/toonz/sources/image/tga/tiio_tga.cpp b/toonz/sources/image/tga/tiio_tga.cppindex d1f26474c..371189e99 100644--- a/toonz/sources/image/tga/tiio_tga.cpp+++ b/toonz/sources/image/tga/tiio_tga.cpp@@ -70,7 +70,7 @@ struct TgaHeader {//============================================================-void readTgaHeader(TgaHeader &header, FILE *chan) {+static void readTgaHeader(TgaHeader &header, FILE *chan) {header.IdentificationField = fgetc(chan);header.ColorMapType = fgetc(chan);header.ImageTypeCode = fgetc(chan);@@ -87,7 +87,7 @@ void readTgaHeader(TgaHeader &header, FILE *chan) {//-------------------------------------------------------------void writeTgaHeader(TgaHeader &header, FILE *chan) {+static void writeTgaHeader(TgaHeader &header, FILE *chan) {fputc(header.IdentificationField, chan);fputc(header.ColorMapType, chan);fputc(header.ImageTypeCode, chan);diff --git a/toonz/sources/image/tzl/tiio_tzl.cpp b/toonz/sources/image/tzl/tiio_tzl.cppindex 76efb069e..f64cfe52b 100644--- a/toonz/sources/image/tzl/tiio_tzl.cpp+++ b/toonz/sources/image/tzl/tiio_tzl.cpp@@ -42,15 +42,15 @@ char *reverse(char *buffer, int size) {}}-int tfwrite(const char *data, const unsigned int count, FILE *f) {+static int tfwrite(const char *data, const unsigned int count, FILE *f) {return fwrite(data, sizeof(char), count, f);}-int tfwrite(UCHAR *data, const unsigned int count, FILE *f) {+static int tfwrite(UCHAR *data, const unsigned int count, FILE *f) {return fwrite(data, sizeof(char), count, f);}-int tfwrite(TINT32 *data, const unsigned int count, FILE *f) {+static int tfwrite(TINT32 *data, const unsigned int count, FILE *f) {if (count == 1) {#if !TNZ_LITTLE_ENDIANTUINT32 dataToWrite = swapTINT32(*data);@@ -63,7 +63,7 @@ int tfwrite(TINT32 *data, const unsigned int count, FILE *f) {return 0;}-int tfwrite(TUINT32 *data, const unsigned int count, FILE *f) {+static int tfwrite(TUINT32 *data, const unsigned int count, FILE *f) {if (count == 1) {#if !TNZ_LITTLE_ENDIANTUINT32 dataToWrite = swapTINT32(*data);@@ -76,7 +76,7 @@ int tfwrite(TUINT32 *data, const unsigned int count, FILE *f) {return 0;}-int tfwrite(double *data, unsigned int count, FILE *f) {+static int tfwrite(double *data, unsigned int count, FILE *f) {if (count == 1) {double v = *data;char *ptr = (char *)&v;@@ -286,8 +286,8 @@ bool readHeaderAndOffsets(FILE *chan, TzlOffsetMap &frameOffsTable,}}-bool adjustIconAspectRatio(TDimension &outDimension, TDimension inDimension,- TDimension imageRes) {+static bool adjustIconAspectRatio(TDimension &outDimension, TDimension inDimension,+ TDimension imageRes) {TINT32 iconLx = inDimension.lx, iconLy = inDimension.ly;assert(iconLx > 0 && iconLy > 0);assert(imageRes.lx > 0 && imageRes.ly > 0);@@ -305,7 +305,7 @@ bool adjustIconAspectRatio(TDimension &outDimension, TDimension inDimension,return true;}-void getThumbnail(TRasterP ras, int shrink, TRasterP &thumbnail) {+static void getThumbnail(TRasterP ras, int shrink, TRasterP &thumbnail) {int j = 0;int y = 0;TPixel32 *pix2 = (TPixel32 *)thumbnail->getRawData();@@ -1995,8 +1995,8 @@ TImageP TImageReaderTzl::load13() {}// Restituisce la regione del raster shrinkata e la relativa savebox.-TRect applyShrinkAndRegion(TRasterP &ras, int shrink, TRect region,- TRect savebox) {+static TRect applyShrinkAndRegion(TRasterP &ras, int shrink, TRect region,+ TRect savebox) {// estraggo la regione solo se essa ha coordinate valide.if (!region.isEmpty() && region != TRect() && region.getLx() > 0 &®ion.getLy() > 0)diff --git a/toonz/sources/image/tzp/tiio_plt.cpp b/toonz/sources/image/tzp/tiio_plt.cppindex 49e983ed3..db0cd3610 100644--- a/toonz/sources/image/tzp/tiio_plt.cpp+++ b/toonz/sources/image/tzp/tiio_plt.cpp@@ -76,8 +76,8 @@ PltReader::~PltReader() { delete m_stripBuffer; }//-------------------------------------------------------------int decode_group_name(char group_name[], char **name, int *key,- int *sister_index) {+static int decode_group_name(char group_name[], char **name, int *key,+ int *sister_index) {char *s, *t;*key = 0;*sister_index = -1;diff --git a/toonz/sources/include/tdoubleparam.h b/toonz/sources/include/tdoubleparam.hindex 5fe50e523..f5412ca2f 100644--- a/toonz/sources/include/tdoubleparam.h+++ b/toonz/sources/include/tdoubleparam.h@@ -156,6 +156,10 @@ public:std::string getValueAlias(double frame, int precision) override;};+DV_IMPORT_API void splitSpeedInOutSegment(TDoubleKeyframe &k,+ TDoubleKeyframe &k0,+ TDoubleKeyframe &k1);+//---------------------------------------------------------DEFINE_PARAM_SMARTPOINTER(TDoubleParam, double)diff --git a/toonz/sources/include/tspectrum.h b/toonz/sources/include/tspectrum.hindex 65063d429..c41c44501 100644--- a/toonz/sources/include/tspectrum.h+++ b/toonz/sources/include/tspectrum.h@@ -172,6 +172,8 @@ updateTable(sampleCount);}};+DVAPI TSpectrumT<TPixel64> convert(const TSpectrumT<TPixel32> &s);+#ifdef _WIN32template class DVAPI TSpectrumT<TPixel32>;template class DVAPI TSpectrumT<TPixel64>;diff --git a/toonz/sources/sound/aiff/tsio_aiff.cpp b/toonz/sources/sound/aiff/tsio_aiff.cppindex 7122a9c21..cdcccf231 100644--- a/toonz/sources/sound/aiff/tsio_aiff.cpp+++ b/toonz/sources/sound/aiff/tsio_aiff.cpp@@ -5,7 +5,7 @@#include "tsound_t.h"#include "tsystem.h"#include "tfilepath_io.h"-#include "tfilepath_io.h"+#include "tsioutils.h"#include <math.h>#define DEFAULT_OFFSET 0@@ -21,7 +21,6 @@ TNZ_LITTLE_ENDIAN undefined !!using namespace std;-void swapAndCopySamples(short *srcBuffer, short *dstBuffer, TINT32 sampleCount);TUINT32 convertToLong(UCHAR *buffer);void storeFloat(unsigned char *buffer, TUINT32 value);@@ -136,7 +135,7 @@ public://---------------------------------------------------------------------ostream &operator<<(ostream &os, const TCOMMChunk &commChunk) {+static ostream &operator<<(ostream &os, const TCOMMChunk &commChunk) {commChunk.print(os);return os;}@@ -191,7 +190,7 @@ public://---------------------------------------------------------------------ostream &operator<<(ostream &os, const TSSNDChunk &ssndChunk) {+static ostream &operator<<(ostream &os, const TSSNDChunk &ssndChunk) {os << "name = '" << ssndChunk.m_name << endl;os << "length = '" << ssndChunk.m_length << endl;os << "offset = '" << (unsigned int)ssndChunk.m_offset << endl;@@ -208,7 +207,7 @@ ostream &operator<<(ostream &os, const TSSNDChunk &ssndChunk) {//==========================================================-void flipLong(unsigned char *ptrc) {+static void flipLong(unsigned char *ptrc) {unsigned char val;val = *(ptrc);@@ -222,7 +221,7 @@ void flipLong(unsigned char *ptrc) {//---------------------------------------------------------------------TUINT32 fetchLong(TUINT32 *ptrl) { return (*ptrl); }+static TUINT32 fetchLong(TUINT32 *ptrl) { return (*ptrl); }//--------------------------------------------------------------------@@ -249,7 +248,7 @@ TUINT32 convertToLong(UCHAR *buffer) {//---------------------------------------------------------------------void storeLong(TUINT32 val, TUINT32 *ptr) { *ptr = val; }+static void storeLong(TUINT32 val, TUINT32 *ptr) { *ptr = val; }//--------------------------------------------------------------------diff --git a/toonz/sources/sound/tsioutils.cpp b/toonz/sources/sound/tsioutils.cppindex e54f9c343..b7c6b3d40 100644--- a/toonz/sources/sound/tsioutils.cpp+++ b/toonz/sources/sound/tsioutils.cpp@@ -2,6 +2,8 @@#include "tcommon.h"+#include "tsioutils.h"+//------------------------------------------------------------------------------void swapAndCopySamples(short *srcBuffer, short *dstBuffer,TINT32 sampleCount) {diff --git a/toonz/sources/sound/tsioutils.h b/toonz/sources/sound/tsioutils.hnew file mode 100644index 000000000..4d5cad122--- /dev/null+++ b/toonz/sources/sound/tsioutils.h@@ -0,0 +1,9 @@+#pragma once++#ifndef TSIOUTILS_INCLUDED+#define TSIOUTILS_INCLUDED++void swapAndCopySamples(short *srcBuffer, short *dstBuffer,+ TINT32 sampleCount);++#endifdiff --git a/toonz/sources/stdfx/backlitfx.cpp b/toonz/sources/stdfx/backlitfx.cppindex 0d1557597..cd0c4b7cb 100644--- a/toonz/sources/stdfx/backlitfx.cpp+++ b/toonz/sources/stdfx/backlitfx.cpp@@ -11,8 +11,8 @@//----------------------------------------------------------------------void backlit(TRaster32P lighted, TRaster32P light, TRaster32P out, double blur,- const TPixel &color, double fade, double scale) {+static void backlit(TRaster32P lighted, TRaster32P light, TRaster32P out, double blur,+ const TPixel &color, double fade, double scale) {assert(light && lighted && out);assert(lighted->getSize() == light->getSize());@@ -92,8 +92,8 @@ void backlit(TRaster32P lighted, TRaster32P light, TRaster32P out, double blur,//----------------------------------------------------------------------void backlit(TRaster64P lighted, TRaster64P light, TRaster64P out, double blur,- const TPixel &color32, double fade, double scale) {+static void backlit(TRaster64P lighted, TRaster64P light, TRaster64P out, double blur,+ const TPixel &color32, double fade, double scale) {assert(light && lighted && out);assert(lighted->getSize() == light->getSize());diff --git a/toonz/sources/stdfx/changecolorfx.cpp b/toonz/sources/stdfx/changecolorfx.cppindex c354f62e7..2f776b603 100644--- a/toonz/sources/stdfx/changecolorfx.cpp+++ b/toonz/sources/stdfx/changecolorfx.cpp@@ -135,7 +135,7 @@ public:void doCompute(TTile &tile, double frame, const TRenderSettings &ri) override;};-double normalize_h(double h) {+static double normalize_h(double h) {if (h < 0) h += 360;if (h > 360) h -= 360;return h;diff --git a/toonz/sources/stdfx/gradients.cpp b/toonz/sources/stdfx/gradients.cppindex f56772841..6fea2e468 100644--- a/toonz/sources/stdfx/gradients.cpp+++ b/toonz/sources/stdfx/gradients.cpp@@ -4,6 +4,9 @@#include "traster.h"#include "tspectrumparam.h"++#include "gradients.h"+//------------------------------------------------------------------namespace {diff --git a/toonz/sources/stdfx/iwa_particlesengine.cpp b/toonz/sources/stdfx/iwa_particlesengine.cppindex a0d771bd8..0bb91ca6c 100644--- a/toonz/sources/stdfx/iwa_particlesengine.cpp+++ b/toonz/sources/stdfx/iwa_particlesengine.cpp@@ -1347,7 +1347,7 @@ void Iwa_Particles_Engine::fill_single_region(まだ出発していない粒子情報を初期化----------------------------------------------------------------*/-bool potentialLessThan(const ParticleOrigin &po1, const ParticleOrigin &po2) {+static bool potentialLessThan(const ParticleOrigin &po1, const ParticleOrigin &po2) {return po1.potential < po2.potential;}diff --git a/toonz/sources/stdfx/motionblurfx.cpp b/toonz/sources/stdfx/motionblurfx.cppindex 606d2dfa8..2d564a0fd 100644--- a/toonz/sources/stdfx/motionblurfx.cpp+++ b/toonz/sources/stdfx/motionblurfx.cpp@@ -326,7 +326,7 @@ void directionalBlur(TRasterPT<T> rout, TRasterPT<T> rin, const TPointD &blur,} // namespace-void enlargeDir(TRectD &r, TPointD p, bool bidirectional) {+static void enlargeDir(TRectD &r, TPointD p, bool bidirectional) {if (bidirectional) {r.x1 += fabs(p.x);r.x0 -= fabs(p.x);@@ -345,7 +345,7 @@ void enlargeDir(TRectD &r, TPointD p, bool bidirectional) {}}-void reduceDir(TRectD &r, TPointD p, bool bidirectional) {+static void reduceDir(TRectD &r, TPointD p, bool bidirectional) {if (bidirectional) {r.x1 -= fabs(p.x);r.x0 += fabs(p.x);diff --git a/toonz/sources/stdfx/particlesengine.cpp b/toonz/sources/stdfx/particlesengine.cppindex 79d398670..f13a74b19 100644--- a/toonz/sources/stdfx/particlesengine.cpp+++ b/toonz/sources/stdfx/particlesengine.cpp@@ -33,7 +33,7 @@Particles_Engine::Particles_Engine(ParticlesFx *parent, double frame): m_parent(parent), m_frame(frame) {}-void printTime(TStopWatch &sw, std::string name) {+static void printTime(TStopWatch &sw, std::string name) {std::ostrstream ss;ss << name << " : ";sw.print(ss);diff --git a/toonz/sources/stdfx/pins.cpp b/toonz/sources/stdfx/pins.cppindex 788e6d9bb..518974b8b 100644--- a/toonz/sources/stdfx/pins.cpp+++ b/toonz/sources/stdfx/pins.cpp@@ -428,7 +428,7 @@ void subdivision(const TPointD &p00, const TPointD &p10, const TPointD &p11,// ------------------------------------------------------------------------#define TINY 1.0e-20-int splitMatrix(double **a, int n, int *index) {+static int splitMatrix(double **a, int n, int *index) {int i, imax = 0, j, k;double big, dum, sum, temp;double *vv, d;@@ -488,8 +488,8 @@ int splitMatrix(double **a, int n, int *index) {/*-----------------------------------------------------------------*/-void buildMatrixes(const FourPoints &ss, const FourPoints &dd, double **a,- double *b) {+static void buildMatrixes(const FourPoints &ss, const FourPoints &dd, double **a,+ double *b) {int i;TPointD s[4], d[4];@@ -515,7 +515,7 @@ void buildMatrixes(const FourPoints &ss, const FourPoints &dd, double **a,/*-----------------------------------------------------------------*/-void computeSolutions(double **a, int *index, double *b) {+static void computeSolutions(double **a, int *index, double *b) {int i, ii = 0, ip, j;double sum;@@ -538,7 +538,7 @@ void computeSolutions(double **a, int *index, double *b) {/*-----------------------------------------------------------------*/-void solveSystems(double **a, double *bx) {+static void solveSystems(double **a, double *bx) {int index[255], i, count = 0, bad_line;double **atmp;int n = 8;@@ -568,8 +568,8 @@ void solveSystems(double **a, double *bx) {/*-----------------------------------------------------------------*/-void computeTransformation(const FourPoints &s, const FourPoints &d,- TAffine &aff, TPointD &perspectDen) {+static void computeTransformation(const FourPoints &s, const FourPoints &d,+ TAffine &aff, TPointD &perspectDen) {double **a, *b;int i;diff --git a/toonz/sources/stdfx/stdfx.cpp b/toonz/sources/stdfx/stdfx.cppindex 603b9eed7..e78f0ccb2 100644--- a/toonz/sources/stdfx/stdfx.cpp+++ b/toonz/sources/stdfx/stdfx.cpp@@ -687,4 +687,7 @@ return &info;*/+/* TODO, move to header */+DV_EXPORT_API void initStdFx();+DV_EXPORT_API void initStdFx() {}diff --git a/toonz/sources/stdfx/stdfx.h b/toonz/sources/stdfx/stdfx.hindex 1518c22de..bd0cb0aff 100644--- a/toonz/sources/stdfx/stdfx.h+++ b/toonz/sources/stdfx/stdfx.h@@ -61,4 +61,6 @@ public:bool isAlmostIsotropic(const TAffine &aff);+DV_EXPORT_API void initStdFx();+#endifdiff --git a/toonz/sources/tcleanupper/tcleanupper.cpp b/toonz/sources/tcleanupper/tcleanupper.cppindex 816d59160..e13373051 100644--- a/toonz/sources/tcleanupper/tcleanupper.cpp+++ b/toonz/sources/tcleanupper/tcleanupper.cpp@@ -195,7 +195,7 @@ TFilePath setToonzFolder(const TFilePath &filename, std::string toonzVar) {//==============================================================================================-void prepareToCleanup(TXshSimpleLevel *xl, TPalette *cleanupPalette) {+static void prepareToCleanup(TXshSimpleLevel *xl, TPalette *cleanupPalette) {assert(xl->getScene());if (xl->getProperties()->getSubsampling() != 1) {xl->getProperties()->setSubsampling(1);@@ -241,7 +241,7 @@ string TaskId;////-------------------------------------------------------------------------void searchLevelsToCleanup(+static void searchLevelsToCleanup(std::vector<std::pair<TXshSimpleLevel *, std::set<TFrameId>>> &levels,TXsheet *xsh, bool selectedOnly) {std::map<wstring, TXshSimpleLevel *> levelTable;@@ -308,7 +308,7 @@ void searchLevelsToCleanup(//------------------------------------------------------------------------------/*- CleanupDefaultパレットを追加する -*/-void addCleanupDefaultPalette(TXshSimpleLevel *sl) {+static void addCleanupDefaultPalette(TXshSimpleLevel *sl) {/*- 元となるパレットはStudioPaletteフォルダに置く -*/TFilePath palettePath =ToonzFolder::getStudioPaletteFolder() + "cleanup_default.tpl";@@ -384,9 +384,9 @@ void addCleanupDefaultPalette(TXshSimpleLevel *sl) {////-------------------------------------------------------------------------void cleanupLevel(TXshSimpleLevel *xl, std::set<TFrameId> fidsInXsheet,- ToonzScene *scene, bool overwrite,- TUserLogAppend &m_userLog) {+static void cleanupLevel(TXshSimpleLevel *xl, std::set<TFrameId> fidsInXsheet,+ ToonzScene *scene, bool overwrite,+ TUserLogAppend &m_userLog) {prepareToCleanup(xl, scene->getProperties()->getCleanupParameters()->m_cleanupPalette.getPointer());@@ -847,4 +847,4 @@ namespace {const char *toonzVersion = "Toonz 7.1";} // namespace-string getToonzVersion() { return toonzVersion; }+static string getToonzVersion() { return toonzVersion; }diff --git a/toonz/sources/tcomposer/tcomposer.cpp b/toonz/sources/tcomposer/tcomposer.cppindex a3d06dfd7..676857aed 100644--- a/toonz/sources/tcomposer/tcomposer.cpp+++ b/toonz/sources/tcomposer/tcomposer.cpp@@ -394,9 +394,9 @@ bool MyMultimediaRenderListener::onFrameFailed(int frame, int column,//==================================================================================-std::pair<int, int> generateMovie(ToonzScene *scene, const TFilePath &fp,- int r0, int r1, int step, int shrink,- int threadCount, int maxTileSize) {+static std::pair<int, int> generateMovie(ToonzScene *scene, const TFilePath &fp,+ int r0, int r1, int step, int shrink,+ int threadCount, int maxTileSize) {QWaitCondition renderCompleted;// riporto gli indici a base zerodiff --git a/toonz/sources/tnzbase/tscanner/tscannerepson.cpp b/toonz/sources/tnzbase/tscanner/tscannerepson.cppindex 7b2740276..2cc40ee63 100644--- a/toonz/sources/tnzbase/tscanner/tscannerepson.cpp+++ b/toonz/sources/tnzbase/tscanner/tscannerepson.cpp@@ -18,8 +18,8 @@using namespace TScannerUtil;-void sense(bool) {}-int scsi_maxlen() {+static void sense(bool) {}+static int scsi_maxlen() {assert(0);return 0;}diff --git a/toonz/sources/tnzbase/tscanner/tscannertwain.cpp b/toonz/sources/tnzbase/tscanner/tscannertwain.cppindex 979d5e554..e907117f8 100644--- a/toonz/sources/tnzbase/tscanner/tscannertwain.cpp+++ b/toonz/sources/tnzbase/tscanner/tscannertwain.cpp@@ -9,15 +9,17 @@ using namespace TScannerUtil;extern "C" {#include "../common/twain/ttwain_util.h"+#include "../common/twain/ttwain_global_def.h" /* forward declare functions */}/* callback used to handle TTWAIN done/error status*/-void throwIT(const char *msg) { throw TException(msg); }+static void throwIT(const char *msg) { throw TException(msg); }extern "C" void TTWAIN_ErrorBox(const char *msg) { throwIT(msg); }-extern "C" int onDoneCB(UCHAR *buffer, TTWAIN_PIXTYPE pixelType, int lx, int ly,+extern "C" {+static int onDoneCB(UCHAR *buffer, TTWAIN_PIXTYPE pixelType, int lx, int ly,int wrap, float xdpi, float ydpi, void *usrData) {TRasterP ras;switch (pixelType) {@@ -69,13 +71,16 @@ extern "C" int onDoneCB(UCHAR *buffer, TTWAIN_PIXTYPE pixelType, int lx, int ly,scannerDevice->decrementPaperLeftCount();return scannerDevice->getPaperLeftCount();}+}//------------------------------------------------------------------------------extern "C" void onErrorCB(void *usrData, void *alwaysZero) {+extern "C" {+static void onErrorCB(void *usrData, void *alwaysZero) {TScanner *scannerDevice = reinterpret_cast<TScanner *>(usrData);scannerDevice->notifyError();}+}//-----------------------------------------------------------------------------@@ -218,7 +223,7 @@ param.m_version = string(TTWAIN_GetVersion());//------------------------------------------------------------------------------void setupParameters(const TScannerParameters ¶ms, bool isAreaSupported) {+static void setupParameters(const TScannerParameters ¶ms, bool isAreaSupported) {if (isAreaSupported) {TRectD scanArea = params.getScanArea();float L = (float)(scanArea.getP00().x / 25.4);@@ -259,7 +264,7 @@ void setupParameters(const TScannerParameters ¶ms, bool isAreaSupported) {}//------------------------------------------------------------------------------void openAndSetupTwain() {+static void openAndSetupTwain() {int rc = TTWAIN_OpenDefaultSource();if (rc) {TTWAIN_SetTwainUsage(TTWAIN_MODE_UNLEASHED);diff --git a/toonz/sources/tnzext/tlin/tlin_cblas_wrap.cpp b/toonz/sources/tnzext/tlin/tlin_cblas_wrap.cppindex 8e104f8e0..885d122c4 100644--- a/toonz/sources/tnzext/tlin/tlin_cblas_wrap.cpp+++ b/toonz/sources/tnzext/tlin/tlin_cblas_wrap.cpp@@ -55,7 +55,7 @@ extern "C" {//========================================================================================-void sum(int n, const double *x, double *&y) {+static void sum(int n, const double *x, double *&y) {/*void cblas_daxpy(blasint n, double a, double *x, blasint incx, double *y,blasint incy);diff --git a/toonz/sources/tnztools/brushtool.cpp b/toonz/sources/tnztools/brushtool.cppindex 6cf93b96e..3272da2f5 100644--- a/toonz/sources/tnztools/brushtool.cpp+++ b/toonz/sources/tnztools/brushtool.cpp@@ -89,8 +89,8 @@ TEnv::DoubleVar RasterBrushHardness("RasterBrushHardness", 100);// note: stroke is unchanged//-void split(TStroke *stroke, const std::vector<double> ¶meterValues,- std::vector<TStroke *> &strokes) {+static void split(TStroke *stroke, const std::vector<double> ¶meterValues,+ std::vector<TStroke *> &strokes) {TThickPoint p2;std::vector<TThickPoint> points;TThickPoint lastPoint = stroke->getControlPoint(0);@@ -199,7 +199,7 @@ void split(TStroke *stroke, const std::vector<double> ¶meterValues,// Note: if the curve is a single point (that's dp=0) or it is a straight// line (that's ddp=0) return 0-double curvature(TPointD dp, TPointD ddp) {+static double curvature(TPointD dp, TPointD ddp) {if (dp == TPointD(0, 0))return 0;else@@ -217,9 +217,9 @@ double curvature(TPointD dp, TPointD ddp) {// Output:// parameterValues = vector of max curvature parameter points-void findMaxCurvPoints(TStroke *stroke, const float &angoloLim,- const float &curvMaxLim,- std::vector<double> ¶meterValues) {+static void findMaxCurvPoints(TStroke *stroke, const float &angoloLim,+ const float &curvMaxLim,+ std::vector<double> ¶meterValues) {TPointD tg1, tg2; // Tangent vectorsTPointD dp, ddp; // First and Second derivate.@@ -320,9 +320,9 @@ void findMaxCurvPoints(TStroke *stroke, const float &angoloLim,}}-void addStroke(TTool::Application *application, const TVectorImageP &vi,- TStroke *stroke, bool breakAngles, bool frameCreated,- bool levelCreated) {+static void addStroke(TTool::Application *application, const TVectorImageP &vi,+ TStroke *stroke, bool breakAngles, bool frameCreated,+ bool levelCreated) {QMutexLocker lock(vi->getMutex());if (application->getCurrentObject()->isSpline()) {diff --git a/toonz/sources/tnztools/geometrictool.cpp b/toonz/sources/tnztools/geometrictool.cppindex bf6c80fb8..3014d027a 100644--- a/toonz/sources/tnztools/geometrictool.cpp+++ b/toonz/sources/tnztools/geometrictool.cpp@@ -65,7 +65,7 @@ TEnv::IntVar GeometricMiterValue("InknpaintGeometricMiterValue", 4);// Utility Functions//------------------------------------------------------------------------------TPointD rectify(const TPointD &oldPos, const TPointD &pos) {+static TPointD rectify(const TPointD &oldPos, const TPointD &pos) {const double h = sqrt(2.0) / 2.0;const TPointD directions[] = {TPointD(1, 0), TPointD(h, h), TPointD(0, 1),TPointD(-h, h), TPointD(-1, 0), TPointD(-h, -h),@@ -85,15 +85,15 @@ TPointD rectify(const TPointD &oldPos, const TPointD &pos) {//------------------------------------------------------------------------------TPointD computeSpeed(TPointD p0, TPointD p1, double factor) {+static TPointD computeSpeed(TPointD p0, TPointD p1, double factor) {TPointD d = p1 - p0;return (d == TPointD()) ? TPointD() : d * (factor / norm(d));}//------------------------------------------------------------------------------TRect drawBluredBrush(const TRasterImageP &ri, TStroke *stroke, int thick,- double hardness, double opacity) {+static TRect drawBluredBrush(const TRasterImageP &ri, TStroke *stroke, int thick,+ double hardness, double opacity) {TStroke *s = new TStroke(*stroke);TPointD riCenter = ri->getRaster()->getCenterD();s->transform(TTranslation(riCenter));@@ -135,8 +135,8 @@ TRect drawBluredBrush(const TRasterImageP &ri, TStroke *stroke, int thick,//------------------------------------------------------------------------------TRect drawBluredBrush(const TToonzImageP &ti, TStroke *stroke, int thick,- double hardness, bool selective) {+static TRect drawBluredBrush(const TToonzImageP &ti, TStroke *stroke, int thick,+ double hardness, bool selective) {TStroke *s = new TStroke(*stroke);TPointD riCenter = ti->getRaster()->getCenterD();s->transform(TTranslation(riCenter));diff --git a/toonz/sources/tnztools/imagegrouping.cpp b/toonz/sources/tnztools/imagegrouping.cppindex 9176a2c11..50203927e 100644--- a/toonz/sources/tnztools/imagegrouping.cpp+++ b/toonz/sources/tnztools/imagegrouping.cpp@@ -616,9 +616,9 @@ refStroke, count, refStroke+count)>commonDepth(vimg, refStroke, count, prev))if(count==0) return;*/-int doMoveGroup(UCHAR moveType, TVectorImage *vimg,- const std::vector<std::pair<TStroke *, int>> &selectedGroups,- int index) {+static int doMoveGroup(UCHAR moveType, TVectorImage *vimg,+ const std::vector<std::pair<TStroke *, int>> &selectedGroups,+ int index) {int refStroke = vimg->getStrokeIndex(selectedGroups[index].first);int count = selectedGroups[index].second;diff --git a/toonz/sources/tnztools/plastictool.cpp b/toonz/sources/tnztools/plastictool.cppindex 3822f0523..8bffbe02f 100644--- a/toonz/sources/tnztools/plastictool.cpp+++ b/toonz/sources/tnztools/plastictool.cpp@@ -1682,7 +1682,7 @@ void drawFullSquare(const TPointD &pos, double radius) {//-------------------------------------------------------------------------void drawFilledSquare(const TPointD &pos, double radius) {+static void drawFilledSquare(const TPointD &pos, double radius) {glBegin(GL_QUADS);glVertex2d(pos.x - radius, pos.y - radius);glVertex2d(pos.x + radius, pos.y - radius);@@ -1693,7 +1693,7 @@ void drawFilledSquare(const TPointD &pos, double radius) {//-------------------------------------------------------------------------void drawHandle(const TPointD &pos, double radius, const TPixel32 &color) {+static void drawHandle(const TPointD &pos, double radius, const TPixel32 &color) {glColor4ub(0, 0, 0, color.m); // Black borderglLineWidth(4.0f);drawSquare(pos, radius);@@ -1705,8 +1705,8 @@ void drawHandle(const TPointD &pos, double radius, const TPixel32 &color) {//-------------------------------------------------------------------------void drawFilledHandle(const TPointD &pos, double radius, double pixelSize,- const TPixel32 &color) {+static void drawFilledHandle(const TPointD &pos, double radius, double pixelSize,+ const TPixel32 &color) {glColor4ub(0, 0, 0, color.m);drawFilledSquare(pos, radius + pixelSize);@@ -1716,7 +1716,7 @@ void drawFilledHandle(const TPointD &pos, double radius, double pixelSize,//-------------------------------------------------------------------------void drawText(const TPointD &pos, const QString &text, double fontScale) {+static void drawText(const TPointD &pos, const QString &text, double fontScale) {// Get the world-to-window affinedouble matrix[16];diff --git a/toonz/sources/tnztools/plastictool_meshedit.cpp b/toonz/sources/tnztools/plastictool_meshedit.cppindex f5231315e..52752cce4 100644--- a/toonz/sources/tnztools/plastictool_meshedit.cpp+++ b/toonz/sources/tnztools/plastictool_meshedit.cpp@@ -155,8 +155,8 @@ struct Closer {//==============================================================================-std::pair<double, int> closestVertex(const TTextureMesh &mesh,- const TPointD &pos) {+static std::pair<double, int> closestVertex(const TTextureMesh &mesh,+ const TPointD &pos) {Closer closer = {mesh, pos};int vIdx = int(std::min_element(mesh.vertices().begin(), mesh.vertices().end(), closer)@@ -167,8 +167,8 @@ std::pair<double, int> closestVertex(const TTextureMesh &mesh,//-------------------------------------------------------------------------std::pair<double, int> closestEdge(const TTextureMesh &mesh,- const TPointD &pos) {+static std::pair<double, int> closestEdge(const TTextureMesh &mesh,+ const TPointD &pos) {Closer closer = {mesh, pos};int eIdx =int(std::min_element(mesh.edges().begin(), mesh.edges().end(), closer)diff --git a/toonz/sources/tnztools/skeletontool.cpp b/toonz/sources/tnztools/skeletontool.cppindex 0ce0e13cb..6f3620c10 100644--- a/toonz/sources/tnztools/skeletontool.cpp+++ b/toonz/sources/tnztools/skeletontool.cpp@@ -80,7 +80,7 @@ inline std::string removeTrailingH(std::string handle) {// return true iff column ancestorIndex is column descentIndex or its parent or// the parent of the parent, etc.-bool isAncestorOf(int ancestorIndex, int descendentIndex) {+static bool isAncestorOf(int ancestorIndex, int descendentIndex) {TStageObjectId ancestorId = TStageObjectId::ColumnId(ancestorIndex);TStageObjectId descendentId = TStageObjectId::ColumnId(descendentIndex);TXsheet *xsh = TTool::getApplication()->getCurrentXsheet()->getXsheet();@@ -91,8 +91,8 @@ bool isAncestorOf(int ancestorIndex, int descendentIndex) {//-------------------------------------------------------------void getHooks(std::vector<HookData> &hooks, TXsheet *xsh, int row, int col,- TPointD dpiScale) {+static void getHooks(std::vector<HookData> &hooks, TXsheet *xsh, int row, int col,+ TPointD dpiScale) {// nota. hook position is in the coordinate system of the parent object.// a inch is Stage::inch@@ -138,8 +138,8 @@ void getHooks(std::vector<HookData> &hooks, TXsheet *xsh, int row, int col,//--------------------------------------------------------------------void getConnectedColumns(std::set<int> &connectedColumns, TXsheet *xsh,- int col) {+static void getConnectedColumns(std::set<int> &connectedColumns, TXsheet *xsh,+ int col) {TStageObjectId id;// insert col and all column ancestorsid = TStageObjectId::ColumnId(col);@@ -165,7 +165,7 @@ void getConnectedColumns(std::set<int> &connectedColumns, TXsheet *xsh,}}-bool canShowBone(Skeleton::Bone *bone, TXsheet *xsh, int row) {+static bool canShowBone(Skeleton::Bone *bone, TXsheet *xsh, int row) {TStageObjectId id = bone->getStageObject()->getId();if (!xsh->getCell(row, id.getIndex()).isEmpty() &&xsh->getColumn(id.getIndex())->isCamstandVisible())diff --git a/toonz/sources/tnztools/toolhandle.cpp b/toonz/sources/tnztools/toolhandle.cppindex 15ae3137c..1143db9b9 100644--- a/toonz/sources/tnztools/toolhandle.cpp+++ b/toonz/sources/tnztools/toolhandle.cpp@@ -103,7 +103,7 @@ void ToolHandle::setToolBusy(bool value) {QIcon currentIcon;-QIcon getCurrentIcon() { return currentIcon; }+static QIcon getCurrentIcon() { return currentIcon; }//-----------------------------------------------------------------------------diff --git a/toonz/sources/tnztools/trackertool.cpp b/toonz/sources/tnztools/trackertool.cppindex 7813b2456..33d82028b 100644--- a/toonz/sources/tnztools/trackertool.cpp+++ b/toonz/sources/tnztools/trackertool.cpp@@ -849,7 +849,7 @@ void TrackerTool::onDeactivate() {//=============================================================================-TTool *getTrackerToolTool() { return &trackerTool; }+static TTool *getTrackerToolTool() { return &trackerTool; }//=============================================================================diff --git a/toonz/sources/tnztools/typetool.cpp b/toonz/sources/tnztools/typetool.cppindex 8aa670156..23229fa8a 100644--- a/toonz/sources/tnztools/typetool.cpp+++ b/toonz/sources/tnztools/typetool.cpp@@ -1645,7 +1645,7 @@ void TypeTool::onImageChanged() { stopEditing(); }//=========================================================-TTool *getTypeTool() { return &typeTool; }+static TTool *getTypeTool() { return &typeTool; }/*void resetTypetTool(TTool*tool){diff --git a/toonz/sources/toonzlib/doubleparamcmd.cpp b/toonz/sources/toonzlib/doubleparamcmd.cppindex 90016cccd..2fa15dbb7 100644--- a/toonz/sources/toonzlib/doubleparamcmd.cpp+++ b/toonz/sources/toonzlib/doubleparamcmd.cpp@@ -9,10 +9,6 @@#include <QString>#include <map>-DV_IMPORT_API void splitSpeedInOutSegment(TDoubleKeyframe &k,- TDoubleKeyframe &k0,- TDoubleKeyframe &k1);-//=============================================================================//// Keyframes Undodiff --git a/toonz/sources/toonzlib/sandor_fxs/calligraph.cpp b/toonz/sources/toonzlib/sandor_fxs/calligraph.cppindex dd21f0463..065b44290 100644--- a/toonz/sources/toonzlib/sandor_fxs/calligraph.cpp+++ b/toonz/sources/toonzlib/sandor_fxs/calligraph.cpp@@ -24,6 +24,7 @@#include "SDef.h"#include "CallCircle.h"#include "CallParam.h"+#include "calligraph.h"//#include "tmsg.h"using namespace std;diff --git a/toonz/sources/toonzlib/tcolumnfx.cpp b/toonz/sources/toonzlib/tcolumnfx.cppindex f9597c800..e9a745276 100644--- a/toonz/sources/toonzlib/tcolumnfx.cpp+++ b/toonz/sources/toonzlib/tcolumnfx.cpp@@ -38,6 +38,7 @@#include "toonz/levelset.h"#include "toonz/txshchildlevel.h"#include "toonz/fxdag.h"+#include "toonz/tcolumnfx.h"#include "toonz/tcolumnfxset.h"#include "toonz/stage.h"#include "toonz/fill.h"