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:
@@ -27,9 +27,9 @@
|
||||
|
||||
/*
|
||||
* NOTE: Because leading HALF values are trimmed from integer, a file
|
||||
* that begins with lots of 0 bits (in the case of big Endian)
|
||||
* or that ends with lots of 0 bits (in the case of little Endian)
|
||||
* will be changed when the subsequent integer is written back.
|
||||
* that begins with lots of 0 bits (in the case of big Endian)
|
||||
* or that ends with lots of 0 bits (in the case of little Endian)
|
||||
* will be changed when the subsequent integer is written back.
|
||||
*/
|
||||
|
||||
|
||||
@@ -37,16 +37,16 @@
|
||||
* file2be - convert a file into an big Endian integer
|
||||
*
|
||||
* given:
|
||||
* filename filename to read
|
||||
* filename filename to read
|
||||
*
|
||||
* returns:
|
||||
* integer read from its contents on big Endian order
|
||||
* integer read from its contents on big Endian order
|
||||
*/
|
||||
define file2be(filename)
|
||||
{
|
||||
local fd; /* open file */
|
||||
local ret; /* integer to return */
|
||||
local c; /* character read from the file */
|
||||
local fd; /* open file */
|
||||
local ret; /* integer to return */
|
||||
local c; /* character read from the file */
|
||||
local i;
|
||||
|
||||
/*
|
||||
@@ -62,8 +62,8 @@ define file2be(filename)
|
||||
*/
|
||||
ret = 0;
|
||||
while (! isnull(c = fgetc(fd))) {
|
||||
ret <<= 8;
|
||||
ret += ord(c);
|
||||
ret <<= 8;
|
||||
ret += ord(c);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -78,17 +78,17 @@ define file2be(filename)
|
||||
* file2le - convert a file into an little Endian integer
|
||||
*
|
||||
* given:
|
||||
* filename filename to read
|
||||
* filename filename to read
|
||||
*
|
||||
* returns:
|
||||
* integer read from its contents on little Endian order
|
||||
* integer read from its contents on little Endian order
|
||||
*/
|
||||
define file2le(filename)
|
||||
{
|
||||
local fd; /* open file */
|
||||
local ret; /* integer to return */
|
||||
local c; /* character read from the file */
|
||||
local shft; /* bit shift for the c value */
|
||||
local fd; /* open file */
|
||||
local ret; /* integer to return */
|
||||
local c; /* character read from the file */
|
||||
local shft; /* bit shift for the c value */
|
||||
local i;
|
||||
|
||||
/*
|
||||
@@ -105,8 +105,8 @@ define file2le(filename)
|
||||
ret = 0;
|
||||
shft = 0;
|
||||
while (! isnull(c = fgetc(fd))) {
|
||||
ret |= (ord(c) << shft);
|
||||
shft += 8;
|
||||
ret |= (ord(c) << shft);
|
||||
shft += 8;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -121,25 +121,25 @@ define file2le(filename)
|
||||
* be2file - convert a big Endian integer into a file
|
||||
*
|
||||
* given:
|
||||
* v integer to write to the file
|
||||
* filename filename to write
|
||||
* v integer to write to the file
|
||||
* filename filename to write
|
||||
*
|
||||
* returns:
|
||||
* The number of octets written to the file.
|
||||
* The number of octets written to the file.
|
||||
*
|
||||
* NOTE: The absolute value of the integer is written to the file.
|
||||
*/
|
||||
define be2file(v, filename)
|
||||
{
|
||||
local fd; /* open file */
|
||||
local octlen; /* length of v in octets */
|
||||
local fd; /* open file */
|
||||
local octlen; /* length of v in octets */
|
||||
local i;
|
||||
|
||||
/*
|
||||
* firewall
|
||||
*/
|
||||
if (!isint(v)) {
|
||||
quit "be2file: 1st arg not an integer";
|
||||
quit "be2file: 1st arg not an integer";
|
||||
}
|
||||
v = abs(v);
|
||||
|
||||
@@ -156,7 +156,7 @@ define be2file(v, filename)
|
||||
*/
|
||||
octlen = int((highbit(v)+8) / 8);
|
||||
for (i=octlen-1; i >= 0; --i) {
|
||||
fputc(fd, char(v >> (i*8)));
|
||||
fputc(fd, char(v >> (i*8)));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -171,24 +171,24 @@ define be2file(v, filename)
|
||||
* le2file - convert a little Endian integer into a file
|
||||
*
|
||||
* given:
|
||||
* v integer to write to the file
|
||||
* filename filename to write
|
||||
* v integer to write to the file
|
||||
* filename filename to write
|
||||
*
|
||||
* returns:
|
||||
* The number of octets written to the file.
|
||||
* The number of octets written to the file.
|
||||
*
|
||||
* NOTE: The absolute value of the integer is written to the file.
|
||||
*/
|
||||
define le2file(v, filename)
|
||||
{
|
||||
local fd; /* open file */
|
||||
local cnt; /* octets written */
|
||||
local fd; /* open file */
|
||||
local cnt; /* octets written */
|
||||
|
||||
/*
|
||||
* firewall
|
||||
*/
|
||||
if (!isint(v)) {
|
||||
quit "be2file: 1st arg not an integer";
|
||||
quit "be2file: 1st arg not an integer";
|
||||
}
|
||||
v = abs(v);
|
||||
|
||||
@@ -205,9 +205,9 @@ define le2file(v, filename)
|
||||
*/
|
||||
cnt = 0;
|
||||
while (v > 0) {
|
||||
fputc(fd, char(v));
|
||||
v >>= 8;
|
||||
++cnt;
|
||||
fputc(fd, char(v));
|
||||
v >>= 8;
|
||||
++cnt;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user