| 730 | } |
| 731 | |
| 732 | int 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 | |
| 751 | int poptBitsChk(poptBits bits, const char * s) |
| 752 | { |
no outgoing calls
no test coverage detected