defs: remove invalid direction

Anything not in the enum is invalid
This commit is contained in:
Wim Taymans 2017-05-16 09:06:37 +02:00
parent 1079d433ef
commit b80fc0b08e
3 changed files with 4 additions and 6 deletions

View file

@ -62,12 +62,12 @@ const char *
pinos_direction_as_string (PinosDirection direction) pinos_direction_as_string (PinosDirection direction)
{ {
switch (direction) { switch (direction) {
case PINOS_DIRECTION_INVALID:
return "invalid";
case PINOS_DIRECTION_INPUT: case PINOS_DIRECTION_INPUT:
return "input"; return "input";
case PINOS_DIRECTION_OUTPUT: case PINOS_DIRECTION_OUTPUT:
return "output"; return "output";
default:
return "invalid";
} }
return "invalid-direction"; return "invalid-direction";
} }

View file

@ -71,7 +71,6 @@ const char * pinos_node_state_as_string (PinosNodeState state);
* The direction of a port * The direction of a port
*/ */
enum _PinosDirection { enum _PinosDirection {
PINOS_DIRECTION_INVALID = SPA_DIRECTION_INVALID,
PINOS_DIRECTION_INPUT = SPA_DIRECTION_INPUT, PINOS_DIRECTION_INPUT = SPA_DIRECTION_INPUT,
PINOS_DIRECTION_OUTPUT = SPA_DIRECTION_OUTPUT PINOS_DIRECTION_OUTPUT = SPA_DIRECTION_OUTPUT
}; };

View file

@ -84,9 +84,8 @@ typedef enum {
#define SPA_RESULT_RETURN_ASYNC(seq) (SPA_RESULT_ASYNC | ((seq) & SPA_ASYNC_SEQ_MASK)) #define SPA_RESULT_RETURN_ASYNC(seq) (SPA_RESULT_ASYNC | ((seq) & SPA_ASYNC_SEQ_MASK))
typedef enum { typedef enum {
SPA_DIRECTION_INVALID = 0, SPA_DIRECTION_INPUT = 0,
SPA_DIRECTION_INPUT, SPA_DIRECTION_OUTPUT = 1,
SPA_DIRECTION_OUTPUT,
} SpaDirection; } SpaDirection;
typedef struct { typedef struct {