Browse Source

[1245] Make CPPPyObjectContainer constructor explicit

Jelte Jansen 13 years ago
parent
commit
170a0661df

+ 1 - 1
src/lib/dns/python/edns_python.cc

@@ -385,7 +385,7 @@ initModulePart_EDNS(PyObject* mod) {
 
 PyObject*
 createEDNSObject(const EDNS& source) {
-    EDNSContainer container = PyObject_New(s_EDNS, &edns_type);
+    EDNSContainer container(PyObject_New(s_EDNS, &edns_type));
     container.set(new EDNS(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/name_python.cc

@@ -722,7 +722,7 @@ initModulePart_Name(PyObject* mod) {
 
 PyObject*
 createNameObject(const Name& source) {
-    NameContainer container = PyObject_New(s_Name, &name_type);
+    NameContainer container(PyObject_New(s_Name, &name_type));
     container.set(new Name(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/opcode_python.cc

@@ -397,7 +397,7 @@ initModulePart_Opcode(PyObject* mod) {
 
 PyObject*
 createOpcodeObject(const Opcode& source) {
-    OpcodeContainer container = PyObject_New(s_Opcode, &opcode_type);
+    OpcodeContainer container(PyObject_New(s_Opcode, &opcode_type));
     container.set(new Opcode(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/rcode_python.cc

@@ -438,7 +438,7 @@ initModulePart_Rcode(PyObject* mod) {
 
 PyObject*
 createRcodeObject(const Rcode& source) {
-    RcodeContainer container = PyObject_New(s_Rcode, &rcode_type);
+    RcodeContainer container(PyObject_New(s_Rcode, &rcode_type));
     container.set(new Rcode(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/rrclass_python.cc

@@ -364,7 +364,7 @@ initModulePart_RRClass(PyObject* mod) {
 
 PyObject*
 createRRClassObject(const RRClass& source) {
-    RRClassContainer container = PyObject_New(s_RRClass, &rrclass_type);
+    RRClassContainer container(PyObject_New(s_RRClass, &rrclass_type));
     container.set(new RRClass(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/rrttl_python.cc

@@ -317,7 +317,7 @@ initModulePart_RRTTL(PyObject* mod) {
 
 PyObject*
 createRRTTLObject(const RRTTL& source) {
-    RRTTLContainer container = PyObject_New(s_RRTTL, &rrttl_type);
+    RRTTLContainer container(PyObject_New(s_RRTTL, &rrttl_type));
     container.set(new RRTTL(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/rrtype_python.cc

@@ -458,7 +458,7 @@ initModulePart_RRType(PyObject* mod) {
 
 PyObject*
 createRRTypeObject(const RRType& source) {
-    RRTypeContainer container = PyObject_New(s_RRType, &rrtype_type);
+    RRTypeContainer container(PyObject_New(s_RRType, &rrtype_type));
     container.set(new RRType(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/tsig_rdata_python.cc

@@ -367,7 +367,7 @@ initModulePart_TSIG(PyObject* mod) {
 
 PyObject*
 createTSIGObject(const any::TSIG& source) {
-    TSIGContainer container = PyObject_New(s_TSIG, &tsig_type);
+    TSIGContainer container(PyObject_New(s_TSIG, &tsig_type));
     container.set(new any::TSIG(source));
     return (container.release());
 }

+ 1 - 1
src/lib/dns/python/tsigerror_python.cc

@@ -361,7 +361,7 @@ initModulePart_TSIGError(PyObject* mod) {
 
 PyObject*
 createTSIGErrorObject(const TSIGError& source) {
-    TSIGErrorContainer container = PyObject_New(s_TSIGError, &tsigerror_type);
+    TSIGErrorContainer container(PyObject_New(s_TSIGError, &tsigerror_type));
     container.set(new TSIGError(source));
     return (container.release());
 }

+ 1 - 2
src/lib/dns/python/tsigrecord_python.cc

@@ -309,8 +309,7 @@ initModulePart_TSIGRecord(PyObject* mod) {
 
 PyObject*
 createTSIGRecordObject(const TSIGRecord& source) {
-    TSIGRecordContainer container = PyObject_New(s_TSIGRecord,
-                                                 &tsigrecord_type);
+    TSIGRecordContainer container(PyObject_New(s_TSIGRecord, &tsigrecord_type));
     container.set(new TSIGRecord(source));
     return (container.release());
 }

+ 1 - 1
src/lib/util/python/pycppwrapper_util.h

@@ -293,7 +293,7 @@ protected:
 /// \c PyObject_New() to the caller.
 template <typename PYSTRUCT, typename CPPCLASS>
 struct CPPPyObjectContainer : public PyObjectContainer {
-    CPPPyObjectContainer(PYSTRUCT* obj) : PyObjectContainer(obj) {}
+    explicit CPPPyObjectContainer(PYSTRUCT* obj) : PyObjectContainer(obj) {}
 
     // This method associates a C++ object with the corresponding python
     // object enclosed in this class.