[SCM] Positional Astronomy Library branch, debian, updated. ef14792ee428af7c547829df44479313b6536878

Ole Streicher debian at liska.ath.cx
Fri Feb 10 20:59:45 UTC 2012


The following commit has been merged in the debian branch:
commit ef14792ee428af7c547829df44479313b6536878
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Fri Feb 10 21:58:28 2012 +0100

    Replace obfuscated code

diff --git a/debian/patches/remove_obfuscated.patch b/debian/patches/remove_obfuscated.patch
new file mode 100644
index 0000000..f637b61
--- /dev/null
+++ b/debian/patches/remove_obfuscated.patch
@@ -0,0 +1,63 @@
+Author: Ole Streicher
+Description: Replace the obfuscated C function by the call of the original
+ F77 subroutine. We will not have theperformance problems here since we
+ use -frecursive instead of locks...
+--- a/sla.c
++++ b/sla.c
+@@ -1596,31 +1631,31 @@ void slaGeoc ( double p, double h, double *r, double *z ) {
+ }
+ 
+ 
+-/* This is the obfusticated C version of slaDeuler. It is used in
+-   preference to a wrapper around the Fortran SLA_DEULER routine in order
+-   to ensure it is thread safe. */
+-
+-void slaDeuler( const char *Q0, double FoO, double BAR, double Q1, double
+-baz[3][3]) { int fobar, fOObaR, Q2, FoBaz, q3; double q4[3][3], Q5[3][3],
+-q6, q7, Q8, foobaz, Q9[3][3]; char q10; for (fobar = 0; fobar < 3;
+-fobar++) { for (fOObaR = 0; fOObaR < 3; fOObaR++) { q4[fOObaR][fobar] =
+-(fOObaR == fobar) ? 1.0 : 0.0; } } Q2 = strlen(Q0); for (FoBaz = 0; FoBaz
+-< 3; FoBaz++) { if (FoBaz <= Q2) { for (fobar = 0; fobar < 3; fobar++) {
+-for (fOObaR = 0; fOObaR < 3; fOObaR++) { Q5[fOObaR][fobar] = (fOObaR ==
+-fobar) ? 1.0 : 0.0; } } switch (FoBaz) { case 0: q6 = FoO; break; case 1:
+-q6 = BAR; break; default: q6 = Q1; break; } q7 = sin(q6); Q8 = cos(q6);
+-q10 = Q0[FoBaz]; if ((q10 == 'X') || (q10 == 'x') || (q10 == '1')) {
+-Q5[1][1] = Q8; Q5[1][2] = q7; Q5[2][1] = -q7; Q5[2][2] = Q8; } else if
+-((q10 == 'Y') || (q10 == 'y') || (q10 == '2')) { Q5[0][0] = Q8; Q5[0][2]
+-= -q7; Q5[2][0] = q7; Q5[2][2] = Q8; } else if ((q10 == 'Z') || (q10 ==
+-'z') || (q10 == '3')) { Q5[0][0] = Q8; Q5[0][1] = q7; Q5[1][0] = -q7;
+-Q5[1][1] = Q8; } else { Q2 = 0; } for (fOObaR = 0; fOObaR < 3; fOObaR++)
+-{ for (fobar = 0; fobar < 3; fobar++) { foobaz = 0.0; for (q3 = 0; q3 <
+-3; q3++) { foobaz += Q5[fOObaR][q3] * q4[q3][fobar]; } Q9[fOObaR][fobar]
+-= foobaz; } } for (fobar = 0; fobar < 3; fobar++) { for (fOObaR = 0;
+-fOObaR < 3; fOObaR++) { q4[fOObaR][fobar] = Q9[fOObaR][fobar]; } } } }
+-for (fobar = 0; fobar < 3; fobar++) { for (fOObaR = 0; fOObaR < 3;
+-fOObaR++) { baz[fOObaR][fobar] = q4[fOObaR][fobar]; } } }
++F77_SUBROUTINE(sla_deuler) ( CHARACTER(ORDER), 
++			     DOUBLE(PHI), 
++			     DOUBLE(THETA), 
++			     DOUBLE(PSI), 
++			     DOUBLE_ARRAY(RMAT) TRAIL(STRING) );
++
++void slaDeuler ( const char *order, double phi, double theta, double psi,
++                 double rmat[3][3] ) {
++  DECLARE_CHARACTER_DYN(ORDER);
++  DECLARE_DOUBLE(PHI);
++  DECLARE_DOUBLE(THETA);
++  DECLARE_DOUBLE(PSI);
++  DECLARE_DOUBLE_ARRAY(RMAT,9);
++  F77_EXPORT_DOUBLE(phi, PHI);
++  F77_EXPORT_DOUBLE(theta, THETA);
++  F77_EXPORT_DOUBLE(psi, PSI);
++  F77_CREATE_EXPORT_CHARACTER( order, ORDER );
++  F77_LOCK( F77_CALL(sla_deuler)( CHARACTER_ARG(ORDER),
++				  DOUBLE_ARG(&PHI),
++				  DOUBLE_ARG(&THETA),
++				  DOUBLE_ARG(&PSI),
++				  DOUBLE_ARRAY_ARG(RMAT) TRAIL_ARG(ORDER)); )
++  F77_IMPORT_DOUBLE_ARRAY(RMAT, rmat, 9);
++  F77_FREE_CHARACTER(ORDER);
++}
+ 
+ F77_SUBROUTINE(sla_de2h)( DOUBLE(HA),
+                           DOUBLE(DEC),
diff --git a/debian/patches/series b/debian/patches/series
index e679a74..7d84415 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 use_std_automake.patch
 enable_locking.patch
+remove_obfuscated.patch

-- 
Positional Astronomy Library



More information about the debian-science-commits mailing list