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:
@@ -12,7 +12,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
|
||||
@@ -20,21 +20,21 @@
|
||||
* 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: 1999/10/13 04:10:33
|
||||
* File existed as early as: 1999
|
||||
* Under source code control: 1999/10/13 04:10:33
|
||||
* File existed as early as: 1999
|
||||
*
|
||||
* 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/
|
||||
*/
|
||||
|
||||
/*
|
||||
* usage:
|
||||
* qtime(utc_hr_offset)
|
||||
* qtime(utc_hr_offset)
|
||||
*
|
||||
* utc_hr_offset Offset from UTC in hours.
|
||||
* utc_hr_offset Offset from UTC in hours.
|
||||
*
|
||||
* See:
|
||||
* http://www.magnetic-ink.dk/download/qtime.html
|
||||
* http://www.magnetic-ink.dk/download/qtime.html
|
||||
*
|
||||
* for examples of qtime() written on other languages.
|
||||
*/
|
||||
@@ -45,42 +45,42 @@
|
||||
*/
|
||||
define qtime(utc_hr_offset)
|
||||
{
|
||||
static mat hr[12] = {
|
||||
"twelve", "one", "two", "three", "four", "five",
|
||||
"six", "seven", "eight", "nine", "ten", "eleven"
|
||||
};
|
||||
static mat mn[7] = {
|
||||
"", "five ", "ten ", "a quarter ", "twenty ", "twenty-five ", "half "
|
||||
};
|
||||
static mat ny[5] = {
|
||||
"nearly ", "almost ", "", "just after ", "after "
|
||||
};
|
||||
static mat up[3] = {
|
||||
"to ", "", "past "
|
||||
};
|
||||
local adj_mins = (((time() + utc_hr_offset*3600) % 86400) + 30)//60+27;
|
||||
local hours = (adj_mins // 60) % 12;
|
||||
local minutes = adj_mins % 60;
|
||||
local almost = minutes % 5;
|
||||
local divisions = (minutes // 5) - 5;
|
||||
local to_past_idx = divisions > 0 ? 1 : 0;
|
||||
static mat hr[12] = {
|
||||
"twelve", "one", "two", "three", "four", "five",
|
||||
"six", "seven", "eight", "nine", "ten", "eleven"
|
||||
};
|
||||
static mat mn[7] = {
|
||||
"", "five ", "ten ", "a quarter ", "twenty ", "twenty-five ", "half "
|
||||
};
|
||||
static mat ny[5] = {
|
||||
"nearly ", "almost ", "", "just after ", "after "
|
||||
};
|
||||
static mat up[3] = {
|
||||
"to ", "", "past "
|
||||
};
|
||||
local adj_mins = (((time() + utc_hr_offset*3600) % 86400) + 30)//60+27;
|
||||
local hours = (adj_mins // 60) % 12;
|
||||
local minutes = adj_mins % 60;
|
||||
local almost = minutes % 5;
|
||||
local divisions = (minutes // 5) - 5;
|
||||
local to_past_idx = divisions > 0 ? 1 : 0;
|
||||
|
||||
if (divisions < 0) {
|
||||
divisions = -divisions;
|
||||
to_past_idx = -1;
|
||||
}
|
||||
++to_past_idx;
|
||||
if (divisions < 0) {
|
||||
divisions = -divisions;
|
||||
to_past_idx = -1;
|
||||
}
|
||||
++to_past_idx;
|
||||
|
||||
/*
|
||||
* Print the English sentence
|
||||
*
|
||||
* We avoid forward and back quotes just to show that the char()
|
||||
* builtin function can be used in conjunction with a printf.
|
||||
*/
|
||||
printf("It%cs %s%s%s%s",
|
||||
char(0x27), ny[almost], mn[divisions],
|
||||
up[to_past_idx], hr[hours]);
|
||||
if (divisions == 0)
|
||||
printf(" o%cclock", char(0x27));
|
||||
print ".";
|
||||
/*
|
||||
* Print the English sentence
|
||||
*
|
||||
* We avoid forward and back quotes just to show that the char()
|
||||
* builtin function can be used in conjunction with a printf.
|
||||
*/
|
||||
printf("It%cs %s%s%s%s",
|
||||
char(0x27), ny[almost], mn[divisions],
|
||||
up[to_past_idx], hr[hours]);
|
||||
if (divisions == 0)
|
||||
printf(" o%cclock", char(0x27));
|
||||
print ".";
|
||||
}
|
||||
|
Reference in New Issue
Block a user