Move defaults for some switches into a default case

This is clearly equivalent, and quiets -Wswitch-default.

Based on part of a patch by Thomas Zimmermann.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
This commit is contained in:
Simon McVittie 2016-10-13 23:09:34 +01:00 committed by Simon McVittie
parent 81a99b4833
commit 21eb3317c5
5 changed files with 14 additions and 13 deletions

View file

@ -187,10 +187,9 @@ bus_config_parser_element_type_to_name (ElementType type)
return "allow_anonymous";
case ELEMENT_APPARMOR:
return "apparmor";
default:
_dbus_assert_not_reached ("bad element type");
return NULL;
}
_dbus_assert_not_reached ("bad element type");
return NULL;
}

View file

@ -267,10 +267,10 @@ _dbus_credentials_include (DBusCredentials *credentials,
return credentials->linux_security_label != NULL;
case DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID:
return credentials->adt_audit_data != NULL;
default:
_dbus_assert_not_reached ("Unknown credential enum value");
return FALSE;
}
_dbus_assert_not_reached ("Unknown credential enum value");
return FALSE;
}
/**

View file

@ -334,9 +334,10 @@ source_string (BlockSource source)
return "malloc0";
case SOURCE_REALLOC_NULL:
return "realloc(NULL)";
default:
_dbus_assert_not_reached ("Invalid malloc block source ID");
return "invalid!";
}
_dbus_assert_not_reached ("Invalid malloc block source ID");
return "invalid!";
}
static void

View file

@ -323,9 +323,10 @@ _dbus_win_error_from_last_error (void)
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND:
return DBUS_ERROR_FILE_NOT_FOUND;
default:
return DBUS_ERROR_FAILED;
}
return DBUS_ERROR_FAILED;
}

View file

@ -670,9 +670,9 @@ _dbus_error_from_errno (int error_number)
case ENOENT:
return DBUS_ERROR_FILE_NOT_FOUND;
#endif
default:
return DBUS_ERROR_FAILED;
}
return DBUS_ERROR_FAILED;
}
/**