From d4fb2091c8042257d6a20b9dd68d5b2b9a628d54 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Mon, 8 Feb 2010 14:35:29 +0100 Subject: [PATCH] Use an enum for DMAP types --- src/dmap_helpers.h | 22 ++++++++++++---------- src/httpd_daap.c | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/dmap_helpers.h b/src/dmap_helpers.h index 17a409c8..41680ffc 100644 --- a/src/dmap_helpers.h +++ b/src/dmap_helpers.h @@ -4,16 +4,18 @@ #include -#define DMAP_TYPE_BYTE 0x01 -#define DMAP_TYPE_UBYTE 0x02 -#define DMAP_TYPE_SHORT 0x03 -#define DMAP_TYPE_INT 0x05 -#define DMAP_TYPE_LONG 0x07 -#define DMAP_TYPE_STRING 0x09 -#define DMAP_TYPE_DATE 0x0a -#define DMAP_TYPE_VERSION 0x0b -#define DMAP_TYPE_LIST 0x0c - +enum dmap_type + { + DMAP_TYPE_BYTE = 0x01, + DMAP_TYPE_UBYTE = 0x02, + DMAP_TYPE_SHORT = 0x03, + DMAP_TYPE_INT = 0x05, + DMAP_TYPE_LONG = 0x07, + DMAP_TYPE_STRING = 0x09, + DMAP_TYPE_DATE = 0x0a, + DMAP_TYPE_VERSION = 0x0b, + DMAP_TYPE_LIST = 0x0c, + }; void dmap_add_container(struct evbuffer *evbuf, char *tag, int len); diff --git a/src/httpd_daap.c b/src/httpd_daap.c index 5405f5a4..5b9fb9de 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -67,7 +67,7 @@ struct daap_update_request { struct dmap_field_map { uint32_t hash; - short type; + enum dmap_type type; char *tag; char *desc; ssize_t mfi_offset;