mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:32:59 +00:00
[FORMATTING] Fix formatting
svn path=/trunk/; revision=31744
This commit is contained in:
parent
896d74327d
commit
f94c2a7484
1 changed files with 223 additions and 254 deletions
|
@ -1,5 +1,4 @@
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* buildno - Generate the build number for ReactOS
|
* buildno - Generate the build number for ReactOS
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999,2000 Emanuele Aliberti
|
* Copyright (c) 1999,2000 Emanuele Aliberti
|
||||||
|
@ -40,28 +39,11 @@ static char * argv0 = "";
|
||||||
static char * filename = "";
|
static char * filename = "";
|
||||||
static char * kernel_version_build_type = 0;
|
static char * kernel_version_build_type = 0;
|
||||||
|
|
||||||
#ifdef DBG
|
|
||||||
void
|
|
||||||
tm_dump (const char *tag, struct tm * t)
|
|
||||||
{
|
|
||||||
printf ("%s->tm_sec = %d\n", tag, t->tm_sec);
|
|
||||||
printf ("%s->tm_min = %d\n", tag, t->tm_min);
|
|
||||||
printf ("%s->tm_hour = %d\n", tag, t->tm_hour);
|
|
||||||
printf ("%s->tm_mday = %d\n", tag, t->tm_mday);
|
|
||||||
printf ("%s->tm_mon = %d\n", tag, t->tm_mon);
|
|
||||||
printf ("%s->tm_year = %d\n", tag, t->tm_year);
|
|
||||||
printf ("%s->tm_wday = %d\n", tag, t->tm_wday);
|
|
||||||
printf ("%s->tm_yday = %d\n", tag, t->tm_yday);
|
|
||||||
printf ("%s->tm_isdst = %d\n\n", tag, t->tm_isdst);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int count_wide_string( wchar_t *str )
|
int count_wide_string( wchar_t *str )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
for( i = 0; str[i]; i++ )
|
||||||
for( i = 0; str[i]; i++ );
|
;
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +64,8 @@ GetRev(void)
|
||||||
{
|
{
|
||||||
while((ch=fgetc(fp)) != EOF)
|
while((ch=fgetc(fp)) != EOF)
|
||||||
{
|
{
|
||||||
if (ch == 10) count++; /* seems to used as a seperator */
|
if (ch == 10)
|
||||||
|
count++; /* seems to used as a seperator */
|
||||||
if (count > 3)
|
if (count > 3)
|
||||||
break;
|
break;
|
||||||
if ((count == 3) && (chars < sizeof(Revision)))
|
if ((count == 3) && (chars < sizeof(Revision)))
|
||||||
|
@ -286,9 +269,10 @@ usage (void)
|
||||||
{
|
{
|
||||||
fprintf (
|
fprintf (
|
||||||
stderr,
|
stderr,
|
||||||
"Usage: %s [-{p|q}] path-to-header\n\n -p print version number and exit\n -q run in quiet mode\n",
|
"Usage: %s [-{p|q}] path-to-header\n\n"
|
||||||
argv0
|
" -p print version number and exit\n"
|
||||||
);
|
" -q run in quiet mode\n",
|
||||||
|
argv0);
|
||||||
exit (EXIT_SUCCESS);
|
exit (EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,13 +326,9 @@ main (int argc, char * argv [])
|
||||||
default:
|
default:
|
||||||
usage ();
|
usage ();
|
||||||
}
|
}
|
||||||
/*
|
/* Set TZ information. */
|
||||||
* Set TZ information.
|
|
||||||
*/
|
|
||||||
tzset ();
|
tzset ();
|
||||||
/*
|
/* We are building TODAY! */
|
||||||
* We are building TODAY!
|
|
||||||
*/
|
|
||||||
if (! quiet)
|
if (! quiet)
|
||||||
{
|
{
|
||||||
printf ( "\nReactOS Build Number Generator\n\n");
|
printf ( "\nReactOS Build Number Generator\n\n");
|
||||||
|
@ -357,7 +337,8 @@ main (int argc, char * argv [])
|
||||||
/* Convert kernel_version_build_type to a host-friendly string */
|
/* Convert kernel_version_build_type to a host-friendly string */
|
||||||
length = count_wide_string(KERNEL_VERSION_BUILD_TYPE);
|
length = count_wide_string(KERNEL_VERSION_BUILD_TYPE);
|
||||||
kernel_version_build_type = (char *)malloc(length+1);
|
kernel_version_build_type = (char *)malloc(length+1);
|
||||||
for( i = 0; KERNEL_VERSION_BUILD_TYPE[i]; i++ ) {
|
for( i = 0; KERNEL_VERSION_BUILD_TYPE[i]; i++ )
|
||||||
|
{
|
||||||
kernel_version_build_type[i] = KERNEL_VERSION_BUILD_TYPE[i];
|
kernel_version_build_type[i] = KERNEL_VERSION_BUILD_TYPE[i];
|
||||||
}
|
}
|
||||||
kernel_version_build_type[i] = 0;
|
kernel_version_build_type[i] = 0;
|
||||||
|
@ -365,21 +346,14 @@ main (int argc, char * argv [])
|
||||||
time (& t1); /* current build time */
|
time (& t1); /* current build time */
|
||||||
t1_tm = gmtime (& t1);
|
t1_tm = gmtime (& t1);
|
||||||
|
|
||||||
#ifdef DBG
|
|
||||||
tm_dump ("t1", t1_tm);
|
|
||||||
#endif
|
|
||||||
t1_tm->tm_year += 1900;
|
t1_tm->tm_year += 1900;
|
||||||
#ifdef DBG
|
|
||||||
tm_dump ("t1", t1_tm);
|
|
||||||
#endif
|
|
||||||
if (! quiet)
|
if (! quiet)
|
||||||
{
|
{
|
||||||
printf (
|
printf (
|
||||||
"Current date: %4d-%02d-%02d\n\n",
|
"Current date: %4d-%02d-%02d\n\n",
|
||||||
t1_tm->tm_year,
|
t1_tm->tm_year,
|
||||||
(t1_tm->tm_mon + 1),
|
(t1_tm->tm_mon + 1),
|
||||||
t1_tm->tm_mday
|
t1_tm->tm_mday);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Compute build number.
|
* Compute build number.
|
||||||
|
@ -393,18 +367,14 @@ main (int argc, char * argv [])
|
||||||
printf (
|
printf (
|
||||||
"ROS Version : %d.%d",
|
"ROS Version : %d.%d",
|
||||||
KERNEL_VERSION_MAJOR,
|
KERNEL_VERSION_MAJOR,
|
||||||
KERNEL_VERSION_MINOR
|
KERNEL_VERSION_MINOR);
|
||||||
);
|
|
||||||
if (0 != KERNEL_VERSION_PATCH_LEVEL)
|
if (0 != KERNEL_VERSION_PATCH_LEVEL)
|
||||||
{
|
{
|
||||||
printf(".%d", KERNEL_VERSION_PATCH_LEVEL);
|
printf(".%d", KERNEL_VERSION_PATCH_LEVEL);
|
||||||
}
|
}
|
||||||
printf("-%s (Build %s)\n\n", kernel_version_build_type, buildstr);
|
printf("-%s (Build %s)\n\n", kernel_version_build_type, buildstr);
|
||||||
}
|
}
|
||||||
/*
|
/* (Over)write the include file, unless the user switched on -p. */
|
||||||
* (Over)write the include file, unless
|
|
||||||
* the user switched on -p.
|
|
||||||
*/
|
|
||||||
if (! print_only)
|
if (! print_only)
|
||||||
{
|
{
|
||||||
write_h (build, buildstr);
|
write_h (build, buildstr);
|
||||||
|
@ -419,5 +389,4 @@ main (int argc, char * argv [])
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue