Browse Source

other simple review comment fixed; alignment of inline comments, and c++ style comments instead of c style

git-svn-id: svn://bind10.isc.org/svn/bind10/experiments/python-binding@2237 e5f2f494-b856-4b98-b285-d166d9295462
Jelte Jansen 15 years ago
parent
commit
024bea20e2

+ 224 - 225
src/lib/dns/python/message_python.cc

@@ -72,55 +72,55 @@ static PyMethodDef MessageFlag_methods[] = {
 static PyTypeObject messageflag_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.MessageFlag",
-    sizeof(s_MessageFlag),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)MessageFlag_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    NULL,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_MessageFlag),              // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)MessageFlag_destroy,    // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    NULL,                               // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The MessageFlag class objects represent standard "
     "flag bits of the header section of DNS messages.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    NULL,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    MessageFlag_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    NULL,                               // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    MessageFlag_methods,                // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
     // TODO: Can we make this NULL? (no direct constructor)
-    (initproc)MessageFlag_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    (initproc)MessageFlag_init,         // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 
@@ -299,55 +299,55 @@ static PyMethodDef Opcode_methods[] = {
 static PyTypeObject opcode_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.Opcode",
-    sizeof(s_Opcode),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)Opcode_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    Opcode_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_Opcode),                   // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)Opcode_destroy,         // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    Opcode_str,                         // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The Opcode class objects represent standard OPCODEs "
     "of the header section of DNS messages.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    (richcmpfunc)Opcode_richcmp,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    Opcode_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    (richcmpfunc)Opcode_richcmp,        // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    Opcode_methods,                     // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
     // TODO: Can we make this NULL? (no direct constructor)
-    (initproc)Opcode_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    (initproc)Opcode_init,              // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 
@@ -705,55 +705,55 @@ static PyMethodDef Rcode_methods[] = {
 static PyTypeObject rcode_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.Rcode",
-    sizeof(s_Rcode),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)Rcode_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    Rcode_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_Rcode),                    // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)Rcode_destroy,          // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    Rcode_str,                          // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The Rcode class objects represent standard RCODEs"
     "of the header section of DNS messages.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    (richcmpfunc)Rcode_richcmp,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    Rcode_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    (richcmpfunc)Rcode_richcmp,         // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    Rcode_methods,                      // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
     // TODO: Can we make this NULL? (no direct constructor)
-    (initproc)Rcode_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    (initproc)Rcode_init,               // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 
@@ -1121,55 +1121,55 @@ static PyMethodDef Section_methods[] = {
 static PyTypeObject section_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.Section",
-    sizeof(s_Section),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)Section_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    NULL,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_Section),                  // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)Section_destroy,        // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    NULL,                               // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The Section class objects represent DNS message sections such "
     "as the header, question, or answer.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    (richcmpfunc)Section_richcmp,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    Section_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    (richcmpfunc)Section_richcmp,       // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    Section_methods,                    // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
     // TODO: Can we make this NULL? (no direct constructor)
-    (initproc)Section_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    (initproc)Section_init,             // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 
@@ -1464,53 +1464,53 @@ static PyMethodDef Message_methods[] = {
 static PyTypeObject message_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.Message",
-    sizeof(s_Message),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)Message_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    Message_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_Message),                  // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)Message_destroy,        // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    Message_str,                        // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The Message class encapsulates a standard DNS message.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    NULL,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    Message_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)Message_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    NULL,                               // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    Message_methods,                    // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)Message_init,             // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int
@@ -1917,7 +1917,7 @@ Message_fromWire(s_Message* self, PyObject* args) {
 bool
 initModulePart_Message(PyObject* mod) {
     
-    /* add methods to class */
+    // add methods to class
     if (PyType_Ready(&messageflag_type) < 0) {
         return false;
     }
@@ -1952,10 +1952,9 @@ initModulePart_Message(PyObject* mod) {
         return false;
     }
     
-    /* Class variables
-     * These are added to the tp_dict of the type object
-     */
-    //PyDict_SetItemString(message_type.tp_dict, "PARSE", Py_BuildValue("I", Message::PARSE));
+    // Class variables
+    // These are added to the tp_dict of the type object
+    //
     addClassVariable(message_type, "PARSE", Py_BuildValue("I", Message::PARSE));
     addClassVariable(message_type, "RENDER", Py_BuildValue("I", Message::RENDER));
     addClassVariable(message_type, "DEFAULT_MAX_UDPSIZE", Py_BuildValue("I", Message::DEFAULT_MAX_UDPSIZE));

+ 44 - 44
src/lib/dns/python/messagerenderer_python.cc

@@ -63,58 +63,58 @@ static PyMethodDef MessageRenderer_methods[] = {
 static PyTypeObject messagerenderer_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.MessageRenderer",
-    sizeof(s_MessageRenderer),                       /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)MessageRenderer_destroy,   /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    NULL,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_MessageRenderer),          // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)MessageRenderer_destroy,// tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    NULL,                               // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The MessageRenderer class encapsulates implementation details "
     "of rendering a DNS message into a buffer in wire format. "
     "In effect, it's simply responsible for name compression at least in the "
     "current implementation. A MessageRenderer class object manages the "
     "positions of names rendered in a buffer and uses that information to render "
     "subsequent names with compression.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    NULL,                               /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    MessageRenderer_methods,                       /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)MessageRenderer_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    NULL,                               // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    MessageRenderer_methods,            // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)MessageRenderer_init,     // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int

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

@@ -73,24 +73,24 @@ static PyMethodDef NameComparisonResult_methods[] = {
 static PyTypeObject name_comparison_result_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.NameComparisonResult",
-    sizeof(s_NameComparisonResult),                       /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)NameComparisonResult_destroy,   /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    NULL,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_NameComparisonResult),           // tp_basicsize
+    0,                                        // tp_itemsize
+    (destructor)NameComparisonResult_destroy, // tp_dealloc
+    NULL,                                     // tp_print
+    NULL,                                     // tp_getattr
+    NULL,                                     // tp_setattr
+    NULL,                                     // tp_reserved
+    NULL,                                     // tp_repr
+    NULL,                                     // tp_as_number
+    NULL,                                     // tp_as_sequence
+    NULL,                                     // tp_as_mapping
+    NULL,                                     // tp_hash 
+    NULL,                                     // tp_call
+    NULL,                                     // tp_str
+    NULL,                                     // tp_getattro
+    NULL,                                     // tp_setattro
+    NULL,                                     // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                       // tp_flags
     "This is a supplemental class used only as a return value of Name.compare(). "
     "It encapsulate a tuple of the comparison: ordering, number of common labels, "
     "and relationship as follows:\n"
@@ -98,34 +98,34 @@ static PyTypeObject name_comparison_result_type = {
     "- labels: the number of common significant labels of the two names being"
     "  compared\n"
     "- relationship: see NameComparisonResult.NameRelation\n",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    NULL,                               /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    NameComparisonResult_methods,                       /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)NameComparisonResult_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                                     // tp_traverse
+    NULL,                                     // tp_clear
+    NULL,                                     // tp_richcompare
+    0,                                        // tp_weaklistoffset
+    NULL,                                     // tp_iter
+    NULL,                                     // tp_iternext
+    NameComparisonResult_methods,             // tp_methods
+    NULL,                                     // tp_members
+    NULL,                                     // tp_getset
+    NULL,                                     // tp_base
+    NULL,                                     // tp_dict
+    NULL,                                     // tp_descr_get
+    NULL,                                     // tp_descr_set
+    0,                                        // tp_dictoffset
+    (initproc)NameComparisonResult_init,      // tp_init
+    NULL,                                     // tp_alloc
+    PyType_GenericNew,                        // tp_new
+    NULL,                                     // tp_free
+    NULL,                                     // tp_is_gc
+    NULL,                                     // tp_bases
+    NULL,                                     // tp_mro
+    NULL,                                     // tp_cache
+    NULL,                                     // tp_subclasses
+    NULL,                                     // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                                     // tp_del
+    0                                         // tp_version_tag
 };
 
 // TODO: is there also a way to just not define it?
@@ -229,56 +229,56 @@ static PyMethodDef Name_methods[] = {
 static PyTypeObject name_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.Name",
-    sizeof(s_Name),                       /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)Name_destroy,   /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    Name_str,                           /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_Name),                     // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)Name_destroy,           // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    Name_str,                           // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The Name class encapsulates DNS names.\n"
     "It provides interfaces to construct a name from string or wire-format data, "
     "transform a name into a string or wire-format data, compare two names, get "
     "access to various properties of a name, etc.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    (richcmpfunc)Name_richcmp,                               /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    Name_methods,                       /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)Name_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    (richcmpfunc)Name_richcmp,          // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    Name_methods,                       // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)Name_init,                // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 
@@ -287,7 +287,7 @@ Name_init(s_Name* self, PyObject* args) {
     const char* s;
     PyObject* downcase = Py_False;
 
-    /* fromText */
+    // fromText
     if (PyArg_ParseTuple(args, "s|O!", &s, &PyBool_Type, &downcase)) {
         try {
             const std::string n(s);
@@ -330,7 +330,7 @@ Name_init(s_Name* self, PyObject* args) {
     Py_ssize_t len;
     unsigned int position = 0;
 
-    /* fromWire */
+    // fromWire
     if (PyArg_ParseTuple(args, "O|IO!", &bytes_obj, &position,
                          &PyBool_Type, &downcase) &&
                          PyObject_AsCharBuffer(bytes_obj, &bytes, &len) != -1) {
@@ -664,12 +664,12 @@ initModulePart_Name(PyObject* mod) {
     po_InvalidBufferPosition = PyErr_NewException("libdns_python.InvalidBufferPosition", NULL, NULL);
     PyModule_AddObject(mod, "InvalidBufferPosition", po_InvalidBufferPosition);
 
-    /* TODO; this one is a message-specific one, move to message? */
+    // TODO; this one is a message-specific one, move to message? 
     po_DNSMessageFORMERR = PyErr_NewException("libdns_python.DNSMessageFORMERR", NULL, NULL);
     Py_INCREF(po_DNSMessageFORMERR);
     PyModule_AddObject(mod, "DNSMessageFORMERR", po_DNSMessageFORMERR);
 
-    /* TODO: this one is module-level, move to libdns_python.cc */
+    // TODO: this one is module-level, move to libdns_python.cc
     po_IscException = PyErr_NewException("libdns_python.IscException", NULL, NULL);
     Py_INCREF(po_IncompleteName);
     PyModule_AddObject(mod, "IscException", po_IscException);

+ 44 - 44
src/lib/dns/python/question_python.cc

@@ -77,54 +77,54 @@ static PyMethodDef Question_methods[] = {
 static PyTypeObject question_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.Question",
-    sizeof(s_Question),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)Question_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    Question_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_Question),                 // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)Question_destroy,       // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    Question_str,                       // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The Question class encapsulates the common search key of DNS"
     "lookup, consisting of owner name, RR type and RR class.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    NULL,                               /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    Question_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)Question_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    NULL,                               // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    Question_methods,                   // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)Question_init,            // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int

+ 44 - 44
src/lib/dns/python/rdata_python.cc

@@ -86,54 +86,54 @@ static PyMethodDef Rdata_methods[] = {
 static PyTypeObject rdata_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.Rdata",
-    sizeof(s_Rdata),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)Rdata_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    Rdata_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_Rdata),                    // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)Rdata_destroy,          // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    Rdata_str,                          // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The Rdata class is an abstract base class that provides "
     "a set of common interfaces to manipulate concrete RDATA objects.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    NULL,                               /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    Rdata_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)Rdata_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    NULL,                               // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    Rdata_methods,                      // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)Rdata_init,               // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int

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

@@ -101,56 +101,56 @@ static PyMethodDef RRClass_methods[] = {
 static PyTypeObject rrclass_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.RRClass",
-    sizeof(s_RRClass),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)RRClass_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    RRClass_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_RRClass),                  // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)RRClass_destroy,        // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    RRClass_str,                        // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The RRClass class encapsulates DNS resource record classes.\n"
     "This class manages the 16-bit integer class codes in quite a straightforward"
     "way.  The only non trivial task is to handle textual representations of"
     "RR classes, such as \"IN\", \"CH\", or \"CLASS65534\".",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    (richcmpfunc)RRClass_richcmp,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    RRClass_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)RRClass_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    (richcmpfunc)RRClass_richcmp,       // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    RRClass_methods,                    // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)RRClass_init,             // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int
@@ -188,8 +188,8 @@ RRClass_init(s_RRClass* self, PyObject* args) {
             PyErr_Clear();
             return 0;
         }
-    /* Incomplete is never thrown, a type error would have already been raised
-     * when we try to read the 2 bytes above */
+    // Incomplete is never thrown, a type error would have already been raised
+    //when we try to read the 2 bytes above
     } catch (InvalidRRClass ic) {
         PyErr_Clear();
         PyErr_SetString(po_InvalidRRClass, ic.what());

+ 44 - 44
src/lib/dns/python/rrset_python.cc

@@ -105,24 +105,24 @@ static PyMethodDef RRset_methods[] = {
 static PyTypeObject rrset_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.RRset",
-    sizeof(s_RRset),                       /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)RRset_destroy,   /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    RRset_str,                          /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_RRset),                    // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)RRset_destroy,          // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    RRset_str,                          // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The AbstractRRset class is an abstract base class that "
     "models a DNS RRset.\n\n"
     "An object of (a specific derived class of) AbstractRRset "
@@ -139,34 +139,34 @@ static PyTypeObject rrset_type = {
     "This is because such checks can be expensive, and it's often easy to "
     "ensure the uniqueness requirement at the %data preparation phase "
     "(e.g. when loading a zone).",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    NULL,                               /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    RRset_methods,                       /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)RRset_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    NULL,                               // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    RRset_methods,                      // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)RRset_init,               // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int

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

@@ -88,58 +88,58 @@ static PyMethodDef RRTTL_methods[] = {
 static PyTypeObject rrttl_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.RRTTL",
-    sizeof(s_RRTTL),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)RRTTL_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    RRTTL_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_RRTTL),                    // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)RRTTL_destroy,          // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    RRTTL_str,                          // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The RRTTL class encapsulates TTLs used in DNS resource records.\n\n"
     "This is a straightforward class; an RRTTL object simply maintains a "
     "32-bit unsigned integer corresponding to the TTL value.  The main purpose "
     "of this class is to provide convenient interfaces to convert a textual "
     "representation into the integer TTL value and vice versa, and to handle "
     "wire-format representations.",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    (richcmpfunc)RRTTL_richcmp,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    RRTTL_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)RRTTL_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    (richcmpfunc)RRTTL_richcmp,         // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    RRTTL_methods,                      // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)RRTTL_init,               // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int

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

