mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
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:
98
have_varvs.c
98
have_varvs.c
@@ -9,7 +9,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
|
||||
@@ -17,11 +17,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: 1995/09/09 22:41:10
|
||||
* File existed as early as: 1995
|
||||
* Under source code control: 1995/09/09 22:41:10
|
||||
* File existed as early as: 1995
|
||||
*
|
||||
* 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/
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -30,7 +30,7 @@
|
||||
* vsnprintf() and hope for the best.
|
||||
*
|
||||
* This program will output #defines and exits 0 if vsnprintf() (or snprintf())
|
||||
* produces the results that we expect. This program exits 1 if vsnprintf()
|
||||
* produces the results that we expect. This program exits 1 if vsnprintf()
|
||||
* (or snprintf()) produces unexpected results while using the <stdarg.h>
|
||||
* include file.
|
||||
*/
|
||||
@@ -60,7 +60,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
|
||||
|
||||
char buf[BUFSIZ+1];
|
||||
@@ -97,57 +97,57 @@ try_nthis(char *a, VSNPRINTF_SIZE_T size, int b, char *c, int d)
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
/*
|
||||
* setup
|
||||
*/
|
||||
buf[0] = '\0';
|
||||
/*
|
||||
* setup
|
||||
*/
|
||||
buf[0] = '\0';
|
||||
|
||||
/*
|
||||
* test variable args and vsnprintf/snprintf
|
||||
*/
|
||||
try_nthis("@%d:%s:%d@", sizeof(buf)-1, 1, "hello", 5);
|
||||
if (strcmp(buf, "@1:hello:5@") != 0) {
|
||||
/*
|
||||
* test variable args and vsnprintf/snprintf
|
||||
*/
|
||||
try_nthis("@%d:%s:%d@", sizeof(buf)-1, 1, "hello", 5);
|
||||
if (strcmp(buf, "@1:hello:5@") != 0) {
|
||||
#if !defined(DONT_HAVE_VSNPRINTF)
|
||||
/* <varargs.h> with vsnprintf() didn't work */
|
||||
/* <varargs.h> with vsnprintf() didn't work */
|
||||
#else
|
||||
/* <varargs.h> with snprintf() simulating vsnprintf() didn't work */
|
||||
/* <varargs.h> with snprintf() simulating vsnprintf() didn't work */
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
try_nthis("%s %d%s%d%d %s", sizeof(buf)-1,
|
||||
"Landon Noll 1st proved that", 2, "^", 23209, -1, "was prime");
|
||||
if (strcmp(buf,
|
||||
"Landon Noll 1st proved that 2^23209-1 was prime") != 0) {
|
||||
exit(1);
|
||||
}
|
||||
try_nthis("%s %d%s%d%d %s", sizeof(buf)-1,
|
||||
"Landon Noll 1st proved that", 2, "^", 23209, -1, "was prime");
|
||||
if (strcmp(buf,
|
||||
"Landon Noll 1st proved that 2^23209-1 was prime") != 0) {
|
||||
#if !defined(DONT_HAVE_VSNPRINTF)
|
||||
/* <varargs.h> with vsnprintf() didn't work */
|
||||
/* <varargs.h> with vsnprintf() didn't work */
|
||||
#else
|
||||
/* <varargs.h> with snprintf() simulating vsnprintf() didn't work */
|
||||
/* <varargs.h> with snprintf() simulating vsnprintf() didn't work */
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* report the result
|
||||
*/
|
||||
puts("/* what type of variable args do we have? */");
|
||||
puts("#define VARARGS /* use <varargs.h> */");
|
||||
puts("#include <varargs.h>");
|
||||
puts("\n/* should we use vsnprintf() and vsnprintf()? */");
|
||||
/*
|
||||
* report the result
|
||||
*/
|
||||
puts("/* what type of variable args do we have? */");
|
||||
puts("#define VARARGS /* use <varargs.h> */");
|
||||
puts("#include <varargs.h>");
|
||||
puts("\n/* should we use vsnprintf() and vsnprintf()? */");
|
||||
#if !defined(DONT_HAVE_VSNPRINTF)
|
||||
puts("#define HAVE_VSNPRINTF /* yes */");
|
||||
puts("#define HAVE_VSNPRINTF /* yes */");
|
||||
#else
|
||||
puts("/*");
|
||||
puts(" * Hack aleart!!!");
|
||||
puts(" *");
|
||||
puts(" * Systems that do not have vsnprintf() need something. In some");
|
||||
puts(" * cases the snprintf() function will deal correctly with the");
|
||||
puts(" * va_alist 4th arg. Same goes for a lack of an vsnprintf()");
|
||||
puts(" * function. In either case we use the #defines below and");
|
||||
puts(" * hope for the best!");
|
||||
puts(" */");
|
||||
puts("#define vsnprintf snprintf");
|
||||
puts("#undef HAVE_VSNPRINTF");
|
||||
puts("/*");
|
||||
puts(" * Hack aleart!!!");
|
||||
puts(" *");
|
||||
puts(" * Systems that do not have vsnprintf() need something. In some");
|
||||
puts(" * cases the snprintf() function will deal correctly with the");
|
||||
puts(" * va_alist 4th arg. Same goes for a lack of an vsnprintf()");
|
||||
puts(" * function. In either case we use the #defines below and");
|
||||
puts(" * hope for the best!");
|
||||
puts(" */");
|
||||
puts("#define vsnprintf snprintf");
|
||||
puts("#undef HAVE_VSNPRINTF");
|
||||
#endif
|
||||
/* exit(0); */
|
||||
return 0;
|
||||
/* exit(0); */
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user