IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 16, 2005, 1:07:10 PM (21 years ago)
Author:
desonia
Message:

removed *(type*)& syntax for setting const values of struts.

Location:
trunk/psLib/src/imageops
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImagePixelExtract.c

    r5511 r5530  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-11-14 22:18:33 $
     10 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-11-16 23:06:14 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2222
    2323#include "psErrorText.h"
    24 
    2524
    2625#define FUNC_MACRO_VECTOR_STORE_ROW(TYPE) \
     
    407406        imgVec = psAlloc(sizeof(psVector));
    408407        imgVec->type = input->type;
    409         imgVec->n = *(int*)&imgVec->nalloc = numCols;
     408
     409        P_PSVECTOR_SET_NALLOC(imgVec,numCols);
     410        imgVec->n = numCols;
    410411        if (mask != NULL) {
    411412            maskVec = psAlloc(sizeof(psVector));
    412413            maskVec->type = mask->type;
    413             maskVec->n = *(int*)&maskVec->nalloc = numCols;
     414            P_PSVECTOR_SET_NALLOC(maskVec,numCols);
     415            maskVec->n = numCols;
    414416        }
    415417        // recycle output to make a proper sized/type output structure
  • trunk/psLib/src/imageops/psImageStats.c

    r5294 r5530  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-10-12 21:02:20 $
     11 *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-11-16 23:06:14 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6464        junkData = (psVector *) psAlloc(sizeof(psVector));
    6565        junkData->type = in->type;
    66         *(int*)&junkData->nalloc = in->numRows * in->numCols;
     66        P_PSVECTOR_SET_NALLOC(junkData,in->numRows * in->numCols);
    6767        junkData->n = junkData->nalloc;
    6868        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     
    8888            junkMask = psAlloc(sizeof(psVector));
    8989            junkMask->type = mask->type;
    90             *(int*)&junkMask->nalloc = mask->numRows * mask->numCols;
     90            P_PSVECTOR_SET_NALLOC(junkMask,mask->numRows * mask->numCols);
    9191            junkMask->n = junkMask->nalloc;
    9292            junkMask->data.U8 = mask->data.V[0];
     
    137137        junkData = (psVector *) psAlloc(sizeof(psVector));
    138138        junkData->type = in->type;
    139         *(int*)&junkData->nalloc = in->numRows * in->numCols;
     139        P_PSVECTOR_SET_NALLOC(junkData,in->numRows * in->numCols);
    140140        junkData->n = junkData->nalloc;
    141141        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
     
    161161            junkMask = psAlloc(sizeof(psVector));
    162162            junkMask->type = mask->type;
    163             *(int*)&junkMask->nalloc = mask->numRows * mask->numCols;
     163            P_PSVECTOR_SET_NALLOC(junkMask,mask->numRows * mask->numCols);
    164164            junkMask->n = junkMask->nalloc;
    165165            junkMask->data.U8 = mask->data.V[0];
Note: See TracChangeset for help on using the changeset viewer.