[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

capasity??



Hi all,

I was reading the code of autopartkit, when I stumbled upon frequent
usage of the variable name 'capasity'... Here's a patch for
the debian-installer CVS repos which changes all occurrences of capasity
to capacity.

Sytse Wielinga


Index: tools/autopartkit/autopartkit.c
--- tools/autopartkit/autopartkit.c
+++ tools/autopartkit/autopartkit.c
@@ -669,11 +669,11 @@
  */
 static void
 normalize_requirements(diskspace_req_t *dest, const diskspace_req_t *source,
-		       const size_t dest_capasity)
+		       const size_t dest_capacity)
 {
     int i;
     int count;
-    memset(dest,0,sizeof(diskspace_req_t)*dest_capasity);
+    memset(dest,0,sizeof(diskspace_req_t)*dest_capacity);
 
     for (count = 0; source[count].mountpoint != NULL; count++)
     {
Index: tools/autopartkit/autopartkit.h
--- tools/autopartkit/autopartkit.h
+++ tools/autopartkit/autopartkit.h
@@ -35,7 +35,7 @@
     const char *path; /* Path to device */
     PedGeometry geom; /* Location of free space */
 
-    PedSector capasity;
+    PedSector capacity;
     PedSector freespace;
 };
 
Index: tools/autopartkit/distribute.c
--- tools/autopartkit/distribute.c
+++ tools/autopartkit/distribute.c
@@ -33,7 +33,7 @@
 
    1. Calculate the sum of all additionally requrested diskspace
       (max-min).  Each disk with no limit to the maximum size
-      get maximum equal to the disk capasity to make sure this
+      get maximum equal to the disk capacity to make sure this
       partition will get the whole disk if there are no other
       partitions requesting more diskspace on this disk, and that
       the other partitions will get a share of the disk.  The other
@@ -80,7 +80,7 @@
 find_disk_with_freespace(struct disk_info_t diskinfo[], PedSector blocks)
 {
     int i;
-    for (i = 0; diskinfo[i].capasity; i++)
+    for (i = 0; diskinfo[i].capacity; i++)
     {
 	if (diskinfo[i].freespace >= blocks)
 	    return &diskinfo[i];
@@ -130,7 +130,7 @@
 	else
 	{
             maxmax_blk = MAX(maxmax_blk, reqs[i].max_blk);
-            maxmax_blk = MAX(maxmax_blk, disk->capasity);
+            maxmax_blk = MAX(maxmax_blk, disk->capacity);
 
 	    /* Found a usable disk.  Add this partition to the disk. */
 	    reqs[i].blocks  = reqs[i].min_blk;
@@ -140,7 +140,7 @@
     }
 
     /* Grow the partitions as much as possible on the allocated disk. */
-    for (i = 0; diskinfo[i].capasity; i++)
+    for (i = 0; diskinfo[i].capacity; i++)
     {
 	int j;
 	int64_t total_wanted = 0;
@@ -188,12 +188,12 @@
 {
     int i;
     autopartkit_log(0, "Suggested partition distribution:\n");
-    for (i = 0; diskinfo[i].capasity; i++)
+    for (i = 0; diskinfo[i].capacity; i++)
     {
         int j;
 	autopartkit_log(0, "  free block '%s' [%llu,%llu]:\n",
 	       diskinfo[i].path ? diskinfo[i].path : "[null]",
-	       BLOCKS_TO_MiB(diskinfo[i].capasity),
+	       BLOCKS_TO_MiB(diskinfo[i].capacity),
 	       BLOCKS_TO_MiB(diskinfo[i].freespace));
 	for (j = 0; reqs[j].mountpoint; ++j)
 	{
@@ -226,9 +226,9 @@
     PedPartition *part = NULL;
 
     int spacenum = 0;
-    const int spacecapasity = 10;
+    const int spacecapacity = 10;
 
-    struct disk_info_t *spaceinfo = calloc(sizeof(*spaceinfo), spacecapasity);
+    struct disk_info_t *spaceinfo = calloc(sizeof(*spaceinfo), spacecapacity);
 
     autopartkit_log(2, "Locating free space on all disks\n");
 
@@ -265,10 +265,10 @@
 		spaceinfo[spacenum].path = disk->dev->path;
 		memcpy(&spaceinfo[spacenum].geom, &part->geom,
 		       sizeof(part->geom));
-		spaceinfo[spacenum].capasity = part->geom.length;
+		spaceinfo[spacenum].capacity = part->geom.length;
 		spaceinfo[spacenum].freespace = part->geom.length;
 		++spacenum;
-		assert(spacenum < spacecapasity);
+		assert(spacenum < spacecapacity);
 	    }
 	}
     }
Index: tools/autopartkit/loadpartitions.c
--- tools/autopartkit/loadpartitions.c
+++ tools/autopartkit/loadpartitions.c
@@ -14,7 +14,7 @@
 
 struct partition_list {
   diskspace_req_t *disk_reqs;
-  unsigned int capasity;
+  unsigned int capacity;
   unsigned int count;
 };
 
@@ -24,16 +24,16 @@
   unsigned int newsize;
   void *mem;
   assert(list);
-  if (list->capasity > list->count + room)
+  if (list->capacity > list->count + room)
   {
 #ifdef DEBUG
     autopartkit_log("Enough room in list %d > %d + %d\n",
-	            list->capasity, list->count, room);
+	            list->capacity, list->count, room);
 #endif /* DEBUG */
     return 0;
   }
 
-  newsize = list->capasity * 2 ;
+  newsize = list->capacity * 2 ;
   if (room > newsize)
     newsize = room;
 
@@ -42,7 +42,7 @@
     return -1;
   else
   {
-    list->capasity = newsize;
+    list->capacity = newsize;
     list->disk_reqs = mem;
     return 0;
   }
@@ -77,7 +77,7 @@
 {
   assert(list);
   list->disk_reqs = NULL;
-  list->capasity = 0;
+  list->capacity = 0;
   list->count = 0;
   return 0;
 }

Attachment: pgpYETo9JOZpt.pgp
Description: PGP signature


Reply to: