Fix const warnings in FBX (build failure on macOS)
Fixes several instances of error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
This looks like it was fixed in 6607fc7da9
when FBX was merged into the 4.0 master branch:
"- fixed const correctness with C++/C version change"
This commit is contained in:
parent
9d1d4d1f6a
commit
77f045db99
4 changed files with 13 additions and 13 deletions
|
@ -107,7 +107,7 @@ public:
|
||||||
return (flags & FAILED_TO_CONSTRUCT) != 0;
|
return (flags & FAILED_TO_CONSTRUCT) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ElementPtr GetElement() const {
|
ElementPtr GetElement() const {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ public:
|
||||||
|
|
||||||
virtual ~Object();
|
virtual ~Object();
|
||||||
|
|
||||||
const ElementPtr SourceElement() const {
|
ElementPtr SourceElement() const {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1186,8 +1186,8 @@ std::string ParseTokenAsString(const TokenPtr t) {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// extract a required element from a scope, abort if the element cannot be found
|
// extract a required element from a scope, abort if the element cannot be found
|
||||||
const ElementPtr GetRequiredElement(const ScopePtr sc, const std::string &index, const ElementPtr element /*= NULL*/) {
|
ElementPtr GetRequiredElement(const ScopePtr sc, const std::string &index, const ElementPtr element /*= NULL*/) {
|
||||||
const ElementPtr el = sc->GetElement(index);
|
ElementPtr el = sc->GetElement(index);
|
||||||
TokenPtr token = el->KeyToken();
|
TokenPtr token = el->KeyToken();
|
||||||
ERR_FAIL_COND_V(!token, nullptr);
|
ERR_FAIL_COND_V(!token, nullptr);
|
||||||
if (!el) {
|
if (!el) {
|
||||||
|
@ -1207,14 +1207,14 @@ bool HasElement(const ScopePtr sc, const std::string &index) {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// extract a required element from a scope, abort if the element cannot be found
|
// extract a required element from a scope, abort if the element cannot be found
|
||||||
const ElementPtr GetOptionalElement(const ScopePtr sc, const std::string &index, const ElementPtr element /*= NULL*/) {
|
ElementPtr GetOptionalElement(const ScopePtr sc, const std::string &index, const ElementPtr element /*= NULL*/) {
|
||||||
const ElementPtr el = sc->GetElement(index);
|
ElementPtr el = sc->GetElement(index);
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// extract required compound scope
|
// extract required compound scope
|
||||||
const ScopePtr GetRequiredScope(const ElementPtr el) {
|
ScopePtr GetRequiredScope(const ElementPtr el) {
|
||||||
if (el) {
|
if (el) {
|
||||||
ScopePtr s = el->Compound();
|
ScopePtr s = el->Compound();
|
||||||
TokenPtr token = el->KeyToken();
|
TokenPtr token = el->KeyToken();
|
||||||
|
|
|
@ -191,7 +191,7 @@ public:
|
||||||
Parser(const TokenList &tokens, bool is_binary);
|
Parser(const TokenList &tokens, bool is_binary);
|
||||||
~Parser();
|
~Parser();
|
||||||
|
|
||||||
const ScopePtr GetRootScope() const {
|
ScopePtr GetRootScope() const {
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,11 +247,11 @@ void ParseVectorDataArray(std::vector<int64_t> &out, const ElementPtr el);
|
||||||
bool HasElement(const ScopePtr sc, const std::string &index);
|
bool HasElement(const ScopePtr sc, const std::string &index);
|
||||||
|
|
||||||
// extract a required element from a scope, abort if the element cannot be found
|
// extract a required element from a scope, abort if the element cannot be found
|
||||||
const ElementPtr GetRequiredElement(const ScopePtr sc, const std::string &index, const ElementPtr element = nullptr);
|
ElementPtr GetRequiredElement(const ScopePtr sc, const std::string &index, const ElementPtr element = nullptr);
|
||||||
const ScopePtr GetRequiredScope(const ElementPtr el); // New in 2020. (less likely to destroy application)
|
ScopePtr GetRequiredScope(const ElementPtr el); // New in 2020. (less likely to destroy application)
|
||||||
const ElementPtr GetOptionalElement(const ScopePtr sc, const std::string &index, const ElementPtr element = nullptr);
|
ElementPtr GetOptionalElement(const ScopePtr sc, const std::string &index, const ElementPtr element = nullptr);
|
||||||
// extract required compound scope
|
// extract required compound scope
|
||||||
const ScopePtr GetRequiredScope(const ElementPtr el);
|
ScopePtr GetRequiredScope(const ElementPtr el);
|
||||||
// get token at a particular index
|
// get token at a particular index
|
||||||
TokenPtr GetRequiredToken(const ElementPtr el, unsigned int index);
|
TokenPtr GetRequiredToken(const ElementPtr el, unsigned int index);
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ public:
|
||||||
PropertyPtr Get(const std::string &name) const;
|
PropertyPtr Get(const std::string &name) const;
|
||||||
|
|
||||||
// PropertyTable's need not be coupled with FBX elements so this can be NULL
|
// PropertyTable's need not be coupled with FBX elements so this can be NULL
|
||||||
const ElementPtr GetElement() const {
|
ElementPtr GetElement() const {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue