MCPcopy Index your code
hub / github.com/RsyncProject/rsync / poptBitsChk

Function poptBitsChk

popt/popt.c:751–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751int poptBitsChk(poptBits bits, const char * s)
752{
753 size_t ns = (s ? strlen(s) : 0);
754 uint32_t h0 = 0;
755 uint32_t h1 = 0;
756 int rc = 1;
757
758 if (bits == NULL || ns == 0)
759 return POPT_ERROR_NULLARG;
760
761 poptJlu32lpair(s, ns, &h0, &h1);
762
763 for (ns = 0; ns < (size_t)_poptBitsK; ns++) {
764 uint32_t h = h0 + ns * h1;
765 uint32_t ix = (h % _poptBitsM);
766 if (PBM_ISSET(ix, bits))
767 continue;
768 rc = 0;
769 break;
770 }
771 return rc;
772}
773
774int poptBitsClr(poptBits bits)
775{

Callers 1

poptSaveBitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected