Loose type-checking and C-style casts are gifts from the gods.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



While Uli's information about the preprocessor was fascinating,
I disagree with his latter comment,
loose type-checking and C-style casts are gifts from the gods.

For example:
#pragma warning( disable: \
4007 4101 4189 4244 4305 4430 4508 4706 4709 4996 )

#define Tics ( QueryPerformanceCounter( & _Tics ), _Tics )

#define Secs ( _Secs = Tics / Secnd_Dub )

__int64 _Tics, Secnd ; double _Secs, Secnd_Dub ;

extern "C" int __stdcall QueryPerformanceCounter( __int64 * );
extern "C" int __stdcall QueryPerformanceFrequency( __int64 * );

typedef unsigned __int32 UInt32_Type ;
typedef UInt32_Type * pUInt32_Type ;

typedef unsigned __int8 UInt8_Type ;
typedef UInt8_Type * pUInt8_Type ;

WinMain( int, int, int, int ) {
int rv = 6 ;
rv ++ ;
QueryPerformanceFrequency( & Secnd ), Secnd_Dub = Secnd ;
double Start = Secs ;

// Timing int-by-int access.
static UInt32_Type B[ 999999 ];
pUInt32_Type P = B - 1, E = B + 999999 ;

while ( ++ P < E ) * P ++ ;
float Waited_32 = Secs - Start ; Start = Secs ;

// Timing byte-by-byte access.
{ pUInt8_Type
P = pUInt8_Type( B ) - 1
, E = pUInt8_Type( B + 999999 ) ;

while ( ++ P < E ) * P ++ ;
float
Waited_8 = Secs - Start
, TimesSlower = Waited_8 / Waited_32 ;

// Breaking here,
// the debugger says: “ Waited_32 == .0029 ” seconds.

// “ Waited_8 == .0113 ” seconds.
// And “ TimesSlower == 3.96 ” times slower.
TimesSlower = TimesSlower ; } }


.



Relevant Pages

  • Re: Mem_Alloc and memory pointers
    ... In general, a (void *) ... > and an (int *) don't have to have the same representation, ... We are all atheists about most of the gods that humanity has ever ...
    (comp.sys.acorn.programmer)
  • Re: please help with mysterious error....
    ... After I turned up the compiler/warning setting, I hope I can make a much better program... ... void int_fillinnumbers(int fillvalue, int startx, ... It don't need another prototype, ... I have a #pragma warning because I got some code that does some nasty/stupid unsigned/signed-tricks so here I would like the compiler to skip unsigned/signed-checks. ...
    (comp.lang.c)
  • Re: Hats off to Auburn
    ... receiver and QB not on same page, ball thrown to wrong place ... INT horrific decision to throw middle screen into crowd of ... we're talking gifts. ... If you're incredible receivers had been uncovered, ...
    (rec.sport.football.college)
  • Re: Hats off to Auburn
    ... receiver and QB not on same page, ball thrown to wrong place ... still not sure about this one, but ball bounced off Devine for INT ... talking gifts. ... For accurate passing into coverage see: ...
    (rec.sport.football.college)
  • Re: Hats off to Auburn
    ... receiver and QB not on same page, ball thrown to wrong place ... INT horrific decision to throw middle screen into crowd of ... we're talking gifts. ... If you're incredible receivers had been uncovered, ...
    (rec.sport.football.college)