in reply to Re^5: Bidirectional lookup algorithm? (Judy)
in thread Bidirectional lookup algorithm? (Updated: further info.)

Word_t should be typedef'd as long long

typedef'ing to unsigned long long reduces the number of "shift count >= width" warnings. I now see only warnings in relation to left shifts.
Anyway, there's obviously something else that's not the right size. (Disappointing that the Judy developers haven't ported this correctly.)

I'm thinking that the "initializer element is not constant" errors must arise from some other issue.
Before I go digging myself, I'll wait for a bit and see if anonymonk (or anyone else) knows what needs to be done.

Cheers,
Rob

Replies are listed 'Best First'.
Re^7: Bidirectional lookup algorithm? (Judy)
by BrowserUk (Patriarch) on Jan 12, 2015 at 13:32 UTC
    I now see only warnings in relation to left shifts. Anyway, there's obviously something else that's not the right size. (Disappointing that the Judy developers haven't ported this correctly.)

    There is a heads-up in the Judy sources that might explain this.

    cJU_POP0MASK(7) is defined (in JudyCommon/JudyPrivateBranch.h:129) as:

    #define cJU_POP0MASK(cPopBytes) JU_LEASTBYTESMASK(cPopBytes)

    Which is defined (in:JudyCommon/JudyPrivate.h:413) as:

    #define JU_LEASTBYTESMASK(BYTES) \ ((0x100UL << (cJU_BITSPERBYTE * ((BYTES) - 1))) - 1)

    And that is preceded by this comment:

    // Note:  This macro has been problematic in the past to get right and to make
    // portable.  Its not OK on all systems to shift by the full word size.  This
    // macro should allow shifting by 1..N bytes, where N is the word size, but
    // should produce a compiler warning if the macro is called with Bytes == 0.
    

    Which may explain the continued warnings.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked