Commits

Michał Górny committed 811a793

Use const more often.

Comments (0)

Files changed (1)

 }
 
 static void BootMountpoint_dealloc(PyObject *o) {
-	BootMountpoint *b = reinterpret_cast<BootMountpoint*>(o);
+	BootMountpoint* const b = reinterpret_cast<BootMountpoint*>(o);
 
 	if (b->status != MOUNTPOINT_NONE) /* clean up! */
 		BootMountpoint_umount(o, NULL);
 
 static PyObject *BootMountpoint_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
 	try {
-		struct libmnt_context *ctx = mnt_new_context();
+		struct libmnt_context* const ctx = mnt_new_context();
 
 		if (!ctx)
 			throw std::runtime_error("unable to create libmount context");
 			PyObject *self = type->tp_alloc(type, 0);
 
 			if (self != NULL) {
-				BootMountpoint *b = reinterpret_cast<BootMountpoint*>(self);
+				BootMountpoint* const b = reinterpret_cast<BootMountpoint*>(self);
 
 				b->mnt_context = ctx;
 				b->status = MOUNTPOINT_NONE;
 
 static PyObject *BootMountpoint_mount(PyObject *args, PyObject *kwds) {
 	try {
-		BootMountpoint *self = reinterpret_cast<BootMountpoint*>(args);
+		BootMountpoint* const self = reinterpret_cast<BootMountpoint*>(args);
 		struct libmnt_context* const ctx = self->mnt_context;
 
 		BootMountpoint_reset(ctx);
 			throw std::runtime_error("unable to get mtab");
 
 		/* backward -> find the top-most mount */
-		struct libmnt_fs *fs = mnt_table_find_target(mtab, "/boot",
+		struct libmnt_fs* const fs = mnt_table_find_target(mtab, "/boot",
 				MNT_ITER_BACKWARD);
 
 		if (!fs) { /* boot not mounted, mount it? */
 
 static PyObject *BootMountpoint_rwmount(PyObject *args, PyObject *kwds) {
 	try {
-		BootMountpoint *self = reinterpret_cast<BootMountpoint*>(args);
+		BootMountpoint* const self = reinterpret_cast<BootMountpoint*>(args);
 		struct libmnt_context* const ctx = self->mnt_context;
 
 		BootMountpoint_reset(ctx);
 			throw std::runtime_error("unable to get mtab");
 
 		/* backward -> find the top-most mount */
-		struct libmnt_fs *fs = mnt_table_find_target(mtab, "/boot",
+		struct libmnt_fs* const fs = mnt_table_find_target(mtab, "/boot",
 				MNT_ITER_BACKWARD);
 
 		if (!fs) { /* boot not mounted, mount it? */
 
 static PyObject *BootMountpoint_umount(PyObject *args, PyObject *kwds) {
 	try {
-		BootMountpoint *self = reinterpret_cast<BootMountpoint*>(args);
+		BootMountpoint* const self = reinterpret_cast<BootMountpoint*>(args);
 		struct libmnt_context* const ctx = self->mnt_context;
 
 		switch (self->status) {