From 0d36ec3c7937d274f501258ddf1798b05e4f33c2 Mon Sep 17 00:00:00 2001 From: Adam Weinberger Date: Tue, 29 Jul 2014 01:16:45 +0000 Subject: Rename misc/ patch-xy patches to reflect the files they modify. --- misc/astrolog/files/patch-aa | 28 ----------- misc/astrolog/files/patch-ab | 51 ------------------- misc/astrolog/files/patch-ac | 94 ------------------------------------ misc/astrolog/files/patch-ad | 47 ------------------ misc/astrolog/files/patch-astrolog.c | 94 ++++++++++++++++++++++++++++++++++++ misc/astrolog/files/patch-astrolog.h | 51 +++++++++++++++++++ misc/astrolog/files/patch-general.c | 47 ++++++++++++++++++ misc/astrolog/files/patch-makefile | 28 +++++++++++ 8 files changed, 220 insertions(+), 220 deletions(-) delete mode 100644 misc/astrolog/files/patch-aa delete mode 100644 misc/astrolog/files/patch-ab delete mode 100644 misc/astrolog/files/patch-ac delete mode 100644 misc/astrolog/files/patch-ad create mode 100644 misc/astrolog/files/patch-astrolog.c create mode 100644 misc/astrolog/files/patch-astrolog.h create mode 100644 misc/astrolog/files/patch-general.c create mode 100644 misc/astrolog/files/patch-makefile (limited to 'misc/astrolog') diff --git a/misc/astrolog/files/patch-aa b/misc/astrolog/files/patch-aa deleted file mode 100644 index 929ff56752e7..000000000000 --- a/misc/astrolog/files/patch-aa +++ /dev/null @@ -1,28 +0,0 @@ ---- makefile.orig 2002-04-27 22:48:52.000000000 +0400 -+++ makefile 2012-11-21 12:12:08.000000000 +0400 -@@ -17,6 +17,7 @@ - # edited, is compile each source file, and link them together with the math - # library, and if applicable, the main X library. - # -+.PATH: src - NAME = astrolog - OBJ = astrolog.o data.o data2.o general.o io.o\ - calc.o matrix.o charts0.o charts1.o charts2.o charts3.o\ -@@ -28,9 +29,15 @@ - # LIBS = -lm -lX11 - # with Debian Linux and X windows worked - # LIBS = -lm -L/usr/X11R6/lib -lX11 --LIBS= -lm -+.if defined(X11) -+LIBS = -L${LOCALBASE}/lib -lX11 -lm -+CFLAGS += -Isrc -DX11 -I${LOCALBASE}/include -DDEFAULT_DIR=\"${PREFIX}/lib/astrolog\" -+.else -+LIBS = -lm -+CFLAGS += -Isrc -DDEFAULT_DIR=\"${PREFIX}/lib/astrolog\" -+.endif - # --CFLAGS = -O -DHPUX_SOURCE -+#CFLAGS = -O -DHPUX_SOURCE - # - # CFLAGS from 5.41 original sources - # CFLAGS = -g -Aa -DHPUX_SOURCE diff --git a/misc/astrolog/files/patch-ab b/misc/astrolog/files/patch-ab deleted file mode 100644 index 87e4a811c345..000000000000 --- a/misc/astrolog/files/patch-ab +++ /dev/null @@ -1,51 +0,0 @@ ---- astrolog.h.orig 2002-04-27 22:50:39.000000000 +0400 -+++ astrolog.h 2012-02-25 21:25:04.000000000 +0400 -@@ -72,9 +72,11 @@ - /*#define MACG /* Comment out this #define if you don't have a Mac, or else */ - /* have one and don't wish to compile in Mac screen graphics. */ - --/*#define MOUSE /* Comment out this #define if you don't have a mouse, or */ -+#if defined(X11) || defined(WIN) || defined(MSG) || defined(BGI) || defined(MACG) -+#define MOUSE /* Comment out this #define if you don't have a mouse, or */ - /* don't wish to compile in mouse tracking features. This is */ - /* only valid if X11, WIN, MSG, BGI, or MACG above are set. */ -+#endif - - #define TIME /* Comment out this #define if your compiler can't take the */ - /* calls to the 'time' or 'localtime' functions as in time.h */ -@@ -138,9 +140,13 @@ - */ - - #ifndef PC -+#ifndef DEFAULT_DIR - #define DEFAULT_DIR "~/astrolog" - #define EPHE_DIR "~/astrolog/ephe" - #else -+#define EPHE_DIR DEFAULT_DIR -+#endif -+#else - #define DEFAULT_DIR "C:\\ASTROLOG" - #define EPHE_DIR DEFAULT_DIR - #endif -@@ -292,6 +298,8 @@ - #define ISG - #include - #include -+#else -+#include - #endif - #ifdef WIN - #define ISG -@@ -1068,9 +1076,9 @@ - */ - - #define byte unsigned char --#define word unsigned short --#define dword unsigned long --#define word4 long -+#define word u_int16_t -+#define dword u_int32_t -+#define word4 int32_t - #define real double - #define _char unsigned char - #define _int unsigned int diff --git a/misc/astrolog/files/patch-ac b/misc/astrolog/files/patch-ac deleted file mode 100644 index d0fec280a4c3..000000000000 --- a/misc/astrolog/files/patch-ac +++ /dev/null @@ -1,94 +0,0 @@ -diff --git astrolog.c astrolog.c -index 5a26c68..8294d3e 100644 ---- astrolog.c -+++ astrolog.c -@@ -38,6 +38,7 @@ - ** Modifications from version 5.40 to 5.41 are by Alois Treindl. - */ - -+#include - #include "astrolog.h" - - -@@ -255,7 +256,7 @@ byte **argv; - byte *pch = szLine; - - /* Split the entered line up into its individual switch strings. */ -- while (*pch >= ' ' || *pch == chTab) { -+ while (!iscntrl((_char)*pch) || *pch == chTab) { - if (*pch == ' ' || *pch == chTab) { - if (fSpace) - /* Skip over the current run of spaces between strings. */ -@@ -1470,8 +1471,18 @@ byte **argv; - case 'z': - if (ch1 == '0') { - if (argc <= 1 || RParseSz(argv[1], pmZon) == rLarge) { -- i = us.dstDef != 0.0; -- SwitchF(i); -+ if (argc > 1 && strcasecmp(argv[1], "current") == 0) { -+ time_t t; -+ struct tm *tm; -+ -+ (void) time(&t); -+ tm = localtime(&t); -+ i = tm->tm_isdst != 0; -+ argc--; argv++; -+ } else { -+ i = us.dstDef != 0.0; -+ SwitchF(i); -+ } - SS = us.dstDef = i ? 1.0 : 0.0; - } else { - SS = us.dstDef = RParseSz(argv[1], pmZon); -@@ -1556,13 +1567,39 @@ byte **argv; - return fFalse; - } - ciCore.nam = SzPersist(argv[1]); -+ if (CchSz(ciCore.nam) > 29) /* see charts1.c */ -+ ciCore.nam[29] = chNull; -+ for (pch = ciCore.nam; *pch; pch++) { -+ if (*pch == '"') /* see io.c */ -+ *pch = '\''; -+ else if (iscntrl((_char)*pch)) /* see xgeneral.c */ -+ *pch = ' '; -+ } - ciCore.loc = SzPersist(argv[2]); -+ if (CchSz(ciCore.loc) > 29) /* see charts1.c */ -+ ciCore.loc[29] = chNull; -+ for (pch = ciCore.loc; *pch; pch++) { -+ if (*pch == '"') /* see io.c */ -+ *pch = '\''; -+ else if (iscntrl((_char)*pch)) /* see xgeneral.c */ -+ *pch = ' '; -+ } - argc -= 2; argv += 2; - break; - } -- if (argc <= 1 || RParseSz(argv[1], pmZon) == rLarge) -- ZZ -= 1.0; -- else { -+ if (argc <= 1 || RParseSz(argv[1], pmZon) == rLarge) { -+ if (argc > 1 && strcasecmp(argv[1], "current") == 0) { -+ time_t t; -+ struct tm *tm; -+ -+ (void) time(&t); -+ tm = localtime(&t); -+ ZZ = us.zonDef = (tm->tm_isdst ? 1 : 0) - -+ (real)tm->tm_gmtoff/(60*60); -+ argc--; argv++; -+ } else -+ ZZ -= 1.0; -+ } else { - ZZ = us.zonDef = RParseSz(argv[1], pmZon); - if (!FValidZon(us.zonDef)) { - ErrorValR("z", us.zonDef); -@@ -2213,7 +2250,7 @@ byte **argv; - #ifdef SWITCHES - void main(argc, argv) - int argc; --byte **argv; -+char **argv; - { - #else - void main() diff --git a/misc/astrolog/files/patch-ad b/misc/astrolog/files/patch-ad deleted file mode 100644 index faaf547d22bc..000000000000 --- a/misc/astrolog/files/patch-ad +++ /dev/null @@ -1,47 +0,0 @@ ---- general.c.orig 2002-04-27 22:33:57.000000000 +0400 -+++ general.c 2012-02-26 11:13:09.000000000 +0400 -@@ -900,14 +900,32 @@ - - /* Return a string containing the given time zone, given as a real value */ - /* having the hours before GMT in the integer part and minutes fractionally. */ -+/* Seconds are printed when needed. */ - - byte *SzZone(zon) - real zon; - { -- static byte szZon[7]; -+ static byte szZon[10]; -+ int hr, min, sec; -+ real rMin; - -- sprintf(szZon, "%c%d:%02d", zon > 0.0 ? '-' : '+', (int)RAbs(zon), -- (int)(RFract(RAbs(zon))*100.0+rRound/60.0)); -+ hr = NFloor(RAbs(zon)); -+ rMin = RFract(RAbs(zon)) * 100.0; -+ min = (int)(rMin + rRound / 600.0); -+ rFractal = RFract(rMin); -+ if (rFractal > rOne) -+ rFractal = rSmall; -+ sec = (int)(60.0*rFractal + rRound); -+ while (min >= 60) { -+ min -= 60; -+ hr++; -+ } -+ while (hr >= 24) -+ hr -= 24; -+ if (sec == 0) -+ sprintf(szZon, "%c%d:%02d", zon > 0.0 ? '-' : '+', hr, min); -+ else -+ sprintf(szZon, "%c%d:%02d:%02d", zon > 0.0 ? '-' : '+', hr, min, sec); - return szZon; - } - -@@ -970,7 +988,7 @@ - int *mon, *day, *yea; - real *tim, zon; - { -- dword curtimer; -+ time_t curtimer; - int min, sec; - real hr; - diff --git a/misc/astrolog/files/patch-astrolog.c b/misc/astrolog/files/patch-astrolog.c new file mode 100644 index 000000000000..d0fec280a4c3 --- /dev/null +++ b/misc/astrolog/files/patch-astrolog.c @@ -0,0 +1,94 @@ +diff --git astrolog.c astrolog.c +index 5a26c68..8294d3e 100644 +--- astrolog.c ++++ astrolog.c +@@ -38,6 +38,7 @@ + ** Modifications from version 5.40 to 5.41 are by Alois Treindl. + */ + ++#include + #include "astrolog.h" + + +@@ -255,7 +256,7 @@ byte **argv; + byte *pch = szLine; + + /* Split the entered line up into its individual switch strings. */ +- while (*pch >= ' ' || *pch == chTab) { ++ while (!iscntrl((_char)*pch) || *pch == chTab) { + if (*pch == ' ' || *pch == chTab) { + if (fSpace) + /* Skip over the current run of spaces between strings. */ +@@ -1470,8 +1471,18 @@ byte **argv; + case 'z': + if (ch1 == '0') { + if (argc <= 1 || RParseSz(argv[1], pmZon) == rLarge) { +- i = us.dstDef != 0.0; +- SwitchF(i); ++ if (argc > 1 && strcasecmp(argv[1], "current") == 0) { ++ time_t t; ++ struct tm *tm; ++ ++ (void) time(&t); ++ tm = localtime(&t); ++ i = tm->tm_isdst != 0; ++ argc--; argv++; ++ } else { ++ i = us.dstDef != 0.0; ++ SwitchF(i); ++ } + SS = us.dstDef = i ? 1.0 : 0.0; + } else { + SS = us.dstDef = RParseSz(argv[1], pmZon); +@@ -1556,13 +1567,39 @@ byte **argv; + return fFalse; + } + ciCore.nam = SzPersist(argv[1]); ++ if (CchSz(ciCore.nam) > 29) /* see charts1.c */ ++ ciCore.nam[29] = chNull; ++ for (pch = ciCore.nam; *pch; pch++) { ++ if (*pch == '"') /* see io.c */ ++ *pch = '\''; ++ else if (iscntrl((_char)*pch)) /* see xgeneral.c */ ++ *pch = ' '; ++ } + ciCore.loc = SzPersist(argv[2]); ++ if (CchSz(ciCore.loc) > 29) /* see charts1.c */ ++ ciCore.loc[29] = chNull; ++ for (pch = ciCore.loc; *pch; pch++) { ++ if (*pch == '"') /* see io.c */ ++ *pch = '\''; ++ else if (iscntrl((_char)*pch)) /* see xgeneral.c */ ++ *pch = ' '; ++ } + argc -= 2; argv += 2; + break; + } +- if (argc <= 1 || RParseSz(argv[1], pmZon) == rLarge) +- ZZ -= 1.0; +- else { ++ if (argc <= 1 || RParseSz(argv[1], pmZon) == rLarge) { ++ if (argc > 1 && strcasecmp(argv[1], "current") == 0) { ++ time_t t; ++ struct tm *tm; ++ ++ (void) time(&t); ++ tm = localtime(&t); ++ ZZ = us.zonDef = (tm->tm_isdst ? 1 : 0) - ++ (real)tm->tm_gmtoff/(60*60); ++ argc--; argv++; ++ } else ++ ZZ -= 1.0; ++ } else { + ZZ = us.zonDef = RParseSz(argv[1], pmZon); + if (!FValidZon(us.zonDef)) { + ErrorValR("z", us.zonDef); +@@ -2213,7 +2250,7 @@ byte **argv; + #ifdef SWITCHES + void main(argc, argv) + int argc; +-byte **argv; ++char **argv; + { + #else + void main() diff --git a/misc/astrolog/files/patch-astrolog.h b/misc/astrolog/files/patch-astrolog.h new file mode 100644 index 000000000000..87e4a811c345 --- /dev/null +++ b/misc/astrolog/files/patch-astrolog.h @@ -0,0 +1,51 @@ +--- astrolog.h.orig 2002-04-27 22:50:39.000000000 +0400 ++++ astrolog.h 2012-02-25 21:25:04.000000000 +0400 +@@ -72,9 +72,11 @@ + /*#define MACG /* Comment out this #define if you don't have a Mac, or else */ + /* have one and don't wish to compile in Mac screen graphics. */ + +-/*#define MOUSE /* Comment out this #define if you don't have a mouse, or */ ++#if defined(X11) || defined(WIN) || defined(MSG) || defined(BGI) || defined(MACG) ++#define MOUSE /* Comment out this #define if you don't have a mouse, or */ + /* don't wish to compile in mouse tracking features. This is */ + /* only valid if X11, WIN, MSG, BGI, or MACG above are set. */ ++#endif + + #define TIME /* Comment out this #define if your compiler can't take the */ + /* calls to the 'time' or 'localtime' functions as in time.h */ +@@ -138,9 +140,13 @@ + */ + + #ifndef PC ++#ifndef DEFAULT_DIR + #define DEFAULT_DIR "~/astrolog" + #define EPHE_DIR "~/astrolog/ephe" + #else ++#define EPHE_DIR DEFAULT_DIR ++#endif ++#else + #define DEFAULT_DIR "C:\\ASTROLOG" + #define EPHE_DIR DEFAULT_DIR + #endif +@@ -292,6 +298,8 @@ + #define ISG + #include + #include ++#else ++#include + #endif + #ifdef WIN + #define ISG +@@ -1068,9 +1076,9 @@ + */ + + #define byte unsigned char +-#define word unsigned short +-#define dword unsigned long +-#define word4 long ++#define word u_int16_t ++#define dword u_int32_t ++#define word4 int32_t + #define real double + #define _char unsigned char + #define _int unsigned int diff --git a/misc/astrolog/files/patch-general.c b/misc/astrolog/files/patch-general.c new file mode 100644 index 000000000000..faaf547d22bc --- /dev/null +++ b/misc/astrolog/files/patch-general.c @@ -0,0 +1,47 @@ +--- general.c.orig 2002-04-27 22:33:57.000000000 +0400 ++++ general.c 2012-02-26 11:13:09.000000000 +0400 +@@ -900,14 +900,32 @@ + + /* Return a string containing the given time zone, given as a real value */ + /* having the hours before GMT in the integer part and minutes fractionally. */ ++/* Seconds are printed when needed. */ + + byte *SzZone(zon) + real zon; + { +- static byte szZon[7]; ++ static byte szZon[10]; ++ int hr, min, sec; ++ real rMin; + +- sprintf(szZon, "%c%d:%02d", zon > 0.0 ? '-' : '+', (int)RAbs(zon), +- (int)(RFract(RAbs(zon))*100.0+rRound/60.0)); ++ hr = NFloor(RAbs(zon)); ++ rMin = RFract(RAbs(zon)) * 100.0; ++ min = (int)(rMin + rRound / 600.0); ++ rFractal = RFract(rMin); ++ if (rFractal > rOne) ++ rFractal = rSmall; ++ sec = (int)(60.0*rFractal + rRound); ++ while (min >= 60) { ++ min -= 60; ++ hr++; ++ } ++ while (hr >= 24) ++ hr -= 24; ++ if (sec == 0) ++ sprintf(szZon, "%c%d:%02d", zon > 0.0 ? '-' : '+', hr, min); ++ else ++ sprintf(szZon, "%c%d:%02d:%02d", zon > 0.0 ? '-' : '+', hr, min, sec); + return szZon; + } + +@@ -970,7 +988,7 @@ + int *mon, *day, *yea; + real *tim, zon; + { +- dword curtimer; ++ time_t curtimer; + int min, sec; + real hr; + diff --git a/misc/astrolog/files/patch-makefile b/misc/astrolog/files/patch-makefile new file mode 100644 index 000000000000..929ff56752e7 --- /dev/null +++ b/misc/astrolog/files/patch-makefile @@ -0,0 +1,28 @@ +--- makefile.orig 2002-04-27 22:48:52.000000000 +0400 ++++ makefile 2012-11-21 12:12:08.000000000 +0400 +@@ -17,6 +17,7 @@ + # edited, is compile each source file, and link them together with the math + # library, and if applicable, the main X library. + # ++.PATH: src + NAME = astrolog + OBJ = astrolog.o data.o data2.o general.o io.o\ + calc.o matrix.o charts0.o charts1.o charts2.o charts3.o\ +@@ -28,9 +29,15 @@ + # LIBS = -lm -lX11 + # with Debian Linux and X windows worked + # LIBS = -lm -L/usr/X11R6/lib -lX11 +-LIBS= -lm ++.if defined(X11) ++LIBS = -L${LOCALBASE}/lib -lX11 -lm ++CFLAGS += -Isrc -DX11 -I${LOCALBASE}/include -DDEFAULT_DIR=\"${PREFIX}/lib/astrolog\" ++.else ++LIBS = -lm ++CFLAGS += -Isrc -DDEFAULT_DIR=\"${PREFIX}/lib/astrolog\" ++.endif + # +-CFLAGS = -O -DHPUX_SOURCE ++#CFLAGS = -O -DHPUX_SOURCE + # + # CFLAGS from 5.41 original sources + # CFLAGS = -g -Aa -DHPUX_SOURCE -- cgit v1.2.3