Index: trunk/psLib/src/math/psMinimize.c
===================================================================
--- trunk/psLib/src/math/psMinimize.c	(revision 5517)
+++ trunk/psLib/src/math/psMinimize.c	(revision 5530)
@@ -10,6 +10,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.144 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-10-28 19:15:04 $
+ *  @version $Revision: 1.145 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-16 23:06:19 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -17,5 +17,5 @@
  *  XXX: must follow coding name standards on local functions.
  *  XXX: put local functions in front.
- * 
+ *
  */
 /*****************************************************************************/
@@ -596,6 +596,6 @@
     psMinimization *min = psAlloc(sizeof(psMinimization));
     psMemSetDeallocator(min, (psFreeFunc)minimizationFree);
-    *(int*)&min->maxIter = maxIter;
-    *(float*)&min->tol = tol;
+    P_PSMINIMIZATION_SET_MAXITER(min,maxIter);
+    P_PSMINIMIZATION_SET_TOL(min,tol);
     min->value = 0.0;
     min->iter = 0;
@@ -1164,5 +1164,5 @@
         for (i=0;i<numDims;i++) {
             if (myParamMask->data.U8[i] == 0) {
-                *(int*)&dummyMin.maxIter = PS_MINIMIZE_POWELL_LINEMIN_MAX_ITERATIONS;
+                P_PSMINIMIZATION_SET_MAXITER((&dummyMin),PS_MINIMIZE_POWELL_LINEMIN_MAX_ITERATIONS);
                 *(float*)&dummyMin.tol = PS_MINIMIZE_POWELL_LINEMIN_ERROR_TOLERANCE;
                 mul = p_psLineMin(&dummyMin,
Index: trunk/psLib/src/math/psMinimize.h
===================================================================
--- trunk/psLib/src/math/psMinimize.h	(revision 5517)
+++ trunk/psLib/src/math/psMinimize.h	(revision 5530)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-29 02:16:19 $
+ *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-16 23:06:19 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -52,12 +52,16 @@
 psMinimization;
 
-/** Allocates a psMinimization structure.
- *
- *  @return psMinimization* :   a new psMinimization struct
-*/
-psMinimization *psMinimizationAlloc(
-    int maxIter,                       ///< Number of minimization iterations to perform.
-    float tol                          ///< Requested error tolerance
-);
+#define P_PSMINIMIZATION_SET_MAXITER(m,val) *(int*)&m->maxIter = val
+        #define P_PSMINIMIZATION_SET_TOL(m,val) *(float*)&m->tol = val
+
+
+                /** Allocates a psMinimization structure.
+                 *
+                 *  @return psMinimization* :   a new psMinimization struct
+                */
+                psMinimization *psMinimizationAlloc(
+                    int maxIter,                       ///< Number of minimization iterations to perform.
+                    float tol                          ///< Requested error tolerance
+                );
 
 /** Checks the type of a particular pointer.
Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 5517)
+++ trunk/psLib/src/math/psStats.c	(revision 5530)
@@ -17,6 +17,6 @@
 *
 *
-*  @version $Revision: 1.150 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-11-15 20:10:32 $
+*  @version $Revision: 1.151 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-11-16 23:06:19 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -2334,6 +2334,7 @@
     newHist = (psHistogram* ) psAlloc(sizeof(psHistogram));
     psMemSetDeallocator(newHist, (psFreeFunc) histogramFree);
-    newHist->bounds = psVectorAlloc(n + 1, PS_TYPE_F32);
-    *(int *)&newHist->bounds->n = newHist->bounds->nalloc;
+    psVector* newBounds = psVectorAlloc(n + 1, PS_TYPE_F32);
+    newHist->bounds = newBounds;
+    newBounds->n = newHist->bounds->nalloc;
 
     // Calculate the bounds for each bin.
@@ -2343,5 +2344,5 @@
     binSize += FLT_EPSILON;
     for (i = 0; i < n + 1; i++) {
-        newHist->bounds->data.F32[i] = lower + (binSize * (psF32)i);
+        newBounds->data.F32[i] = lower + (binSize * (psF32)i);
     }
 
@@ -2383,8 +2384,9 @@
     newHist = (psHistogram* ) psAlloc(sizeof(psHistogram));
     psMemSetDeallocator(newHist, (psFreeFunc) histogramFree);
-    newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32);
-    *(int *)&newHist->bounds->n = newHist->bounds->nalloc;
+    psVector* newBounds = psVectorAlloc(bounds->n, PS_TYPE_F32);
+    newHist->bounds = newBounds;
+    newBounds->n = newHist->bounds->nalloc;
     for (i = 0; i < bounds->n; i++) {
-        newHist->bounds->data.F32[i] = bounds->data.F32[i];
+        newBounds->data.F32[i] = bounds->data.F32[i];
     }
 
