summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/create_chunk.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-04-01 12:18:20 +0000
committerobrien <obrien@FreeBSD.org>2001-04-01 12:18:20 +0000
commitbe7c1d12489eca9263a2127dedf1cdfeb2ad8b93 (patch)
treea48d82e5adc3563378b2bd88d4318266ec48cd3e /lib/libdisk/create_chunk.c
parent51dae2254ac1cd5dc67d293758322c96c592a731 (diff)
downloadFreeBSD-src-be7c1d12489eca9263a2127dedf1cdfeb2ad8b93.zip
FreeBSD-src-be7c1d12489eca9263a2127dedf1cdfeb2ad8b93.tar.gz
Add spaces around operators.
It's OK, the Project and afford them now -- they aren't as expensive as they used to be.
Diffstat (limited to 'lib/libdisk/create_chunk.c')
-rw-r--r--lib/libdisk/create_chunk.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index 59a83dc..6a4ded3 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -65,59 +65,59 @@ Fixup_FreeBSD_Names(struct disk *d, struct chunk *c)
if (!strcmp(c->name, "X")) return;
/* reset all names to "X" */
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1; c1 = c1->next) {
c1->oname = c1->name;
c1->name = malloc(12);
- if(!c1->name) barfout(1,"Malloc failed");
+ if(!c1->name) barfout(1, "Malloc failed");
strcpy(c1->name,"X");
}
/* Allocate the first swap-partition we find */
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1; c1 = c1->next) {
if (c1->type == unused) continue;
if (c1->subtype != FS_SWAP) continue;
- sprintf(c1->name,"%s%c",c->name,SWAP_PART+'a');
+ sprintf(c1->name, "%s%c", c->name, SWAP_PART + 'a');
break;
}
/* Allocate the first root-partition we find */
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1; c1 = c1->next) {
if (c1->type == unused) continue;
if (!(c1->flags & CHUNK_IS_ROOT)) continue;
- sprintf(c1->name,"%s%c",c->name,0+'a');
+ sprintf(c1->name, "%s%c", c->name, 0 + 'a');
break;
}
/* Try to give them the same as they had before */
- for (c1 = c->part; c1 ; c1 = c1->next) {
- if (strcmp(c1->name,"X")) continue;
+ for (c1 = c->part; c1; c1 = c1->next) {
+ if (strcmp(c1->name, "X")) continue;
for(c3 = c->part; c3 ; c3 = c3->next)
if (c1 != c3 && !strcmp(c3->name, c1->oname)) {
goto newname;
}
- strcpy(c1->name,c1->oname);
+ strcpy(c1->name, c1->oname);
newname:
}
/* Allocate the rest sequentially */
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1; c1 = c1->next) {
const char order[] = "efghabd";
if (c1->type == unused) continue;
- if (strcmp("X",c1->name)) continue;
+ if (strcmp("X", c1->name)) continue;
- for(j=0;j<strlen(order);j++) {
- sprintf(c1->name,"%s%c",c->name,order[j]);
+ for(j = 0; j < strlen(order); j++) {
+ sprintf(c1->name, "%s%c", c->name, order[j]);
for(c3 = c->part; c3 ; c3 = c3->next)
if (c1 != c3 && !strcmp(c3->name, c1->name))
goto match;
break;
match:
- strcpy(c1->name,"X");
+ strcpy(c1->name, "X");
continue;
}
}
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1; c1 = c1->next) {
free(c1->oname);
c1->oname = 0;
}
@@ -129,14 +129,14 @@ Fixup_Extended_Names(struct disk *d, struct chunk *c)
struct chunk *c1;
int j=5;
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1; c1 = c1->next) {
if (c1->type == unused) continue;
free(c1->name);
c1->name = malloc(12);
- if(!c1->name) barfout(1,"malloc failed");
- sprintf(c1->name,"%ss%d",d->chunks->name,j++);
+ if(!c1->name) barfout(1, "malloc failed");
+ sprintf(c1->name, "%ss%d", d->chunks->name, j++);
if (c1->type == freebsd)
- Fixup_FreeBSD_Names(d,c1);
+ Fixup_FreeBSD_Names(d, c1);
}
}
@@ -155,14 +155,14 @@ Fixup_Names(struct disk *d)
c2->flags &= ~CHUNK_BSD_COMPAT;
if (c2->type == unused)
continue;
- if (strcmp(c2->name,"X"))
+ if (strcmp(c2->name, "X"))
continue;
#ifdef __i386__
c2->oname = malloc(12);
- if(!c2->oname) barfout(1,"malloc failed");
- for(j=1;j<=NDOSPART;j++) {
- sprintf(c2->oname,"%ss%d",c1->name,j);
- for(c3 = c1->part; c3 ; c3 = c3->next)
+ if(!c2->oname) barfout(1, "malloc failed");
+ for(j = 1; j <= NDOSPART; j++) {
+ sprintf(c2->oname, "%ss%d", c1->name, j);
+ for(c3 = c1->part; c3; c3 = c3->next)
if (c3 != c2 && !strcmp(c3->name, c2->oname))
goto match;
free(c2->name);
@@ -179,18 +179,18 @@ Fixup_Names(struct disk *d)
c2->name = strdup(c1->name);
#endif /*__i386__*/
}
- for(c2 = c1->part; c2 ; c2 = c2->next) {
+ for(c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == freebsd) {
c2->flags |= CHUNK_BSD_COMPAT;
break;
}
}
- for(c2 = c1->part; c2 ; c2 = c2->next) {
+ for(c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == freebsd)
- Fixup_FreeBSD_Names(d,c2);
+ Fixup_FreeBSD_Names(d, c2);
#ifndef PC98
if (c2->type == extended)
- Fixup_Extended_Names(d,c2);
+ Fixup_Extended_Names(d, c2);
#endif
}
}
@@ -227,9 +227,9 @@ Create_Chunk(struct disk *d, u_long offset, u_long size, chunk_e type, int subty
}
#ifdef PC98
- i = Add_Chunk(d,offset,size,"X",type,subtype,flags,sname);
+ i = Add_Chunk(d, offset, size, "X", type, subtype, flags, sname);
#else
- i = Add_Chunk(d,offset,size,"X",type,subtype,flags);
+ i = Add_Chunk(d, offset, size, "X", type, subtype, flags);
#endif
Fixup_Names(d);
return i;
@@ -244,7 +244,7 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent , u_long size, chunk_e ty
if (!parent)
parent = d->chunks;
- for (c1=parent->part; c1 ; c1 = c1->next) {
+ for (c1=parent->part; c1; c1 = c1->next) {
if (c1->type != unused) continue;
if (c1->size < size) continue;
offset = c1->offset;
@@ -253,17 +253,17 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent , u_long size, chunk_e ty
return 0;
found:
#ifdef PC98
- i = Add_Chunk(d,offset,size,"X",type,subtype,flags,"-");
+ i = Add_Chunk(d, offset, size, "X", type, subtype, flags, "-");
#else
- i = Add_Chunk(d,offset,size,"X",type,subtype,flags);
+ i = Add_Chunk(d, offset, size, "X", type, subtype, flags);
#endif
if (i)
return 0;
Fixup_Names(d);
- for (c1=parent->part; c1 ; c1 = c1->next)
+ for (c1=parent->part; c1; c1 = c1->next)
if (c1->offset == offset)
return c1;
- barfout(1,"Serious internal trouble");
+ barfout(1, "Serious internal trouble");
return 0;
}
OpenPOWER on IntegriCloud