.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:misc/clisp?expand=0&rev=97
This commit is contained in:
parent
3b65639246
commit
77b721475b
@ -30,3 +30,128 @@ diff -r 51ceb35b1711 src/lispbibl.d
|
||||
#define SINGLEMAP_WORKS 1
|
||||
#endif
|
||||
#if defined(UNIX_LINUX) && defined(SPARC64) /* Linux/sparc64 */
|
||||
--- clisp-2.49.90/src/spvw_calendar.c
|
||||
+++ clisp-2.49.90/src/spvw_calendar.c 2018-02-14 13:11:00.207400810 +0000
|
||||
@@ -9,7 +9,7 @@
|
||||
hebrew_calendar_leap_year_p (5763) = true
|
||||
hebrew_calendar_leap_year_p (5764) = false
|
||||
*/
|
||||
-local inline bool hebrew_calendar_leap_year_p (int year)
|
||||
+local inline bool hebrew_calendar_leap_year_p (const int year)
|
||||
{
|
||||
return ((7 * year + 1) % 19) < 7;
|
||||
}
|
||||
@@ -23,7 +23,7 @@ local inline bool hebrew_calendar_leap_y
|
||||
- hebrew_calendar_elapsed_months (year)
|
||||
== (hebrew_calendar_leap_year_p (year) ? 13 : 12).
|
||||
*/
|
||||
-local inline int hebrew_calendar_elapsed_months (int year)
|
||||
+local inline int hebrew_calendar_elapsed_months (const int year)
|
||||
{
|
||||
return ((year - 1) / 19) * 235
|
||||
+ ((year - 1) % 19) * 12
|
||||
@@ -35,16 +35,16 @@ local inline int hebrew_calendar_elapsed
|
||||
hebrew_calendar_elapsed_days (5763) = 2104528
|
||||
hebrew_calendar_elapsed_days (5764) = 2104913
|
||||
*/
|
||||
-local int hebrew_calendar_elapsed_days (int year)
|
||||
+local int hebrew_calendar_elapsed_days (const int year)
|
||||
{
|
||||
- int months_elapsed = hebrew_calendar_elapsed_months (year);
|
||||
- int parts_elapsed = (months_elapsed % 1080) * 793 + 204;
|
||||
- int hours_elapsed =
|
||||
+ const int months_elapsed = hebrew_calendar_elapsed_months (year);
|
||||
+ const int parts_elapsed = (months_elapsed % 1080) * 793 + 204;
|
||||
+ const int hours_elapsed =
|
||||
5 + months_elapsed * 12 + (months_elapsed / 1080) * 793
|
||||
+ (parts_elapsed / 1080);
|
||||
- int parts = (hours_elapsed % 24) * 1080 + (parts_elapsed % 1080);
|
||||
- int day = 1 + months_elapsed * 29 + (hours_elapsed / 24);
|
||||
- int day1 =
|
||||
+ const int parts = (hours_elapsed % 24) * 1080 + (parts_elapsed % 1080);
|
||||
+ const int day = 1 + months_elapsed * 29 + (hours_elapsed / 24);
|
||||
+ const int day1 =
|
||||
(parts >= 19440
|
||||
|| ((day % 7) == 2 && parts >= 9924
|
||||
&& !hebrew_calendar_leap_year_p (year))
|
||||
@@ -66,32 +66,32 @@ local int hebrew_calendar_elapsed_days (
|
||||
Note that the result is in the range 351..357 or 380..386.
|
||||
Probably (but I cannot prove it) it is in the range 353..355 or 383..385.
|
||||
*/
|
||||
-local inline int hebrew_calendar_days_in_year (int year)
|
||||
+local inline int hebrew_calendar_days_in_year (const int year)
|
||||
{
|
||||
return hebrew_calendar_elapsed_days (year + 1)
|
||||
- hebrew_calendar_elapsed_days (year);
|
||||
}
|
||||
|
||||
/* Test whether in the given year, the Heshvan month is long. */
|
||||
-local inline bool hebrew_calendar_long_heshvan_p (int year)
|
||||
+local inline bool hebrew_calendar_long_heshvan_p (const int year)
|
||||
{
|
||||
return (hebrew_calendar_days_in_year (year) % 10) == 5;
|
||||
}
|
||||
|
||||
/* Test whether in the given year, the Kislev month is short. */
|
||||
-local inline bool hebrew_calendar_short_kislev_p (int year)
|
||||
+local inline bool hebrew_calendar_short_kislev_p (const int year)
|
||||
{
|
||||
return (hebrew_calendar_days_in_year (year) % 10) == 3;
|
||||
}
|
||||
|
||||
/* Return the number of months of the given year. */
|
||||
-local inline int hebrew_calendar_months_in_year (int year)
|
||||
+local inline int hebrew_calendar_months_in_year (const int year)
|
||||
{
|
||||
return (hebrew_calendar_leap_year_p (year) ? 13 : 12);
|
||||
}
|
||||
|
||||
/* Return the number of days in the given month of the given year. */
|
||||
-local int hebrew_calendar_last_day_of_month (int year, int month)
|
||||
+local int hebrew_calendar_last_day_of_month (const int year, const int month)
|
||||
{
|
||||
/* Note that month 7 is the first month, and month 6 is the last one. */
|
||||
switch (month)
|
||||
@@ -131,7 +131,7 @@ local int hebrew_calendar_last_day_of_mo
|
||||
hebrew_calendar_to_universal (5763, 6, 29) = 37888
|
||||
hebrew_calendar_to_universal (5764, 7, 1) = 37889
|
||||
*/
|
||||
-local int hebrew_calendar_to_universal (int year, int month, int day)
|
||||
+local int hebrew_calendar_to_universal (const int year, const int month, const int day)
|
||||
{
|
||||
int days;
|
||||
int m;
|
||||
@@ -158,7 +158,7 @@ local int hebrew_calendar_to_universal (
|
||||
hebrew_calendar_from_universal (37889) = { 5764, 7, 1 }
|
||||
*/
|
||||
struct hebrew_date { int year; int month; int day; };
|
||||
-local void hebrew_calendar_from_universal (int udate, struct hebrew_date *result)
|
||||
+local void hebrew_calendar_from_universal (const int udate, struct hebrew_date *__restrict__ result)
|
||||
{
|
||||
int year;
|
||||
int elapsed_days;
|
||||
@@ -167,6 +167,7 @@ local void hebrew_calendar_from_universa
|
||||
int month;
|
||||
|
||||
year = (int)((float)udate/(float)365.2422) + 5661;
|
||||
+#pragma GCC unroll 1
|
||||
for (;; year--) {
|
||||
elapsed_days = hebrew_calendar_elapsed_days (year) - 2067024;
|
||||
if (udate >= elapsed_days)
|
||||
@@ -175,6 +176,7 @@ local void hebrew_calendar_from_universa
|
||||
|
||||
remaining_days = udate - elapsed_days;
|
||||
max_month = hebrew_calendar_months_in_year (year);
|
||||
+#pragma GCC unroll 1
|
||||
for (month = 7; month <= max_month; month++) {
|
||||
int mlength = hebrew_calendar_last_day_of_month (year, month);
|
||||
if (remaining_days < mlength)
|
||||
@@ -198,7 +200,7 @@ local void hebrew_calendar_from_universa
|
||||
}
|
||||
|
||||
/* Return the number of Hanukka candles for a given universal date. */
|
||||
-local int hebrew_calendar_hanukka_candles (int udate)
|
||||
+local int hebrew_calendar_hanukka_candles (const int udate)
|
||||
{
|
||||
/* The first day of Hanukka is on 25 Kislev. */
|
||||
struct hebrew_date date;
|
||||
|
Loading…
x
Reference in New Issue
Block a user