Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix for 32bit build

shun-iwasawa5014597cf4ad
diff --git a/toonz/sources/.clang-format b/toonz/sources/.clang-format
index 700421a18..85c47f76b 100644
--- a/toonz/sources/.clang-format
+++ b/toonz/sources/.clang-format
@@ -1,5 +1,5 @@
BasedOnStyle: Google
-Standard: C++17
+Standard: c++17
UseTab: Never
AccessModifierOffset: -2
AlignAfterOpenBracket: true
diff --git a/toonz/sources/common/tiio/movsettings.cpp b/toonz/sources/common/tiio/movsettings.cpp
index af9a7d0eb..effd10263 100644
--- a/toonz/sources/common/tiio/movsettings.cpp
+++ b/toonz/sources/common/tiio/movsettings.cpp
@@ -10,7 +10,7 @@
#include "tiio.h"
#if !defined(x64) && !defined(__LP64__) && \
- !(defined(LINUX) || defined(FREEBSD) || defined(HAIKU)) && \
+ !(defined(LINUX) || defined(FREEBSD) || defined(HAIKU)) && \
!(defined(__GNUC__) && defined(_WIN32))
//********************************************************************************
@@ -116,9 +116,9 @@ void visitAtoms(const QTAtomContainer &atoms, const QTAtom &parent,
int sonCount = QTCountChildrenOfType(atoms, curr, 0);
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "%d %d %d", (int)atomType, (int)id,
- sonCount);
- string str(buffer);
+ std::snprintf(buffer, sizeof(buffer), "%d %d %d", (int)atomType, (int)id,
+ sonCount);
+ std::string str(buffer);
if (sonCount > 0) {
pg.add(new TStringProperty(str, TString()));
@@ -131,9 +131,9 @@ void visitAtoms(const QTAtomContainer &atoms, const QTAtom &parent,
if (QTGetAtomDataPtr(atoms, curr, &size, (char **)&atomData) != noErr)
assert(false);
- string strapp;
+ std::string strapp;
for (int i = 0; i < size; i++) {
- string num;
+ std::string num;
if (atomData[i] == 0) {
int count = 1;
while ((i + 1) < size && atomData[i + 1] == 0) i++, count++;
@@ -145,7 +145,7 @@ void visitAtoms(const QTAtomContainer &atoms, const QTAtom &parent,
}
num = std::to_string(atomData[i]);
- strapp = strapp + string(num) + " ";
+ strapp = strapp + std::string(num) + " ";
}
// unsigned short*buffer = new unsigned short[size];
@@ -153,7 +153,7 @@ void visitAtoms(const QTAtomContainer &atoms, const QTAtom &parent,
// for (i=0; i<size; i++)
// buffer[i] = atomData[i]+1;
- wstring data = ::to_wstring(strapp);
+ std::wstring data = ::to_wstring(strapp);
pg.add(new TStringProperty(str, data));
}
@@ -220,17 +220,17 @@ void visitprops(TPropertyGroup &pg, int &index, QTAtomContainer &atoms,
int count = pg.getPropertyCount();
while (index < count) {
TStringProperty *p = (TStringProperty *)pg.getProperty(index++);
- string str0 = p->getName();
+ std::string str0 = p->getName();
const char *buf = str0.c_str();
int atomType, id, sonCount;
- sscanf(buf, "%d %d %d", &atomType, &id, &sonCount);
+ std::sscanf(buf, "%d %d %d", &atomType, &id, &sonCount);
QTAtom newAtom;
if (sonCount == 0) {
- wstring appow = p->getValue();
- string appo = ::to_string(appow);
- const char *str = appo.c_str();
+ std::wstring appow = p->getValue();
+ std::string appo = ::to_string(appow);
+ const char *str = appo.c_str();
- vector<UCHAR> buf;
+ std::vector<UCHAR> buf;
while (strlen(str) > 0) {
if (str[0] == 'z') {
int count = atoi(str + 1);
diff --git a/toonz/sources/image/3gp/tiio_3gpW.cpp b/toonz/sources/image/3gp/tiio_3gpW.cpp
index 553b62bae..ac12fe10e 100644
--- a/toonz/sources/image/3gp/tiio_3gpW.cpp
+++ b/toonz/sources/image/3gp/tiio_3gpW.cpp
@@ -88,7 +88,7 @@ enum QTLibError {
QTUnableToSetMovieBox,
};
-string buildQTErrorString(int ec) {
+std::string buildQTErrorString(int ec) {
switch (ec) {
case QTNotInstalled:
return "Can't create; ensure that quicktime is correctly installed on your "
@@ -184,8 +184,8 @@ TFilePath getLegalName(const TFilePath &name) {
//--------------------------`----------------------------------------------------
-string long2fourchar(TINT32 fcc) {
- string s;
+std::string long2fourchar(TINT32 fcc) {
+ std::string s;
s += (char((fcc & 0xff000000) >> 24));
s += (char((fcc & 0x00ff0000) >> 16));
s += (char((fcc & 0x0000ff00) >> 8));
@@ -296,7 +296,7 @@ void TImageWriter3gp::save(const TImageP &img) {
void TLevelWriter3gp::save(const TImageP &img, int frameIndex) {
if (m_cancelled) return;
- string msg;
+ std::string msg;
QMutexLocker sl(&m_mutex);
TRasterImageP image(img);
@@ -509,7 +509,9 @@ TLevelWriter3gp::TLevelWriter3gp(const TFilePath &path, TPropertyGroup *winfo)
#define FailWithAction(cond, action, handler) \
if (cond) { \
DebugStr((ConstStr255Param) #cond " goto " #handler); \
- { action; } \
+ { \
+ action; \
+ } \
goto handler; \
} else \
0
diff --git a/toonz/sources/image/mov/tiio_movW.cpp b/toonz/sources/image/mov/tiio_movW.cpp
index 7bcbb439d..c4c06ae0d 100644
--- a/toonz/sources/image/mov/tiio_movW.cpp
+++ b/toonz/sources/image/mov/tiio_movW.cpp
@@ -92,7 +92,7 @@ enum QTLibError {
QTUnableToSetMovieBox,
};
-string buildQTErrorString(int ec) {
+std::string buildQTErrorString(int ec) {
switch (ec) {
case QTNotInstalled:
return "Can't create; ensure that quicktime is correctly installed on your "
@@ -188,8 +188,8 @@ TFilePath getLegalName(const TFilePath &name) {
//-------------------------------------------------------------------------------
-string long2fourchar(TINT32 fcc) {
- string s;
+std::string long2fourchar(TINT32 fcc) {
+ std::string s;
s += (char((fcc & 0xff000000) >> 24));
s += (char((fcc & 0x00ff0000) >> 16));
s += (char((fcc & 0x0000ff00) >> 8));
@@ -618,7 +618,9 @@ TLevelWriterMov::TLevelWriterMov(const TFilePath &path, TPropertyGroup *winfo)
#define FailWithAction(cond, action, handler) \
if (cond) { \
DebugStr((ConstStr255Param) #cond " goto " #handler); \
- { action; } \
+ { \
+ action; \
+ } \
goto handler; \
} else \
0
@@ -948,7 +950,7 @@ TLevelReaderMov::TLevelReaderMov(const TFilePath &path)
// Retrieve the timecode media handler
{
Track tcTrack = GetMovieIndTrackType(m_movie, 1, TimeCodeMediaType,
- movieTrackMediaType);
+ movieTrackMediaType);
Media tcMedia = GetTrackMedia(tcTrack);
m_timecodeHandler = GetMediaHandler(tcMedia);
}
diff --git a/toonz/sources/toonz/tpanels.cpp b/toonz/sources/toonz/tpanels.cpp
index 1b459fdd2..a1fd5d3ec 100644
--- a/toonz/sources/toonz/tpanels.cpp
+++ b/toonz/sources/toonz/tpanels.cpp
@@ -29,7 +29,9 @@
#include "expressionreferencemanager.h"
+#if defined(x64)
#include "stopmotioncontroller.h"
+#endif
#include "tasksviewer.h"
#include "batchserversviewer.h"
@@ -239,8 +241,10 @@ void SchematicScenePanel::onDeleteFxs(const FxSelection *selection) {
TApp *app = TApp::instance();
TFxCommand::deleteSelection(
std::list<TFxP>(selection->getFxs().begin(), selection->getFxs().end()),
- std::list<Link>(selection->getLinks().begin(), selection->getLinks().end()),
- std::list<int>(selection->getColumnIndexes().begin(), selection->getColumnIndexes().end()),
+ std::list<Link>(selection->getLinks().begin(),
+ selection->getLinks().end()),
+ std::list<int>(selection->getColumnIndexes().begin(),
+ selection->getColumnIndexes().end()),
app->getCurrentXsheet(), app->getCurrentFx());
}
@@ -254,9 +258,12 @@ void SchematicScenePanel::onDeleteStageObjects(
TApp *app = TApp::instance();
TStageObjectCmd::deleteSelection(
- std::vector<TStageObjectId>(selection->getObjects().toVector().begin(), selection->getObjects().toVector().end()),
- std::list<QPair<TStageObjectId, TStageObjectId>>(selection->getLinks().begin(), selection->getLinks().end()),
- std::list<int>(selection->getSplines().begin(), selection->getSplines().end()),
+ std::vector<TStageObjectId>(selection->getObjects().toVector().begin(),
+ selection->getObjects().toVector().end()),
+ std::list<QPair<TStageObjectId, TStageObjectId>>(
+ selection->getLinks().begin(), selection->getLinks().end()),
+ std::list<int>(selection->getSplines().begin(),
+ selection->getSplines().end()),
app->getCurrentXsheet(), app->getCurrentObject(), app->getCurrentFx());
}
@@ -1656,7 +1663,7 @@ public:
//=============================================================================
OpenFloatingPanel openFxBrowserCommand(MI_InsertFx, "FxBrowser",
- QObject::tr("Fx Browser"));
+ QObject::tr("Fx Browser"));
//-----------------------------------------------------------------------------
@@ -1693,4 +1700,4 @@ public:
//=============================================================================
OpenFloatingPanel openLocatorCommand(MI_OpenLocator, "Locator",
- QObject::tr("Locator"));
\ No newline at end of file
+ QObject::tr("Locator"));
\ No newline at end of file