There are several warnings about this:

  table.c: In function '_test_code_bad':
  table.c:209: warning: enumeration value 'FAT_TYPE_FAT12' not handled in switch

However, there are a few switch stmts that *do* handle that enum value.
Do any of you know how best to avoid those warnings?

  - handle FAT_TYPE_FAT12 like FAT_TYPE_FAT16, as is done
    at least once in each of table.c and traverse.c.

or

  - fall through (e.g., default: break, or FAT_TYPE_FAT12: break),
    which is equivalent to what the current code does, yet will
    avoid the warning.

Two examples:
==========================================

static int
_test_code_bad (const FatTable* ft, FatCluster code)
{
        switch (ft->fat_type) {
                case FAT_TYPE_FAT16:
                if (code == 0xfff7) return 1;
                break;

                case FAT_TYPE_FAT32:
                if (code == 0x0ffffff7) return 1;
                break;
        }
        return 0;
}

static int
_test_code_eof (const FatTable* ft, FatCluster code)
{
        switch (ft->fat_type) {
                case FAT_TYPE_FAT16:
                if (code >= 0xfff7) return 1;
                break;

                case FAT_TYPE_FAT32:
                if (code >= 0x0ffffff7) return 1;
                break;
        }
        return 0;
}

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to