From 975acaf5498223318ed2c61bf896dc982c1801f4 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Thu, 15 Dec 2022 13:12:32 +0100 Subject: coding style: line breaks Only two line breaks separate copyright notice from source. For the rest of the source file any function declaration or similar block is separated with a line break from any other block. Except when a python function definition is previously followed by a docstring #define block. --- partition.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'partition.c') diff --git a/partition.c b/partition.c index 45c391a..5284869 100644 --- a/partition.c +++ b/partition.c @@ -12,12 +12,10 @@ #include "fdisk.h" - static PyMemberDef Partition_members[] = { { NULL } }; - static void Partition_dealloc(PartitionObject *self) { if (self->pa) @@ -78,12 +76,10 @@ static int Partition_init(PartitionObject *self, PyObject *args, PyObject *kwds) return 0; } - static PyMethodDef Partition_methods[] = { {NULL} }; - static PyObject *Partition_get_partno(PartitionObject *self) { if (fdisk_partition_has_partno(self->pa)) { @@ -91,6 +87,7 @@ static PyObject *Partition_get_partno(PartitionObject *self) } Py_RETURN_NONE; } + static int Partition_set_partno(PartitionObject *self, PyObject *value, void *closure) { size_t num; @@ -113,6 +110,7 @@ static int Partition_set_partno(PartitionObject *self, PyObject *value, void *cl return 0; } + static PyObject *Partition_get_size(PartitionObject *self) { if (fdisk_partition_has_size(self->pa)) { @@ -120,6 +118,7 @@ static PyObject *Partition_get_size(PartitionObject *self) } Py_RETURN_NONE; } + static int Partition_set_size(PartitionObject *self, PyObject *value, void *closure) { uint64_t sectors; @@ -143,6 +142,7 @@ static int Partition_set_size(PartitionObject *self, PyObject *value, void *clos return 0; } + static PyObject *Partition_get_type(PartitionObject *self) { struct fdisk_parttype *t; @@ -153,6 +153,7 @@ static PyObject *Partition_get_type(PartitionObject *self) Py_RETURN_NONE; } + static int Partition_set_type(PartitionObject *self, PyObject *value, void *closure) { if (!value) { @@ -173,6 +174,7 @@ static int Partition_set_type(PartitionObject *self, PyObject *value, void *clos return 0; } + static PyGetSetDef Partition_getseters[] = { {"partno", (getter)Partition_get_partno, (setter)Partition_set_partno, "partition number", NULL}, {"size", (getter)Partition_get_size, (setter)Partition_set_size, "number of sectors", NULL}, -- cgit v1.2.3-18-g5258