mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +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:
92
endian.c
92
endian.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,15 +17,15 @@
|
||||
* 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: 1993/11/15 04:32:58
|
||||
* File existed as early as: 1993
|
||||
* Under source code control: 1993/11/15 04:32:58
|
||||
* File existed as early as: 1993
|
||||
*
|
||||
* 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/
|
||||
*/
|
||||
|
||||
/*
|
||||
* Big Endian: Amdahl, 68k, Pyramid, MIPS, Sparc, ...
|
||||
* Big Endian: Amdahl, 68k, Pyramid, MIPS, Sparc, ...
|
||||
* Little Endian: Vax, 32k, Spim (Dec Mips), i386, i486, ...
|
||||
*/
|
||||
|
||||
@@ -43,63 +43,63 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
|
||||
|
||||
/* byte order array */
|
||||
char byte[8] = { (char)0x12, (char)0x36, (char)0x48, (char)0x59,
|
||||
(char)0x01, (char)0x23, (char)0x45, (char)0x67 };
|
||||
(char)0x01, (char)0x23, (char)0x45, (char)0x67 };
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
/* pointers into the byte order array */
|
||||
/* pointers into the byte order array */
|
||||
#if defined(DEBUG) || (!defined(BIG_ENDIAN) && !defined(BIG_ENDIAN))
|
||||
int *intp = (int *)byte;
|
||||
int *intp = (int *)byte;
|
||||
#endif
|
||||
#if defined(DEBUG)
|
||||
short *shortp = (short *)byte;
|
||||
long *longp = (long *)byte;
|
||||
short *shortp = (short *)byte;
|
||||
long *longp = (long *)byte;
|
||||
|
||||
printf("byte: %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
byte[0], byte[1], byte[2], byte[3],
|
||||
byte[4], byte[5], byte[6], byte[7]);
|
||||
printf("short: %04x %04x %04x %04x\n",
|
||||
shortp[0], shortp[1], shortp[2], shortp[3]);
|
||||
printf("int: %08x %08x\n",
|
||||
intp[0], intp[1]);
|
||||
printf("long: %08x %08x\n",
|
||||
longp[0], longp[1]);
|
||||
printf("byte: %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
byte[0], byte[1], byte[2], byte[3],
|
||||
byte[4], byte[5], byte[6], byte[7]);
|
||||
printf("short: %04x %04x %04x %04x\n",
|
||||
shortp[0], shortp[1], shortp[2], shortp[3]);
|
||||
printf("int: %08x %08x\n",
|
||||
intp[0], intp[1]);
|
||||
printf("long: %08x %08x\n",
|
||||
longp[0], longp[1]);
|
||||
#endif
|
||||
|
||||
/* Print the standard <machine/endian.h> defines */
|
||||
printf("#undef BIG_ENDIAN\n");
|
||||
printf("#define BIG_ENDIAN\t4321\n");
|
||||
printf("#undef LITTLE_ENDIAN\n");
|
||||
printf("#define LITTLE_ENDIAN\t1234\n");
|
||||
printf("#undef CALC_BYTE_ORDER\n");
|
||||
/* Print the standard <machine/endian.h> defines */
|
||||
printf("#undef BIG_ENDIAN\n");
|
||||
printf("#define BIG_ENDIAN\t4321\n");
|
||||
printf("#undef LITTLE_ENDIAN\n");
|
||||
printf("#define LITTLE_ENDIAN\t1234\n");
|
||||
printf("#undef CALC_BYTE_ORDER\n");
|
||||
|
||||
#if defined(BIG_ENDIAN)
|
||||
printf("#define CALC_BYTE_ORDER\tBIG_ENDIAN\n");
|
||||
printf("#define CALC_BYTE_ORDER\tBIG_ENDIAN\n");
|
||||
#elif defined(LITTLE_ENDIAN)
|
||||
printf("#define CALC_BYTE_ORDER\tLITTLW_ENDIAN\n");
|
||||
printf("#define CALC_BYTE_ORDER\tLITTLW_ENDIAN\n");
|
||||
#else
|
||||
/* Determine byte order */
|
||||
if (intp[0] == 0x12364859) {
|
||||
/* Most Significant Byte first */
|
||||
printf("#define CALC_BYTE_ORDER\tBIG_ENDIAN\n");
|
||||
} else if (intp[0] == 0x59483612) {
|
||||
/* Least Significant Byte first */
|
||||
printf("#define CALC_BYTE_ORDER\tLITTLE_ENDIAN\n");
|
||||
} else {
|
||||
fprintf(stderr, "@=-=@ Fatal build error - cannot @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ determine byte order. Set @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ ${CALC_BYTE_ORDER} in the Makefile @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ to be either -DBIG_ENDIAN or @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ to be -DLITTLE_ENDIAN @=-=@\n");
|
||||
exit(1);
|
||||
}
|
||||
/* Determine byte order */
|
||||
if (intp[0] == 0x12364859) {
|
||||
/* Most Significant Byte first */
|
||||
printf("#define CALC_BYTE_ORDER\tBIG_ENDIAN\n");
|
||||
} else if (intp[0] == 0x59483612) {
|
||||
/* Least Significant Byte first */
|
||||
printf("#define CALC_BYTE_ORDER\tLITTLE_ENDIAN\n");
|
||||
} else {
|
||||
fprintf(stderr, "@=-=@ Fatal build error - cannot @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ determine byte order. Set @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ ${CALC_BYTE_ORDER} in the Makefile @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ to be either -DBIG_ENDIAN or @=-=@\n");
|
||||
fprintf(stderr, "@=-=@ to be -DLITTLE_ENDIAN @=-=@\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
/* exit(0); */
|
||||
return 0;
|
||||
/* exit(0); */
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user