From e8161c42d076b7c3109a0cfaf3f98e5aaef6bd71 Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 16 Oct 2002 07:25:56 +0000 Subject: [PATCH] A few new helper functions -- mm --- hadaq/subevt.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hadaq/subevt.h b/hadaq/subevt.h index bfd8edc..ee2da40 100644 --- a/hadaq/subevt.h +++ b/hadaq/subevt.h @@ -86,12 +86,12 @@ static uint32_t SubEvt_id(const void *my) static uint32_t SubEvt_pureId(const void *my) { - return SubEvt_hdrValue(my, SubEvtIdx_id) & 0x7fffffffU; + return SubEvt_id(my) & 0x7fffffffUL; } static int SubEvt_dataError(const void *my) { - return (SubEvt_hdrValue(my, SubEvtIdx_id) & 0x80000000) != 0; + return (SubEvt_id(my) & 0x80000000UL) != 0; } static void SubEvt_setId(void *my, uint32_t id) @@ -99,6 +99,14 @@ static void SubEvt_setId(void *my, uint32_t id) SubEvt_setHdrValue(my, SubEvtIdx_id, id); } +static int SubEvt_setDataError(const void *my) { + SubEvt_setId(my, SubEvt_id(my) | 0x80000000UL); +} + +static int SubEvt_clrDataError(const void *my) { + SubEvt_setId(my, SubEvt_id(my) & ~0x80000000UL); +} + static uint32_t SubEvt_trigNr(const void *my) { return SubEvt_hdrValue(my, SubEvtIdx_trigNr); -- 2.43.0