Index: trunk/psModules/src/astrom/pmAstrometryObjects.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 7944)
+++ trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 7953)
@@ -8,6 +8,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-07-20 13:02:19 $
+*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-07-24 23:56:26 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -136,85 +136,47 @@
         return NULL; \
     } \
-    /*
-     * sort both lists by X coord; 
-    st1 first
-    */ \
-    psVector *x1 = psVectorAlloc(st1->n, PS_TYPE_F64);
+    /* sort both lists by X coord; st1 first */ \
+    psVector *x1 = psVectorAlloc(st1->n, PS_TYPE_F64); \
     \
-    x1->n = x1->nalloc;
+    x1->n = x1->nalloc; \
+    for (int i = 0; i < st1->n; i++) { \
+        x1->data.F64[i] = ((pmAstromObj *)st1->data[i])->MEMBER->x; \
+    } \
+    const psVector *sorted1 = psVectorSortIndex(NULL, x1); \
+    assert (sorted1->type.type == PS_TYPE_S32); \
     \
-    for (int i = 0; i < st1->n; i++)
-    {
-        \
-        x1->data.F64[i] = ((pmAstromObj *)st1->data[i])->MEMBER->x;
-        \
-    } \
-    const psVector *sorted1 = psVectorSortIndex(NULL, x1);
-    \
-    assert (sorted1->type.type == PS_TYPE_S32);
-    \
-    \
-    psVector *y1 = psVectorAlloc(st1->n, PS_TYPE_F64);
-    \
-    y1->n = y1->nalloc;
-    \
-    for (int i = 0; i < st1->n; i++)
-    {
-        \
-        x1->data.F64[i] = ((pmAstromObj *)st1->data[sorted1->data.S32[i]])->MEMBER->x;
-        \
-        y1->data.F64[i] = ((pmAstromObj *)st1->data[sorted1->data.S32[i]])->MEMBER->y;
-        \
+    psVector *y1 = psVectorAlloc(st1->n, PS_TYPE_F64); \
+    y1->n = y1->nalloc; \
+    for (int i = 0; i < st1->n; i++) { \
+        x1->data.F64[i] = ((pmAstromObj *)st1->data[sorted1->data.S32[i]])->MEMBER->x; \
+        y1->data.F64[i] = ((pmAstromObj *)st1->data[sorted1->data.S32[i]])->MEMBER->y; \
     } \
     \
     /* now st2 */ \
-    psVector *x2 = psVectorAlloc(st2->n, PS_TYPE_F64);
+    psVector *x2 = psVectorAlloc(st2->n, PS_TYPE_F64); \
+    x2->n = x2->nalloc; \
+    for (int i = 0; i < st2->n; i++) { \
+        x2->data.F64[i] = ((pmAstromObj *)st2->data[i])->MEMBER->x; \
+    } \
+    const psVector *sorted2 = psVectorSortIndex(NULL, x2); \
     \
-    x2->n = x2->nalloc;
+    psVector *y2 = psVectorAlloc(st2->n, PS_TYPE_F64); \
+    y2->n = y2->nalloc; \
+    for (int i = 0; i < st2->n; i++) { \
+        x2->data.F64[i] = ((pmAstromObj *)st2->data[sorted2->data.S32[i]])->MEMBER->x; \
+        y2->data.F64[i] = ((pmAstromObj *)st2->data[sorted2->data.S32[i]])->MEMBER->y; \
+    } \
+    /* Do the work */ \
+    psArray *matches = match_lists(x1, y1, x2, y2, sorted1, sorted2, RADIUS); \
     \
-    for (int i = 0; i < st2->n; i++)
-    {
-        \
-        x2->data.F64[i] = ((pmAstromObj *)st2->data[i])->MEMBER->x;
-        \
-    } \
-    const psVector *sorted2 = psVectorSortIndex(NULL, x2);
+    psFree(sorted1); \
+    psFree(sorted2); \
+    psFree(x1); \
+    psFree(y1); \
+    psFree(x2); \
+    psFree(y2); \
     \
-    \
-    psVector *y2 = psVectorAlloc(st2->n, PS_TYPE_F64);
-    \
-    y2->n = y2->nalloc;
-    \
-    for (int i = 0; i < st2->n; i++)
-    {
-        \
-        x2->data.F64[i] = ((pmAstromObj *)st2->data[sorted2->data.S32[i]])->MEMBER->x;
-        \
-        y2->data.F64[i] = ((pmAstromObj *)st2->data[sorted2->data.S32[i]])->MEMBER->y;
-        \
-    } \
-    /*
-     * Do the work
-     */ \
-    psArray *matches = match_lists(x1, y1, x2, y2, sorted1, sorted2, RADIUS);
-    \
-    \
-    psFree(sorted1);
-    \
-    psFree(sorted2);
-    \
-    psFree(x1);
-    \
-    psFree(y1);
-    \
-    psFree(x2);
-    \
-    psFree(y2);
-    \
-    \
-    psLogMsg (__func__, 3, "radius match: %d pairs (radius: %f)\n", matches->n, RADIUS);
-    \
-    return (matches);
-    \
+    psLogMsg (__func__, 3, "radius match: %d pairs (radius: %f)\n", matches->n, RADIUS); \
+    return (matches); \
 }
 
