Lines Matching defs:pArray1

199 static int crSaIntersected(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)
204 for (uint32_t i = 0, j = 0; i < pArray1->cSize && j < pArray2->cSize; )
206 if (pArray1->pElements[i] == pArray2->pElements[j])
208 rc = CrSaAdd(pResult, pArray1->pElements[i]);
218 else if (pArray1->pElements[i] < pArray2->pElements[j])
231 static void crSaIntersect(CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)
233 for (uint32_t i = 0, j = 0; i < pArray1->cSize && j < pArray2->cSize; )
235 if (pArray1->pElements[i] == pArray2->pElements[j])
240 else if (pArray1->pElements[i] < pArray2->pElements[j])
241 crSaDelAt(pArray1, i);
251 VBOXSADECL(void) CrSaIntersect(CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)
253 crSaIntersect(pArray1, pArray2);
256 VBOXSADECL(int) CrSaIntersected(CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)
258 return crSaIntersected(pArray1, pArray2, pResult);
261 static int crSaUnited(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)
268 while (i < pArray1->cSize && j < pArray2->cSize)
271 if (pArray1->pElements[i] == pArray2->pElements[j])
273 element = pArray1->pElements[i];
277 else if (pArray1->pElements[i] < pArray2->pElements[j])
279 element = pArray1->pElements[i];
284 element = pArray1->pElements[j];
299 if (i < pArray1->cSize)
302 pTail = pArray1;
331 VBOXSADECL(int) CrSaUnited(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2, CR_SORTARRAY *pResult)
333 return crSaUnited(pArray1, pArray2, pResult);
336 static int crSaClone(const CR_SORTARRAY *pArray1, CR_SORTARRAY *pResult)
341 if (pArray1->cSize > pResult->cBufferSize)
344 uint32_t cNewBufferSize = pArray1->cSize;
357 pResult->cSize = pArray1->cSize;
358 memcpy(pResult->pElements, pArray1->pElements, pArray1->cSize * sizeof (pArray1->pElements[0]));
366 VBOXSADECL(int) CrSaClone(const CR_SORTARRAY *pArray1, CR_SORTARRAY *pResult)
368 return crSaClone(pArray1, pResult);
371 static int crSaCmp(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)
373 int diff = CrSaGetSize(pArray1) - CrSaGetSize(pArray2);
377 return memcmp(pArray1->pElements, pArray2->pElements, pArray1->cSize * sizeof (pArray1->pElements[0]));
380 VBOXSADECL(int) CrSaCmp(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)
382 return crSaCmp(pArray1, pArray2);
385 static bool crSaCovers(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)
387 if (CrSaGetSize(pArray1) < CrSaGetSize(pArray2))
393 if (i == pArray1->cSize)
396 if (pArray1->pElements[i] == pArray2->pElements[j])
401 else if (pArray1->pElements[i] < pArray2->pElements[j])
410 VBOXSADECL(bool) CrSaCovers(const CR_SORTARRAY *pArray1, const CR_SORTARRAY *pArray2)
412 return crSaCovers(pArray1, pArray2);