git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2404
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// accessors
// get high part
long GetHi() const
// accessors
// get high part
long GetHi() const
- { return (long)((m_ll & 0xFFFFFFFF00000000ll) >> 32); }
+ { return (long)((m_ll & 0xFFFFFFFF00000000l) >> 32); }
// get low part
unsigned long GetLo() const
// get low part
unsigned long GetLo() const
- { return (unsigned long) (m_ll & 0x00000000FFFFFFFFll); }
+ { return (unsigned long) (m_ll & 0x00000000FFFFFFFFl); }
// convert to native long long
wxLongLong_t GetValue() const { return m_ll; }
// convert to native long long
wxLongLong_t GetValue() const { return m_ll; }
void *asArray() const;
// input/output
void *asArray() const;
// input/output
- friend std::ostream& operator<<(ostream&, const wxLongLongNative&);
+ friend ostream& operator<<(ostream&, const wxLongLongNative&);
private:
wxLongLong_t m_ll;
private:
wxLongLong_t m_ll;
wxLongLongWx& remainder) const;
// input/output
wxLongLongWx& remainder) const;
// input/output
- friend ostream& operator<<(std::ostream&, const wxLongLongWx&);
+ friend ostream& operator<<(ostream&, const wxLongLongWx&);
private:
// long is at least 32 bits, so represent our 64bit number as 2 longs
private:
// long is at least 32 bits, so represent our 64bit number as 2 longs
-std::ostream& operator<< (std::ostream& o, const wxLongLongNative& ll)
+ostream& operator<< (ostream& o, const wxLongLongNative& ll)
-std::ostream& operator<< (std::ostream& o, const wxLongLongWx& ll)
+ostream& operator<< (ostream& o, const wxLongLongWx& ll)
+#include "wx/wxprec.h"
+
#include "wx/longlong.h"
#include <time.h>
#include "wx/longlong.h"
#include <time.h>
#include <Events.h>
#endif
#include <Events.h>
#endif
-static const unsigned long long NumberOfTests = 100000ll;
+static const unsigned wxLongLong_t NumberOfTests = 100000l;
//using namespace std;
int oddbits(unsigned int number);
//using namespace std;
int oddbits(unsigned int number);
- std::cout << std::endl << "Starting shift tests." << endl;
+ cout << endl << "Starting shift tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(oneb, twob, 8) != 0) || (memcmp(onec, twoc, 8) != 0) || (memcmp(oneb, onec, 8) != 0))
{
if ((memcmp(oneb, twob, 8) != 0) || (memcmp(onec, twoc, 8) != 0) || (memcmp(oneb, onec, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
- std::cout << ">> ";
- std::cout << shift << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
+ cout << ">> ";
+ cout << shift << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
- std::cout << std::endl << "Starting first addition tests." << endl;
+ cout << endl << "Starting first addition tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
- std::cout << std::endl << "Starting second addition tests." << endl;
+ cout << endl << "Starting second addition tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << counter << " successful trials: " << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << endl;
- std::cout << std::endl << "Starting first subtraction tests." << endl;
+ cout << endl << "Starting first subtraction tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1d << std::endl;
- std::cout << l2d << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1d << endl;
+ cout << l2d << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
- std::cout << std::endl << "Starting second subtraction tests." << endl;
+ cout << endl << "Starting second subtraction tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << counter << " successful trials: " << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << endl;
- std::cout << std::endl << "Starting pre/post increment/decrement tests." << endl;
+ cout << endl << "Starting pre/post increment/decrement tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << (pre ? "pre" : "post") << (increment ? "increment" : "decrement") << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << (pre ? "pre" : "post") << (increment ? "increment" : "decrement") << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
- std::cout << std::endl << "Starting negation tests." << endl;
+ cout << endl << "Starting negation tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
int multiplicationtest()
{
int multiplicationtest()
{
- std::cout << std::endl << "Starting multiplication tests." << endl;
+ cout << endl << "Starting multiplication tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1d << std::endl;
- std::cout << l2d << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1d << endl;
+ cout << l2d << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
- std::cout << std::endl << "Starting bitwise tests." << endl;
+ cout << endl << "Starting bitwise tests." << endl;
long hi = 0;
unsigned long lo = 0;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
{
if ((counter % 1000) == 999)
{
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1d << std::endl;
- std::cout << l2d << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1d << endl;
+ cout << l2d << endl;
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
SIOUXSettings.autocloseonquit = 0;
#endif
SIOUXSettings.autocloseonquit = 0;
#endif
- std::cout << "Starting tests." << endl;
+ cout << "Starting tests." << endl;
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
if (!negationtest())
return 1;
if (!negationtest())
return 1;
- std::cout << std::endl << "The tests are finished." << std::endl;
+ cout << endl << "The tests are finished." << endl;