/*<<<***************************************************************************
The MIT License (MIT)

Copyright(C) 2013 - 2015 Marc Mirti Mancinelli, Christophe Lardau and Philippe Pamart (xdcube.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
////////////////////////////////////////////////////////////////////////////////
#Title: xbArray
#Project: xdcBase
////////////////////////////////////////////////////////////////////////////////
#Author: Marc MIRTI MANCINELLI
#History:
<26/05/2013: creation.
12/02/2014: this notice inserted.
***************************************************************************>>>*/
#include "stdafx.h"

#include "xbArray.h"

int xbSortLong(const long &nb1,const long &nb2)
{
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

int xbFindLong(const long &nb1,const void *pNb2)
{
	long nb2 = *(long*)pNb2;
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

int xbSortUlong(const ulong &nb1,const ulong &nb2)
{
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

int xbFindUlong(const ulong &nb1,const void *pNb2)
{
	ulong nb2 = *(ulong*)pNb2;
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

int xbSortInt64(const int64 &nb1,const int64 &nb2)
{
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

int xbFindInt64(const int64 &nb1,const void *pNb2)
{
	int64 nb2 = *(int64*)pNb2;
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

int xbSortUint64(const uint64 &nb1,const uint64 &nb2)
{
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

int xbFindUint64(const uint64 &nb1,const void *pNb2)
{
	uint64 nb2 = *(uint64*)pNb2;
	if (nb1 > nb2) return 1;
	if (nb1 < nb2) return -1;
	return 0;
}

