This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- AppTime()
- {
- counterRate = 1;
- baseCounter = 0;
- QueryPerformanceFrequency( (LARGE_INTEGER*)&counterRate);
- QueryPerformanceCounter( (LARGE_INTEGER*)&baseCounter);
- }
- __int64 counterRate; // LARGE_INTEGER type has no math functions so use int64
- __int64 baseCounter;
+ AppTime() {
+ counterRate = 1;
+ baseCounter = 0;
+ QueryPerformanceFrequency( (LARGE_INTEGER*)&counterRate);
+ QueryPerformanceCounter( (LARGE_INTEGER*)&baseCounter);
+ }
+ __int64 counterRate; // LARGE_INTEGER type has no math functions so use int64
+ __int64 baseCounter;
};
static AppTime g_appTime;
void CopyCStringToPascal( const char* src, unsigned char dst[256])
{
};
static AppTime g_appTime;
void CopyCStringToPascal( const char* src, unsigned char dst[256])
{
- int len = strlen( src);
- dst[ 0] = len;
- memcpy( dst + 1, src, len);
+ int len = strlen( src);
+ dst[ 0] = len;
+ memcpy( dst + 1, src, len);
- __int64 value = a.hi;
- value <<= 32;
- value |= a.lo;
- __int64 value2 = b.hi;
- value2 <<= 32;
- value2 |= b.lo;
- value -= value2;
-
- if (value <= 0)
- return durationImmediate;
-
- __int64 frac = value % g_appTime.counterRate;
- value /= g_appTime.counterRate;
-
- Duration time;
-
- if (value == 0)
- {
- frac *= -1000000;
- frac /= g_appTime.counterRate;
- time = (Duration)frac;
- }
- else
- {
- frac *= 1000;
- frac /= g_appTime.counterRate;
- value *= 1000;
- value += frac;
- time = (Duration)value;
- }
-
- return time;
+ __int64 value = a.hi;
+ value <<= 32;
+ value |= a.lo;
+ __int64 value2 = b.hi;
+ value2 <<= 32;
+ value2 |= b.lo;
+ value -= value2;
+
+ if (value <= 0)
+ return durationImmediate;
+
+ __int64 frac = value % g_appTime.counterRate;
+ value /= g_appTime.counterRate;
+
+ Duration time;
+
+ if (value == 0) {
+ frac *= -1000000;
+ frac /= g_appTime.counterRate;
+ time = (Duration)frac;
+ } else {
+ frac *= 1000;
+ frac /= g_appTime.counterRate;
+ value *= 1000;
+ value += frac;
+ time = (Duration)value;
+ }
+
+ return time;
return(1); /* quick rejection: exists in current case. */
ptr = strrchr(buf, '/'); /* find entry at end of path. */
return(1); /* quick rejection: exists in current case. */
ptr = strrchr(buf, '/'); /* find entry at end of path. */
- while ((dent = readdir(dirp)) != NULL)
- {
- if (strcasecmp(dent->d_name, ptr) == 0)
- {
+ while ((dent = readdir(dirp)) != NULL) {
+ if (strcasecmp(dent->d_name, ptr) == 0) {
- // translate filename into proper path name
- if (orgfilename[ 0] == ':')
- orgfilename++;
- strcpy( g_filename, orgfilename);
+ // translate filename into proper path name
+ if (orgfilename[ 0] == ':')
+ orgfilename++;
+ strcpy( g_filename, orgfilename);