Remove enum mqe_event and use u32 for queue events

We were using intermediate values int he enum and casting back and forth
with a u32; it is cleaner to just use a u32 and define some special
values.

Silences ICC warning #188: enumerated type mixed with another type.
This commit is contained in:
Justin Viiret
2015-10-23 10:59:48 +11:00
committed by Matthew Barr
parent 9ff1303cd8
commit 55b357f7d1
6 changed files with 29 additions and 25 deletions

View File

@@ -41,24 +41,28 @@ extern "C"
#define MAX_MQE_LEN 10
/** Queue events */
enum mqe_event {
MQE_START = 0, /**< and begin! Note: stateless engines will start from
* this location */
MQE_END = 1, /**< stop scanning */
MQE_TOP = 2, /**< enable start + start dot star */
MQE_TOP_FIRST = 4, /**< first event corresponding to a TOP _N_ */
/*
* Additional tops (in multi-top engines) use the event values from
* MQE_TOP_FIRST to something.
*/
/** Queue event: begin scanning. Note: stateless engines will start from this
* location. */
#define MQE_START 0U
MQE_INVALID = ~0U
};
/** Queue event: stop scanning. */
#define MQE_END 1U
/** Queue event: enable start and start-dot-star. */
#define MQE_TOP 2U
/** Queue event: first event corresponding to a numbered TOP. Additional tops
* (in multi-top engines) use the event values from MQE_TOP_FIRST to
* MQE_INVALID - 1. */
#define MQE_TOP_FIRST 4U
/** Invalid queue event */
#define MQE_INVALID (~0U)
/** Queue item */
struct mq_item {
u32 type; /**< event; from mqe_event */
u32 type; /**< event type, from MQE_* */
s64a location; /**< relative to the start of the current buffer */
u64a som; /**< pattern start-of-match corresponding to a top, only used
* by som engines. */