Esempio n. 1
0
void tst_Cmptest::compare_pointerfuncs()
{
    QCOMPARE(intptr(), intptr());
    QCOMPARE(&i, &i);
    QCOMPARE(intptr(), &i);
    QCOMPARE(&i, intptr());
}
/**
 *	This method is used for determining uniqueness of states. As far as
 *	we are concerned, the waypoint and waypoint set ptr determine uniqueness.
 *
 *	@return 	Negative if this is less than other
 *				Positive if this is greater than other
 *				Zero if this equals other
 */
int WaypointState::compare(const WaypointState& other) const
{
	/*
	// check sets first (it's fast)
	if (pWPSet_->setNum() == other.pWPSet_->setNum())
	{
		// now chunk names
		int chunkRes = strcmp( pWPSet_->chunk().chunkID().c_str(),
			  other.pWPSet_->chunk().chunkID().c_str() );
		if (chunkRes == 0)
		{
			// and finally waypoint ids
			return waypointID_ - other.waypointID_;
		}
		else
		{
			return chunkRes;
		}
	}
	else
	{
		return pWPSet_->setNum() - other.pWPSet_->setNum();
		//return int(&*pWPSet_) - int(&*other.pWPSet_);
	}
	*/
	if (pWPSet_ == other.pWPSet_)
		return waypointID_ - other.waypointID_;
	else
		return intptr(&*pWPSet_) - intptr(&*other.pWPSet_);
}
  void edge_cases() {
    int a({0}); // expected-error {{cannot initialize non-class type 'int' with a parenthesized initializer list}}
    (void) int({0}); // expected-error {{cannot initialize non-class type 'int' with a parenthesized initializer list}}
    new int({0});  // expected-error {{cannot initialize non-class type 'int' with a parenthesized initializer list}}

    int *b({0});  // expected-error {{cannot initialize non-class type 'int *' with a parenthesized initializer list}}
    typedef int *intptr;
    int *c = intptr({0});  // expected-error {{cannot initialize non-class type 'intptr' (aka 'int *') with a parenthesized initializer list}}
  }
Esempio n. 4
0
Nub::Nub(dove::InterfaceHolder & interfaceHolder) :
remLen_(0)
,sremLen_(0)
,fd_(NOSOCKET)
,interfaceHolder_(interfaceHolder)
,userData_(intptr())
,fdStatus_(SOCKET_INVALID)
{
}
Esempio n. 5
0
void MachOLoader::checkMmapMinAddr(intptr addr)
{
	static intptr minimum = -1;
	if (minimum == intptr(-1))
	{
		std::ifstream f("/proc/sys/vm/mmap_min_addr");

		if (!f.is_open())
			minimum = 0;
		else
			f >> minimum;
	}