convert ASCII TABs to ASCII SPACEs

Converted all ASCII tabs to ASCII spaces using a 8 character
tab stop, for all files, except for all Makefiles (plus rpm.mk).
The `git diff -w` reports no changes.
This commit is contained in:
Landon Curt Noll
2024-07-11 22:03:52 -07:00
parent fe9cefe6ef
commit db77e29a23
631 changed files with 90607 additions and 90600 deletions

140
version.c
View File

@@ -11,7 +11,7 @@
*
* Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details.
*
* A copy of version 2.1 of the GNU Lesser General Public License is
@@ -19,11 +19,11 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Under source code control: 1990/05/22 11:00:58
* File existed as early as: 1990
* Under source code control: 1990/05/22 11:00:58
* File existed as early as: 1990
*
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/
@@ -49,7 +49,7 @@ static char *program;
#include "have_unused.h"
#include "banned.h" /* include after system header <> includes */
#include "banned.h" /* include after system header <> includes */
/*
@@ -64,7 +64,7 @@ int calc_minor_patch = MINOR_PATCH;
/*
* stored version
*/
STATIC char *stored_version = NULL; /* version formed if != NULL */
STATIC char *stored_version = NULL; /* version formed if != NULL */
/*
@@ -74,7 +74,7 @@ char *Copyright = "\n"
"calc - arbitrary precision calculator\n"
"\n"
"Copyright (C) 1999-2023 David I. Bell, Landon Curt Noll "
"and Ernest Bowen\n"
"and Ernest Bowen\n"
"\n"
"Initial author: David I. Bell\n"
"\n"
@@ -90,7 +90,7 @@ char *Copyright = "\n"
char *Usability = "\n"
"Calc is distributed in the hope that it will be useful, but WITHOUT\n"
"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\n"
"or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\n"
"Public License for more details.\n";
char *COPYING_LGPL = "\n"
"A copy of version 2.1 of the GNU Lesser General Public License is\n"
@@ -109,44 +109,44 @@ char *COPYING_LGPL = "\n"
* This function returns a malloced version string. This version
* string does not contain the title, just:
*
* x.y.z.w
* x.y.z.w
*/
char *
version(void)
{
char verbuf[BUFSIZ+1]; /* form version string here */
size_t len; /* length of version string */
char verbuf[BUFSIZ+1]; /* form version string here */
size_t len; /* length of version string */
/*
* return previously stored version if one exists
*/
if (stored_version) {
return stored_version;
}
/*
* return previously stored version if one exists
*/
if (stored_version) {
return stored_version;
}
/*
* form the version buffer
*/
snprintf(verbuf, BUFSIZ,
"%d.%d.%d.%d", calc_major_ver, calc_minor_ver,
calc_major_patch, calc_minor_patch);
verbuf[BUFSIZ] = '\0'; /* paranoia */
/*
* form the version buffer
*/
snprintf(verbuf, BUFSIZ,
"%d.%d.%d.%d", calc_major_ver, calc_minor_ver,
calc_major_patch, calc_minor_patch);
verbuf[BUFSIZ] = '\0'; /* paranoia */
/*
* save the versions string into a newly malloced buffer
*/
len = strlen(verbuf);
stored_version = (char *)calloc(len+1, sizeof(verbuf[0]));
if (stored_version == NULL) {
fprintf(stderr, "%s: cannot malloc version string\n", program);
exit(70);
}
strlcpy(stored_version, verbuf, len+1);
/*
* save the versions string into a newly malloced buffer
*/
len = strlen(verbuf);
stored_version = (char *)calloc(len+1, sizeof(verbuf[0]));
if (stored_version == NULL) {
fprintf(stderr, "%s: cannot malloc version string\n", program);
exit(70);
}
strlcpy(stored_version, verbuf, len+1);
/*
* return the newly malloced buffer
*/
return stored_version;
/*
* return the newly malloced buffer
*/
return stored_version;
}
@@ -158,17 +158,17 @@ version(void)
*
* This function prints the major part version string:
*
* x.y.z
* x.y.z
*/
void
print_3_level_version(void)
{
/*
* form the version buffer
*/
printf("%d.%d.%d\n", calc_major_ver, calc_minor_ver,
calc_major_patch);
return;
/*
* form the version buffer
*/
printf("%d.%d.%d\n", calc_major_ver, calc_minor_ver,
calc_major_patch);
return;
}
@@ -179,32 +179,32 @@ print_3_level_version(void)
int
main(int argc, char *argv[])
{
program = argv[0];
/*
* case: -V - print 3-level version
*/
if (argc == 2 && strcmp(argv[1], "-V") == 0) {
print_3_level_version();
program = argv[0];
/*
* case: -V - print 3-level version
*/
if (argc == 2 && strcmp(argv[1], "-V") == 0) {
print_3_level_version();
/*
* case: no args - print 4-level version
*/
} else if (argc == 1) {
printf("%s\n", version());
/*
* case: no args - print 4-level version
*/
} else if (argc == 1) {
printf("%s\n", version());
/*
* case: -h or wrong number of args or invalid options
*/
} else {
fprintf(stderr,
"usage: %s [-V | -h]\n"
"\n"
" -h print this message and exit non-zero\n"
" -V print 3-level version (def: print 4-level version)\n",
program);
exit(75);
}
return 0;
/*
* case: -h or wrong number of args or invalid options
*/
} else {
fprintf(stderr,
"usage: %s [-V | -h]\n"
"\n"
" -h print this message and exit non-zero\n"
" -V print 3-level version (def: print 4-level version)\n",
program);
exit(75);
}
return 0;
}
#endif /* CALC_VER */