mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-26 14:43:50 -04:00
general: Get rid of some coerce constructors where they make no sense
This commit is contained in:
parent
61ff260ee3
commit
cee1de7338
@ -53,8 +53,8 @@ PUBLISHED:
|
||||
};
|
||||
|
||||
DSearchPath() = default;
|
||||
DSearchPath(const std::string &path, const std::string &separator = std::string());
|
||||
DSearchPath(const Filename &directory);
|
||||
explicit DSearchPath(const std::string &path, const std::string &separator = std::string());
|
||||
explicit DSearchPath(const Filename &directory);
|
||||
DSearchPath(const DSearchPath ©) = default;
|
||||
DSearchPath(DSearchPath &&from) = default;
|
||||
~DSearchPath() = default;
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
|
||||
PUBLISHED:
|
||||
INLINE Filename();
|
||||
Filename(const Filename &dirname, const Filename &basename);
|
||||
explicit Filename(const Filename &dirname, const Filename &basename);
|
||||
|
||||
#ifdef HAVE_PYTHON
|
||||
EXTENSION(Filename(PyObject *path));
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
class EXPCL_DTOOL_PRC ConfigVariableBool : public ConfigVariable {
|
||||
PUBLISHED:
|
||||
INLINE ConfigVariableBool(const std::string &name);
|
||||
INLINE explicit ConfigVariableBool(const std::string &name);
|
||||
INLINE ConfigVariableBool(const std::string &name, bool default_value,
|
||||
const std::string &description = std::string(), int flags = 0);
|
||||
INLINE ConfigVariableBool(const std::string &name, const std::string &default_value,
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
class EXPCL_DTOOL_PRC ConfigVariableDouble : public ConfigVariable {
|
||||
PUBLISHED:
|
||||
INLINE ConfigVariableDouble(const std::string &name);
|
||||
INLINE explicit ConfigVariableDouble(const std::string &name);
|
||||
INLINE ConfigVariableDouble(const std::string &name, double default_value,
|
||||
const std::string &description = std::string(),
|
||||
int flags = 0);
|
||||
|
@ -26,7 +26,7 @@
|
||||
*/
|
||||
class EXPCL_DTOOL_PRC ConfigVariableFilename : public ConfigVariable {
|
||||
PUBLISHED:
|
||||
INLINE ConfigVariableFilename(const std::string &name);
|
||||
INLINE explicit ConfigVariableFilename(const std::string &name);
|
||||
INLINE ConfigVariableFilename(const std::string &name, const Filename &default_value,
|
||||
const std::string &description = std::string(), int flags = 0);
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
class EXPCL_DTOOL_PRC ConfigVariableInt : public ConfigVariable {
|
||||
PUBLISHED:
|
||||
INLINE ConfigVariableInt(const std::string &name);
|
||||
INLINE explicit ConfigVariableInt(const std::string &name);
|
||||
INLINE ConfigVariableInt(const std::string &name, int default_value,
|
||||
const std::string &description = std::string(),
|
||||
int flags = 0);
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
class EXPCL_DTOOL_PRC ConfigVariableInt64 : public ConfigVariable {
|
||||
PUBLISHED:
|
||||
INLINE ConfigVariableInt64(const std::string &name);
|
||||
INLINE explicit ConfigVariableInt64(const std::string &name);
|
||||
INLINE ConfigVariableInt64(const std::string &name, int64_t default_value,
|
||||
const std::string &description = std::string(),
|
||||
int flags = 0);
|
||||
|
@ -29,7 +29,7 @@ class EXPCL_PANDA_DOWNLOADER URLSpec {
|
||||
PUBLISHED:
|
||||
URLSpec();
|
||||
INLINE URLSpec(const std::string &url, bool server_name_expected = false);
|
||||
URLSpec(const URLSpec &url, const Filename &path);
|
||||
explicit URLSpec(const URLSpec &url, const Filename &path);
|
||||
INLINE void operator = (const std::string &url);
|
||||
|
||||
INLINE bool operator == (const URLSpec &other) const;
|
||||
|
@ -38,7 +38,7 @@
|
||||
class EXPCL_PANDA_EXPRESS Datagram : public TypedObject {
|
||||
PUBLISHED:
|
||||
INLINE Datagram() = default;
|
||||
INLINE Datagram(const void *data, size_t size);
|
||||
INLINE explicit Datagram(const void *data, size_t size);
|
||||
INLINE explicit Datagram(vector_uchar data);
|
||||
Datagram(const Datagram ©) = default;
|
||||
Datagram(Datagram &&from) noexcept = default;
|
||||
|
@ -10455,9 +10455,9 @@ make_this_from_bam(const FactoryParams ¶ms) {
|
||||
// If texture filename was given relative to the bam filename, expand
|
||||
// it now.
|
||||
Filename bam_dir = manager->get_filename().get_dirname();
|
||||
vfs->resolve_filename(filename, bam_dir);
|
||||
vfs->resolve_filename(filename, DSearchPath(bam_dir));
|
||||
if (!alpha_filename.empty()) {
|
||||
vfs->resolve_filename(alpha_filename, bam_dir);
|
||||
vfs->resolve_filename(alpha_filename, DSearchPath(bam_dir));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ PUBLISHED:
|
||||
INLINE_LINMATH FLOATNAME(LVecBase3)() = default;
|
||||
INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE fill_value);
|
||||
INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z);
|
||||
INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z);
|
||||
INLINE_LINMATH explicit FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z);
|
||||
ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase3));
|
||||
|
||||
#ifdef CPPPARSER
|
||||
|
@ -40,7 +40,7 @@ PUBLISHED:
|
||||
INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE fill_value);
|
||||
INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w);
|
||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©);
|
||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w);
|
||||
INLINE_LINMATH explicit FLOATNAME(LVecBase4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w);
|
||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LPoint3) &point);
|
||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVector3) &vector);
|
||||
ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase4));
|
||||
|
@ -41,7 +41,7 @@ typedef unsigned char gray;
|
||||
struct pixel {
|
||||
PUBLISHED:
|
||||
pixel() = default;
|
||||
pixel(gray fill) : r(fill), g(fill), b(fill) { }
|
||||
explicit pixel(gray fill) : r(fill), g(fill), b(fill) { }
|
||||
pixel(gray r, gray g, gray b) : r(r), g(g), b(b) { }
|
||||
|
||||
gray operator [](int i) const { nassertr(i >= 0 && i < 3, 0); return *(&r + i); }
|
||||
|
@ -30,7 +30,7 @@ PUBLISHED:
|
||||
// its value, it might happen after the value had already been set
|
||||
// previously by another static initializer!
|
||||
INLINE ButtonHandle() = default;
|
||||
constexpr ButtonHandle(int index);
|
||||
explicit constexpr ButtonHandle(int index);
|
||||
ButtonHandle(const std::string &name);
|
||||
|
||||
PUBLISHED:
|
||||
|
@ -49,8 +49,8 @@ PUBLISHED:
|
||||
TF_no_filters = 0x0400, // disallow using texture pool filters
|
||||
};
|
||||
|
||||
LoaderOptions(int flags = LF_search | LF_report_errors);
|
||||
constexpr LoaderOptions(int flags, int texture_flags);
|
||||
explicit LoaderOptions(int flags = LF_search | LF_report_errors);
|
||||
explicit constexpr LoaderOptions(int flags, int texture_flags);
|
||||
|
||||
INLINE void set_flags(int flags);
|
||||
INLINE int get_flags() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user