Simplify signature of get_encoding_rules(), make all rules static

This commit is contained in:
Martin Willi
2012-03-20 17:30:42 +01:00
parent 683d83ed3e
commit e9b55b8325
26 changed files with 114 additions and 137 deletions
@@ -79,7 +79,7 @@ struct private_delete_payload_t {
* The defined offsets are the positions in a object of type
* private_delete_payload_t.
*/
encoding_rule_t delete_payload_encodings[] = {
static encoding_rule_t encodings[] = {
/* 1 Byte next payload type, stored in the field next_payload */
{ U_INT_8, offsetof(private_delete_payload_t, next_payload) },
/* the critical bit */
@@ -145,11 +145,11 @@ METHOD(payload_t, verify, status_t,
return SUCCESS;
}
METHOD(payload_t, get_encoding_rules, void,
private_delete_payload_t *this, encoding_rule_t **rules, size_t *rule_count)
METHOD(payload_t, get_encoding_rules, int,
private_delete_payload_t *this, encoding_rule_t **rules)
{
*rules = delete_payload_encodings;
*rule_count = countof(delete_payload_encodings);
*rules = encodings;
return countof(encodings);
}
METHOD(payload_t, get_payload_type, payload_type_t,