remove all trailing whitespace
This commit is contained in:
parent
d2d4966571
commit
b39f9d20a9
222 changed files with 3286 additions and 3286 deletions
|
@ -140,7 +140,7 @@ acorn_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
grub_disk_addr_t sector;
|
||||
grub_err_t err;
|
||||
grub_partition_t p;
|
||||
|
||||
|
||||
/* Enforce raw disk access. */
|
||||
raw.partition = 0;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ struct grub_amiga_rdsk
|
|||
grub_uint32_t badblcklst;
|
||||
grub_uint32_t partitionlst;
|
||||
grub_uint32_t fslst;
|
||||
|
||||
|
||||
/* The other information is not important for us. */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
@ -61,7 +61,7 @@ struct grub_amiga_partition
|
|||
grub_uint32_t unused5[3];
|
||||
grub_uint32_t lowcyl;
|
||||
grub_uint32_t highcyl;
|
||||
|
||||
|
||||
grub_uint32_t firstcyl;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
@ -80,18 +80,18 @@ amiga_partition_map_iterate (grub_disk_t disk,
|
|||
int partno = 0;
|
||||
int next = -1;
|
||||
unsigned pos;
|
||||
|
||||
|
||||
/* Enforce raw disk access. */
|
||||
raw = *disk;
|
||||
raw.partition = 0;
|
||||
|
||||
|
||||
/* The RDSK block is one of the first 15 blocks. */
|
||||
for (pos = 0; pos < 15; pos++)
|
||||
{
|
||||
/* Read the RDSK block which is a descriptor for the entire disk. */
|
||||
if (grub_disk_read (&raw, pos, 0, sizeof (rdsk), &rdsk))
|
||||
return grub_errno;
|
||||
|
||||
|
||||
if (grub_strcmp ((char *) rdsk.magic, "RDSK") == 0)
|
||||
{
|
||||
/* Found the first PART block. */
|
||||
|
@ -103,36 +103,36 @@ amiga_partition_map_iterate (grub_disk_t disk,
|
|||
if (next == -1)
|
||||
return grub_error (GRUB_ERR_BAD_PART_TABLE,
|
||||
"Amiga partition map not found.");
|
||||
|
||||
|
||||
/* The end of the partition list is marked using "-1". */
|
||||
while (next != -1)
|
||||
{
|
||||
struct grub_amiga_partition apart;
|
||||
|
||||
|
||||
/* Read the RDSK block which is a descriptor for the entire disk. */
|
||||
if (grub_disk_read (&raw, next, 0, sizeof (apart), &apart))
|
||||
return grub_errno;
|
||||
|
||||
|
||||
/* Calculate the first block and the size of the partition. */
|
||||
part.start = (grub_be_to_cpu32 (apart.lowcyl)
|
||||
part.start = (grub_be_to_cpu32 (apart.lowcyl)
|
||||
* grub_be_to_cpu32 (apart.heads)
|
||||
* grub_be_to_cpu32 (apart.block_per_track));
|
||||
part.len = ((grub_be_to_cpu32 (apart.highcyl)
|
||||
- grub_be_to_cpu32 (apart.lowcyl) + 1)
|
||||
* grub_be_to_cpu32 (apart.heads)
|
||||
* grub_be_to_cpu32 (apart.block_per_track));
|
||||
|
||||
|
||||
part.offset = (grub_off_t) next * 512;
|
||||
part.index = partno;
|
||||
part.partmap = &grub_amiga_partition_map;
|
||||
|
||||
|
||||
if (hook (disk, &part))
|
||||
return grub_errno;
|
||||
|
||||
|
||||
next = grub_be_to_cpu32 (apart.next);
|
||||
partno++;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
char *s = (char *) str;
|
||||
|
||||
auto int find_func (grub_disk_t d, const grub_partition_t partition);
|
||||
|
||||
|
||||
int find_func (grub_disk_t d __attribute__ ((unused)),
|
||||
const grub_partition_t partition)
|
||||
{
|
||||
|
@ -154,14 +154,14 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
p = (grub_partition_t) grub_malloc (sizeof (*p));
|
||||
if (! p)
|
||||
return 1;
|
||||
|
||||
|
||||
grub_memcpy (p, partition, sizeof (*p));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Get the partition number. */
|
||||
partnum = grub_strtoul (s, 0, 10) - 1;
|
||||
if (grub_errno)
|
||||
|
|
|
@ -76,7 +76,7 @@ struct grub_apple_part
|
|||
|
||||
/* Reserved. */
|
||||
grub_uint32_t reserved2;
|
||||
|
||||
|
||||
/* The entry point of the bootcode. */
|
||||
grub_uint32_t bootcode_entrypoint;
|
||||
|
||||
|
@ -181,7 +181,7 @@ apple_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
char *s = (char *) str;
|
||||
|
||||
auto int find_func (grub_disk_t d, const grub_partition_t partition);
|
||||
|
||||
|
||||
int find_func (grub_disk_t d __attribute__ ((unused)),
|
||||
const grub_partition_t partition)
|
||||
{
|
||||
|
@ -190,14 +190,14 @@ apple_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
p = (grub_partition_t) grub_malloc (sizeof (*p));
|
||||
if (! p)
|
||||
return 1;
|
||||
|
||||
|
||||
grub_memcpy (p, partition, sizeof (*p));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Get the partition number. */
|
||||
partnum = grub_strtoul (s, 0, 10) - 1;
|
||||
if (grub_errno)
|
||||
|
@ -205,7 +205,7 @@ apple_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (apple_partition_map_iterate (disk, find_func))
|
||||
goto fail;
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ gpt_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
char *s = (char *) str;
|
||||
|
||||
auto int find_func (grub_disk_t d, const grub_partition_t partition);
|
||||
|
||||
|
||||
int find_func (grub_disk_t d __attribute__ ((unused)),
|
||||
const grub_partition_t partition)
|
||||
{
|
||||
|
@ -131,14 +131,14 @@ gpt_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
p = (grub_partition_t) grub_malloc (sizeof (*p));
|
||||
if (! p)
|
||||
return 1;
|
||||
|
||||
|
||||
grub_memcpy (p, partition, sizeof (*p));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Get the partition number. */
|
||||
partnum = grub_strtoul (s, 0, 10) - 1;
|
||||
if (grub_errno)
|
||||
|
|
38
partmap/pc.c
38
partmap/pc.c
|
@ -33,27 +33,27 @@ grub_partition_parse (const char *str)
|
|||
{
|
||||
grub_partition_t p;
|
||||
struct grub_pc_partition *pcdata;
|
||||
|
||||
|
||||
char *s = (char *) str;
|
||||
|
||||
|
||||
p = (grub_partition_t) grub_malloc (sizeof (*p));
|
||||
if (! p)
|
||||
return 0;
|
||||
|
||||
|
||||
pcdata = (struct grub_pc_partition *) grub_malloc (sizeof (*pcdata));
|
||||
if (! pcdata)
|
||||
goto fail;
|
||||
|
||||
|
||||
p->data = pcdata;
|
||||
p->partmap = &grub_pc_partition_map;
|
||||
|
||||
|
||||
/* Initialize some of the fields with invalid values. */
|
||||
pcdata->bsd_part = pcdata->dos_type = pcdata->bsd_type = p->index = -1;
|
||||
|
||||
/* Get the DOS partition number. The number is counted from one for
|
||||
the user interface, and from zero internally. */
|
||||
pcdata->dos_part = grub_strtoul (s, &s, 0) - 1;
|
||||
|
||||
|
||||
if (grub_errno)
|
||||
{
|
||||
/* Not found. Maybe only a BSD label is specified. */
|
||||
|
@ -79,7 +79,7 @@ grub_partition_parse (const char *str)
|
|||
goto fail;
|
||||
|
||||
return p;
|
||||
|
||||
|
||||
fail:
|
||||
grub_free (p);
|
||||
grub_free (pcdata);
|
||||
|
@ -101,18 +101,18 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
/* Enforce raw disk access. */
|
||||
raw = *disk;
|
||||
raw.partition = 0;
|
||||
|
||||
|
||||
p.offset = 0;
|
||||
pcdata.ext_offset = 0;
|
||||
pcdata.dos_part = -1;
|
||||
p.data = &pcdata;
|
||||
p.partmap = &grub_pc_partition_map;
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
int i;
|
||||
struct grub_pc_partition_entry *e;
|
||||
|
||||
|
||||
/* Read the MBR. */
|
||||
if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr))
|
||||
goto finish;
|
||||
|
@ -125,7 +125,7 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
for (p.index = 0; p.index < 4; p.index++)
|
||||
{
|
||||
e = mbr.entries + p.index;
|
||||
|
||||
|
||||
p.start = p.offset + grub_le_to_cpu32 (e->start);
|
||||
p.len = grub_le_to_cpu32 (e->length);
|
||||
pcdata.bsd_part = -1;
|
||||
|
@ -147,7 +147,7 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
&& ! grub_pc_partition_is_extended (e->type))
|
||||
{
|
||||
pcdata.dos_part++;
|
||||
|
||||
|
||||
if (hook (disk, &p))
|
||||
return 1;
|
||||
|
||||
|
@ -188,7 +188,7 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
p.start = grub_le_to_cpu32 (be->offset);
|
||||
p.len = grub_le_to_cpu32 (be->size);
|
||||
pcdata.bsd_type = be->fs_type;
|
||||
|
||||
|
||||
if (be->fs_type != GRUB_PC_PARTITION_BSD_TYPE_UNUSED)
|
||||
if (hook (disk, &p))
|
||||
return 1;
|
||||
|
@ -205,7 +205,7 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
e = mbr.entries + i;
|
||||
|
||||
|
||||
if (grub_pc_partition_is_extended (e->type))
|
||||
{
|
||||
p.offset = pcdata.ext_offset + grub_le_to_cpu32 (e->start);
|
||||
|
@ -231,7 +231,7 @@ pc_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
{
|
||||
grub_partition_t p;
|
||||
struct grub_pc_partition *pcdata;
|
||||
|
||||
|
||||
auto int find_func (grub_disk_t d, const grub_partition_t partition);
|
||||
|
||||
int find_func (grub_disk_t d __attribute__ ((unused)),
|
||||
|
@ -247,14 +247,14 @@ pc_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
grub_memcpy (pcdata, partdata, sizeof (*pcdata));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
p = grub_partition_parse (str);
|
||||
if (! p)
|
||||
return 0;
|
||||
|
||||
|
||||
pcdata = p->data;
|
||||
pc_partition_map_iterate (disk, find_func);
|
||||
if (grub_errno)
|
||||
|
@ -280,7 +280,7 @@ pc_partition_map_get_name (const grub_partition_t p)
|
|||
{
|
||||
char *name;
|
||||
struct grub_pc_partition *pcdata = p->data;
|
||||
|
||||
|
||||
name = grub_malloc (13);
|
||||
if (! name)
|
||||
return 0;
|
||||
|
|
|
@ -73,12 +73,12 @@ grub_sun_is_valid (struct grub_sun_block *label)
|
|||
{
|
||||
grub_uint16_t *pos;
|
||||
grub_uint16_t sum = 0;
|
||||
|
||||
|
||||
for (pos = (grub_uint16_t *) label;
|
||||
pos < (grub_uint16_t *) (label + 1);
|
||||
pos++)
|
||||
sum ^= *pos;
|
||||
|
||||
|
||||
return ! sum;
|
||||
}
|
||||
|
||||
|
@ -91,10 +91,10 @@ sun_partition_map_iterate (grub_disk_t disk,
|
|||
struct grub_disk raw;
|
||||
struct grub_sun_block block;
|
||||
int partnum;
|
||||
|
||||
|
||||
raw = *disk;
|
||||
raw.partition = 0;
|
||||
|
||||
|
||||
p = (grub_partition_t) grub_malloc (sizeof (struct grub_partition));
|
||||
if (! p)
|
||||
return grub_errno;
|
||||
|
@ -107,16 +107,16 @@ sun_partition_map_iterate (grub_disk_t disk,
|
|||
{
|
||||
if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.magic))
|
||||
grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");
|
||||
|
||||
|
||||
if (! grub_sun_is_valid (&block))
|
||||
grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");
|
||||
|
||||
|
||||
/* Maybe another error value would be better, because partition
|
||||
table _is_ recognized but invalid. */
|
||||
for (partnum = 0; partnum < GRUB_PARTMAP_SUN_MAX_PARTS; partnum++)
|
||||
{
|
||||
struct grub_sun_partition_descriptor *desc;
|
||||
|
||||
|
||||
if (block.infos[partnum].id == 0
|
||||
|| block.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID)
|
||||
continue;
|
||||
|
@ -134,7 +134,7 @@ sun_partition_map_iterate (grub_disk_t disk,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
grub_free (p);
|
||||
|
||||
return grub_errno;
|
||||
|
@ -148,7 +148,7 @@ sun_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
char *s = (char *) str;
|
||||
|
||||
auto int find_func (grub_disk_t d, const grub_partition_t partition);
|
||||
|
||||
|
||||
int find_func (grub_disk_t d __attribute__ ((unused)),
|
||||
const grub_partition_t partition)
|
||||
{
|
||||
|
@ -157,10 +157,10 @@ sun_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
p = (grub_partition_t) grub_malloc (sizeof (*p));
|
||||
if (p)
|
||||
grub_memcpy (p, partition, sizeof (*p));
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ sun_partition_map_probe (grub_disk_t disk, const char *str)
|
|||
grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
|
||||
p = 0;
|
||||
}
|
||||
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -187,11 +187,11 @@ static char *
|
|||
sun_partition_map_get_name (const grub_partition_t p)
|
||||
{
|
||||
char *name;
|
||||
|
||||
|
||||
name = grub_malloc (13);
|
||||
if (name)
|
||||
grub_sprintf (name, "%d", p->index + 1);
|
||||
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue