testcrypt: fix a technically illegal forward-typedef.

Every compiler that's so far seen testcrypt.c has tolerated me writing
'typedef enum ValueType ValueType' before actually saying what 'enum
ValueType' is, but one just pointed out that it's not actually legal
standard C to do that. Moved the typedef to after the enum.
This commit is contained in:
Simon Tatham 2019-01-11 19:13:27 +00:00
Родитель d4d89d51e9
Коммит 2a365bb08a
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -81,7 +81,6 @@ int random_byte(void)
/* end of list */ /* end of list */
typedef struct Value Value; typedef struct Value Value;
typedef enum ValueType ValueType;
enum ValueType { enum ValueType {
#define VALTYPE_ENUM(n,t,f) VT_##n, #define VALTYPE_ENUM(n,t,f) VT_##n,
@ -89,6 +88,8 @@ enum ValueType {
#undef VALTYPE_ENUM #undef VALTYPE_ENUM
}; };
typedef enum ValueType ValueType;
const char *const type_names[] = { const char *const type_names[] = {
#define VALTYPE_NAME(n,t,f) #n, #define VALTYPE_NAME(n,t,f) #n,
VALUE_TYPES(VALTYPE_NAME) VALUE_TYPES(VALTYPE_NAME)