MCPcopy Create free account
hub / github.com/RsyncProject/rsync / poptBitsAdd

Function poptBitsAdd

popt/popt.c:732–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730}
731
732int poptBitsAdd(poptBits bits, const char * s)
733{
734 size_t ns = (s ? strlen(s) : 0);
735 uint32_t h0 = 0;
736 uint32_t h1 = 0;
737
738 if (bits == NULL || ns == 0)
739 return POPT_ERROR_NULLARG;
740
741 poptJlu32lpair(s, ns, &h0, &h1);
742
743 for (ns = 0; ns < (size_t)_poptBitsK; ns++) {
744 uint32_t h = h0 + ns * h1;
745 uint32_t ix = (h % _poptBitsM);
746 PBM_SET(ix, bits);
747 }
748 return 0;
749}
750
751int poptBitsChk(poptBits bits, const char * s)
752{

Callers 2

poptBitsArgsFunction · 0.85
poptSaveBitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected