- __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;
-}
-
-
-static char g_filename[ 256];
-char* ConvertFileName( const char* orgfilename)
-{
- // translate filename into proper path name
- if (orgfilename[ 0] == ':')
- orgfilename++;
- strcpy( g_filename, orgfilename);
-
- for (int n = 0; g_filename[ n]; n++)
- {
- if (g_filename[ n] == ':')
- g_filename[ n] = '/';
- }
-
- return g_filename;
+ __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;