Previously we were comparing PartitionScheme values against the undefined enum
value -1, which causes a warning with gcc 4.5. Define -1 explicitly as
"PART_TYPE_UNKNOWN" and only use that in the code, which is cleaner.
Thanks to Marti Raudsepp for pointing this out!
DEBUG ("In part_add_partition: device_file=%s, start=%lld, size=%lld, type=%s", device_file, start, size, type);
}
- scheme = -1;
+ scheme = PART_TYPE_UNKNOWN;
if (is_change)
{
PartitionTable *p;
/* now that we know the partitoning scheme, sanity check type and flags */
switch (scheme)
{
- case -1:
+ case PART_TYPE_UNKNOWN:
/* unknown partition table format; error out if any type, label or flags are given */
if ((flags != NULL && flags[0] != NULL))
{
/* Partition schemes understood by this library */
typedef enum
{
+ PART_TYPE_UNKNOWN = -1,
PART_TYPE_MSDOS = 0,
PART_TYPE_MSDOS_EXTENDED = 1,
PART_TYPE_APPLE = 2,