@@ -152,56 +152,56 @@ static PyMethodDef RRType_methods[] = {
 static PyTypeObject rrtype_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "libdns_python.RRType",
-    sizeof(s_RRType),                  /* tp_basicsize */
-    0,                                  /* tp_itemsize */
-    (destructor)RRType_destroy,        /* tp_dealloc */
-    NULL,                               /* tp_print */
-    NULL,                               /* tp_getattr */
-    NULL,                               /* tp_setattr */
-    NULL,                               /* tp_reserved */
-    NULL,                               /* tp_repr */
-    NULL,                               /* tp_as_number */
-    NULL,                               /* tp_as_sequence */
-    NULL,                               /* tp_as_mapping */
-    NULL,                               /* tp_hash  */
-    NULL,                               /* tp_call */
-    RRType_str,                               /* tp_str */
-    NULL,                               /* tp_getattro */
-    NULL,                               /* tp_setattro */
-    NULL,                               /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT,                 /* tp_flags */
+    sizeof(s_RRType),                   // tp_basicsize
+    0,                                  // tp_itemsize
+    (destructor)RRType_destroy,         // tp_dealloc
+    NULL,                               // tp_print
+    NULL,                               // tp_getattr
+    NULL,                               // tp_setattr
+    NULL,                               // tp_reserved
+    NULL,                               // tp_repr
+    NULL,                               // tp_as_number
+    NULL,                               // tp_as_sequence
+    NULL,                               // tp_as_mapping
+    NULL,                               // tp_hash 
+    NULL,                               // tp_call
+    RRType_str,                         // tp_str
+    NULL,                               // tp_getattro
+    NULL,                               // tp_setattro
+    NULL,                               // tp_as_buffer
+    Py_TPFLAGS_DEFAULT,                 // tp_flags
     "The RRType class encapsulates DNS resource record types.\n\n"
     "This class manages the 16-bit integer type codes in quite a straightforward "
     "way. The only non trivial task is to handle textual representations of "
     "RR types, such as \"A\", \"AAAA\", or \"TYPE65534\".",
-    NULL,                               /* tp_traverse */
-    NULL,                               /* tp_clear */
-    (richcmpfunc)RRType_richcmp,       /* tp_richcompare */
-    0,                                  /* tp_weaklistoffset */
-    NULL,                               /* tp_iter */
-    NULL,                               /* tp_iternext */
-    RRType_methods,                    /* tp_methods */
-    NULL,                               /* tp_members */
-    NULL,                               /* tp_getset */
-    NULL,                               /* tp_base */
-    NULL,                               /* tp_dict */
-    NULL,                               /* tp_descr_get */
-    NULL,                               /* tp_descr_set */
-    0,                                  /* tp_dictoffset */
-    (initproc)RRType_init,                /* tp_init */
-    NULL,                               /* tp_alloc */
-    PyType_GenericNew,                  /* tp_new */
-    NULL,                               /* tp_free */
-    NULL,                               /* tp_is_gc */
-    NULL,                               /* tp_bases */
-    NULL,                               /* tp_mro */
-    NULL,                               /* tp_cache */
-    NULL,                               /* tp_subclasses */
-    NULL,                               /* tp_weaklist */
+    NULL,                               // tp_traverse
+    NULL,                               // tp_clear
+    (richcmpfunc)RRType_richcmp,        // tp_richcompare
+    0,                                  // tp_weaklistoffset
+    NULL,                               // tp_iter
+    NULL,                               // tp_iternext
+    RRType_methods,                     // tp_methods
+    NULL,                               // tp_members
+    NULL,                               // tp_getset
+    NULL,                               // tp_base
+    NULL,                               // tp_dict
+    NULL,                               // tp_descr_get
+    NULL,                               // tp_descr_set
+    0,                                  // tp_dictoffset
+    (initproc)RRType_init,              // tp_init
+    NULL,                               // tp_alloc
+    PyType_GenericNew,                  // tp_new
+    NULL,                               // tp_free
+    NULL,                               // tp_is_gc
+    NULL,                               // tp_bases
+    NULL,                               // tp_mro
+    NULL,                               // tp_cache
+    NULL,                               // tp_subclasses
+    NULL,                               // tp_weaklist
     // Note: not sure if the following are correct.  Added them just to
     // make the compiler happy.
-    NULL,                               /* tp_del */
-    0                                   /* tp_version_tag */
+    NULL,                               // tp_del
+    0                                   // tp_version_tag
 };
 
 static int