mirror of
https://github.com/reactos/RosBE.git
synced 2024-11-23 11:29:44 +00:00
[FORMATTING] Fix indentation and comment style. No code changes.
svn path=/trunk/tools/RosBE/; revision=1172
This commit is contained in:
parent
be3d564574
commit
61873d735e
@ -19,36 +19,36 @@
|
||||
|
||||
static LPTSTR SkipSelfArgument(LPTSTR lpszCommandLine)
|
||||
{
|
||||
LPTSTR p = lpszCommandLine;
|
||||
int quote = 0;
|
||||
LPTSTR p = lpszCommandLine;
|
||||
int quote = 0;
|
||||
|
||||
// Skip leading whitespace
|
||||
while(*p != 0 && _istspace(*p))
|
||||
++ p;
|
||||
// Skip leading whitespace
|
||||
while(*p != 0 && _istspace(*p))
|
||||
++ p;
|
||||
|
||||
if(*p == 0)
|
||||
return p;
|
||||
if(*p == 0)
|
||||
return p;
|
||||
|
||||
// Skip argument 0
|
||||
// BUGBUG: the assumption is that argument 0 never contains escaped quotes
|
||||
do
|
||||
{
|
||||
if(*p == TEXT('\"'))
|
||||
{
|
||||
quote = !quote;
|
||||
++ p;
|
||||
continue;
|
||||
}
|
||||
// Skip argument 0
|
||||
// BUGBUG: the assumption is that argument 0 never contains escaped quotes
|
||||
do
|
||||
{
|
||||
if(*p == TEXT('\"'))
|
||||
{
|
||||
quote = !quote;
|
||||
++ p;
|
||||
continue;
|
||||
}
|
||||
|
||||
++ p;
|
||||
}
|
||||
while(*p != 0 && (quote || !_istspace(*p)));
|
||||
++ p;
|
||||
}
|
||||
while(*p != 0 && (quote || !_istspace(*p)));
|
||||
|
||||
// Skip trailing whitespace
|
||||
while(*p != 0 && _istspace(*p))
|
||||
++ p;
|
||||
// Skip trailing whitespace
|
||||
while(*p != 0 && _istspace(*p))
|
||||
++ p;
|
||||
|
||||
return p;
|
||||
return p;
|
||||
}
|
||||
|
||||
int main()
|
||||
@ -57,69 +57,51 @@ int main()
|
||||
time_t StartTime, FinishTime;
|
||||
double TotalTime;
|
||||
int Hour, Minute, Second;
|
||||
int Status;
|
||||
int Status;
|
||||
|
||||
//
|
||||
// Get the command line to pass on.
|
||||
//
|
||||
FullCommandLine = GetCommandLine();
|
||||
CommandLine = SkipSelfArgument(FullCommandLine);
|
||||
|
||||
//
|
||||
// If nothing is on the command-line exit
|
||||
//
|
||||
if (CommandLine[0] == 0)
|
||||
{
|
||||
fprintf(stderr, "buildtime: required parameter not specified\n");
|
||||
fprintf(stderr, "buildtime: required parameter not specified\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
CommandLineBuffer = malloc((strlen(CommandLine) + 2 + 1));
|
||||
if (!CommandLineBuffer)
|
||||
{
|
||||
fprintf(stderr, "buildtime: unable to allocate memory\n");
|
||||
fprintf(stderr, "buildtime: unable to allocate memory\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
CommandLineBuffer[0] = 0;
|
||||
CommandLineBuffer[0] = 0;
|
||||
strcat(CommandLineBuffer, CommandLine);
|
||||
|
||||
//
|
||||
// Grab the starting timestamp.
|
||||
//
|
||||
time(&StartTime);
|
||||
|
||||
//
|
||||
// Run the program (Status is 1 on failure).
|
||||
//
|
||||
Status = system(CommandLineBuffer);
|
||||
|
||||
//
|
||||
// Grab the finishing timestamp.
|
||||
//
|
||||
time(&FinishTime);
|
||||
|
||||
//
|
||||
// Get the elapsed time.
|
||||
//
|
||||
TotalTime = difftime(FinishTime, StartTime);
|
||||
|
||||
//
|
||||
// Convert the elapsed time to a human readable format.
|
||||
//
|
||||
Second = (int)TotalTime % 60;
|
||||
TotalTime = TotalTime / 60;
|
||||
Minute = (int)TotalTime % 60;
|
||||
Hour = TotalTime / 60;
|
||||
|
||||
//
|
||||
// Print the total build time.
|
||||
//
|
||||
printf("\nTotal Build Time: %02d:%02d:%02d", Hour, Minute, Second);
|
||||
|
||||
//
|
||||
// Free the memory we allocated for the command line.
|
||||
//
|
||||
free(CommandLineBuffer);
|
||||
|
||||
return Status;
|
||||
|
Loading…
Reference in New Issue
Block a user