Format with uncrustify (#3388)

This commit is contained in:
Paul Fultz II 2021-08-07 13:51:18 -05:00 committed by GitHub
parent f361106770
commit 7f358b2bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
287 changed files with 27831 additions and 24185 deletions

3128
.uncrustify.cfg Normal file

File diff suppressed because it is too large Load Diff

View File

@ -102,8 +102,7 @@ CmdLineParser::CmdLineParser(Settings *settings)
, mShowVersion(false) , mShowVersion(false)
, mShowErrorMessages(false) , mShowErrorMessages(false)
, mExitAfterPrint(false) , mExitAfterPrint(false)
{ {}
}
void CmdLineParser::printMessage(const std::string &message) void CmdLineParser::printMessage(const std::string &message)
{ {

View File

@ -81,8 +81,7 @@
CppCheckExecutor::CppCheckExecutor() CppCheckExecutor::CppCheckExecutor()
: mSettings(nullptr), mLatestProgressOutputTime(0), mErrorOutput(nullptr), mBugHuntingReport(nullptr), mShowAllErrors(false) : mSettings(nullptr), mLatestProgressOutputTime(0), mErrorOutput(nullptr), mBugHuntingReport(nullptr), mShowAllErrors(false)
{ {}
}
CppCheckExecutor::~CppCheckExecutor() CppCheckExecutor::~CppCheckExecutor()
{ {

View File

@ -88,7 +88,7 @@ int main(int argc, char* argv[])
GetModuleFileNameA(nullptr, exename, sizeof(exename)/sizeof(exename[0])-1); GetModuleFileNameA(nullptr, exename, sizeof(exename)/sizeof(exename[0])-1);
argv[0] = exename; argv[0] = exename;
#endif #endif
// *INDENT-OFF*
#ifdef NDEBUG #ifdef NDEBUG
try { try {
#endif #endif
@ -103,6 +103,7 @@ int main(int argc, char* argv[])
} }
return EXIT_FAILURE; return EXIT_FAILURE;
#endif #endif
// *INDENT-ON*
} }

View File

@ -563,9 +563,7 @@ void ThreadExecutor::report(const ErrorMessage &msg, MessageType msgType)
#else #else
void ThreadExecutor::addFileContent(const std::string & /*path*/, const std::string & /*content*/) void ThreadExecutor::addFileContent(const std::string & /*path*/, const std::string & /*content*/)
{ {}
}
unsigned int ThreadExecutor::check() unsigned int ThreadExecutor::check()
{ {
@ -573,21 +571,14 @@ unsigned int ThreadExecutor::check()
} }
void ThreadExecutor::reportOut(const std::string & /*outmsg*/, Color) void ThreadExecutor::reportOut(const std::string & /*outmsg*/, Color)
{ {}
}
void ThreadExecutor::reportErr(const ErrorMessage & /*msg*/) void ThreadExecutor::reportErr(const ErrorMessage & /*msg*/)
{ {}
}
void ThreadExecutor::reportInfo(const ErrorMessage & /*msg*/) void ThreadExecutor::reportInfo(const ErrorMessage & /*msg*/)
{ {}
}
void ThreadExecutor::bughuntingReport(const std::string & /*str*/) void ThreadExecutor::bughuntingReport(const std::string & /*str*/)
{ {}
}
#endif #endif

View File

@ -23,5 +23,4 @@ Application::Application(const QString &name, const QString &path,
: mName(name) : mName(name)
, mPath(path) , mPath(path)
, mParameters(params) , mParameters(params)
{ {}
}

View File

@ -27,8 +27,7 @@ const unsigned int CppcheckLibraryData::Function::Arg::ANY = ~0U;
const unsigned int CppcheckLibraryData::Function::Arg::VARIADIC = ~1U; const unsigned int CppcheckLibraryData::Function::Arg::VARIADIC = ~1U;
CppcheckLibraryData::CppcheckLibraryData() CppcheckLibraryData::CppcheckLibraryData()
{ {}
}
static std::string unhandledElement(const QXmlStreamReader &xmlReader) static std::string unhandledElement(const QXmlStreamReader &xmlReader)
{ {

View File

@ -64,8 +64,7 @@ public:
struct Function { struct Function {
Function() : noreturn(Unknown), gccPure(false), gccConst(false), Function() : noreturn(Unknown), gccPure(false), gccConst(false),
leakignore(false), useretval(false) { leakignore(false), useretval(false) {}
}
QString comments; QString comments;
QString name; QString name;
@ -89,8 +88,7 @@ public:
} formatstr; } formatstr;
struct Arg { struct Arg {
Arg() : nr(0), notbool(false), notnull(false), notuninit(false), Arg() : nr(0), notbool(false), notnull(false), notuninit(false),
formatstr(false), strz(false) { formatstr(false), strz(false) {}
}
QString name; QString name;
unsigned int nr; unsigned int nr;

View File

@ -24,12 +24,10 @@
CsvReport::CsvReport(const QString &filename) : CsvReport::CsvReport(const QString &filename) :
Report(filename) Report(filename)
{ {}
}
CsvReport::~CsvReport() CsvReport::~CsvReport()
{ {}
}
bool CsvReport::create() bool CsvReport::create()
{ {

View File

@ -24,8 +24,7 @@ QErrorPathItem::QErrorPathItem(const ErrorMessage::FileLocation &loc)
, line(loc.line) , line(loc.line)
, column(loc.column) , column(loc.column)
, info(QString::fromStdString(loc.getinfo())) , info(QString::fromStdString(loc.getinfo()))
{ {}
}
bool operator==(const QErrorPathItem &i1, const QErrorPathItem &i2) bool operator==(const QErrorPathItem &i1, const QErrorPathItem &i2)
{ {
@ -38,8 +37,7 @@ ErrorItem::ErrorItem()
, inconclusive(false) , inconclusive(false)
, cwe(-1) , cwe(-1)
, hash(0) , hash(0)
{ {}
}
ErrorItem::ErrorItem(const ErrorMessage &errmsg) ErrorItem::ErrorItem(const ErrorMessage &errmsg)
: file0(QString::fromStdString(errmsg.file0)) : file0(QString::fromStdString(errmsg.file0))

View File

@ -1415,8 +1415,7 @@ void MainWindow::save()
} }
void MainWindow::resultsAdded() void MainWindow::resultsAdded()
{ {}
}
void MainWindow::toggleMainToolBar() void MainWindow::toggleMainToolBar()
{ {

View File

@ -23,12 +23,10 @@
PrintableReport::PrintableReport() : PrintableReport::PrintableReport() :
Report(QString()) Report(QString())
{ {}
}
PrintableReport::~PrintableReport() PrintableReport::~PrintableReport()
{ {}
}
bool PrintableReport::create() bool PrintableReport::create()
{ {

View File

@ -21,8 +21,7 @@
Report::Report(const QString &filename) : Report::Report(const QString &filename) :
QObject(), QObject(),
mFilename(filename) mFilename(filename)
{ {}
}
Report::~Report() Report::~Report()
{ {

View File

@ -98,8 +98,7 @@ ResultsTree::ResultsTree(QWidget * parent) :
} }
ResultsTree::~ResultsTree() ResultsTree::~ResultsTree()
{ {}
}
void ResultsTree::keyPressEvent(QKeyEvent *event) void ResultsTree::keyPressEvent(QKeyEvent *event)
{ {

View File

@ -31,8 +31,6 @@ private slots:
private: private:
// Empty implementations of ErrorLogger methods. // Empty implementations of ErrorLogger methods.
// We don't care about the output in the benchmark tests. // We don't care about the output in the benchmark tests.
void reportOut(const std::string & outmsg) override { void reportOut(const std::string & outmsg) override {}
} void reportErr(const ErrorMessage &msg) override {}
void reportErr(const ErrorMessage &msg) override {
}
}; };

View File

@ -1053,8 +1053,7 @@ public:
_read(read), _read(read),
_write(write), _write(write),
_modified(modified), _modified(modified),
_allocateMemory(allocateMemory) { _allocateMemory(allocateMemory) {}
}
/** variable is used.. set both read+write */ /** variable is used.. set both read+write */
void use() { void use() {

View File

@ -69,8 +69,7 @@ TranslationHandler::TranslationHandler(QObject *parent) :
} }
TranslationHandler::~TranslationHandler() TranslationHandler::~TranslationHandler()
{ {}
}
const QStringList TranslationHandler::getNames() const const QStringList TranslationHandler::getNames() const
{ {

View File

@ -23,12 +23,10 @@
TxtReport::TxtReport(const QString &filename) : TxtReport::TxtReport(const QString &filename) :
Report(filename) Report(filename)
{ {}
}
TxtReport::~TxtReport() TxtReport::~TxtReport()
{ {}
}
bool TxtReport::create() bool TxtReport::create()
{ {

View File

@ -27,8 +27,7 @@ static const char VersionAttribute[] = "version";
XmlReport::XmlReport(const QString &filename) : XmlReport::XmlReport(const QString &filename) :
Report(filename) Report(filename)
{ {}
}
QString XmlReport::quoteMessage(const QString &message) QString XmlReport::quoteMessage(const QString &message)
{ {

View File

@ -51,8 +51,7 @@ XmlReportV2::XmlReportV2(const QString &filename) :
XmlReport(filename), XmlReport(filename),
mXmlReader(nullptr), mXmlReader(nullptr),
mXmlWriter(nullptr) mXmlWriter(nullptr)
{ {}
}
XmlReportV2::~XmlReportV2() XmlReportV2::~XmlReportV2()
{ {

View File

@ -86,7 +86,9 @@ struct Analyzer {
return get(Incremental); return get(Incremental);
} }
bool isSymbolicMatch() const { return get(SymbolicMatch); } bool isSymbolicMatch() const {
return get(SymbolicMatch);
}
bool matches() const { bool matches() const {
return get(Match); return get(Match);

View File

@ -2102,7 +2102,9 @@ Token* findVariableChanged(Token *start, const Token *end, int indirect, const n
return nullptr; return nullptr;
if (depth < 0) if (depth < 0)
return start; return start;
auto getExprTok = memoize([&] { return findExpression(start, exprid); }); auto getExprTok = memoize([&] {
return findExpression(start, exprid);
});
for (Token *tok = start; tok != end; tok = tok->next()) { for (Token *tok = start; tok != end; tok = tok->next()) {
if (tok->exprId() != exprid) { if (tok->exprId() != exprid) {
if (globalvar && Token::Match(tok, "%name% (")) if (globalvar && Token::Match(tok, "%name% ("))

View File

@ -62,8 +62,7 @@ public:
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
Check(const std::string &aname, const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) Check(const std::string &aname, const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: mTokenizer(tokenizer), mSettings(settings), mErrorLogger(errorLogger), mName(aname) { : mTokenizer(tokenizer), mSettings(settings), mErrorLogger(errorLogger), mName(aname) {}
}
virtual ~Check() { virtual ~Check() {
if (!mTokenizer) if (!mTokenizer)

View File

@ -43,13 +43,11 @@ class Tokenizer;
class CPPCHECKLIB Check64BitPortability : public Check { class CPPCHECKLIB Check64BitPortability : public Check {
public: public:
/** This constructor is used when registering the Check64BitPortability */ /** This constructor is used when registering the Check64BitPortability */
Check64BitPortability() : Check(myName()) { Check64BitPortability() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
Check64BitPortability(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) Check64BitPortability(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -42,12 +42,10 @@ class Tokenizer;
class CPPCHECKLIB CheckAssert : public Check { class CPPCHECKLIB CheckAssert : public Check {
public: public:
CheckAssert() : Check(myName()) { CheckAssert() : Check(myName()) {}
}
CheckAssert(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckAssert(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** run checks, the token list is not simplified */ /** run checks, the token list is not simplified */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -42,13 +42,11 @@ class Variable;
class CPPCHECKLIB CheckAutoVariables : public Check { class CPPCHECKLIB CheckAutoVariables : public Check {
public: public:
/** This constructor is used when registering the CheckClass */ /** This constructor is used when registering the CheckClass */
CheckAutoVariables() : Check(myName()) { CheckAutoVariables() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckAutoVariables(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckAutoVariables(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -41,13 +41,11 @@ class Tokenizer;
class CPPCHECKLIB CheckBool : public Check { class CPPCHECKLIB CheckBool : public Check {
public: public:
/** @brief This constructor is used when registering the CheckClass */ /** @brief This constructor is used when registering the CheckClass */
CheckBool() : Check(myName()) { CheckBool() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckBool(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckBool(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -40,13 +40,11 @@ class Token;
class CPPCHECKLIB CheckBoost : public Check { class CPPCHECKLIB CheckBoost : public Check {
public: public:
/** This constructor is used when registering the CheckClass */ /** This constructor is used when registering the CheckClass */
CheckBoost() : Check(myName()) { CheckBoost() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckBoost(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckBoost(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -60,13 +60,11 @@ class CPPCHECKLIB CheckBufferOverrun : public Check {
public: public:
/** This constructor is used when registering the CheckClass */ /** This constructor is used when registering the CheckClass */
CheckBufferOverrun() : Check(myName()) { CheckBufferOverrun() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckBufferOverrun(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckBufferOverrun(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
CheckBufferOverrun checkBufferOverrun(tokenizer, settings, errorLogger); CheckBufferOverrun checkBufferOverrun(tokenizer, settings, errorLogger);

View File

@ -106,9 +106,7 @@ static bool isVclTypeInit(const Type *type)
CheckClass::CheckClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckClass::CheckClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger), : Check(myName(), tokenizer, settings, errorLogger),
mSymbolDatabase(tokenizer?tokenizer->getSymbolDatabase():nullptr) mSymbolDatabase(tokenizer?tokenizer->getSymbolDatabase():nullptr)
{ {}
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// ClassCheck: Check that all class constructors are ok. // ClassCheck: Check that all class constructors are ok.

View File

@ -44,8 +44,7 @@ class Token;
class CPPCHECKLIB CheckClass : public Check { class CPPCHECKLIB CheckClass : public Check {
public: public:
/** @brief This constructor is used when registering the CheckClass */ /** @brief This constructor is used when registering the CheckClass */
CheckClass() : Check(myName()), mSymbolDatabase(nullptr) { CheckClass() : Check(myName()), mSymbolDatabase(nullptr) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger); CheckClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger);

View File

@ -47,13 +47,11 @@ class ValueType;
class CPPCHECKLIB CheckCondition : public Check { class CPPCHECKLIB CheckCondition : public Check {
public: public:
/** This constructor is used when registering the CheckAssignIf */ /** This constructor is used when registering the CheckAssignIf */
CheckCondition() : Check(myName()) { CheckCondition() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckCondition(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckCondition(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
CheckCondition checkCondition(tokenizer, settings, errorLogger); CheckCondition checkCondition(tokenizer, settings, errorLogger);

View File

@ -54,13 +54,11 @@ static const struct CWE CWE480(480U); // Use of Incorrect Operator
class CPPCHECKLIB CheckExceptionSafety : public Check { class CPPCHECKLIB CheckExceptionSafety : public Check {
public: public:
/** This constructor is used when registering the CheckClass */ /** This constructor is used when registering the CheckClass */
CheckExceptionSafety() : Check(myName()) { CheckExceptionSafety() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckExceptionSafety(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckExceptionSafety(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
if (tokenizer->isC()) if (tokenizer->isC())

View File

@ -51,13 +51,11 @@ namespace ValueFlow {
class CPPCHECKLIB CheckFunctions : public Check { class CPPCHECKLIB CheckFunctions : public Check {
public: public:
/** This constructor is used when registering the CheckFunctions */ /** This constructor is used when registering the CheckFunctions */
CheckFunctions() : Check(myName()) { CheckFunctions() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckFunctions(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckFunctions(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -36,13 +36,11 @@
class CPPCHECKLIB CheckInternal : public Check { class CPPCHECKLIB CheckInternal : public Check {
public: public:
/** This constructor is used when registering the CheckClass */ /** This constructor is used when registering the CheckClass */
CheckInternal() : Check(myName()) { CheckInternal() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckInternal(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckInternal(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
if (!settings->checks.isEnabled(Checks::internalCheck)) if (!settings->checks.isEnabled(Checks::internalCheck))

View File

@ -108,8 +108,7 @@ struct Filepointer {
AppendMode append_mode; AppendMode append_mode;
std::string filename; std::string filename;
explicit Filepointer(OpenMode mode_ = OpenMode::UNKNOWN_OM) explicit Filepointer(OpenMode mode_ = OpenMode::UNKNOWN_OM)
: mode(mode_), mode_indent(0), lastOperation(Operation::NONE), op_indent(0), append_mode(AppendMode::UNKNOWN_AM) { : mode(mode_), mode_indent(0), lastOperation(Operation::NONE), op_indent(0), append_mode(AppendMode::UNKNOWN_AM) {}
}
}; };
namespace { namespace {

View File

@ -43,13 +43,11 @@ class ErrorLogger;
class CPPCHECKLIB CheckIO : public Check { class CPPCHECKLIB CheckIO : public Check {
public: public:
/** @brief This constructor is used when registering CheckIO */ /** @brief This constructor is used when registering CheckIO */
CheckIO() : Check(myName()) { CheckIO() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckIO(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckIO(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks on the normal token list */ /** @brief Run checks on the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -108,13 +108,11 @@ public:
class CPPCHECKLIB CheckLeakAutoVar : public Check { class CPPCHECKLIB CheckLeakAutoVar : public Check {
public: public:
/** This constructor is used when registering the CheckLeakAutoVar */ /** This constructor is used when registering the CheckLeakAutoVar */
CheckLeakAutoVar() : Check(myName()) { CheckLeakAutoVar() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckLeakAutoVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckLeakAutoVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
CheckLeakAutoVar checkLeakAutoVar(tokenizer, settings, errorLogger); CheckLeakAutoVar checkLeakAutoVar(tokenizer, settings, errorLogger);

View File

@ -88,8 +88,7 @@ public:
void operator=(const CheckMemoryLeak &) = delete; void operator=(const CheckMemoryLeak &) = delete;
CheckMemoryLeak(const Tokenizer *t, ErrorLogger *e, const Settings *s) CheckMemoryLeak(const Tokenizer *t, ErrorLogger *e, const Settings *s)
: mTokenizer_(t), mErrorLogger_(e), mSettings_(s) { : mTokenizer_(t), mErrorLogger_(e), mSettings_(s) {}
}
/** @brief What type of allocation are used.. the "Many" means that several types of allocation and deallocation are used */ /** @brief What type of allocation are used.. the "Many" means that several types of allocation and deallocation are used */
enum AllocType { No, Malloc, New, NewArray, File, Fd, Pipe, OtherMem, OtherRes, Many }; enum AllocType { No, Malloc, New, NewArray, File, Fd, Pipe, OtherMem, OtherRes, Many };
@ -172,13 +171,11 @@ public:
class CPPCHECKLIB CheckMemoryLeakInFunction : private Check, public CheckMemoryLeak { class CPPCHECKLIB CheckMemoryLeakInFunction : private Check, public CheckMemoryLeak {
public: public:
/** @brief This constructor is used when registering this class */ /** @brief This constructor is used when registering this class */
CheckMemoryLeakInFunction() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) { CheckMemoryLeakInFunction() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) {}
}
/** @brief This constructor is used when running checks */ /** @brief This constructor is used when running checks */
CheckMemoryLeakInFunction(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckMemoryLeakInFunction(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
CheckMemoryLeakInFunction checkMemoryLeak(tokenizer, settings, errorLogger); CheckMemoryLeakInFunction checkMemoryLeak(tokenizer, settings, errorLogger);
@ -234,12 +231,10 @@ private:
class CPPCHECKLIB CheckMemoryLeakInClass : private Check, private CheckMemoryLeak { class CPPCHECKLIB CheckMemoryLeakInClass : private Check, private CheckMemoryLeak {
public: public:
CheckMemoryLeakInClass() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) { CheckMemoryLeakInClass() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) {}
}
CheckMemoryLeakInClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckMemoryLeakInClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {}
}
void runChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) OVERRIDE { void runChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) OVERRIDE {
if (!tokenizr->isCPP()) if (!tokenizr->isCPP())
@ -281,12 +276,10 @@ private:
class CPPCHECKLIB CheckMemoryLeakStructMember : private Check, private CheckMemoryLeak { class CPPCHECKLIB CheckMemoryLeakStructMember : private Check, private CheckMemoryLeak {
public: public:
CheckMemoryLeakStructMember() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) { CheckMemoryLeakStructMember() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) {}
}
CheckMemoryLeakStructMember(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckMemoryLeakStructMember(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
CheckMemoryLeakStructMember checkMemoryLeak(tokenizer, settings, errorLogger); CheckMemoryLeakStructMember checkMemoryLeak(tokenizer, settings, errorLogger);
@ -302,8 +295,7 @@ private:
void checkStructVariable(const Variable * const variable); void checkStructVariable(const Variable * const variable);
void getErrorMessages(ErrorLogger * /*errorLogger*/, const Settings * /*settings*/) const OVERRIDE { void getErrorMessages(ErrorLogger * /*errorLogger*/, const Settings * /*settings*/) const OVERRIDE {}
}
static std::string myName() { static std::string myName() {
return "Memory leaks (struct members)"; return "Memory leaks (struct members)";
@ -320,12 +312,10 @@ private:
class CPPCHECKLIB CheckMemoryLeakNoVar : private Check, private CheckMemoryLeak { class CPPCHECKLIB CheckMemoryLeakNoVar : private Check, private CheckMemoryLeak {
public: public:
CheckMemoryLeakNoVar() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) { CheckMemoryLeakNoVar() : Check(myName()), CheckMemoryLeak(nullptr, nullptr, nullptr) {}
}
CheckMemoryLeakNoVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckMemoryLeakNoVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
CheckMemoryLeakNoVar checkMemoryLeak(tokenizer, settings, errorLogger); CheckMemoryLeakNoVar checkMemoryLeak(tokenizer, settings, errorLogger);

View File

@ -46,13 +46,11 @@ class Tokenizer;
class CPPCHECKLIB CheckNullPointer : public Check { class CPPCHECKLIB CheckNullPointer : public Check {
public: public:
/** @brief This constructor is used when registering the CheckNullPointer */ /** @brief This constructor is used when registering the CheckNullPointer */
CheckNullPointer() : Check(myName()) { CheckNullPointer() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckNullPointer(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckNullPointer(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -1268,8 +1268,7 @@ void CheckOther::checkPassByReference()
bool inconclusive = false; bool inconclusive = false;
if (var->valueType() && var->valueType()->type == ValueType::Type::CONTAINER) { if (var->valueType() && var->valueType()->type == ValueType::Type::CONTAINER) {} else if (var->type() && !var->type()->isEnumType()) { // Check if type is a struct or class.
} else if (var->type() && !var->type()->isEnumType()) { // Check if type is a struct or class.
// Ensure that it is a large object. // Ensure that it is a large object.
if (!var->type()->classScope) if (!var->type()->classScope)
inconclusive = true; inconclusive = true;

View File

@ -50,13 +50,11 @@ class ErrorLogger;
class CPPCHECKLIB CheckOther : public Check { class CPPCHECKLIB CheckOther : public Check {
public: public:
/** @brief This constructor is used when registering the CheckClass */ /** @brief This constructor is used when registering the CheckClass */
CheckOther() : Check(myName()) { CheckOther() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckOther(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckOther(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -42,13 +42,11 @@ class Token;
class CPPCHECKLIB CheckPostfixOperator : public Check { class CPPCHECKLIB CheckPostfixOperator : public Check {
public: public:
/** This constructor is used when registering the CheckPostfixOperator */ /** This constructor is used when registering the CheckPostfixOperator */
CheckPostfixOperator() : Check(myName()) { CheckPostfixOperator() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckPostfixOperator(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckPostfixOperator(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
if (tokenizer->isC()) if (tokenizer->isC())

View File

@ -41,13 +41,11 @@ class Tokenizer;
class CPPCHECKLIB CheckSizeof : public Check { class CPPCHECKLIB CheckSizeof : public Check {
public: public:
/** @brief This constructor is used when registering the CheckClass */ /** @brief This constructor is used when registering the CheckClass */
CheckSizeof() : Check(myName()) { CheckSizeof() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckSizeof(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) CheckSizeof(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) OVERRIDE { void runChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) OVERRIDE {

View File

@ -46,13 +46,11 @@ class ErrorLogger;
class CPPCHECKLIB CheckStl : public Check { class CPPCHECKLIB CheckStl : public Check {
public: public:
/** This constructor is used when registering the CheckClass */ /** This constructor is used when registering the CheckClass */
CheckStl() : Check(myName()) { CheckStl() : Check(myName()) {}
}
/** This constructor is used when running checks. */ /** This constructor is used when running checks. */
CheckStl(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) CheckStl(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** run checks, the token list is not simplified */ /** run checks, the token list is not simplified */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -41,13 +41,11 @@ class Tokenizer;
class CPPCHECKLIB CheckString : public Check { class CPPCHECKLIB CheckString : public Check {
public: public:
/** @brief This constructor is used when registering the CheckClass */ /** @brief This constructor is used when registering the CheckClass */
CheckString() : Check(myName()) { CheckString() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckString(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckString(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -40,13 +40,11 @@ class Tokenizer;
class CPPCHECKLIB CheckType : public Check { class CPPCHECKLIB CheckType : public Check {
public: public:
/** @brief This constructor is used when registering the CheckClass */ /** @brief This constructor is used when registering the CheckClass */
CheckType() : Check(myName()) { CheckType() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckType(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckType(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -55,13 +55,11 @@ struct VariableValue {
class CPPCHECKLIB CheckUninitVar : public Check { class CPPCHECKLIB CheckUninitVar : public Check {
public: public:
/** @brief This constructor is used when registering the CheckUninitVar */ /** @brief This constructor is used when registering the CheckUninitVar */
CheckUninitVar() : Check(myName()) { CheckUninitVar() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckUninitVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckUninitVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -355,8 +355,7 @@ bool CheckUnusedFunctions::analyseWholeProgram(const CTU::FileInfo *ctu, const s
CheckUnusedFunctions::FunctionDecl::FunctionDecl(const Function *f) CheckUnusedFunctions::FunctionDecl::FunctionDecl(const Function *f)
: functionName(f->name()), lineNumber(f->token->linenr()) : functionName(f->name()), lineNumber(f->token->linenr())
{ {}
}
std::string CheckUnusedFunctions::analyzerInfo() const std::string CheckUnusedFunctions::analyzerInfo() const
{ {

View File

@ -42,13 +42,11 @@ class Tokenizer;
class CPPCHECKLIB CheckUnusedFunctions : public Check { class CPPCHECKLIB CheckUnusedFunctions : public Check {
public: public:
/** @brief This constructor is used when registering the CheckUnusedFunctions */ /** @brief This constructor is used when registering the CheckUnusedFunctions */
CheckUnusedFunctions() : Check(myName()) { CheckUnusedFunctions() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckUnusedFunctions(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckUnusedFunctions(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
static void clear() { static void clear() {
instance.mFunctions.clear(); instance.mFunctions.clear();
@ -101,8 +99,7 @@ private:
class CPPCHECKLIB FunctionUsage { class CPPCHECKLIB FunctionUsage {
public: public:
FunctionUsage() : lineNumber(0), usedSameFile(false), usedOtherFile(false) { FunctionUsage() : lineNumber(0), usedSameFile(false), usedOtherFile(false) {}
}
std::string filename; std::string filename;
unsigned int lineNumber; unsigned int lineNumber;

View File

@ -115,8 +115,7 @@ public:
_read(read), _read(read),
_write(write), _write(write),
_modified(modified), _modified(modified),
_allocateMemory(allocateMemory) { _allocateMemory(allocateMemory) {}
}
/** variable is used.. set both read+write */ /** variable is used.. set both read+write */
void use() { void use() {

View File

@ -46,13 +46,11 @@ class Function;
class CPPCHECKLIB CheckUnusedVar : public Check { class CPPCHECKLIB CheckUnusedVar : public Check {
public: public:
/** @brief This constructor is used when registering the CheckClass */ /** @brief This constructor is used when registering the CheckClass */
CheckUnusedVar() : Check(myName()) { CheckUnusedVar() : Check(myName()) {}
}
/** @brief This constructor is used when running checks. */ /** @brief This constructor is used when running checks. */
CheckUnusedVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckUnusedVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
/** @brief Run checks against the normal token list */ /** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {

View File

@ -41,12 +41,10 @@ class Tokenizer;
class CPPCHECKLIB CheckVaarg : public Check { class CPPCHECKLIB CheckVaarg : public Check {
public: public:
CheckVaarg() : Check(myName()) { CheckVaarg() : Check(myName()) {}
}
CheckVaarg(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) CheckVaarg(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
: Check(myName(), tokenizer, settings, errorLogger) { : Check(myName(), tokenizer, settings, errorLogger) {}
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE {
CheckVaarg check(tokenizer, settings, errorLogger); CheckVaarg check(tokenizer, settings, errorLogger);

View File

@ -329,8 +329,7 @@ CppCheck::CppCheck(ErrorLogger &errorLogger,
, mTooManyConfigs(false) , mTooManyConfigs(false)
, mSimplify(true) , mSimplify(true)
, mExecuteCommand(executeCommand) , mExecuteCommand(executeCommand)
{ {}
}
CppCheck::~CppCheck() CppCheck::~CppCheck()
{ {
@ -1512,9 +1511,7 @@ void CppCheck::reportInfo(const ErrorMessage &msg)
} }
void CppCheck::reportStatus(unsigned int /*fileindex*/, unsigned int /*filecount*/, std::size_t /*sizedone*/, std::size_t /*sizetotal*/) void CppCheck::reportStatus(unsigned int /*fileindex*/, unsigned int /*filecount*/, std::size_t /*sizedone*/, std::size_t /*sizetotal*/)
{ {}
}
void CppCheck::bughuntingReport(const std::string &str) void CppCheck::bughuntingReport(const std::string &str)
{ {

View File

@ -55,8 +55,7 @@ CTU::FileInfo::Location::Location(const Tokenizer *tokenizer, const Token *tok)
: fileName(tokenizer->list.file(tok)) : fileName(tokenizer->list.file(tok))
, lineNumber(tok->linenr()) , lineNumber(tok->linenr())
, column(tok->column()) , column(tok->column())
{ {}
}
std::string CTU::FileInfo::toString() const std::string CTU::FileInfo::toString() const
{ {
@ -151,15 +150,13 @@ CTU::FileInfo::CallBase::CallBase(const Tokenizer *tokenizer, const Token *callT
, callArgNr(0) , callArgNr(0)
, callFunctionName(callToken->next()->astOperand1()->expressionString()) , callFunctionName(callToken->next()->astOperand1()->expressionString())
, location(CTU::FileInfo::Location(tokenizer, callToken)) , location(CTU::FileInfo::Location(tokenizer, callToken))
{ {}
}
CTU::FileInfo::NestedCall::NestedCall(const Tokenizer *tokenizer, const Function *myFunction, const Token *callToken) CTU::FileInfo::NestedCall::NestedCall(const Tokenizer *tokenizer, const Function *myFunction, const Token *callToken)
: CallBase(tokenizer, callToken) : CallBase(tokenizer, callToken)
, myId(getFunctionId(tokenizer, myFunction)) , myId(getFunctionId(tokenizer, myFunction))
, myArgNr(0) , myArgNr(0)
{ {}
}
static std::string readAttrString(const tinyxml2::XMLElement *e, const char *attr, bool *error) static std::string readAttrString(const tinyxml2::XMLElement *e, const char *attr, bool *error)
{ {

View File

@ -98,8 +98,7 @@ namespace CTU {
NestedCall(const std::string &myId, nonneg int myArgNr, const std::string &callId, nonneg int callArgnr, const std::string &callFunctionName, const Location &location) NestedCall(const std::string &myId, nonneg int myArgNr, const std::string &callId, nonneg int callArgnr, const std::string &callFunctionName, const Location &location)
: CallBase(callId, callArgnr, callFunctionName, location), : CallBase(callId, callArgnr, callFunctionName, location),
myId(myId), myId(myId),
myArgNr(myArgNr) { myArgNr(myArgNr) {}
}
NestedCall(const Tokenizer *tokenizer, const Function *myFunction, const Token *callToken); NestedCall(const Tokenizer *tokenizer, const Function *myFunction, const Token *callToken);

View File

@ -69,8 +69,7 @@ static std::size_t calculateWarningHash(const TokenList *tokenList, const std::s
ErrorMessage::ErrorMessage() ErrorMessage::ErrorMessage()
: incomplete(false), severity(Severity::none), cwe(0U), certainty(Certainty::normal), hash(0) : incomplete(false), severity(Severity::none), cwe(0U), certainty(Certainty::normal), hash(0)
{ {}
}
ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file1, Severity::SeverityType severity, const std::string &msg, const std::string &id, Certainty::CertaintyLevel certainty) : ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file1, Severity::SeverityType severity, const std::string &msg, const std::string &id, Certainty::CertaintyLevel certainty) :
callStack(callStack), // locations for this error message callStack(callStack), // locations for this error message
@ -660,13 +659,11 @@ std::string ErrorLogger::callStackToString(const std::list<ErrorMessage::FileLoc
ErrorMessage::FileLocation::FileLocation(const Token* tok, const TokenList* tokenList) ErrorMessage::FileLocation::FileLocation(const Token* tok, const TokenList* tokenList)
: fileIndex(tok->fileIndex()), line(tok->linenr()), column(tok->column()), mOrigFileName(tokenList->getOrigFile(tok)), mFileName(tokenList->file(tok)) : fileIndex(tok->fileIndex()), line(tok->linenr()), column(tok->column()), mOrigFileName(tokenList->getOrigFile(tok)), mFileName(tokenList->file(tok))
{ {}
}
ErrorMessage::FileLocation::FileLocation(const Token* tok, const std::string &info, const TokenList* tokenList) ErrorMessage::FileLocation::FileLocation(const Token* tok, const std::string &info, const TokenList* tokenList)
: fileIndex(tok->fileIndex()), line(tok->linenr()), column(tok->column()), mOrigFileName(tokenList->getOrigFile(tok)), mFileName(tokenList->file(tok)), mInfo(info) : fileIndex(tok->fileIndex()), line(tok->linenr()), column(tok->column()), mOrigFileName(tokenList->getOrigFile(tok)), mFileName(tokenList->file(tok)), mInfo(info)
{ {}
}
std::string ErrorMessage::FileLocation::getfile(bool convert) const std::string ErrorMessage::FileLocation::getfile(bool convert) const
{ {

View File

@ -67,16 +67,13 @@ public:
class CPPCHECKLIB FileLocation { class CPPCHECKLIB FileLocation {
public: public:
FileLocation() FileLocation()
: fileIndex(0), line(0), column(0) { : fileIndex(0), line(0), column(0) {}
}
FileLocation(const std::string &file, int line, unsigned int column) FileLocation(const std::string &file, int line, unsigned int column)
: fileIndex(0), line(line), column(column), mOrigFileName(file), mFileName(file) { : fileIndex(0), line(line), column(column), mOrigFileName(file), mFileName(file) {}
}
FileLocation(const std::string &file, const std::string &info, int line, unsigned int column) FileLocation(const std::string &file, const std::string &info, int line, unsigned int column)
: fileIndex(0), line(line), column(column), mOrigFileName(file), mFileName(file), mInfo(info) { : fileIndex(0), line(line), column(column), mOrigFileName(file), mFileName(file), mInfo(info) {}
}
FileLocation(const Token* tok, const TokenList* tokenList); FileLocation(const Token* tok, const TokenList* tokenList);
FileLocation(const Token* tok, const std::string &info, const TokenList* tokenList); FileLocation(const Token* tok, const std::string &info, const TokenList* tokenList);

View File

@ -916,8 +916,7 @@ ExprEngine::ArrayValue::ArrayValue(const std::string &name, const ExprEngine::Ar
: Value(name, ExprEngine::ValueType::ArrayValue) : Value(name, ExprEngine::ValueType::ArrayValue)
, pointer(arrayValue.pointer), nullPointer(arrayValue.nullPointer), uninitPointer(arrayValue.uninitPointer) , pointer(arrayValue.pointer), nullPointer(arrayValue.nullPointer), uninitPointer(arrayValue.uninitPointer)
, data(arrayValue.data), size(arrayValue.size) , data(arrayValue.data), size(arrayValue.size)
{ {}
}
std::string ExprEngine::ArrayValue::getRange() const std::string ExprEngine::ArrayValue::getRange() const
@ -1130,8 +1129,7 @@ public:
for (auto constraint : data->constraints) { for (auto constraint : data->constraints) {
try { try {
solver.add(getConstraintExpr(constraint)); solver.add(getConstraintExpr(constraint));
} catch (const BailoutValueException &) { } catch (const BailoutValueException &) {}
}
} }
} }

View File

@ -74,8 +74,7 @@ namespace ExprEngine {
public: public:
explicit DataBase(const std::string &currentFunction, const Settings *settings) explicit DataBase(const std::string &currentFunction, const Settings *settings)
: currentFunction(currentFunction) : currentFunction(currentFunction)
, settings(settings) { , settings(settings) {}
}
virtual std::string getNewSymbolName() = 0; virtual std::string getNewSymbolName() = 0;
const std::string currentFunction; const std::string currentFunction;
const Settings * const settings; const Settings * const settings;
@ -144,8 +143,7 @@ namespace ExprEngine {
: Value(name, ValueType::IntRange) : Value(name, ValueType::IntRange)
, minValue(minValue) , minValue(minValue)
, maxValue(maxValue) , maxValue(maxValue)
, loopScope(nullptr) { , loopScope(nullptr) {}
}
std::string getRange() const OVERRIDE { std::string getRange() const OVERRIDE {
if (minValue == maxValue) if (minValue == maxValue)
return str(minValue); return str(minValue);
@ -165,8 +163,7 @@ namespace ExprEngine {
FloatRange(const std::string &name, long double minValue, long double maxValue) FloatRange(const std::string &name, long double minValue, long double maxValue)
: Value(name, ValueType::FloatRange) : Value(name, ValueType::FloatRange)
, minValue(minValue) , minValue(minValue)
, maxValue(maxValue) { , maxValue(maxValue) {}
}
std::string getRange() const OVERRIDE { std::string getRange() const OVERRIDE {
return std::to_string(minValue) + ":" + std::to_string(maxValue); return std::to_string(minValue) + ":" + std::to_string(maxValue);
@ -279,8 +276,7 @@ namespace ExprEngine {
: Value(getName(binop, op1, op2), ValueType::BinOpResult) : Value(getName(binop, op1, op2), ValueType::BinOpResult)
, binop(binop) , binop(binop)
, op1(op1) , op1(op1)
, op2(op2) { , op2(op2) {}
}
bool isEqual(const DataBase *dataBase, int value) const OVERRIDE; bool isEqual(const DataBase *dataBase, int value) const OVERRIDE;
bool isGreaterThan(const DataBase *dataBase, int value) const OVERRIDE; bool isGreaterThan(const DataBase *dataBase, int value) const OVERRIDE;
@ -306,8 +302,7 @@ namespace ExprEngine {
: Value(name, ValueType::IntegerTruncation) : Value(name, ValueType::IntegerTruncation)
, inputValue(inputValue) , inputValue(inputValue)
, bits(bits) , bits(bits)
, sign(sign) { , sign(sign) {}
}
std::string getSymbolicExpression() const OVERRIDE; std::string getSymbolicExpression() const OVERRIDE;

View File

@ -57,8 +57,7 @@ static void gettokenlistfromvalid(const std::string& valid, TokenList& tokenList
} }
Library::Library() : bugHunting(false), mAllocId(0) Library::Library() : bugHunting(false), mAllocId(0)
{ {}
}
Library::Error Library::load(const char exename[], const char path[]) Library::Error Library::load(const char exename[], const char path[])
{ {

View File

@ -213,8 +213,7 @@ public:
opLessAllowed(true), opLessAllowed(true),
hasInitializerListConstructor(false), hasInitializerListConstructor(false),
unstableErase(false), unstableErase(false),
unstableInsert(false) { unstableInsert(false) {}
}
enum class Action { enum class Action {
RESIZE, CLEAR, PUSH, POP, FIND, INSERT, ERASE, CHANGE_CONTENT, CHANGE, CHANGE_INTERNAL, RESIZE, CLEAR, PUSH, POP, FIND, INSERT, ERASE, CHANGE_CONTENT, CHANGE, CHANGE_INTERNAL,
@ -268,8 +267,7 @@ public:
optional(false), optional(false),
variadic(false), variadic(false),
iteratorInfo(), iteratorInfo(),
direction(Direction::DIR_UNKNOWN) { direction(Direction::DIR_UNKNOWN) {}
}
bool notbool; bool notbool;
bool notnull; bool notnull;
@ -457,8 +455,7 @@ public:
, mLong(false) , mLong(false)
, mPointer(false) , mPointer(false)
, mPtrPtr(false) , mPtrPtr(false)
, mConstPtr(false) { , mConstPtr(false) {}
}
bool operator == (const PlatformType & type) const { bool operator == (const PlatformType & type) const {
return (mSigned == type.mSigned && return (mSigned == type.mSigned &&
mUnsigned == type.mUnsigned && mUnsigned == type.mUnsigned &&

View File

@ -29,8 +29,7 @@ namespace MatchCompiler {
public: public:
typedef const char(&StringRef)[n]; typedef const char(&StringRef)[n];
explicit ConstString(StringRef s) explicit ConstString(StringRef s)
:_s(s) { : _s(s) {}
}
operator StringRef() const { operator StringRef() const {
return _s; return _s;

View File

@ -54,8 +54,7 @@ Directive::Directive(const std::string &_file, const int _linenr, const std::str
file(_file), file(_file),
linenr(_linenr), linenr(_linenr),
str(trim(_str)) str(trim(_str))
{ {}
}
std::atomic<bool> Preprocessor::missingIncludeFlag; std::atomic<bool> Preprocessor::missingIncludeFlag;
std::atomic<bool> Preprocessor::missingSystemIncludeFlag; std::atomic<bool> Preprocessor::missingSystemIncludeFlag;
@ -63,8 +62,7 @@ std::atomic<bool> Preprocessor::missingSystemIncludeFlag;
char Preprocessor::macroChar = char(1); char Preprocessor::macroChar = char(1);
Preprocessor::Preprocessor(Settings& settings, ErrorLogger *errorLogger) : mSettings(settings), mErrorLogger(errorLogger) Preprocessor::Preprocessor(Settings& settings, ErrorLogger *errorLogger) : mSettings(settings), mErrorLogger(errorLogger)
{ {}
}
Preprocessor::~Preprocessor() Preprocessor::~Preprocessor()
{ {

View File

@ -4083,8 +4083,7 @@ Scope::Scope(const SymbolDatabase *check_, const Token *classDef_, const Scope *
function(nullptr), function(nullptr),
enumType(nullptr), enumType(nullptr),
enumClass(false) enumClass(false)
{ {}
}
Scope::Scope(const SymbolDatabase *check_, const Token *classDef_, const Scope *nestedIn_) : Scope::Scope(const SymbolDatabase *check_, const Token *classDef_, const Scope *nestedIn_) :
check(check_), check(check_),

View File

@ -77,8 +77,7 @@ public:
class BaseInfo { class BaseInfo {
public: public:
BaseInfo() : BaseInfo() :
type(nullptr), nameTok(nullptr), access(AccessControl::Public), isVirtual(false) { type(nullptr), nameTok(nullptr), access(AccessControl::Public), isVirtual(false) {}
}
std::string name; std::string name;
const Type* type; const Type* type;
@ -93,8 +92,7 @@ public:
struct FriendInfo { struct FriendInfo {
FriendInfo() : FriendInfo() :
nameStart(nullptr), nameEnd(nullptr), type(nullptr) { nameStart(nullptr), nameEnd(nullptr), type(nullptr) {}
}
const Token* nameStart; const Token* nameStart;
const Token* nameEnd; const Token* nameEnd;

View File

@ -264,12 +264,10 @@ bool TemplateSimplifier::TokenAndName::isAliasToken(const Token *tok) const
TemplateSimplifier::TemplateSimplifier(Tokenizer *tokenizer) TemplateSimplifier::TemplateSimplifier(Tokenizer *tokenizer)
: mTokenizer(tokenizer), mTokenList(tokenizer->list), mSettings(tokenizer->mSettings), : mTokenizer(tokenizer), mTokenList(tokenizer->list), mSettings(tokenizer->mSettings),
mErrorLogger(tokenizer->mErrorLogger), mChanged(false) mErrorLogger(tokenizer->mErrorLogger), mChanged(false)
{ {}
}
TemplateSimplifier::~TemplateSimplifier() TemplateSimplifier::~TemplateSimplifier()
{ {}
}
void TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates() void TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates()
{ {

View File

@ -46,8 +46,7 @@ struct TimerResultsData {
TimerResultsData() TimerResultsData()
: mClocks(0) : mClocks(0)
, mNumberOfResults(0) { , mNumberOfResults(0) {}
}
double seconds() const { double seconds() const {
const double ret = (double)((unsigned long)mClocks) / (double)CLOCKS_PER_SEC; const double ret = (double)((unsigned long)mClocks) / (double)CLOCKS_PER_SEC;
@ -57,8 +56,7 @@ struct TimerResultsData {
class CPPCHECKLIB TimerResults : public TimerResultsIntf { class CPPCHECKLIB TimerResults : public TimerResultsIntf {
public: public:
TimerResults() { TimerResults() {}
}
void showResults(SHOWTIME_MODES mode) const; void showResults(SHOWTIME_MODES mode) const;
void addResults(const std::string& str, std::clock_t clocks) OVERRIDE; void addResults(const std::string& str, std::clock_t clocks) OVERRIDE;

View File

@ -52,11 +52,9 @@ namespace {
// in order to store information about the scope // in order to store information about the scope
struct VarIdScopeInfo { struct VarIdScopeInfo {
VarIdScopeInfo() VarIdScopeInfo()
:isExecutable(false), isStructInit(false), isEnum(false), startVarid(0) { : isExecutable(false), isStructInit(false), isEnum(false), startVarid(0) {}
}
VarIdScopeInfo(bool isExecutable, bool isStructInit, bool isEnum, nonneg int startVarid) VarIdScopeInfo(bool isExecutable, bool isStructInit, bool isEnum, nonneg int startVarid)
:isExecutable(isExecutable), isStructInit(isStructInit), isEnum(isEnum), startVarid(startVarid) { : isExecutable(isExecutable), isStructInit(isStructInit), isEnum(isEnum), startVarid(startVarid) {}
}
const bool isExecutable; const bool isExecutable;
const bool isStructInit; const bool isStructInit;
@ -161,8 +159,7 @@ Tokenizer::Tokenizer() :
, mMaxTime(std::time(0) + MAXTIME) , mMaxTime(std::time(0) + MAXTIME)
#endif #endif
, mPreprocessor(nullptr) , mPreprocessor(nullptr)
{ {}
}
Tokenizer::Tokenizer(const Settings *settings, ErrorLogger *errorLogger) : Tokenizer::Tokenizer(const Settings *settings, ErrorLogger *errorLogger) :
list(settings), list(settings),

View File

@ -1803,8 +1803,7 @@ class SelectValueFromVarIdMapRange {
using reference = value_type &; using reference = value_type &;
explicit Iterator(const M::const_iterator &it) explicit Iterator(const M::const_iterator &it)
: mIt(it) { : mIt(it) {}
}
reference operator*() const { reference operator*() const {
return mIt->second; return mIt->second;
@ -1834,8 +1833,7 @@ class SelectValueFromVarIdMapRange {
public: public:
explicit SelectValueFromVarIdMapRange(const M *m) explicit SelectValueFromVarIdMapRange(const M *m)
: mMap(m) { : mMap(m) {}
}
Iterator begin() const { Iterator begin() const {
return Iterator(mMap->begin()); return Iterator(mMap->begin());
@ -2107,7 +2105,9 @@ struct ValueFlowAnalyzer : Analyzer {
} }
} }
virtual bool useSymbolicValues() const { return true; } virtual bool useSymbolicValues() const {
return true;
}
bool isSameSymbolicValue(const Token* tok, ErrorPath* errorPath = nullptr) const bool isSameSymbolicValue(const Token* tok, ErrorPath* errorPath = nullptr) const
{ {

View File

@ -57,7 +57,9 @@ public:
return mPtr.release(); return mPtr.release();
} }
T* get() NOEXCEPT { return mPtr.get(); } T* get() NOEXCEPT {
return mPtr.get();
}
const T* get() const NOEXCEPT { const T* get() const NOEXCEPT {
return mPtr.get(); return mPtr.get();
} }
@ -69,7 +71,9 @@ public:
return *get(); return *get();
} }
T* operator->() NOEXCEPT { return get(); } T* operator->() NOEXCEPT {
return get();
}
const T* operator->() const NOEXCEPT { const T* operator->() const NOEXCEPT {
return get(); return get();
} }

42
runformat Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
UNCRUSTIFY_VERSION="0.72.0"
UNCRUSTIFY="${UNCRUSTIFY-uncrustify}"
DETECTED_VERSION=$("$UNCRUSTIFY" --version 2>&1 | grep -o -E '[0-9.]+')
if [ "$DETECTED_VERSION" != "${UNCRUSTIFY_VERSION}" ]; then
echo "You should use version: ${UNCRUSTIFY_VERSION}"
echo "Detected version: ${DETECTED_VERSION}"
exit 1
fi
# OS variables
[ $(uname -s) = "Darwin" ] && export OSX=1 && export UNIX=1
[ $(uname -s) = "Linux" ] && export LINUX=1 && export UNIX=1
uname -s | grep -q "_NT-" && export WINDOWS=1
if [ $OSX ]
then
export CPUCOUNT=$(sysctl -n hw.ncpu)
elif [ $LINUX ]
then
export CPUCOUNT=$(nproc)
else
export CPUCOUNT="1"
fi
function formatCplusplus {
find $1 -iname '*.h' \
-o -iname '*.c' \
-o -iname '*.cpp' \
| xargs -n 1 -P $CPUCOUNT -I{} -t $UNCRUSTIFY -c .uncrustify.cfg --no-backup {}
}
formatCplusplus cli/
formatCplusplus democlient/
formatCplusplus gui/
formatCplusplus lib/
formatCplusplus oss-fuzz/
formatCplusplus test/
formatCplusplus tools/
formatCplusplus samples/

View File

@ -442,8 +442,7 @@ static bool write_pbm_image(QIODevice *out, const QImage &sourceImage, const QBy
QPpmHandler::QPpmHandler() QPpmHandler::QPpmHandler()
: state(Ready) : state(Ready)
{ {}
}
bool QPpmHandler::readHeader() bool QPpmHandler::readHeader()
{ {

View File

@ -55,14 +55,28 @@ public:
virtual int getType() = 0; virtual int getType() = 0;
// Return size of input and output tuples. // Return size of input and output tuples.
int getInputSize() { return m; } int getInputSize() {
int getOutputSize() { return n; } return m;
}
int getOutputSize() {
return n;
}
double getDomainMin(int i) { return domain[i][0]; } double getDomainMin(int i) {
double getDomainMax(int i) { return domain[i][1]; } return domain[i][0];
double getRangeMin(int i) { return range[i][0]; } }
double getRangeMax(int i) { return range[i][1]; } double getDomainMax(int i) {
GBool getHasRange() { return hasRange; } return domain[i][1];
}
double getRangeMin(int i) {
return range[i][0];
}
double getRangeMax(int i) {
return range[i][1];
}
GBool getHasRange() {
return hasRange;
}
// Transform an input tuple into an output tuple. // Transform an input tuple into an output tuple.
virtual void transform(double *in, double *out) = 0; virtual void transform(double *in, double *out) = 0;
@ -88,10 +102,16 @@ public:
IdentityFunction(); IdentityFunction();
virtual ~IdentityFunction(); virtual ~IdentityFunction();
virtual Function *copy() { return new IdentityFunction(); } virtual Function *copy() {
virtual int getType() { return -1; } return new IdentityFunction();
}
virtual int getType() {
return -1;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return gTrue; } virtual GBool isOk() {
return gTrue;
}
private: private:
}; };
@ -105,17 +125,35 @@ public:
SampledFunction(Object *funcObj, Dict *dict); SampledFunction(Object *funcObj, Dict *dict);
virtual ~SampledFunction(); virtual ~SampledFunction();
virtual Function *copy() { return new SampledFunction(this); } virtual Function *copy() {
virtual int getType() { return 0; } return new SampledFunction(this);
}
virtual int getType() {
return 0;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
int getSampleSize(int i) { return sampleSize[i]; } int getSampleSize(int i) {
double getEncodeMin(int i) { return encode[i][0]; } return sampleSize[i];
double getEncodeMax(int i) { return encode[i][1]; } }
double getDecodeMin(int i) { return decode[i][0]; } double getEncodeMin(int i) {
double getDecodeMax(int i) { return decode[i][1]; } return encode[i][0];
double *getSamples() { return samples; } }
double getEncodeMax(int i) {
return encode[i][1];
}
double getDecodeMin(int i) {
return decode[i][0];
}
double getDecodeMax(int i) {
return decode[i][1];
}
double *getSamples() {
return samples;
}
private: private:
@ -147,14 +185,26 @@ public:
ExponentialFunction(Object *funcObj, Dict *dict); ExponentialFunction(Object *funcObj, Dict *dict);
virtual ~ExponentialFunction(); virtual ~ExponentialFunction();
virtual Function *copy() { return new ExponentialFunction(this); } virtual Function *copy() {
virtual int getType() { return 2; } return new ExponentialFunction(this);
}
virtual int getType() {
return 2;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
double *getC0() { return c0; } double *getC0() {
double *getC1() { return c1; } return c0;
double getE() { return e; } }
double *getC1() {
return c1;
}
double getE() {
return e;
}
private: private:
@ -175,16 +225,32 @@ public:
StitchingFunction(Object *funcObj, Dict *dict, int recursion); StitchingFunction(Object *funcObj, Dict *dict, int recursion);
virtual ~StitchingFunction(); virtual ~StitchingFunction();
virtual Function *copy() { return new StitchingFunction(this); } virtual Function *copy() {
virtual int getType() { return 3; } return new StitchingFunction(this);
}
virtual int getType() {
return 3;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
int getNumFuncs() { return k; } int getNumFuncs() {
Function *getFunc(int i) { return funcs[i]; } return k;
double *getBounds() { return bounds; } }
double *getEncode() { return encode; } Function *getFunc(int i) {
double *getScale() { return scale; } return funcs[i];
}
double *getBounds() {
return bounds;
}
double *getEncode() {
return encode;
}
double *getScale() {
return scale;
}
private: private:
@ -207,12 +273,20 @@ public:
PostScriptFunction(Object *funcObj, Dict *dict); PostScriptFunction(Object *funcObj, Dict *dict);
virtual ~PostScriptFunction(); virtual ~PostScriptFunction();
virtual Function *copy() { return new PostScriptFunction(this); } virtual Function *copy() {
virtual int getType() { return 4; } return new PostScriptFunction(this);
}
virtual int getType() {
return 4;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
GString *getCodeString() { return codeString; } GString *getCodeString() {
return codeString;
}
private: private:

View File

@ -99,7 +99,9 @@ public:
virtual ~PSOutputDev(); virtual ~PSOutputDev();
// Check if file was successfully created. // Check if file was successfully created.
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
// Returns false if there have been any errors on the output stream. // Returns false if there have been any errors on the output stream.
GBool checkIO(); GBool checkIO();
@ -108,30 +110,42 @@ public:
// Does this device use upside-down coordinates? // Does this device use upside-down coordinates?
// (Upside-down means (0,0) is the top left corner of the page.) // (Upside-down means (0,0) is the top left corner of the page.)
virtual GBool upsideDown() { return gFalse; } virtual GBool upsideDown() {
return gFalse;
}
// Does this device use drawChar() or drawString()? // Does this device use drawChar() or drawString()?
virtual GBool useDrawChar() { return gFalse; } virtual GBool useDrawChar() {
return gFalse;
}
// Does this device use tilingPatternFill()? If this returns false, // Does this device use tilingPatternFill()? If this returns false,
// tiling pattern fills will be reduced to a series of other drawing // tiling pattern fills will be reduced to a series of other drawing
// operations. // operations.
virtual GBool useTilingPatternFill() { return gTrue; } virtual GBool useTilingPatternFill() {
return gTrue;
}
// Does this device use functionShadedFill(), axialShadedFill(), and // Does this device use functionShadedFill(), axialShadedFill(), and
// radialShadedFill()? If this returns false, these shaded fills // radialShadedFill()? If this returns false, these shaded fills
// will be reduced to a series of other drawing operations. // will be reduced to a series of other drawing operations.
virtual GBool useShadedFills() virtual GBool useShadedFills()
{ return level == psLevel2 || level == psLevel2Sep || {
level == psLevel3 || level == psLevel3Sep; } return level == psLevel2 || level == psLevel2Sep ||
level == psLevel3 || level == psLevel3Sep;
}
// Does this device use drawForm()? If this returns false, // Does this device use drawForm()? If this returns false,
// form-type XObjects will be interpreted (i.e., unrolled). // form-type XObjects will be interpreted (i.e., unrolled).
virtual GBool useDrawForm() { return preload; } virtual GBool useDrawForm() {
return preload;
}
// Does this device use beginType3Char/endType3Char? Otherwise, // Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString. // text in Type 3 fonts will be drawn with drawChar/drawString.
virtual GBool interpretType3Chars() { return gFalse; } virtual GBool interpretType3Chars() {
return gFalse;
}
//----- header/trailer (used only if manualCtrl is true) //----- header/trailer (used only if manualCtrl is true)
@ -260,21 +274,35 @@ public:
//----- miscellaneous //----- miscellaneous
void setImageableArea(int imgLLXA, int imgLLYA, int imgURXA, int imgURYA) void setImageableArea(int imgLLXA, int imgLLYA, int imgURXA, int imgURYA)
{ imgLLX = imgLLXA; imgLLY = imgLLYA; imgURX = imgURXA; imgURY = imgURYA; } {
imgLLX = imgLLXA; imgLLY = imgLLYA; imgURX = imgURXA; imgURY = imgURYA;
}
void setOffset(double x, double y) void setOffset(double x, double y)
{ tx0 = x; ty0 = y; } {
tx0 = x; ty0 = y;
}
void setScale(double x, double y) void setScale(double x, double y)
{ xScale0 = x; yScale0 = y; } {
xScale0 = x; yScale0 = y;
}
void setRotate(int rotateA) void setRotate(int rotateA)
{ rotate0 = rotateA; } {
rotate0 = rotateA;
}
void setClip(double llx, double lly, double urx, double ury) void setClip(double llx, double lly, double urx, double ury)
{ clipLLX0 = llx; clipLLY0 = lly; clipURX0 = urx; clipURY0 = ury; } {
clipLLX0 = llx; clipLLY0 = lly; clipURX0 = urx; clipURY0 = ury;
}
void setUnderlayCbk(void (*cbk)(PSOutputDev *psOut, void *data), void setUnderlayCbk(void (*cbk)(PSOutputDev *psOut, void *data),
void *data) void *data)
{ underlayCbk = cbk; underlayCbkData = data; } {
underlayCbk = cbk; underlayCbkData = data;
}
void setOverlayCbk(void (*cbk)(PSOutputDev *psOut, void *data), void setOverlayCbk(void (*cbk)(PSOutputDev *psOut, void *data),
void *data) void *data)
{ overlayCbk = cbk; overlayCbkData = data; } {
overlayCbk = cbk; overlayCbkData = data;
}
void writePSChar(char c); void writePSChar(char c);
void writePSBlock(char *s, int len); void writePSBlock(char *s, int len);

View File

@ -235,28 +235,40 @@ public:
int *xMax, int *yMax); int *xMax, int *yMax);
// Return the associated bitmap. // Return the associated bitmap.
SplashBitmap *getBitmap() { return bitmap; } SplashBitmap *getBitmap() {
return bitmap;
}
// Set the minimum line width. // Set the minimum line width.
void setMinLineWidth(SplashCoord w) { minLineWidth = w; } void setMinLineWidth(SplashCoord w) {
minLineWidth = w;
}
// Get a bounding box which includes all modifications since the // Get a bounding box which includes all modifications since the
// last call to clearModRegion. // last call to clearModRegion.
void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax) void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax)
{ *xMin = modXMin; *yMin = modYMin; *xMax = modXMax; *yMax = modYMax; } {
*xMin = modXMin; *yMin = modYMin; *xMax = modXMax; *yMax = modYMax;
}
// Clear the modified region bounding box. // Clear the modified region bounding box.
void clearModRegion(); void clearModRegion();
// Get clipping status for the last drawing operation subject to // Get clipping status for the last drawing operation subject to
// clipping. // clipping.
SplashClipResult getClipRes() { return opClipRes; } SplashClipResult getClipRes() {
return opClipRes;
}
// Toggle debug mode on or off. // Toggle debug mode on or off.
void setDebugMode(GBool debugModeA) { debugMode = debugModeA; } void setDebugMode(GBool debugModeA) {
debugMode = debugModeA;
}
#if 1 //~tmp: turn off anti-aliasing temporarily #if 1 //~tmp: turn off anti-aliasing temporarily
void setInShading(GBool sh) { inShading = sh; } void setInShading(GBool sh) {
inShading = sh;
}
#endif #endif

View File

@ -78,7 +78,9 @@ public:
// Get kind of stream. // Get kind of stream.
virtual StreamKind getKind() = 0; virtual StreamKind getKind() = 0;
virtual GBool isEmbedStream() { return gFalse; } virtual GBool isEmbedStream() {
return gFalse;
}
// Reset stream to beginning. // Reset stream to beginning.
virtual void reset() = 0; virtual void reset() = 0;
@ -133,14 +135,18 @@ public:
virtual Dict *getDict() = 0; virtual Dict *getDict() = 0;
// Is this an encoding filter? // Is this an encoding filter?
virtual GBool isEncoder() { return gFalse; } virtual GBool isEncoder() {
return gFalse;
}
// Get image parameters which are defined by the stream contents. // Get image parameters which are defined by the stream contents.
virtual void getImageParams(int *bitsPerComponent, virtual void getImageParams(int *bitsPerComponent,
StreamColorSpaceMode *csMode) {} StreamColorSpaceMode *csMode) {}
// Return the next stream in the "stack". // Return the next stream in the "stack".
virtual Stream *getNextStream() { return NULL; } virtual Stream *getNextStream() {
return NULL;
}
// Add filters to this stream according to the parameters in <dict>. // Add filters to this stream according to the parameters in <dict>.
// Returns the new stream. // Returns the new stream.
@ -165,11 +171,21 @@ public:
virtual Stream *makeSubStream(GFileOffset start, GBool limited, virtual Stream *makeSubStream(GFileOffset start, GBool limited,
GFileOffset length, Object *dict) = 0; GFileOffset length, Object *dict) = 0;
virtual void setPos(GFileOffset pos, int dir = 0) = 0; virtual void setPos(GFileOffset pos, int dir = 0) = 0;
virtual GBool isBinary(GBool last = gTrue) { return last; } virtual GBool isBinary(GBool last = gTrue) {
virtual BaseStream *getBaseStream() { return this; } return last;
virtual Stream *getUndecodedStream() { return this; } }
virtual Dict *getDict() { return dict.getDict(); } virtual BaseStream *getBaseStream() {
virtual GString *getFileName() { return NULL; } return this;
}
virtual Stream *getUndecodedStream() {
return this;
}
virtual Dict *getDict() {
return dict.getDict();
}
virtual GString *getFileName() {
return NULL;
}
// Get/set position of first byte of stream within the file. // Get/set position of first byte of stream within the file.
virtual GFileOffset getStart() = 0; virtual GFileOffset getStart() = 0;
@ -192,12 +208,22 @@ public:
FilterStream(Stream *strA); FilterStream(Stream *strA);
virtual ~FilterStream(); virtual ~FilterStream();
virtual void close(); virtual void close();
virtual GFileOffset getPos() { return str->getPos(); } virtual GFileOffset getPos() {
return str->getPos();
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual BaseStream *getBaseStream() { return str->getBaseStream(); } virtual BaseStream *getBaseStream() {
virtual Stream *getUndecodedStream() { return str->getUndecodedStream(); } return str->getBaseStream();
virtual Dict *getDict() { return str->getDict(); } }
virtual Stream *getNextStream() { return str; } virtual Stream *getUndecodedStream() {
return str->getUndecodedStream();
}
virtual Dict *getDict() {
return str->getDict();
}
virtual Stream *getNextStream() {
return str;
}
protected: protected:
@ -263,7 +289,9 @@ public:
~StreamPredictor(); ~StreamPredictor();
GBool isOk() { return ok; } GBool isOk() {
return ok;
}
void reset(); void reset();
@ -271,10 +299,18 @@ public:
int getChar(); int getChar();
int getBlock(char *blk, int size); int getBlock(char *blk, int size);
int getPredictor() { return predictor; } int getPredictor() {
int getWidth() { return width; } return predictor;
int getNComps() { return nComps; } }
int getNBits() { return nBits; } int getWidth() {
return width;
}
int getNComps() {
return nComps;
}
int getNBits() {
return nBits;
}
private: private:
@ -308,16 +344,26 @@ public:
virtual Stream *copy(); virtual Stream *copy();
virtual Stream *makeSubStream(GFileOffset startA, GBool limitedA, virtual Stream *makeSubStream(GFileOffset startA, GBool limitedA,
GFileOffset lengthA, Object *dictA); GFileOffset lengthA, Object *dictA);
virtual StreamKind getKind() { return strFile; } virtual StreamKind getKind() {
return strFile;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GFileOffset getPos() { return bufPos + (int)(bufPtr - buf); } virtual GFileOffset getPos() {
return bufPos + (int)(bufPtr - buf);
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual GFileOffset getStart() { return start; } virtual GFileOffset getStart() {
return start;
}
virtual void moveStart(int delta); virtual void moveStart(int delta);
private: private:
@ -348,17 +394,27 @@ public:
virtual Stream *copy(); virtual Stream *copy();
virtual Stream *makeSubStream(GFileOffset start, GBool limited, virtual Stream *makeSubStream(GFileOffset start, GBool limited,
GFileOffset lengthA, Object *dictA); GFileOffset lengthA, Object *dictA);
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual void close(); virtual void close();
virtual int getChar() virtual int getChar()
{ return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; } {
return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF;
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; } {
return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF;
}
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); } virtual GFileOffset getPos() {
return (GFileOffset)(bufPtr - buf);
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual GFileOffset getStart() { return start; } virtual GFileOffset getStart() {
return start;
}
virtual void moveStart(int delta); virtual void moveStart(int delta);
private: private:
@ -389,13 +445,19 @@ public:
virtual Stream *copy(); virtual Stream *copy();
virtual Stream *makeSubStream(GFileOffset start, GBool limitedA, virtual Stream *makeSubStream(GFileOffset start, GBool limitedA,
GFileOffset lengthA, Object *dictA); GFileOffset lengthA, Object *dictA);
virtual StreamKind getKind() { return str->getKind(); } virtual StreamKind getKind() {
virtual GBool isEmbedStream() { return gTrue; } return str->getKind();
}
virtual GBool isEmbedStream() {
return gTrue;
}
virtual void reset() {} virtual void reset() {}
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GFileOffset getPos() { return str->getPos(); } virtual GFileOffset getPos() {
return str->getPos();
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual GFileOffset getStart(); virtual GFileOffset getStart();
virtual void moveStart(int delta); virtual void moveStart(int delta);
@ -417,10 +479,14 @@ public:
ASCIIHexStream(Stream *strA); ASCIIHexStream(Stream *strA);
virtual ~ASCIIHexStream(); virtual ~ASCIIHexStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strASCIIHex; } virtual StreamKind getKind() {
return strASCIIHex;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ int c = lookChar(); buf = EOF; return c; } {
int c = lookChar(); buf = EOF; return c;
}
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
@ -441,10 +507,14 @@ public:
ASCII85Stream(Stream *strA); ASCII85Stream(Stream *strA);
virtual ~ASCII85Stream(); virtual ~ASCII85Stream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strASCII85; } virtual StreamKind getKind() {
return strASCII85;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ int ch = lookChar(); ++index; return ch; } {
int ch = lookChar(); ++index; return ch;
}
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
@ -468,7 +538,9 @@ public:
int bits, int earlyA); int bits, int earlyA);
virtual ~LZWStream(); virtual ~LZWStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strLZW; } virtual StreamKind getKind() {
return strLZW;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
@ -513,12 +585,18 @@ public:
RunLengthStream(Stream *strA); RunLengthStream(Stream *strA);
virtual ~RunLengthStream(); virtual ~RunLengthStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strRunLength; } virtual StreamKind getKind() {
return strRunLength;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
@ -547,7 +625,9 @@ public:
GBool endOfBlockA, GBool blackA); GBool endOfBlockA, GBool blackA);
virtual ~CCITTFaxStream(); virtual ~CCITTFaxStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strCCITTFax; } virtual StreamKind getKind() {
return strCCITTFax;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
@ -584,7 +664,9 @@ private:
short getWhiteCode(); short getWhiteCode();
short getBlackCode(); short getBlackCode();
short lookBits(int n); short lookBits(int n);
void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; } void eatBits(int n) {
if ((inputBits -= n) < 0) inputBits = 0;
}
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@ -644,7 +726,9 @@ public:
DCTStream(Stream *strA, int colorXformA); DCTStream(Stream *strA, int colorXformA);
virtual ~DCTStream(); virtual ~DCTStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strDCT; } virtual StreamKind getKind() {
return strDCT;
}
virtual void reset(); virtual void reset();
virtual void close(); virtual void close();
virtual int getChar(); virtual int getChar();
@ -652,7 +736,9 @@ public:
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
Stream *getRawStream() { return str; } Stream *getRawStream() {
return str;
}
private: private:
@ -779,7 +865,9 @@ public:
int colors, int bits); int colors, int bits);
virtual ~FlateStream(); virtual ~FlateStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strFlate; } virtual StreamKind getKind() {
return strFlate;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
@ -835,14 +923,26 @@ public:
EOFStream(Stream *strA); EOFStream(Stream *strA);
virtual ~EOFStream(); virtual ~EOFStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset() {} virtual void reset() {}
virtual int getChar() { return EOF; } virtual int getChar() {
virtual int lookChar() { return EOF; } return EOF;
virtual int getBlock(char *blk, int size) { return 0; } }
virtual int lookChar() {
return EOF;
}
virtual int getBlock(char *blk, int size) {
return 0;
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } return NULL;
}
virtual GBool isBinary(GBool last = gTrue) {
return gFalse;
}
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@ -855,12 +955,16 @@ public:
BufStream(Stream *strA, int bufSizeA); BufStream(Stream *strA, int bufSizeA);
virtual ~BufStream(); virtual ~BufStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
return NULL;
}
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
int lookChar(int idx); int lookChar(int idx);
@ -881,14 +985,20 @@ public:
FixedLengthEncoder(Stream *strA, int lengthA); FixedLengthEncoder(Stream *strA, int lengthA);
~FixedLengthEncoder(); ~FixedLengthEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
return NULL;
}
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
virtual GBool isEncoder() { return gTrue; } virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -906,16 +1016,28 @@ public:
ASCIIHexEncoder(Stream *strA); ASCIIHexEncoder(Stream *strA);
virtual ~ASCIIHexEncoder(); virtual ~ASCIIHexEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gFalse;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -938,16 +1060,28 @@ public:
ASCII85Encoder(Stream *strA); ASCII85Encoder(Stream *strA);
virtual ~ASCII85Encoder(); virtual ~ASCII85Encoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gFalse;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -970,16 +1104,28 @@ public:
RunLengthEncoder(Stream *strA); RunLengthEncoder(Stream *strA);
virtual ~RunLengthEncoder(); virtual ~RunLengthEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gTrue; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gTrue;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -1008,14 +1154,22 @@ public:
LZWEncoder(Stream *strA); LZWEncoder(Stream *strA);
virtual ~LZWEncoder(); virtual ~LZWEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gTrue; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gTrue;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:

View File

@ -55,14 +55,28 @@ public:
virtual int getType() = 0; virtual int getType() = 0;
// Return size of input and output tuples. // Return size of input and output tuples.
int getInputSize() { return m; } int getInputSize() {
int getOutputSize() { return n; } return m;
}
int getOutputSize() {
return n;
}
double getDomainMin(int i) { return domain[i][0]; } double getDomainMin(int i) {
double getDomainMax(int i) { return domain[i][1]; } return domain[i][0];
double getRangeMin(int i) { return range[i][0]; } }
double getRangeMax(int i) { return range[i][1]; } double getDomainMax(int i) {
GBool getHasRange() { return hasRange; } return domain[i][1];
}
double getRangeMin(int i) {
return range[i][0];
}
double getRangeMax(int i) {
return range[i][1];
}
GBool getHasRange() {
return hasRange;
}
// Transform an input tuple into an output tuple. // Transform an input tuple into an output tuple.
virtual void transform(double *in, double *out) = 0; virtual void transform(double *in, double *out) = 0;
@ -88,10 +102,16 @@ public:
IdentityFunction(); IdentityFunction();
virtual ~IdentityFunction(); virtual ~IdentityFunction();
virtual Function *copy() { return new IdentityFunction(); } virtual Function *copy() {
virtual int getType() { return -1; } return new IdentityFunction();
}
virtual int getType() {
return -1;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return gTrue; } virtual GBool isOk() {
return gTrue;
}
private: private:
}; };
@ -105,17 +125,35 @@ public:
SampledFunction(Object *funcObj, Dict *dict); SampledFunction(Object *funcObj, Dict *dict);
virtual ~SampledFunction(); virtual ~SampledFunction();
virtual Function *copy() { return new SampledFunction(this); } virtual Function *copy() {
virtual int getType() { return 0; } return new SampledFunction(this);
}
virtual int getType() {
return 0;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
int getSampleSize(int i) { return sampleSize[i]; } int getSampleSize(int i) {
double getEncodeMin(int i) { return encode[i][0]; } return sampleSize[i];
double getEncodeMax(int i) { return encode[i][1]; } }
double getDecodeMin(int i) { return decode[i][0]; } double getEncodeMin(int i) {
double getDecodeMax(int i) { return decode[i][1]; } return encode[i][0];
double *getSamples() { return samples; } }
double getEncodeMax(int i) {
return encode[i][1];
}
double getDecodeMin(int i) {
return decode[i][0];
}
double getDecodeMax(int i) {
return decode[i][1];
}
double *getSamples() {
return samples;
}
private: private:
@ -147,14 +185,26 @@ public:
ExponentialFunction(Object *funcObj, Dict *dict); ExponentialFunction(Object *funcObj, Dict *dict);
virtual ~ExponentialFunction(); virtual ~ExponentialFunction();
virtual Function *copy() { return new ExponentialFunction(this); } virtual Function *copy() {
virtual int getType() { return 2; } return new ExponentialFunction(this);
}
virtual int getType() {
return 2;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
double *getC0() { return c0; } double *getC0() {
double *getC1() { return c1; } return c0;
double getE() { return e; } }
double *getC1() {
return c1;
}
double getE() {
return e;
}
private: private:
@ -175,16 +225,32 @@ public:
StitchingFunction(Object *funcObj, Dict *dict, int recursion); StitchingFunction(Object *funcObj, Dict *dict, int recursion);
virtual ~StitchingFunction(); virtual ~StitchingFunction();
virtual Function *copy() { return new StitchingFunction(this); } virtual Function *copy() {
virtual int getType() { return 3; } return new StitchingFunction(this);
}
virtual int getType() {
return 3;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
int getNumFuncs() { return k; } int getNumFuncs() {
Function *getFunc(int i) { return funcs[i]; } return k;
double *getBounds() { return bounds; } }
double *getEncode() { return encode; } Function *getFunc(int i) {
double *getScale() { return scale; } return funcs[i];
}
double *getBounds() {
return bounds;
}
double *getEncode() {
return encode;
}
double *getScale() {
return scale;
}
private: private:
@ -207,12 +273,20 @@ public:
PostScriptFunction(Object *funcObj, Dict *dict); PostScriptFunction(Object *funcObj, Dict *dict);
virtual ~PostScriptFunction(); virtual ~PostScriptFunction();
virtual Function *copy() { return new PostScriptFunction(this); } virtual Function *copy() {
virtual int getType() { return 4; } return new PostScriptFunction(this);
}
virtual int getType() {
return 4;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
GString *getCodeString() { return codeString; } GString *getCodeString() {
return codeString;
}
private: private:

View File

@ -235,28 +235,40 @@ public:
int *xMax, int *yMax); int *xMax, int *yMax);
// Return the associated bitmap. // Return the associated bitmap.
SplashBitmap *getBitmap() { return bitmap; } SplashBitmap *getBitmap() {
return bitmap;
}
// Set the minimum line width. // Set the minimum line width.
void setMinLineWidth(SplashCoord w) { minLineWidth = w; } void setMinLineWidth(SplashCoord w) {
minLineWidth = w;
}
// Get a bounding box which includes all modifications since the // Get a bounding box which includes all modifications since the
// last call to clearModRegion. // last call to clearModRegion.
void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax) void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax)
{ *xMin = modXMin; *yMin = modYMin; *xMax = modXMax; *yMax = modYMax; } {
*xMin = modXMin; *yMin = modYMin; *xMax = modXMax; *yMax = modYMax;
}
// Clear the modified region bounding box. // Clear the modified region bounding box.
void clearModRegion(); void clearModRegion();
// Get clipping status for the last drawing operation subject to // Get clipping status for the last drawing operation subject to
// clipping. // clipping.
SplashClipResult getClipRes() { return opClipRes; } SplashClipResult getClipRes() {
return opClipRes;
}
// Toggle debug mode on or off. // Toggle debug mode on or off.
void setDebugMode(GBool debugModeA) { debugMode = debugModeA; } void setDebugMode(GBool debugModeA) {
debugMode = debugModeA;
}
#if 1 //~tmp: turn off anti-aliasing temporarily #if 1 //~tmp: turn off anti-aliasing temporarily
void setInShading(GBool sh) { inShading = sh; } void setInShading(GBool sh) {
inShading = sh;
}
#endif #endif

View File

@ -78,7 +78,9 @@ public:
// Get kind of stream. // Get kind of stream.
virtual StreamKind getKind() = 0; virtual StreamKind getKind() = 0;
virtual GBool isEmbedStream() { return gFalse; } virtual GBool isEmbedStream() {
return gFalse;
}
// Reset stream to beginning. // Reset stream to beginning.
virtual void reset() = 0; virtual void reset() = 0;
@ -133,14 +135,18 @@ public:
virtual Dict *getDict() = 0; virtual Dict *getDict() = 0;
// Is this an encoding filter? // Is this an encoding filter?
virtual GBool isEncoder() { return gFalse; } virtual GBool isEncoder() {
return gFalse;
}
// Get image parameters which are defined by the stream contents. // Get image parameters which are defined by the stream contents.
virtual void getImageParams(int *bitsPerComponent, virtual void getImageParams(int *bitsPerComponent,
StreamColorSpaceMode *csMode) {} StreamColorSpaceMode *csMode) {}
// Return the next stream in the "stack". // Return the next stream in the "stack".
virtual Stream *getNextStream() { return NULL; } virtual Stream *getNextStream() {
return NULL;
}
// Add filters to this stream according to the parameters in <dict>. // Add filters to this stream according to the parameters in <dict>.
// Returns the new stream. // Returns the new stream.
@ -165,11 +171,21 @@ public:
virtual Stream *makeSubStream(GFileOffset start, GBool limited, virtual Stream *makeSubStream(GFileOffset start, GBool limited,
GFileOffset length, Object *dict) = 0; GFileOffset length, Object *dict) = 0;
virtual void setPos(GFileOffset pos, int dir = 0) = 0; virtual void setPos(GFileOffset pos, int dir = 0) = 0;
virtual GBool isBinary(GBool last = gTrue) { return last; } virtual GBool isBinary(GBool last = gTrue) {
virtual BaseStream *getBaseStream() { return this; } return last;
virtual Stream *getUndecodedStream() { return this; } }
virtual Dict *getDict() { return dict.getDict(); } virtual BaseStream *getBaseStream() {
virtual GString *getFileName() { return NULL; } return this;
}
virtual Stream *getUndecodedStream() {
return this;
}
virtual Dict *getDict() {
return dict.getDict();
}
virtual GString *getFileName() {
return NULL;
}
// Get/set position of first byte of stream within the file. // Get/set position of first byte of stream within the file.
virtual GFileOffset getStart() = 0; virtual GFileOffset getStart() = 0;
@ -192,12 +208,22 @@ public:
FilterStream(Stream *strA); FilterStream(Stream *strA);
virtual ~FilterStream(); virtual ~FilterStream();
virtual void close(); virtual void close();
virtual GFileOffset getPos() { return str->getPos(); } virtual GFileOffset getPos() {
return str->getPos();
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual BaseStream *getBaseStream() { return str->getBaseStream(); } virtual BaseStream *getBaseStream() {
virtual Stream *getUndecodedStream() { return str->getUndecodedStream(); } return str->getBaseStream();
virtual Dict *getDict() { return str->getDict(); } }
virtual Stream *getNextStream() { return str; } virtual Stream *getUndecodedStream() {
return str->getUndecodedStream();
}
virtual Dict *getDict() {
return str->getDict();
}
virtual Stream *getNextStream() {
return str;
}
protected: protected:
@ -263,7 +289,9 @@ public:
~StreamPredictor(); ~StreamPredictor();
GBool isOk() { return ok; } GBool isOk() {
return ok;
}
void reset(); void reset();
@ -271,10 +299,18 @@ public:
int getChar(); int getChar();
int getBlock(char *blk, int size); int getBlock(char *blk, int size);
int getPredictor() { return predictor; } int getPredictor() {
int getWidth() { return width; } return predictor;
int getNComps() { return nComps; } }
int getNBits() { return nBits; } int getWidth() {
return width;
}
int getNComps() {
return nComps;
}
int getNBits() {
return nBits;
}
private: private:
@ -308,16 +344,26 @@ public:
virtual Stream *copy(); virtual Stream *copy();
virtual Stream *makeSubStream(GFileOffset startA, GBool limitedA, virtual Stream *makeSubStream(GFileOffset startA, GBool limitedA,
GFileOffset lengthA, Object *dictA); GFileOffset lengthA, Object *dictA);
virtual StreamKind getKind() { return strFile; } virtual StreamKind getKind() {
return strFile;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GFileOffset getPos() { return bufPos + (int)(bufPtr - buf); } virtual GFileOffset getPos() {
return bufPos + (int)(bufPtr - buf);
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual GFileOffset getStart() { return start; } virtual GFileOffset getStart() {
return start;
}
virtual void moveStart(int delta); virtual void moveStart(int delta);
private: private:
@ -348,17 +394,27 @@ public:
virtual Stream *copy(); virtual Stream *copy();
virtual Stream *makeSubStream(GFileOffset start, GBool limited, virtual Stream *makeSubStream(GFileOffset start, GBool limited,
GFileOffset lengthA, Object *dictA); GFileOffset lengthA, Object *dictA);
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual void close(); virtual void close();
virtual int getChar() virtual int getChar()
{ return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF; } {
return (bufPtr < bufEnd) ? (*bufPtr++ & 0xff) : EOF;
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF; } {
return (bufPtr < bufEnd) ? (*bufPtr & 0xff) : EOF;
}
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GFileOffset getPos() { return (GFileOffset)(bufPtr - buf); } virtual GFileOffset getPos() {
return (GFileOffset)(bufPtr - buf);
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual GFileOffset getStart() { return start; } virtual GFileOffset getStart() {
return start;
}
virtual void moveStart(int delta); virtual void moveStart(int delta);
private: private:
@ -389,13 +445,19 @@ public:
virtual Stream *copy(); virtual Stream *copy();
virtual Stream *makeSubStream(GFileOffset start, GBool limitedA, virtual Stream *makeSubStream(GFileOffset start, GBool limitedA,
GFileOffset lengthA, Object *dictA); GFileOffset lengthA, Object *dictA);
virtual StreamKind getKind() { return str->getKind(); } virtual StreamKind getKind() {
virtual GBool isEmbedStream() { return gTrue; } return str->getKind();
}
virtual GBool isEmbedStream() {
return gTrue;
}
virtual void reset() {} virtual void reset() {}
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GFileOffset getPos() { return str->getPos(); } virtual GFileOffset getPos() {
return str->getPos();
}
virtual void setPos(GFileOffset pos, int dir = 0); virtual void setPos(GFileOffset pos, int dir = 0);
virtual GFileOffset getStart(); virtual GFileOffset getStart();
virtual void moveStart(int delta); virtual void moveStart(int delta);
@ -417,10 +479,14 @@ public:
ASCIIHexStream(Stream *strA); ASCIIHexStream(Stream *strA);
virtual ~ASCIIHexStream(); virtual ~ASCIIHexStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strASCIIHex; } virtual StreamKind getKind() {
return strASCIIHex;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ int c = lookChar(); buf = EOF; return c; } {
int c = lookChar(); buf = EOF; return c;
}
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
@ -441,10 +507,14 @@ public:
ASCII85Stream(Stream *strA); ASCII85Stream(Stream *strA);
virtual ~ASCII85Stream(); virtual ~ASCII85Stream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strASCII85; } virtual StreamKind getKind() {
return strASCII85;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ int ch = lookChar(); ++index; return ch; } {
int ch = lookChar(); ++index; return ch;
}
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
@ -468,7 +538,9 @@ public:
int bits, int earlyA); int bits, int earlyA);
virtual ~LZWStream(); virtual ~LZWStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strLZW; } virtual StreamKind getKind() {
return strLZW;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
@ -513,12 +585,18 @@ public:
RunLengthStream(Stream *strA); RunLengthStream(Stream *strA);
virtual ~RunLengthStream(); virtual ~RunLengthStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strRunLength; } virtual StreamKind getKind() {
return strRunLength;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
@ -547,7 +625,9 @@ public:
GBool endOfBlockA, GBool blackA); GBool endOfBlockA, GBool blackA);
virtual ~CCITTFaxStream(); virtual ~CCITTFaxStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strCCITTFax; } virtual StreamKind getKind() {
return strCCITTFax;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
@ -584,7 +664,9 @@ private:
short getWhiteCode(); short getWhiteCode();
short getBlackCode(); short getBlackCode();
short lookBits(int n); short lookBits(int n);
void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; } void eatBits(int n) {
if ((inputBits -= n) < 0) inputBits = 0;
}
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@ -644,7 +726,9 @@ public:
DCTStream(Stream *strA, int colorXformA); DCTStream(Stream *strA, int colorXformA);
virtual ~DCTStream(); virtual ~DCTStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strDCT; } virtual StreamKind getKind() {
return strDCT;
}
virtual void reset(); virtual void reset();
virtual void close(); virtual void close();
virtual int getChar(); virtual int getChar();
@ -652,7 +736,9 @@ public:
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
Stream *getRawStream() { return str; } Stream *getRawStream() {
return str;
}
private: private:
@ -779,7 +865,9 @@ public:
int colors, int bits); int colors, int bits);
virtual ~FlateStream(); virtual ~FlateStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strFlate; } virtual StreamKind getKind() {
return strFlate;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
@ -835,14 +923,26 @@ public:
EOFStream(Stream *strA); EOFStream(Stream *strA);
virtual ~EOFStream(); virtual ~EOFStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset() {} virtual void reset() {}
virtual int getChar() { return EOF; } virtual int getChar() {
virtual int lookChar() { return EOF; } return EOF;
virtual int getBlock(char *blk, int size) { return 0; } }
virtual int lookChar() {
return EOF;
}
virtual int getBlock(char *blk, int size) {
return 0;
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } return NULL;
}
virtual GBool isBinary(GBool last = gTrue) {
return gFalse;
}
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@ -855,12 +955,16 @@ public:
BufStream(Stream *strA, int bufSizeA); BufStream(Stream *strA, int bufSizeA);
virtual ~BufStream(); virtual ~BufStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
return NULL;
}
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
int lookChar(int idx); int lookChar(int idx);
@ -881,14 +985,20 @@ public:
FixedLengthEncoder(Stream *strA, int lengthA); FixedLengthEncoder(Stream *strA, int lengthA);
~FixedLengthEncoder(); ~FixedLengthEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
return NULL;
}
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
virtual GBool isEncoder() { return gTrue; } virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -906,16 +1016,28 @@ public:
ASCIIHexEncoder(Stream *strA); ASCIIHexEncoder(Stream *strA);
virtual ~ASCIIHexEncoder(); virtual ~ASCIIHexEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gFalse;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -938,16 +1060,28 @@ public:
ASCII85Encoder(Stream *strA); ASCII85Encoder(Stream *strA);
virtual ~ASCII85Encoder(); virtual ~ASCII85Encoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gFalse;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -970,16 +1104,28 @@ public:
RunLengthEncoder(Stream *strA); RunLengthEncoder(Stream *strA);
virtual ~RunLengthEncoder(); virtual ~RunLengthEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
}
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } {
return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
}
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gTrue; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gTrue;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:
@ -1008,14 +1154,22 @@ public:
LZWEncoder(Stream *strA); LZWEncoder(Stream *strA);
virtual ~LZWEncoder(); virtual ~LZWEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() {
return strWeird;
}
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent)
{ return NULL; } {
virtual GBool isBinary(GBool last = gTrue) { return gTrue; } return NULL;
virtual GBool isEncoder() { return gTrue; } }
virtual GBool isBinary(GBool last = gTrue) {
return gTrue;
}
virtual GBool isEncoder() {
return gTrue;
}
private: private:

View File

@ -55,14 +55,28 @@ public:
virtual int getType() = 0; virtual int getType() = 0;
// Return size of input and output tuples. // Return size of input and output tuples.
int getInputSize() { return m; } int getInputSize() {
int getOutputSize() { return n; } return m;
}
int getOutputSize() {
return n;
}
double getDomainMin(int i) { return domain[i][0]; } double getDomainMin(int i) {
double getDomainMax(int i) { return domain[i][1]; } return domain[i][0];
double getRangeMin(int i) { return range[i][0]; } }
double getRangeMax(int i) { return range[i][1]; } double getDomainMax(int i) {
GBool getHasRange() { return hasRange; } return domain[i][1];
}
double getRangeMin(int i) {
return range[i][0];
}
double getRangeMax(int i) {
return range[i][1];
}
GBool getHasRange() {
return hasRange;
}
// Transform an input tuple into an output tuple. // Transform an input tuple into an output tuple.
virtual void transform(double *in, double *out) = 0; virtual void transform(double *in, double *out) = 0;
@ -88,10 +102,16 @@ public:
IdentityFunction(); IdentityFunction();
virtual ~IdentityFunction(); virtual ~IdentityFunction();
virtual Function *copy() { return new IdentityFunction(); } virtual Function *copy() {
virtual int getType() { return -1; } return new IdentityFunction();
}
virtual int getType() {
return -1;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return gTrue; } virtual GBool isOk() {
return gTrue;
}
private: private:
}; };
@ -105,17 +125,35 @@ public:
SampledFunction(Object *funcObj, Dict *dict); SampledFunction(Object *funcObj, Dict *dict);
virtual ~SampledFunction(); virtual ~SampledFunction();
virtual Function *copy() { return new SampledFunction(this); } virtual Function *copy() {
virtual int getType() { return 0; } return new SampledFunction(this);
}
virtual int getType() {
return 0;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
int getSampleSize(int i) { return sampleSize[i]; } int getSampleSize(int i) {
double getEncodeMin(int i) { return encode[i][0]; } return sampleSize[i];
double getEncodeMax(int i) { return encode[i][1]; } }
double getDecodeMin(int i) { return decode[i][0]; } double getEncodeMin(int i) {
double getDecodeMax(int i) { return decode[i][1]; } return encode[i][0];
double *getSamples() { return samples; } }
double getEncodeMax(int i) {
return encode[i][1];
}
double getDecodeMin(int i) {
return decode[i][0];
}
double getDecodeMax(int i) {
return decode[i][1];
}
double *getSamples() {
return samples;
}
private: private:
@ -147,14 +185,26 @@ public:
ExponentialFunction(Object *funcObj, Dict *dict); ExponentialFunction(Object *funcObj, Dict *dict);
virtual ~ExponentialFunction(); virtual ~ExponentialFunction();
virtual Function *copy() { return new ExponentialFunction(this); } virtual Function *copy() {
virtual int getType() { return 2; } return new ExponentialFunction(this);
}
virtual int getType() {
return 2;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
double *getC0() { return c0; } double *getC0() {
double *getC1() { return c1; } return c0;
double getE() { return e; } }
double *getC1() {
return c1;
}
double getE() {
return e;
}
private: private:
@ -175,16 +225,32 @@ public:
StitchingFunction(Object *funcObj, Dict *dict, int recursion); StitchingFunction(Object *funcObj, Dict *dict, int recursion);
virtual ~StitchingFunction(); virtual ~StitchingFunction();
virtual Function *copy() { return new StitchingFunction(this); } virtual Function *copy() {
virtual int getType() { return 3; } return new StitchingFunction(this);
}
virtual int getType() {
return 3;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
int getNumFuncs() { return k; } int getNumFuncs() {
Function *getFunc(int i) { return funcs[i]; } return k;
double *getBounds() { return bounds; } }
double *getEncode() { return encode; } Function *getFunc(int i) {
double *getScale() { return scale; } return funcs[i];
}
double *getBounds() {
return bounds;
}
double *getEncode() {
return encode;
}
double *getScale() {
return scale;
}
private: private:
@ -207,12 +273,20 @@ public:
PostScriptFunction(Object *funcObj, Dict *dict); PostScriptFunction(Object *funcObj, Dict *dict);
virtual ~PostScriptFunction(); virtual ~PostScriptFunction();
virtual Function *copy() { return new PostScriptFunction(this); } virtual Function *copy() {
virtual int getType() { return 4; } return new PostScriptFunction(this);
}
virtual int getType() {
return 4;
}
virtual void transform(double *in, double *out); virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; } virtual GBool isOk() {
return ok;
}
GString *getCodeString() { return codeString; } GString *getCodeString() {
return codeString;
}
private: private:

View File

@ -35,7 +35,7 @@
% %
% %
*/ */
/* /*
Include declarations. Include declarations.
*/ */
@ -73,7 +73,7 @@
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE) #if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
#include <openjpeg.h> #include <openjpeg.h>
#endif #endif
/* /*
Forward declarations. Forward declarations.
*/ */
@ -81,7 +81,7 @@
static MagickBooleanType static MagickBooleanType
WriteJP2Image(const ImageInfo *,Image *,ExceptionInfo *); WriteJP2Image(const ImageInfo *,Image *,ExceptionInfo *);
#endif #endif
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -115,7 +115,7 @@ static MagickBooleanType IsJ2K(const unsigned char *magick,const size_t length)
return(MagickTrue); return(MagickTrue);
return(MagickFalse); return(MagickFalse);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -153,7 +153,7 @@ static MagickBooleanType IsJP2(const unsigned char *magick,const size_t length)
return(MagickTrue); return(MagickTrue);
return(MagickFalse); return(MagickFalse);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -534,7 +534,7 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
return(GetFirstImageInList(image)); return(GetFirstImageInList(image));
} }
#endif #endif
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -649,7 +649,7 @@ ModuleExport size_t RegisterJP2Image(void)
(void) RegisterMagickInfo(entry); (void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature); return(MagickImageCoderSignature);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -677,7 +677,7 @@ ModuleExport void UnregisterJP2Image(void)
(void) UnregisterMagickInfo("JP2"); (void) UnregisterMagickInfo("JP2");
(void) UnregisterMagickInfo("J2K"); (void) UnregisterMagickInfo("J2K");
} }
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE) #if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@ -33,7 +33,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
*/ */
/* /*
Include declarations. Include declarations.
*/ */
@ -63,7 +63,7 @@
#include "MagickCore/statistic.h" #include "MagickCore/statistic.h"
#include "MagickCore/string_.h" #include "MagickCore/string_.h"
#include "MagickCore/transform.h" #include "MagickCore/transform.h"
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -127,7 +127,7 @@ static void ClearBounds(Image *image,RectangleInfo *bounds,
break; break;
} }
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -196,7 +196,7 @@ static MagickBooleanType IsBoundsCleared(const Image *image1,
} }
return(y < (ssize_t) bounds->height ? MagickTrue : MagickFalse); return(y < (ssize_t) bounds->height ? MagickTrue : MagickFalse);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -347,7 +347,7 @@ MagickExport Image *CoalesceImages(const Image *image,ExceptionInfo *exception)
dispose_image=DestroyImage(dispose_image); dispose_image=DestroyImage(dispose_image);
return(GetFirstImageInList(coalesce_image)); return(GetFirstImageInList(coalesce_image));
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -487,7 +487,7 @@ MagickExport Image *DisposeImages(const Image *images,ExceptionInfo *exception)
dispose_image=DestroyImage(dispose_image); dispose_image=DestroyImage(dispose_image);
return(GetFirstImageInList(dispose_images)); return(GetFirstImageInList(dispose_images));
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -552,7 +552,7 @@ static MagickBooleanType ComparePixels(const LayerMethod method,
return(MagickFalse); return(MagickFalse);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -701,7 +701,7 @@ static RectangleInfo CompareImagesBounds(const Image *image1,
bounds.height=(size_t) (y-bounds.y+1); bounds.height=(size_t) (y-bounds.y+1);
return(bounds); return(bounds);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -857,7 +857,7 @@ MagickExport Image *CompareImagesLayers(const Image *image,
} }
return(GetFirstImageInList(layers)); return(GetFirstImageInList(layers));
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1357,7 +1357,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method,
} }
return(GetFirstImageInList(optimized_image)); return(GetFirstImageInList(optimized_image));
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1391,7 +1391,7 @@ MagickExport Image *OptimizeImageLayers(const Image *image,
{ {
return(OptimizeLayerFrames(image,OptimizeImageLayer,exception)); return(OptimizeLayerFrames(image,OptimizeImageLayer,exception));
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1424,7 +1424,7 @@ MagickExport Image *OptimizePlusImageLayers(const Image *image,
{ {
return OptimizeLayerFrames(image,OptimizePlusLayer,exception); return OptimizeLayerFrames(image,OptimizePlusLayer,exception);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1552,7 +1552,7 @@ MagickExport void OptimizeImageTransparency(const Image *image,
dispose_image=DestroyImage(dispose_image); dispose_image=DestroyImage(dispose_image);
return; return;
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1624,7 +1624,7 @@ MagickExport void RemoveDuplicateLayers(Image **images,
} }
*images = GetFirstImageInList(*images); *images = GetFirstImageInList(*images);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1698,7 +1698,7 @@ MagickExport void RemoveZeroDelayLayers(Image **images,
} }
*images=GetFirstImageInList(*images); *images=GetFirstImageInList(*images);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1844,7 +1844,7 @@ MagickExport void CompositeLayers(Image *destination,
destination=GetNextImageInList(destination); destination=GetNextImageInList(destination);
} }
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %

View File

@ -968,8 +968,7 @@ static void scandrives(void)
} }
static void empty(void) static void empty(void)
{ {}
}
static void (*floppy_work_fn)(void); static void (*floppy_work_fn)(void);
@ -4450,8 +4449,7 @@ static struct attribute *floppy_dev_attrs[] = {
ATTRIBUTE_GROUPS(floppy_dev); ATTRIBUTE_GROUPS(floppy_dev);
static void floppy_device_release(struct device *dev) static void floppy_device_release(struct device *dev)
{ {}
}
static int floppy_resume(struct device *dev) static int floppy_resume(struct device *dev)
{ {

View File

@ -60,19 +60,29 @@ public:
SplashFunctionPattern(SplashColorMode colorMode, GfxState *state, GfxFunctionShading *shading); SplashFunctionPattern(SplashColorMode colorMode, GfxState *state, GfxFunctionShading *shading);
SplashPattern *copy() override { return new SplashFunctionPattern(colorMode, state, (GfxFunctionShading *) shading); } SplashPattern *copy() override {
return new SplashFunctionPattern(colorMode, state, (GfxFunctionShading *) shading);
}
~SplashFunctionPattern(); ~SplashFunctionPattern();
bool testPosition(int x, int y) override { return true; } bool testPosition(int x, int y) override {
return true;
}
bool isStatic() override { return false; } bool isStatic() override {
return false;
}
bool getColor(int x, int y, SplashColorPtr c) override; bool getColor(int x, int y, SplashColorPtr c) override;
virtual GfxFunctionShading *getShading() { return shading; } virtual GfxFunctionShading *getShading() {
return shading;
}
bool isCMYK() override { return gfxMode == csDeviceCMYK; } bool isCMYK() override {
return gfxMode == csDeviceCMYK;
}
protected: protected:
Matrix ictm; Matrix ictm;
@ -94,13 +104,19 @@ public:
bool testPosition(int x, int y) override; bool testPosition(int x, int y) override;
bool isStatic() override { return false; } bool isStatic() override {
return false;
}
virtual bool getParameter(double xs, double ys, double *t) = 0; virtual bool getParameter(double xs, double ys, double *t) = 0;
virtual GfxUnivariateShading *getShading() { return shading; } virtual GfxUnivariateShading *getShading() {
return shading;
}
bool isCMYK() override { return gfxMode == csDeviceCMYK; } bool isCMYK() override {
return gfxMode == csDeviceCMYK;
}
protected: protected:
Matrix ictm; Matrix ictm;
@ -116,7 +132,9 @@ public:
SplashAxialPattern(SplashColorMode colorMode, GfxState *state, GfxAxialShading *shading); SplashAxialPattern(SplashColorMode colorMode, GfxState *state, GfxAxialShading *shading);
SplashPattern *copy() override { return new SplashAxialPattern(colorMode, state, (GfxAxialShading *) shading); } SplashPattern *copy() override {
return new SplashAxialPattern(colorMode, state, (GfxAxialShading *) shading);
}
~SplashAxialPattern(); ~SplashAxialPattern();
@ -133,24 +151,40 @@ public:
SplashGouraudPattern(bool bDirectColorTranslation, GfxState *state, GfxGouraudTriangleShading *shading); SplashGouraudPattern(bool bDirectColorTranslation, GfxState *state, GfxGouraudTriangleShading *shading);
SplashPattern *copy() override { return new SplashGouraudPattern(bDirectColorTranslation, state, shading); } SplashPattern *copy() override {
return new SplashGouraudPattern(bDirectColorTranslation, state, shading);
}
~SplashGouraudPattern(); ~SplashGouraudPattern();
bool getColor(int x, int y, SplashColorPtr c) override { return false; } bool getColor(int x, int y, SplashColorPtr c) override {
return false;
}
bool testPosition(int x, int y) override { return false; } bool testPosition(int x, int y) override {
return false;
}
bool isStatic() override { return false; } bool isStatic() override {
return false;
}
bool isCMYK() override { return gfxMode == csDeviceCMYK; } bool isCMYK() override {
return gfxMode == csDeviceCMYK;
}
bool isParameterized() override { return shading->isParameterized(); } bool isParameterized() override {
int getNTriangles() override { return shading->getNTriangles(); } return shading->isParameterized();
}
int getNTriangles() override {
return shading->getNTriangles();
}
void getTriangle(int i, double *x0, double *y0, double *color0, void getTriangle(int i, double *x0, double *y0, double *color0,
double *x1, double *y1, double *color1, double *x1, double *y1, double *color1,
double *x2, double *y2, double *color2) override double *x2, double *y2, double *color2) override
{ shading->getTriangle(i, x0, y0, color0, x1, y1, color1, x2, y2, color2); } {
shading->getTriangle(i, x0, y0, color0, x1, y1, color1, x2, y2, color2);
}
void getParameterizedColor(double t, SplashColorMode mode, SplashColorPtr c) override; void getParameterizedColor(double t, SplashColorMode mode, SplashColorPtr c) override;
@ -167,7 +201,9 @@ public:
SplashRadialPattern(SplashColorMode colorMode, GfxState *state, GfxRadialShading *shading); SplashRadialPattern(SplashColorMode colorMode, GfxState *state, GfxRadialShading *shading);
SplashPattern *copy() override { return new SplashRadialPattern(colorMode, state, (GfxRadialShading *) shading); } SplashPattern *copy() override {
return new SplashRadialPattern(colorMode, state, (GfxRadialShading *) shading);
}
~SplashRadialPattern(); ~SplashRadialPattern();
@ -205,24 +241,34 @@ public:
// Does this device use tilingPatternFill()? If this returns false, // Does this device use tilingPatternFill()? If this returns false,
// tiling pattern fills will be reduced to a series of other drawing // tiling pattern fills will be reduced to a series of other drawing
// operations. // operations.
bool useTilingPatternFill() override { return true; } bool useTilingPatternFill() override {
return true;
}
// Does this device use functionShadedFill(), axialShadedFill(), and // Does this device use functionShadedFill(), axialShadedFill(), and
// radialShadedFill()? If this returns false, these shaded fills // radialShadedFill()? If this returns false, these shaded fills
// will be reduced to a series of other drawing operations. // will be reduced to a series of other drawing operations.
bool useShadedFills(int type) override bool useShadedFills(int type) override
{ return (type >= 1 && type <= 5) ? true : false; } {
return (type >= 1 && type <= 5) ? true : false;
}
// Does this device use upside-down coordinates? // Does this device use upside-down coordinates?
// (Upside-down means (0,0) is the top left corner of the page.) // (Upside-down means (0,0) is the top left corner of the page.)
bool upsideDown() override { return bitmapTopDown ^ bitmapUpsideDown; } bool upsideDown() override {
return bitmapTopDown ^ bitmapUpsideDown;
}
// Does this device use drawChar() or drawString()? // Does this device use drawChar() or drawString()?
bool useDrawChar() override { return true; } bool useDrawChar() override {
return true;
}
// Does this device use beginType3Char/endType3Char? Otherwise, // Does this device use beginType3Char/endType3Char? Otherwise,
// text in Type 3 fonts will be drawn with drawChar/drawString. // text in Type 3 fonts will be drawn with drawChar/drawString.
bool interpretType3Chars() override { return true; } bool interpretType3Chars() override {
return true;
}
//----- initialization and control //----- initialization and control
@ -346,11 +392,17 @@ public:
void setPaperColor(SplashColorPtr paperColorA); void setPaperColor(SplashColorPtr paperColorA);
bool isReverseVideo() { return reverseVideo; } bool isReverseVideo() {
void setReverseVideo(bool reverseVideoA) { reverseVideo = reverseVideoA; } return reverseVideo;
}
void setReverseVideo(bool reverseVideoA) {
reverseVideo = reverseVideoA;
}
// Get the bitmap and its size. // Get the bitmap and its size.
SplashBitmap *getBitmap() { return bitmap; } SplashBitmap *getBitmap() {
return bitmap;
}
int getBitmapWidth(); int getBitmapWidth();
int getBitmapHeight(); int getBitmapHeight();
@ -360,10 +412,14 @@ public:
// Set this flag to true to generate an upside-down bitmap (useful // Set this flag to true to generate an upside-down bitmap (useful
// for Windows BMP files). // for Windows BMP files).
void setBitmapUpsideDown(bool f) { bitmapUpsideDown = f; } void setBitmapUpsideDown(bool f) {
bitmapUpsideDown = f;
}
// Get the Splash object. // Get the Splash object.
Splash *getSplash() { return splash; } Splash *getSplash() {
return splash;
}
// Get the modified region. // Get the modified region.
void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax); void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax);
@ -371,22 +427,32 @@ public:
// Clear the modified region. // Clear the modified region.
void clearModRegion(); void clearModRegion();
SplashFont *getCurrentFont() { return font; } SplashFont *getCurrentFont() {
return font;
}
// If <skipTextA> is true, don't draw horizontal text. // If <skipTextA> is true, don't draw horizontal text.
// If <skipRotatedTextA> is true, don't draw rotated (non-horizontal) text. // If <skipRotatedTextA> is true, don't draw rotated (non-horizontal) text.
void setSkipText(bool skipHorizTextA, bool skipRotatedTextA) void setSkipText(bool skipHorizTextA, bool skipRotatedTextA)
{ skipHorizText = skipHorizTextA; skipRotatedText = skipRotatedTextA; } {
skipHorizText = skipHorizTextA; skipRotatedText = skipRotatedTextA;
}
int getNestCount() { return nestCount; } int getNestCount() {
return nestCount;
}
#if 1 //~tmp: turn off anti-aliasing temporarily #if 1 //~tmp: turn off anti-aliasing temporarily
bool getVectorAntialias() override; bool getVectorAntialias() override;
void setVectorAntialias(bool vaa) override; void setVectorAntialias(bool vaa) override;
#endif #endif
bool getFontAntialias() { return fontAntialias; } bool getFontAntialias() {
void setFontAntialias(bool anti) { fontAntialias = anti; } return fontAntialias;
}
void setFontAntialias(bool anti) {
fontAntialias = anti;
}
void setFreeTypeHinting(bool enable, bool enableSlightHinting); void setFreeTypeHinting(bool enable, bool enableSlightHinting);

View File

@ -36,7 +36,7 @@
% %
% %
*/ */
/* /*
Include declarations. Include declarations.
*/ */
@ -93,7 +93,7 @@
#include "MagickCore/timer.h" #include "MagickCore/timer.h"
#include "MagickCore/utility.h" #include "MagickCore/utility.h"
#include "MagickCore/version.h" #include "MagickCore/version.h"
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -570,7 +570,7 @@ MagickExport Image *CannyEdgeImage(const Image *image,const double radius,
canny_cache=DestroyMatrixInfo(canny_cache); canny_cache=DestroyMatrixInfo(canny_cache);
return(edge_image); return(edge_image);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -1710,7 +1710,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
cooccurrence=(ChannelStatistics **) RelinquishMagickMemory(cooccurrence); cooccurrence=(ChannelStatistics **) RelinquishMagickMemory(cooccurrence);
return(channel_features); return(channel_features);
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %
@ -2110,7 +2110,7 @@ MagickExport Image *HoughLineImage(const Image *image,const size_t width,
(void) RelinquishUniqueFileResource(path); (void) RelinquishUniqueFileResource(path);
return(GetFirstImageInList(lines_image)); return(GetFirstImageInList(lines_image));
} }
/* /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % %

View File

@ -15,16 +15,13 @@
BOOST_FORCEINLINE void boost_forceinline_test() BOOST_FORCEINLINE void boost_forceinline_test()
{ {}
}
BOOST_NOINLINE void boost_noinline_test() BOOST_NOINLINE void boost_noinline_test()
{ {}
}
BOOST_NORETURN void boost_noreturn_test() BOOST_NORETURN void boost_noreturn_test()
{ {}
}
void print_hello() void print_hello()
{ {
@ -33,10 +30,8 @@ void print_hello()
void valid_code(boost::function<void(void)> &pf_print_hello) void valid_code(boost::function<void(void)> &pf_print_hello)
{ {
if (BOOST_LIKELY(1)) { if (BOOST_LIKELY(1)) {}
} if (BOOST_UNLIKELY(0)) {}
if (BOOST_UNLIKELY(0)) {
}
int int1 = 5; int int1 = 5;
boost::endian::endian_reverse_inplace(int1); boost::endian::endian_reverse_inplace(int1);

View File

@ -18,13 +18,9 @@ void validCode(int argInt, GHashTableIter * hash_table_iter, GHashTable * hash_t
g_assert_cmpstr("test", ==, "test"); g_assert_cmpstr("test", ==, "test");
// if G_UNLIKELY is not defined this results in a syntax error // if G_UNLIKELY is not defined this results in a syntax error
if G_UNLIKELY(argInt == 1) { if G_UNLIKELY(argInt == 1) {} else if (G_UNLIKELY(argInt == 2)) {}
} else if (G_UNLIKELY(argInt == 2)) {
}
if G_LIKELY(argInt == 0) { if G_LIKELY(argInt == 0) {} else if (G_LIKELY(argInt == -1)) {}
} else if (G_LIKELY(argInt == -1)) {
}
printf("%s", _("test")); printf("%s", _("test"));
printf("%s", Q_("a|test")); printf("%s", Q_("a|test"));

View File

@ -373,8 +373,7 @@ void MacroTest2_test()
void validCode(int * pIntPtr, QString & qstrArg) void validCode(int * pIntPtr, QString & qstrArg)
{ {
if (QFile::exists("test")) { if (QFile::exists("test")) {}
}
if (pIntPtr != Q_NULLPTR) { if (pIntPtr != Q_NULLPTR) {
*pIntPtr = 5; *pIntPtr = 5;
@ -384,8 +383,7 @@ void validCode(int * pIntPtr, QString & qstrArg)
forever { forever {
} }
} else if (pIntPtr && *pIntPtr == 2) { } else if (pIntPtr && *pIntPtr == 2) {
Q_FOREVER { Q_FOREVER {}
}
} }
if (Q_LIKELY(pIntPtr)) {} if (Q_LIKELY(pIntPtr)) {}
@ -399,13 +397,11 @@ void validCode(int * pIntPtr, QString & qstrArg)
//#9650 //#9650
QString qstr1(qstrArg); QString qstr1(qstrArg);
if (qstr1.length() == 1) { if (qstr1.length() == 1) {} else {
} else {
qstr1.chop(1); qstr1.chop(1);
if (qstr1.length() == 1) {} if (qstr1.length() == 1) {}
} }
if (qstr1.length() == 1) { if (qstr1.length() == 1) {} else {
} else {
qstr1.remove(1); qstr1.remove(1);
if (qstr1.length() == 1) {} if (qstr1.length() == 1) {}
} }

View File

@ -842,8 +842,7 @@ void oppositeInnerCondition_SUCCEEDED_FAILED(HRESULT hr)
{ {
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
// TODO ticket #8596 cppcheck-suppress oppositeInnerCondition // TODO ticket #8596 cppcheck-suppress oppositeInnerCondition
if (FAILED(hr)) { if (FAILED(hr)) {}
}
} }
} }

View File

@ -3,8 +3,6 @@
void validCode(int argInt) void validCode(int argInt)
{ {
// if G_UNLIKELY is not defined this results in a syntax error // if G_UNLIKELY is not defined this results in a syntax error
if G_UNLIKELY(argInt == 1) { if G_UNLIKELY(argInt == 1) {} else if (G_UNLIKELY(argInt == 2)) {}
} else if (G_UNLIKELY(argInt == 2)) {
}
} }

View File

@ -14,7 +14,9 @@ void call(int x) {
par_dependant(0, 1000); par_dependant(0, 1000);
} }
int getLargeIndex() { return 1000; } int getLargeIndex() {
return 1000;
}
void return_value() { void return_value() {
TestData[getLargeIndex()] = 0; // BUG TestData[getLargeIndex()] = 0; // BUG
} }

View File

@ -1,17 +1,49 @@
void alias() { int x; int *ip=&x; float *fp = (float *)ip; } void alias() {
int buffer_overflow() { int x[10]={0}; return x[100]; } int x; int *ip=&x; float *fp = (float *)ip;
int dead_pointer(int a) { int *p=&a; if (a) { int x=0; p = &x; } return *p; } }
int division_by_zero() { return 100 / 0; } int buffer_overflow() {
int float_to_int() { double d=1E100; return (int)d; } int x[10]={0}; return x[100];
void negative_size(int sz) { if (sz < 0) { int buf[sz]; } } }
int dead_pointer(int a) {
int *p=&a; if (a) { int x=0; p = &x; } return *p;
}
int division_by_zero() {
return 100 / 0;
}
int float_to_int() {
double d=1E100; return (int)d;
}
void negative_size(int sz) {
if (sz < 0) { int buf[sz]; }
}
int no_return() {} int no_return() {}
int null_pointer() { int *p = 0; return *p; } int null_pointer() {
int *pointer_arithmetic() { static int buf[10]; return buf + 100; } int *p = 0; return *p;
unsigned char pointer_to_u8() { static int buf[10]; return (int*)buf; } }
int pointer_subtraction() { char a[10]; char b[10]; return b-a; } int *pointer_arithmetic() {
int pointer_comparison() { char a[10]; char b[10]; return b<a; } static int buf[10]; return buf + 100;
int shift_overrun(int x) { return x << 123; } }
int shift_negative() { return -1 << 1; } unsigned char pointer_to_u8() {
int int_overflow() { int intmax = (~0U) >> 1; return intmax * 2; } static int buf[10]; return (int*)buf;
void string_literal() { *((char *)"hello") = 0; } }
int uninit() { int x; return x + 2; } int pointer_subtraction() {
char a[10]; char b[10]; return b-a;
}
int pointer_comparison() {
char a[10]; char b[10]; return b<a;
}
int shift_overrun(int x) {
return x << 123;
}
int shift_negative() {
return -1 << 1;
}
int int_overflow() {
int intmax = (~0U) >> 1; return intmax * 2;
}
void string_literal() {
*((char *)"hello") = 0;
}
int uninit() {
int x; return x + 2;
}

View File

@ -25,8 +25,7 @@
class Test64BitPortability : public TestFixture { class Test64BitPortability : public TestFixture {
public: public:
Test64BitPortability() : TestFixture("Test64BitPortability") { Test64BitPortability() : TestFixture("Test64BitPortability") {}
}
private: private:
Settings settings; Settings settings;

View File

@ -28,8 +28,7 @@
class TestAstUtils : public TestFixture { class TestAstUtils : public TestFixture {
public: public:
TestAstUtils() : TestFixture("TestAstUtils") { TestAstUtils() : TestFixture("TestAstUtils") {}
}
private: private:

View File

@ -25,8 +25,7 @@
class TestAutoVariables : public TestFixture { class TestAutoVariables : public TestFixture {
public: public:
TestAutoVariables() : TestFixture("TestAutoVariables") { TestAutoVariables() : TestFixture("TestAutoVariables") {}
}
private: private:
Settings settings; Settings settings;

View File

@ -25,8 +25,7 @@
class TestBool : public TestFixture { class TestBool : public TestFixture {
public: public:
TestBool() : TestFixture("TestBool") { TestBool() : TestFixture("TestBool") {}
}
private: private:
Settings settings; Settings settings;

View File

@ -25,8 +25,7 @@
class TestBoost : public TestFixture { class TestBoost : public TestFixture {
public: public:
TestBoost() : TestFixture("TestBoost") { TestBoost() : TestFixture("TestBoost") {}
}
private: private:
Settings settings; Settings settings;

View File

@ -33,8 +33,7 @@
class TestBufferOverrun : public TestFixture { class TestBufferOverrun : public TestFixture {
public: public:
TestBufferOverrun() : TestFixture("TestBufferOverrun") { TestBufferOverrun() : TestFixture("TestBufferOverrun") {}
}
private: private:
Settings settings0; Settings settings0;

View File

@ -26,8 +26,7 @@
class TestCharVar : public TestFixture { class TestCharVar : public TestFixture {
public: public:
TestCharVar() : TestFixture("TestCharVar") { TestCharVar() : TestFixture("TestCharVar") {}
}
private: private:
Settings settings; Settings settings;

Some files were not shown because too many files have changed in this diff Show More