Revert the default statement for PIN type checking
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 20 Mar 2010 01:26:57 +0000 (02:26 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 20 Mar 2010 01:26:57 +0000 (02:26 +0100)
Also fix the coding style for the switch statement and remove the
number assignment for an internal enum.

src/common.c
src/common.h

index 32b64d4..b58d9be 100644 (file)
@@ -592,8 +592,7 @@ gboolean is_valid_pin(const char *pin, enum pin_type type)
        if (i != strspn(pin, "012345679"))
                return FALSE;
 
-       switch (type)
-       {
+       switch (type) {
        case PIN_TYPE_PIN:
                /* 11.11 Section 9.3 ("CHV"): 4..8 IA-5 digits */
                if (4 <= i && i <= 8)
@@ -613,8 +612,6 @@ gboolean is_valid_pin(const char *pin, enum pin_type type)
                if (i < 8)
                        return TRUE;
                break;
-       default:
-               break;
        }
 
        return FALSE;
index d166f48..c43e46d 100644 (file)
@@ -116,10 +116,10 @@ enum ss_cssu {
 };
 
 enum pin_type {
-       PIN_TYPE_NONE = 0,
-       PIN_TYPE_PIN = 1,
-       PIN_TYPE_PUK = 2,
-       PIN_TYPE_NET = 3,
+       PIN_TYPE_NONE,
+       PIN_TYPE_PIN,
+       PIN_TYPE_PUK,
+       PIN_TYPE_NET,
 };
 
 const char *telephony_error_to_str(const struct ofono_error *error);