Commit 69407b06 authored by Reinhard Prix's avatar Reinhard Prix

global variable-initializer macros XLAL_INIT_MEM() and XLAL_INIT_DECL()

- XLAL_INIT_MEM(x) sets the memory of variable 'x' to zero
- removed all (identical) previous local definitions of that macro
- added C99 convenience-macro XLAL_INIT_DECL(x) for declare+initialize a
  variable x, as in: INT4 XLAL_INIT_DECL(myvar);
- refs #1091
Original: 29d91768f90864116a06e2de523d728f2620b4d2
parent 346a06d0
......@@ -71,6 +71,12 @@ typedef uint16_t UINT2; /**< Two-byte unsigned integer. */
typedef uint32_t UINT4; /**< Four-byte unsigned integer. */
typedef uint64_t UINT8; /**< Eight-byte unsigned integer; on some platforms this is equivalent to <tt>unsigned long int</tt> instead. */
/** MACRO to initialize arbitrary variable 'x' to zero */
#define XLAL_INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/** C99 MACRO to declare and zero-initialize a variable, use as "type XLAL_INIT_DECL(var);" */
#define XLAL_INIT_DECL(var) var; XLAL_INIT_MEM(var)
/* Macros for integer constants */
/**
* \def LAL_INT8_C(v) (v ## LL)
......
......@@ -111,8 +111,6 @@ int finite(double);
#define LAL_INT4_MAX 2147483647
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/*---------- internal types ----------*/
/** What info do we want to store in our toplist? */
......@@ -456,7 +454,7 @@ int main(int argc,char *argv[])
char colum_headings_string_base[] = "freq alpha delta f1dot f2dot f3dot 2F";
UINT4 column_headings_string_length = sizeof(colum_headings_string_base);
char column_headings_string[column_headings_string_length];
INIT_MEM( column_headings_string );
XLAL_INIT_MEM( column_headings_string );
strcat ( column_headings_string, colum_headings_string_base );
if ( uvar.computeLV )
{
......
......@@ -84,7 +84,6 @@
#define MYMIN(x,y) ( (x) < (y) ? (x) : (y) )
#define SQ(x) ((x)*(x))
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define LAL_INT4_MAX 2147483647
......@@ -473,7 +472,7 @@ InitPFS ( LALStatus *status, ConfigVariables *cfg, const UserInput_t *uvar )
XLALPrintError ("%s: XLALTimestampsFromMultiSFTCatalogView() failed with errno=%d\n", __func__, xlalErrno );
ABORT ( status, PREDICTFSTAT_EXLAL, PREDICTFSTAT_MSGEXLAL );
}
MultiLALDetector multiIFO; INIT_MEM(multiIFO);
MultiLALDetector XLAL_INIT_DECL(multiIFO);
if ( XLALMultiLALDetectorFromMultiSFTCatalogView ( &multiIFO, multiCatalogView ) != XLAL_SUCCESS ) {
XLALPrintError ("%s: XLALMultiLALDetectorFromMultiSFTCatalogView() failed with errno=%d\n", __func__, xlalErrno );
ABORT ( status, PREDICTFSTAT_EXLAL, PREDICTFSTAT_MSGEXLAL );
......@@ -502,7 +501,7 @@ InitPFS ( LALStatus *status, ConfigVariables *cfg, const UserInput_t *uvar )
assumeSqrtSX_input = uvar->assumeSqrtSX;
}
MultiNoiseFloor assumeSqrtSX; INIT_MEM(assumeSqrtSX);
MultiNoiseFloor XLAL_INIT_DECL(assumeSqrtSX);
if ( XLALParseMultiNoiseFloor ( &assumeSqrtSX, assumeSqrtSX_input, numDetectors ) != XLAL_SUCCESS ) {
XLALPrintError ("%s: XLALParseMultiNoiseFloor() failed with errno=%d\n", __func__, xlalErrno );
ABORT ( status, PREDICTFSTAT_EXLAL, PREDICTFSTAT_MSGEXLAL );
......
......@@ -33,7 +33,6 @@
// ----- defines & macros ----------
#define TRUE (1==1)
#define FALSE (1==0)
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/* (possible) fields of the output Fstat-file */
typedef struct {
......@@ -72,7 +71,7 @@ int
main (int argc, char *argv[] )
{
/* register all user-variables */
UserVariables_t uvar; INIT_MEM ( uvar );
UserVariables_t XLAL_INIT_DECL(uvar);
XLAL_CHECK ( XLALinitUserVars ( &uvar ) == XLAL_SUCCESS, XLAL_EFUNC );
/* read cmdline & cfgfile */
......@@ -240,8 +239,8 @@ XLALcompareFstatFiles ( UINT4 *diff, const LALParsedDataFile *f1, const LALParse
XLAL_CHECK ( (diff != NULL) && (f1 != NULL) && ( f2 != NULL ) && (Ftol > 0), XLAL_EINVAL );
REAL4 eps4 = 100.0 * LAL_REAL4_EPS;
FstatLine_t parsed1; INIT_MEM ( parsed1 );
FstatLine_t parsed2; INIT_MEM ( parsed2 );
FstatLine_t XLAL_INIT_DECL(parsed1);
FstatLine_t XLAL_INIT_DECL(parsed2);
UINT4 nlines1 = f1->lines->nTokens;
UINT4 nlines2 = f2->lines->nTokens;
......
......@@ -82,8 +82,6 @@
#define FALSE (1==0)
/*----- Macros ----- */
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/* ---------- local types ---------- */
......@@ -842,7 +840,7 @@ write_LV_candidate_to_fp ( FILE *fp, const LVcomponents *LVstat, const PulsarDop
}
PulsarDopplerParams dopplerParams = empty_PulsarDopplerParams;
INIT_MEM( dopplerParams.fkdot );
XLAL_INIT_MEM( dopplerParams.fkdot );
if ( dopplerParams_in == NULL ) { /* just write zeros */
dopplerParams.Alpha = 0.0;
dopplerParams.Delta = 0.0;
......
......@@ -107,7 +107,6 @@ int global_argc;
/* ---------- Macros -------------------- */
#define HSMAX(x,y) ( (x) > (y) ? (x) : (y) )
#define HSMIN(x,y) ( (x) < (y) ? (x) : (y) )
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/* ---------- Exported types ---------- */
......@@ -672,7 +671,7 @@ int MAIN( int argc, char *argv[]) {
/*------------ Set up stacks, detector states etc. */
/* initialize spin range vectors */
INIT_MEM( spinRange_Temp );
XLAL_INIT_MEM( spinRange_Temp );
/* some useful first stage params */
usefulParams.sftbasename = uvar_DataFiles1;
......@@ -703,10 +702,10 @@ int MAIN( int argc, char *argv[]) {
/* ----- */
INIT_MEM ( usefulParams.spinRange_startTime );
INIT_MEM ( usefulParams.spinRange_endTime );
INIT_MEM ( usefulParams.spinRange_refTime );
INIT_MEM ( usefulParams.spinRange_midTime );
XLAL_INIT_MEM ( usefulParams.spinRange_startTime );
XLAL_INIT_MEM ( usefulParams.spinRange_endTime );
XLAL_INIT_MEM ( usefulParams.spinRange_refTime );
XLAL_INIT_MEM ( usefulParams.spinRange_midTime );
/* copy user specified spin variables at reftime */
/* the reference time value in spinRange_refTime will be set in SetUpSFTs() */
......@@ -912,7 +911,7 @@ int MAIN( int argc, char *argv[]) {
/* binary orbit and higher spindowns not considered */
thisPoint.asini = 0 /* isolated pulsar */;
INIT_MEM ( thisPoint.fkdot );
XLAL_INIT_MEM ( thisPoint.fkdot );
/*---------- set up stuff for semi-coherent part ---------*/
/* set up some semiCoherent parameters */
......@@ -950,7 +949,7 @@ int MAIN( int argc, char *argv[]) {
column_headings_string_length += 6 + numDetectors*9; /* 6 for " <2Fr>" and 9 per detector for " <2Fr_XY>" */
}
char column_headings_string[column_headings_string_length];
INIT_MEM( column_headings_string );
XLAL_INIT_MEM( column_headings_string );
strcat ( column_headings_string, colum_headings_string_base );
if ( uvar_computeLV ) {
strcat ( column_headings_string, " LV" );
......@@ -2652,8 +2651,7 @@ int XLALExtrapolateToplistPulsarSpins ( toplist_t *list, /**< [out/
if ( deltaTau == 0 )
return XLAL_SUCCESS; /* can skip this step if reftimes are equal */
PulsarSpins fkdot;
INIT_MEM ( fkdot );
PulsarSpins XLAL_INIT_DECL(fkdot);
UINT4 numElements = list->elems;
for (UINT4 j = 0; j < numElements; j++ ) /* loop over toplist */
......
......@@ -27,7 +27,6 @@
#define FALSE (1==0)
/*----- Macros ----- */
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/*----- SWITCHES -----*/
......@@ -214,7 +213,7 @@ int XLALComputeExtraStatsSemiCoherent ( LVcomponents *lineVeto,
PulsarDopplerParams dopplerParams_temp = empty_PulsarDopplerParams; /* struct containing sky position, frequency and fdot for the current candidate */
dopplerParams_temp.Alpha = dopplerParams->Alpha;
dopplerParams_temp.Delta = dopplerParams->Delta;
INIT_MEM( dopplerParams_temp.fkdot );
XLAL_INIT_MEM( dopplerParams_temp.fkdot );
/* compute single- and multi-detector Fstats for each data segment and sum up */
UINT4 k;
......
......@@ -36,7 +36,6 @@
/*---------- DEFINES ----------*/
/*----- Macros ----- */
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/*---------- internal types ----------*/
/*---------- empty initializers ---------- */
......@@ -67,10 +66,10 @@ int
main(int argc, char *argv[])
{
/* register all our user-variable */
UserVariables_t uvar; INIT_MEM ( uvar );
UserVariables_t XLAL_INIT_DECL(uvar);
XLAL_CHECK ( XLALReadUserInput ( argc, argv, &uvar ) == XLAL_SUCCESS, XLAL_EFUNC );
SFTConstraints constraints; INIT_MEM ( constraints );
SFTConstraints XLAL_INIT_DECL(constraints);
CHAR detector[2] = "??"; /* allow reading v1-SFTs without detector-info */
constraints.detector = detector;
SFTCatalog *catalog;
......
......@@ -107,8 +107,6 @@ CHAR *uvar_debugOut=NULL;
#define SQUARE(x) ((x)*(x))
#define CUBE(x) ((x)*(x)*(x))
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define N_SPINDOWN_DERIVS 6
void initUserVars (LALStatus *status);
......@@ -581,9 +579,9 @@ int main(int argc, char *argv[]){
fdotsMax->length = N_SPINDOWN_DERIVS;
fdotsMax->data = (REAL8 *)LALCalloc(fdotsMax->length, sizeof(REAL8));
INIT_MEM(spinRange_startTime);
INIT_MEM(spinRange_endTime);
INIT_MEM(spinRange_refTime);
XLAL_INIT_MEM(spinRange_startTime);
XLAL_INIT_MEM(spinRange_endTime);
XLAL_INIT_MEM(spinRange_refTime);
spinRange_refTime.refTime = refTime;
spinRange_refTime.fkdot[0] = uvar_f0;
......@@ -1279,7 +1277,7 @@ void InitDoppParams(LALStatus *status,
/* initialize Doppler parameters of the potential source */
INIT_MEM( thisPoint->fkdot );
XLAL_INIT_MEM( thisPoint->fkdot );
thisPoint->fkdot[0] = f_current;
thisPoint->fkdot[1] = fdot_current;
thisPoint->fkdot[2] = fddot_current;
......
......@@ -219,9 +219,9 @@ int main(int argc, char *argv[]){
/* fdotsMax->length = N_SPINDOWN_DERIVS; */
/* fdotsMax->data = (REAL8 *)LALCalloc(fdotsMax->length, sizeof(REAL8)); */
/* INIT_MEM(spinRange_startTime); */
/* INIT_MEM(spinRange_endTime); */
/* INIT_MEM(spinRange_refTime); */
/* XLAL_INIT_MEM(spinRange_startTime); */
/* XLAL_INIT_MEM(spinRange_endTime); */
/* XLAL_INIT_MEM(spinRange_refTime); */
/* spinRange_refTime.refTime = refTime; */
/* spinRange_refTime.fkdot[0] = uvar_f0; */
......
......@@ -27,8 +27,6 @@
#define HSMAX(x,y) ( (x) > (y) ? (x) : (y) )
#define HSMIN(x,y) ( (x) < (y) ? (x) : (y) )
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#ifdef OUTPUT_TIMING
extern time_t clock0;
......
......@@ -171,8 +171,6 @@ BOOLEAN uvar_validateLUT = FALSE;
#define HSMAX(x,y) ( (x) > (y) ? (x) : (y) )
#define HSMIN(x,y) ( (x) < (y) ? (x) : (y) )
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define BLOCKSIZE_REALLOC 50
/** Useful stuff for a single stage of the Hierarchical search */
......@@ -638,7 +636,7 @@ int MAIN( int argc, char *argv[]) {
/*------------ Set up stacks, noise weights, detector states etc. */
/* initialize spin range vectors */
INIT_MEM(spinRange_Temp);
XLAL_INIT_MEM(spinRange_Temp);
/* some useful first stage params */
usefulParams.sftbasename = uvar_DataFiles1;
......@@ -646,10 +644,10 @@ int MAIN( int argc, char *argv[]) {
usefulParams.tStack = uvar_tStack;
usefulParams.SSBprec = uvar_SSBprecision;
INIT_MEM ( usefulParams.spinRange_startTime );
INIT_MEM ( usefulParams.spinRange_endTime );
INIT_MEM ( usefulParams.spinRange_refTime );
INIT_MEM ( usefulParams.spinRange_midTime );
XLAL_INIT_MEM ( usefulParams.spinRange_startTime );
XLAL_INIT_MEM ( usefulParams.spinRange_endTime );
XLAL_INIT_MEM ( usefulParams.spinRange_refTime );
XLAL_INIT_MEM ( usefulParams.spinRange_midTime );
/* copy user specified spin variables at reftime */
/* the reference time value in spinRange_refTime will be set in SetUpSFTs() */
......@@ -801,7 +799,7 @@ int MAIN( int argc, char *argv[]) {
thisPoint.refTime = tMidGPS;
/* binary orbit and higher spindowns not considered */
thisPoint.asini = 0 /* isolated pulsar */;
INIT_MEM ( thisPoint.fkdot );
XLAL_INIT_MEM ( thisPoint.fkdot );
/* set up some semiCoherent parameters */
......@@ -2893,8 +2891,8 @@ void PrintSemiCohCandidates(LALStatus *status,
INITSTATUS(status);
ATTATCHSTATUSPTR (status);
INIT_MEM ( fkdotIn );
INIT_MEM ( fkdotOut );
XLAL_INIT_MEM ( fkdotIn );
XLAL_INIT_MEM ( fkdotOut );
for (k=0; k < in->nCandidates; k++) {
/* fprintf(fp, "%e %e %e %g %g %g %g %e %e\n", in->list[k].significance, in->list[k].freq, */
......@@ -2931,7 +2929,7 @@ void PrintSemiCohCandidates(LALStatus *status,
INITSTATUS(status);
ATTATCHSTATUSPTR (status);
INIT_MEM(fkdot);
XLAL_INIT_MEM(fkdot);
fprintf(fp, "## Fstat values from stack %d (reftime -- %d %d)\n", stackIndex, refTime.gpsSeconds, refTime.gpsNanoSeconds);
......@@ -3399,7 +3397,7 @@ void GetSemiCohToplist(LALStatus *status,
ASSERT ( in != NULL, status, HIERARCHICALSEARCH_ENULL, HIERARCHICALSEARCH_MSGENULL );
ASSERT ( in->length >= in->nCandidates, status, HIERARCHICALSEARCH_EVAL, HIERARCHICALSEARCH_MSGEVAL );
INIT_MEM ( line );
XLAL_INIT_MEM ( line );
/* go through candidates and insert into toplist if necessary */
for ( k = 0; k < in->nCandidates; k++) {
......
......@@ -159,8 +159,6 @@ BOOLEAN uvar_validateLUT = FALSE;
#define HSMAX(x,y) ( (x) > (y) ? (x) : (y) )
#define HSMIN(x,y) ( (x) < (y) ? (x) : (y) )
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define BLOCKSIZE_REALLOC 50
/** Useful stuff for a single stage of the Hierarchical search */
......@@ -610,7 +608,7 @@ int MAIN( int argc, char *argv[]) {
/*------------ Set up stacks, noise weights, detector states etc. */
/* initialize spin range vectors */
INIT_MEM(spinRange_Temp);
XLAL_INIT_MEM(spinRange_Temp);
/* some useful first stage params */
usefulParams.sftbasename = uvar_DataFiles1;
......@@ -618,10 +616,10 @@ int MAIN( int argc, char *argv[]) {
usefulParams.tStack = uvar_tStack;
usefulParams.SSBprec = uvar_SSBprecision;
INIT_MEM ( usefulParams.spinRange_startTime );
INIT_MEM ( usefulParams.spinRange_endTime );
INIT_MEM ( usefulParams.spinRange_refTime );
INIT_MEM ( usefulParams.spinRange_midTime );
XLAL_INIT_MEM ( usefulParams.spinRange_startTime );
XLAL_INIT_MEM ( usefulParams.spinRange_endTime );
XLAL_INIT_MEM ( usefulParams.spinRange_refTime );
XLAL_INIT_MEM ( usefulParams.spinRange_midTime );
/* either use WU-original band parameters if given, otherwise adapt to candidate-list range */
REAL8 Freq, FreqBand, f1dot, f1dotBand;
......@@ -740,7 +738,7 @@ int MAIN( int argc, char *argv[]) {
thisPoint.refTime = tMidGPS;
/* binary orbit and higher spindowns not considered */
thisPoint.asini = 0 /* isolated pulsar */;
INIT_MEM ( thisPoint.fkdot );
XLAL_INIT_MEM ( thisPoint.fkdot );
/* set up some semiCoherent parameters */
semiCohPar.useToplist = FALSE;
......@@ -2541,8 +2539,8 @@ void PrintSemiCohCandidates(LALStatus *status,
INITSTATUS(status);
ATTATCHSTATUSPTR (status);
INIT_MEM ( fkdotIn );
INIT_MEM ( fkdotOut );
XLAL_INIT_MEM ( fkdotIn );
XLAL_INIT_MEM ( fkdotOut );
for (k=0; k < in->nCandidates; k++) {
/* fprintf(fp, "%e %e %e %g %g %g %g %e %e\n", in->list[k].significance, in->list[k].freq, */
......@@ -2579,7 +2577,7 @@ void PrintSemiCohCandidates(LALStatus *status,
INITSTATUS(status);
ATTATCHSTATUSPTR (status);
INIT_MEM(fkdot);
XLAL_INIT_MEM(fkdot);
fprintf(fp, "## Fstat values from stack %d (reftime -- %d %d)\n", stackIndex, refTime.gpsSeconds, refTime.gpsNanoSeconds);
......
......@@ -39,9 +39,6 @@
#define SSMAX(x,y) ( (x) > (y) ? (x) : (y) )
#define SSMIN(x,y) ( (x) < (y) ? (x) : (y) )
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define BLOCKSIZE_REALLOC 50
static int smallerStackSlide(const void *a,const void *b) {
......@@ -197,7 +194,7 @@ void StackSlideVecF(LALStatus *status, /**< pointer to LALStatus structure */
/* The input parameter space point */
inputPoint.refTime = refTimeGPS;
inputPoint.asini = 0 /* isolated pulsar */;
INIT_MEM ( inputPoint.fkdot );
XLAL_INIT_MEM ( inputPoint.fkdot );
inputPoint.fkdot[0] = fmid;
inputPoint.fkdot[1] = fdot;
inputPoint.Alpha = alpha;
......@@ -206,12 +203,12 @@ void StackSlideVecF(LALStatus *status, /**< pointer to LALStatus structure */
/* Values for output parameter space point that do not change */
outputPoint.refTime = refTimeGPS;
outputPoint.asini = 0 /* isolated pulsar */;
INIT_MEM ( outputPoint.fkdot );
XLAL_INIT_MEM ( outputPoint.fkdot );
/* uncertainties in the output parameter space point */
outputPointUnc.refTime = refTimeGPS;
outputPointUnc.asini = 0 /* isolated pulsar */;
INIT_MEM ( outputPointUnc.fkdot );
XLAL_INIT_MEM ( outputPointUnc.fkdot );
outputPointUnc.fkdot[0] = deltaF;
outputPointUnc.fkdot[1] = dfdot;
outputPointUnc.Delta = dDelta;
......
......@@ -44,7 +44,6 @@
// ---------- local macro definitions
#define SQ(x) ( (x) * (x) )
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
// ---------- local type definitions
// ---------- empty initializers
......@@ -250,7 +249,7 @@ XLALCWMakeFakeData ( SFTVector **SFTvect,
XLAL_CHECK ( XLALGetTransientWindowTimespan ( &t0, &t1, pulsarParams->Transient ) == XLAL_SUCCESS, XLAL_EFUNC );
// use latest possible start-time: max(t0,firstGPS), but not later than than lastGPS
LIGOTimeGPS signalStartGPS; INIT_MEM ( signalStartGPS );
LIGOTimeGPS XLAL_INIT_DECL(signalStartGPS);
if ( t0 <= firstGPS_REAL8 ) {
signalStartGPS = firstGPS;
} else if ( t0 >= lastGPS_REAL8 ) {
......@@ -261,7 +260,7 @@ XLALCWMakeFakeData ( SFTVector **SFTvect,
}
// use earliest possible end-time: min(t1,lastGPS), but not earlier than firstGPS
LIGOTimeGPS signalEndGPS; INIT_MEM ( signalEndGPS );
LIGOTimeGPS XLAL_INIT_DECL(signalEndGPS);
if ( t1 >= lastGPS_REAL8 ) {
signalEndGPS = lastGPS;
} else if ( t1 <= firstGPS_REAL8 ) {
......@@ -653,7 +652,7 @@ XLALReadPulsarParams ( PulsarParams *pulsarParams, ///< [out] pulsar parameters
XLAL_CHECK ( pulsarParams != NULL, XLAL_EINVAL );
XLAL_CHECK ( cfgdata != NULL, XLAL_EINVAL );
INIT_MEM ( (*pulsarParams) ); // wipe input struct clean
XLAL_INIT_MEM ( (*pulsarParams) ); // wipe input struct clean
// ---------- PulsarAmplitudeParams ----------
// ----- h0, cosi
......
......@@ -41,8 +41,6 @@
#include <lal/CWFastMath.h>
#include <lal/NormalizeSFTRngMed.h>
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define MYSIGN(x) ( ((x) < 0) ? (-1.0):(+1.0) )
#define SQ(x) ( (x) * (x) )
......@@ -278,8 +276,7 @@ XLALSetupFstatInput(
if (generateSFTs) {
// Initialise parameters struct for XLALCWMakeFakeMultiData()
CWMFDataParams MFDparams;
INIT_MEM(MFDparams);
CWMFDataParams XLAL_INIT_DECL(MFDparams);
MFDparams.fMin = minFreq;
MFDparams.Band = maxFreq - minFreq;
MFDparams.multiIFO = common->detectors;
......
......@@ -33,7 +33,6 @@
/*----- Macros ----- */
#define SQUARE(x) ((x) * (x))
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/*----- SWITCHES -----*/
......
......@@ -46,8 +46,6 @@
#define TRUE (1==1)
#define FALSE (1==0)
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#ifdef __GNUC__
#define UNUSED __attribute__ ((unused))
#else
......@@ -502,7 +500,7 @@ XLALNextDopplerPos(PulsarDopplerParams *pos, DopplerFullScanState *scan)
break;
case GRID_FILE_FULLGRID:
INIT_MEM(pos->fkdot);
XLAL_INIT_MEM(pos->fkdot);
pos->fkdot[0] = scan->thisGridPoint->entry.data[0];
pos->Alpha = scan->thisGridPoint->entry.data[1];
pos->Delta = scan->thisGridPoint->entry.data[2];
......
......@@ -53,8 +53,6 @@
#define MIN(x,y) (x < y ? x : y)
#define MAX(x,y) (x > y ? x : y)
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define TRUE (1==1)
#define FALSE (1==0)
......@@ -305,7 +303,7 @@ InitDopplerSkyScan( LALStatus *status, /**< pointer to LALStatus structure */
gridpoint.Alpha = skyScan->skyGrid->Alpha;
gridpoint.Delta = skyScan->skyGrid->Delta;
INIT_MEM ( gridpoint.fkdot );
XLAL_INIT_MEM ( gridpoint.fkdot );
gridpoint.fkdot[0] = init->Freq;
TRY ( getGridSpacings( status->statusPtr, &gridSpacings, gridpoint, init), status);
......
......@@ -28,7 +28,6 @@
/** Simple Euklidean scalar product for two 3-dim vectors in cartesian coords */
#define SCALAR(u,v) ((u)[0]*(v)[0] + (u)[1]*(v)[1] + (u)[2]*(v)[2])
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
// ----- global variables, initializers
static LALUnit emptyUnit;
......@@ -212,11 +211,11 @@ XLALSimulateExactPulsarSignal ( const PulsarSignalParams *params )
REAL8 refTime0 = XLALGPSGetREAL8 ( &(params->pulsar.refTime) );
REAL8 deltaRef = startTimeSSB - refTime0;
LIGOTimeGPS newEpoch;
PulsarSpins fkdotOld, fkdotNew;
PulsarSpins fkdotNew;
XLALGPSSetREAL8( &newEpoch, startTimeSSB );
INIT_MEM ( fkdotOld );
PulsarSpins XLAL_INIT_DECL(fkdotOld);
fkdotOld[0] = f0;
fkdotOld[1] = f1dot;
fkdotOld[2] = f2dot;
......
......@@ -48,8 +48,6 @@
*/
/*---------- SCALING FACTORS ----------*/
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/** shortcuts for integer powers */
#define POW2(a) ( (a) * (a) )
#define POW3(a) ( (a) * (a) * (a) )
......
......@@ -53,7 +53,6 @@
// ----- macros
#define GPS2REAL8(gps) (1.0 * (gps).gpsSeconds + 1.e-9 * (gps).gpsNanoSeconds )
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
// ----- global variables
static REAL8 A,B; /* binary time delay coefficients (need to be global so that the LAL root finding procedure can see them) */
......@@ -91,8 +90,8 @@ main ( int argc, char *argv[] )
UserInput_t uvar_s;
UserInput_t *uvar = &uvar_s;
INIT_MEM ( status );
INIT_MEM ( uvar_s );
XLAL_INIT_MEM ( status );
XLAL_INIT_MEM ( uvar_s );
struct tms buf;
uvar->randSeed = times(&buf);
......
......@@ -31,8 +31,6 @@
#include <lal/PulsarDataTypes.h>
#include <lal/ExtrapolatePulsarSpins.h>
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
/** \name Error codes */
/*@{*/
#define PULSARSPINTESTC_ENORM 0
......@@ -101,14 +99,14 @@ int main(int argc, char *argv[])
argc = 1; /* avoid warning */
/* set up initial spin-values */
INIT_MEM( fkdot0 );
XLAL_INIT_MEM( fkdot0 );
fkdot0[0] = 300.0;
fkdot0[1] = -1.e-7;
fkdot0[2] = 1e-15;
fkdot0[3] = -1e-22;
/* Result: (from ExtrPulsarSpins.m) */
INIT_MEM ( result );
XLAL_INIT_MEM ( result );
result[0] = 2.809011145986047e+02;
result[1] = -4.529256832000000e-07;
result[2] = -8.460800000000001e-15;
......@@ -164,13 +162,13 @@ int main(int argc, char *argv[])
/* ----- now test LALExtrapolatePulsarSpinRange() ----- */
/* set up initial spin-range */
range0.refTime = epoch0;
INIT_MEM ( range0.fkdot );
XLAL_INIT_MEM ( range0.fkdot );
range0.fkdot[0] = fkdot0[0];
range0.fkdot[1] = fkdot0[1];
range0.fkdot[2] = fkdot0[2];
range0.fkdot[3] = fkdot0[3];
INIT_MEM ( range0.fkdotBand );
XLAL_INIT_MEM ( range0.fkdotBand );
range0.fkdotBand[0] = 0;
range0.fkdotBand[1] = -1.0e-7;
range0.fkdotBand[2] = 1.0e-15;
......@@ -180,13 +178,13 @@ int main(int argc, char *argv[])
rangeResult.refTime.gpsSeconds = 619572733;
rangeResult.refTime.gpsNanoSeconds = 0;
INIT_MEM ( rangeResult.fkdot );
XLAL_INIT_MEM ( rangeResult.fkdot );
rangeResult.fkdot[0] = 3.280495590653952e+02;
rangeResult.fkdot[1] = -1.284283366400000e-06;
rangeResult.fkdot[2] = 1.046080000000000e-14;
rangeResult.fkdot[3] = -2.000000000000000e-22;
INIT_MEM ( rangeResult.fkdotBand );
XLAL_INIT_MEM ( rangeResult.fkdotBand );
rangeResult.fkdotBand[0] = 2.804955906539521e+01;
rangeResult.fkdotBand[1] = 6.421416832000000e-07;
rangeResult.fkdotBand[2] = 1.046080000000000e-14;
......
......@@ -22,7 +22,6 @@
#include <lal/NormalizeSFTRngMed.h>
#include <lal/Units.h>
#define INIT_MEM(x) memset(&(x), 0, sizeof((x)))
#define REL_ERR(x,y) ( fabs((x) - (y)) / fabs( (x) ) )
/* Default parameters. */
......@@ -69,7 +68,7 @@ int main ( void )
/* get memory for running-median vector */
REAL8FrequencySeries rngmed;
INIT_MEM ( rngmed );