Main swap routine macro, not use other functions directly.
In the macro, the type of object and its size are determined. Depending on this, the function and the swap (copy) mode are selected.
- Parameters
-
| A | any C types, equals B. |
| B | any C types, equals A. |
Example:
Variable A, B - any C types pointer.
int ia = 10, ib = 20, *pia = &ia, *pib = &ib;
printf("%d)\tInt* pia = %d, pib = %d\n", __LINE__, *pia, *pib);
printf("%d)\tInt* pia = %d, pib = %d\n", __LINE__, *pia, *pib);
int iaa[] = { 1, 2, 3, 4, 5 }, iba[] = { 6, 7, 8, 9, 0 };
printf("%d)\tInt Array iaa = {", __LINE__);
for (i = 0; i < __NELE(iaa); i++)
{
printf(" %d,", iaa[i]);
}
printf(" }\n");
- Note
- To connect to your project, you need to declare a one header file fswap.h
- If you use own structures in an array format, you will need to add their description to fswap.h
- All functions that are automatically selected by __swap_fast(A,B), do not use them directly.