Commit f9cfad3a authored by Adam Mercer's avatar Adam Mercer

use correct format specifiers

Original: 24911ae8446f28db34c82b85ff616ef995fc660f
parent 199bde0c
......@@ -325,7 +325,7 @@ static void *PadAlloc(size_t * p, size_t n, int keep, const char *func)
}
if (lalDebugLevel & LALMEMINFOBIT) {
XLALPrintError("%s meminfo: allocating %ld bytes at address %p\n",
XLALPrintError("%s meminfo: allocating %zu bytes at address %p\n",
func, n, p + nprefix);
}
......@@ -369,7 +369,7 @@ static void *UnPadAlloc(void *p, int keep, const char *func)
s = (char *) q;
if (lalDebugLevel & LALMEMINFOBIT) {
XLALPrintError("%s meminfo: freeing %ld bytes at address %p\n",
XLALPrintError("%s meminfo: freeing %zu bytes at address %p\n",
func, n, p);
}
......
......@@ -668,7 +668,7 @@ XLALGetVersionString( int level )
len += strlen(lalstochastic_info);
#endif
if ( (ret = XLALMalloc ( len )) == NULL ) {
XLALPrintError ("%s: Failed to XLALMalloc(%lu)\n", __func__, len );
XLALPrintError ("%s: Failed to XLALMalloc(%zu)\n", __func__, len );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
......@@ -1989,7 +1989,7 @@ write_FstatCandidate_to_fp ( FILE *fp, const FstatCandidate *thisFCand )
snprintf ( buf0, sizeof(buf0), " %.9g", thisFCand->twoFX[X] );
UINT4 len1 = strlen ( extraStatsStr ) + strlen ( buf0 ) + 1;
if ( len1 > sizeof ( extraStatsStr ) ) {
XLAL_ERROR ( XLAL_EINVAL, "assembled output string too long! (%d > %lu)\n", len1, sizeof(extraStatsStr ));
XLAL_ERROR ( XLAL_EINVAL, "assembled output string too long! (%d > %zu)\n", len1, sizeof(extraStatsStr ));
break; /* we can't really terminate with error in this function, but at least we avoid crashing */
}
strcat ( extraStatsStr, buf0 );
......
......@@ -782,13 +782,13 @@ XLALCreateMultiLIGOTimeGPSVector ( UINT4 numDetectors )
MultiLIGOTimeGPSVector *ret;
if ( (ret = XLALMalloc ( sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: XLALMalloc(%lu) failed.\n", __func__, sizeof(*ret) );
XLALPrintError ("%s: XLALMalloc(%zu) failed.\n", __func__, sizeof(*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
ret->length = numDetectors;
if ( (ret->data = XLALCalloc ( numDetectors, sizeof(*ret->data) )) == NULL ) {
XLALPrintError ("%s: XLALCalloc(%d, %lu) failed.\n", __func__, numDetectors, sizeof(*ret->data) );
XLALPrintError ("%s: XLALCalloc(%d, %zu) failed.\n", __func__, numDetectors, sizeof(*ret->data) );
XLALFree ( ret );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......@@ -819,7 +819,7 @@ write_BSGL_candidate_to_fp ( FILE *fp, const BSGLComponents *stats, const LALStr
for ( UINT4 X = 0; X < IFOs->length ; X ++ ) {
snprintf ( buf0, sizeof(buf0), " 2F_%s", IFOs->data[X] );
UINT4 len1 = strlen ( stat_header_string ) + strlen ( buf0 ) + 1;
XLAL_CHECK ( len1 <= sizeof ( stat_header_string ), XLAL_EBADLEN, "Assembled output string too long! (%d > %lu)", len1, sizeof(stat_header_string));
XLAL_CHECK ( len1 <= sizeof ( stat_header_string ), XLAL_EBADLEN, "Assembled output string too long! (%d > %zu)", len1, sizeof(stat_header_string));
strcat ( stat_header_string, buf0 );
}
if ( haveBSGL ) {
......@@ -843,7 +843,7 @@ write_BSGL_candidate_to_fp ( FILE *fp, const BSGLComponents *stats, const LALStr
for ( UINT4 X = 0; X < IFOs->length ; X ++ ) {
snprintf ( buf0, sizeof(buf0), " %.6f", stats->TwoFX[X] );
UINT4 len1 = strlen ( statString ) + strlen ( buf0 ) + 1;
XLAL_CHECK ( len1 <= sizeof ( statString ), XLAL_EBADLEN, "Assembled output string too long! (%d > %lu)", len1, sizeof(statString));
XLAL_CHECK ( len1 <= sizeof ( statString ), XLAL_EBADLEN, "Assembled output string too long! (%d > %zu)", len1, sizeof(statString));
strcat ( statString, buf0 );
} /* for X < IFOs->length */
if ( haveBSGL ) {
......@@ -881,8 +881,8 @@ XLALComputeConstantMultiNoiseWeightsFromNoiseFloor ( const MultiNoiseFloor *mult
/* create multi noise weights for output */
MultiNoiseWeights *multiWeights = NULL;
XLAL_CHECK_NULL ( (multiWeights = XLALCalloc(1, sizeof(*multiWeights))) != NULL, XLAL_ENOMEM, "Failed call to XLALCalloc ( 1, %lu )\n", sizeof(*multiWeights) );
XLAL_CHECK_NULL ( (multiWeights->data = XLALCalloc(numDet, sizeof(*multiWeights->data))) != NULL, XLAL_ENOMEM, "Failed call to XLALCalloc ( %d, %lu )\n", numDet, sizeof(*multiWeights->data) );
XLAL_CHECK_NULL ( (multiWeights = XLALCalloc(1, sizeof(*multiWeights))) != NULL, XLAL_ENOMEM, "Failed call to XLALCalloc ( 1, %zu )\n", sizeof(*multiWeights) );
XLAL_CHECK_NULL ( (multiWeights->data = XLALCalloc(numDet, sizeof(*multiWeights->data))) != NULL, XLAL_ENOMEM, "Failed call to XLALCalloc ( %d, %zu )\n", numDet, sizeof(*multiWeights->data) );
multiWeights->length = numDet;
REAL8 sqrtSnTotal = 0;
......
......@@ -2672,7 +2672,7 @@ XLALSetUpStacksFromSegmentList ( const SFTCatalog *catalog, /**< complete list o
/* set memory of output catalog sequence to maximum possible length */
if ( (stacks = XLALCalloc ( 1, sizeof(*stacks) ) ) == NULL ) {
XLALPrintError ("%s: XLALCalloc(%lu) failed.\n", __func__, sizeof(*stacks) );
XLALPrintError ("%s: XLALCalloc(%zu) failed.\n", __func__, sizeof(*stacks) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
stacks->length = numSegments;
......
......@@ -367,7 +367,7 @@ main(int argc, char *argv[])
if ( uvar.TDDfile )
{
CHAR *fname = XLALCalloc (1, len = strlen(uvar.TDDfile) + 10 );
XLAL_CHECK ( fname != NULL, XLAL_ENOMEM, "XLALCalloc(1,%lu) failed\n", len );
XLAL_CHECK ( fname != NULL, XLAL_ENOMEM, "XLALCalloc(1,%zu) failed\n", len );
sprintf (fname, "%s.%02d", uvar.TDDfile, i_chunk);
XLAL_CHECK ( XLALdumpREAL4TimeSeries ( fname, Tseries ) == XLAL_SUCCESS, XLAL_EFUNC );
XLALFree (fname);
......@@ -387,7 +387,7 @@ main(int argc, char *argv[])
XLAL_CHECK ( (fname = LALCalloc (1, len )) != NULL, XLAL_ENOMEM );
size_t written = snprintf ( fname, len, "%s/%c-%c%c_%s-%d-%d.gwf",
uvar.TDDframedir, IFO[0], IFO[0], IFO[1], uvar.frameDesc, params.startTimeGPS.gpsSeconds, (int)params.duration );
XLAL_CHECK ( written < len, XLAL_ESIZE, "Frame-filename exceeds expected maximal length (%lu): '%s'\n", len, fname );
XLAL_CHECK ( written < len, XLAL_ESIZE, "Frame-filename exceeds expected maximal length (%zu): '%s'\n", len, fname );
/* define the output frame */
LALFrameH *outFrame;
......@@ -491,7 +491,7 @@ main(int argc, char *argv[])
if ( uvar.outSFTv1 ) /* write output-SFTs using the SFT-v1 format */
{
CHAR *fname = XLALCalloc (1, len = strlen (uvar.outSFTbname) + 10 );
XLAL_CHECK ( fname != NULL, XLAL_ENOMEM, "XLALCalloc(1,%lu) failed.\n", len );
XLAL_CHECK ( fname != NULL, XLAL_ENOMEM, "XLALCalloc(1,%zu) failed.\n", len );
LALStatus status = blank_status;
for (UINT4 i=0; i < SFTs->length; i++)
......@@ -510,7 +510,7 @@ main(int argc, char *argv[])
CHAR *logstr;
XLAL_CHECK ( (logstr = XLALUserVarGetLog ( UVAR_LOGFMT_CMDLINE )) != NULL, XLAL_EFUNC );
char *comment = XLALCalloc ( 1, len = strlen ( logstr ) + strlen(GV.VCSInfoString) + 512 );
XLAL_CHECK ( comment != NULL, XLAL_ENOMEM, "XLALCalloc(1,%lu) failed.\n", len );
XLAL_CHECK ( comment != NULL, XLAL_ENOMEM, "XLALCalloc(1,%zu) failed.\n", len );
sprintf ( comment, "Generated by:\n%s\n%s\n", logstr, GV.VCSInfoString );
/* if user requesting single concatenated SFT */
......
......@@ -218,7 +218,7 @@ main(int argc, char *argv[])
CHAR *logstr;
XLAL_CHECK ( (logstr = XLALUserVarGetLog ( UVAR_LOGFMT_CMDLINE )) != NULL, XLAL_EFUNC );
char *comment = XLALCalloc ( 1, len = strlen ( logstr ) + strlen(GV.VCSInfoString) + 512 );
XLAL_CHECK ( comment != NULL, XLAL_ENOMEM, "XLALCalloc(1,%lu) failed.\n", len );
XLAL_CHECK ( comment != NULL, XLAL_ENOMEM, "XLALCalloc(1,%zu) failed.\n", len );
sprintf ( comment, "Generated by:\n%s\n%s\n", logstr, GV.VCSInfoString );
for ( UINT4 X=0; X < mSFTs->length; X ++ )
......@@ -243,7 +243,7 @@ main(int argc, char *argv[])
{
FILE *fp;
CHAR *fname = XLALCalloc (1, len = strlen(uvar.TDDfile) + 10 );
XLAL_CHECK ( fname != NULL, XLAL_ENOMEM, "XLALCalloc(1,%lu) failed\n", len );
XLAL_CHECK ( fname != NULL, XLAL_ENOMEM, "XLALCalloc(1,%zu) failed\n", len );
for ( UINT4 X=0; X < mTseries->length; X ++ )
{
......@@ -281,7 +281,7 @@ main(int argc, char *argv[])
XLAL_CHECK ( (fname = LALCalloc (1, len )) != NULL, XLAL_ENOMEM );
size_t written = snprintf ( fname, len, "%s/%c-%c%c_%s-%d-%d.gwf",
uvar.TDDframedir, IFO[0], IFO[0], IFO[1], uvar.outLabel, startTimeGPS.gpsSeconds, (int)duration );
XLAL_CHECK ( written < len, XLAL_ESIZE, "Frame-filename exceeds expected maximal length (%lu): '%s'\n", len, fname );
XLAL_CHECK ( written < len, XLAL_ESIZE, "Frame-filename exceeds expected maximal length (%zu): '%s'\n", len, fname );
/* define the output frame */
LALFrameH *outFrame;
......
......@@ -497,11 +497,11 @@ XLALInitCode ( ConfigVariables *cfg, const UserVariables_t *uvar, const char *ap
/* create multi noise weights */
if ( (cfg->multiNoiseWeights = XLALCalloc(1, sizeof(*cfg->multiNoiseWeights))) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( 1, %lu )\n", __func__, sizeof(*cfg->multiNoiseWeights) );
XLALPrintError ("%s: failed to XLALCalloc ( 1, %zu )\n", __func__, sizeof(*cfg->multiNoiseWeights) );
XLAL_ERROR ( XLAL_ENOMEM );
}
if ( (cfg->multiNoiseWeights->data = XLALCalloc(cfg->numDetectors, sizeof(*cfg->multiNoiseWeights->data))) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( %d, %lu )\n", __func__, cfg->numDetectors, sizeof(*cfg->multiNoiseWeights->data) );
XLALPrintError ("%s: failed to XLALCalloc ( %d, %zu )\n", __func__, cfg->numDetectors, sizeof(*cfg->multiNoiseWeights->data) );
XLAL_ERROR ( XLAL_ENOMEM );
}
cfg->multiNoiseWeights->length = cfg->numDetectors;
......
......@@ -517,7 +517,7 @@ XLALInitCode ( ConfigVariables *cfg, const UserVariables_t *uvar, const char *ap
size_t len = strlen ( app_name ) + 1;
if ( (cfg->history = XLALCalloc ( 1, sizeof(*cfg->history))) == NULL ) {
LogPrintf (LOG_CRITICAL, "%s: XLALCalloc(1,%lu) failed.\n\n", __func__, sizeof(*cfg->history));
LogPrintf (LOG_CRITICAL, "%s: XLALCalloc(1,%zu) failed.\n\n", __func__, sizeof(*cfg->history));
XLAL_ERROR ( XLAL_ENOMEM );
}
......
......@@ -189,7 +189,7 @@ int read_fstat_toplist_from_fp(toplist_t*l, FILE*fp, UINT4*checksum, UINT4 maxby
}
else if (line[len-1] != '\n') {
LogPrintf (LOG_CRITICAL,
"Line %d is too long or has no NEWLINE. First %lu chars are:\n'%s'\n",
"Line %d is too long or has no NEWLINE. First %zu chars are:\n'%s'\n",
lines,sizeof(line)-1, line);
return -1;
}
......@@ -227,7 +227,7 @@ int read_fstat_toplist_from_fp(toplist_t*l, FILE*fp, UINT4*checksum, UINT4 maxby
) {
LogPrintf (LOG_CRITICAL,
"Line %d has invalid values.\n"
"First %lu chars are:\n"
"First %zu chars are:\n"
"%s\n"
"All fields should be finite\n"
"1st field should be positive.\n"
......@@ -780,7 +780,7 @@ int write_hs_checkpoint(const char*filename, toplist_t*tl, UINT4 counter, BOOLEA
len = fwrite(tl->data, tl->size, tl->elems, fp);
if(len != tl->elems) {
LOGIOERROR("Couldn't write data to", tmpfilename);
LogPrintf(LOG_CRITICAL,"fwrite() returned %d, length was %lu\n", len, tl->elems);
LogPrintf(LOG_CRITICAL,"fwrite() returned %d, length was %zu\n", len, tl->elems);
if(fclose(fp))
LOGIOERROR("In addition: couldn't close", tmpfilename);
return(-1);
......
......@@ -1005,7 +1005,7 @@ int MAIN( int argc, char *argv[]) {
}
else {
fstatVector.data[k].data = LALRealloc( fstatVector.data[k].data, sizeof(REAL4Sequence));
XLAL_CHECK( fstatVector.data[k].data != NULL, XLAL_ENOMEM, "Failed to re-allocate memory LALRealloc ( %lu )\n", sizeof(REAL4Sequence) );
XLAL_CHECK( fstatVector.data[k].data != NULL, XLAL_ENOMEM, "Failed to re-allocate memory LALRealloc ( %zu )\n", sizeof(REAL4Sequence) );
fstatVector.data[k].data->length = binsFstat1;
fstatVector.data[k].data->data = LALRealloc( fstatVector.data[k].data->data, alloc_len = binsFstat1 * sizeof(REAL4));
......
......@@ -217,7 +217,7 @@ int read_houghFstat_toplist_from_fp(toplist_t*l, FILE*fp, UINT4*checksum, UINT4
}
else if (line[len-1] != '\n') {
LogPrintf (LOG_CRITICAL,
"Line %d is too long or has no NEWLINE. First %lu chars are:\n'%s'\n",
"Line %d is too long or has no NEWLINE. First %zu chars are:\n'%s'\n",
lines,sizeof(line)-1, line);
return -1;
}
......@@ -255,7 +255,7 @@ int read_houghFstat_toplist_from_fp(toplist_t*l, FILE*fp, UINT4*checksum, UINT4
) {
LogPrintf (LOG_CRITICAL,
"Line %d has invalid values.\n"
"First %lu chars are:\n"
"First %zu chars are:\n"
"%s\n"
"All fields should be finite\n"
"1st field should be positive.\n"
......@@ -321,7 +321,7 @@ static int print_houghFstatline_to_str(HoughFstatOutputEntry fline, char* buf, i
snprintf ( buf0, sizeof(buf0), " %7.6f", fline.sumTwoFX->data[X] );
UINT4 len1 = strlen ( extraFStr ) + strlen ( buf0 ) + 1;
if ( len1 > sizeof ( extraFStr ) ) {
XLALPrintError ("%s: assembled output string too long! (%d > %lu)\n", fn, len1, sizeof(extraFStr ));
XLALPrintError ("%s: assembled output string too long! (%d > %zu)\n", fn, len1, sizeof(extraFStr ));
break; /* we can't really terminate with error in this function, but at least we avoid crashing */
}
strcat ( extraFStr, buf0 );
......
......@@ -331,7 +331,7 @@ void XLALDetCharRemoveTrigs( LALGSequence* trig_sequence, LALGSequence** tbd, co
size_t vetoed_events = 0;
size_t de_vetoed_events = 0;
size_t nevents = XLALGetGSequenceLength(trig_sequence);
XLALPrintInfo( "nevents: %lu\n", nevents );
XLALPrintInfo( "nevents: %zu\n", nevents );
XLALPrintInfo( "Channel to veto: %s\n", vchan );
// Pointer to the current position in the trigger list
......@@ -426,12 +426,12 @@ void XLALDetCharRemoveTrigs( LALGSequence* trig_sequence, LALGSequence** tbd, co
// FIXME: Add to veto list
XLALFree( trig_veto );
XLALPrintInfo( "%lu events deleted so far.\n", vetoed_events );
XLALPrintInfo( "%zu events deleted so far.\n", vetoed_events );
nevents = XLALGetGSequenceLength(trig_sequence);
XLALPrintInfo( "%lu events remain\n", nevents );
XLALPrintInfo( "%zu events remain\n", nevents );
}
XLALPrintInfo( "Done, total events removed %lu\n", vetoed_events );
XLALPrintInfo( "Done, ref channel total events removed %lu\n", de_vetoed_events );
XLALPrintInfo( "Done, total events removed %zu\n", vetoed_events );
XLALPrintInfo( "Done, ref channel total events removed %zu\n", de_vetoed_events );
}
......
......@@ -3760,12 +3760,12 @@ void LALInferenceFprintSplineCalibrationHeader(FILE *output, LALInferenceRunStat
UINT4 ncal = *(UINT4 *)LALInferenceGetVariable(runState->currentParams, "spcal_npts");
for (i = 0; i < ncal; i++) {
snprintf(parname, VARNAME_MAX, "%sspcalamp%02ld", ifo->name, i);
snprintf(parname, VARNAME_MAX, "%sspcalamp%02zu", ifo->name, i);
fprintf(output, "%s\t", parname);
}
for (i = 0; i < ncal; i++) {
snprintf(parname, VARNAME_MAX, "%sspcalphase%02ld", ifo->name, i);
snprintf(parname, VARNAME_MAX, "%sspcalphase%02zu", ifo->name, i);
fprintf(output, "%s\t", parname);
}
......
......@@ -943,7 +943,7 @@ XLALFstatMethodHelpString ( void )
separator = '|';
} // for i < FMETHOD_LAST
XLAL_CHECK_NULL ( XLAL_LAST_ELEM ( helpstr ) == '\0', XLAL_EBADLEN, "FstatMethod help-string exceeds buffer length (%lu)\n", sizeof(helpstr) );
XLAL_CHECK_NULL ( XLAL_LAST_ELEM ( helpstr ) == '\0', XLAL_EBADLEN, "FstatMethod help-string exceeds buffer length (%zu)\n", sizeof(helpstr) );
firstCall = 0;
......
......@@ -531,13 +531,13 @@ XLALCreateDetectorStateSeries ( UINT4 length ) /**< number of entries */
DetectorStateSeries *ret = NULL;
if ( (ret = LALCalloc(1, sizeof(DetectorStateSeries) )) == NULL ) {
XLALPrintError ("%s: failed to LALCalloc(1, %lu)\n", __func__, sizeof(DetectorStateSeries) );
XLALPrintError ("%s: failed to LALCalloc(1, %zu)\n", __func__, sizeof(DetectorStateSeries) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
if ( (ret->data = LALCalloc (length, sizeof(DetectorState) )) == NULL ) {
XLALFree (ret);
XLALPrintError ("%s: failed to LALCalloc(%d, %lu)\n", __func__, length, sizeof(DetectorState) );
XLALPrintError ("%s: failed to LALCalloc(%d, %zu)\n", __func__, length, sizeof(DetectorState) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......@@ -691,12 +691,12 @@ XLALGetMultiDetectorStates( const MultiLIGOTimeGPSVector *multiTS, /**< [in] mul
/* prepare return-structure */
MultiDetectorStateSeries *ret = NULL;
if ( ( ret = LALCalloc ( 1, sizeof( *ret ) )) == NULL ) {
XLALPrintError ("%s: LALCalloc ( 1, %lu ) failed\n", __func__, sizeof(*ret) );
XLALPrintError ("%s: LALCalloc ( 1, %zu ) failed\n", __func__, sizeof(*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
if ( ( ret->data = LALCalloc ( numDetectors, sizeof( *(ret->data) ) )) == NULL ) {
XLALFree ( ret );
XLALPrintError ("%s: LALCalloc ( %d, %lu ) failed\n", __func__, numDetectors, sizeof(*(ret->data)) );
XLALPrintError ("%s: LALCalloc ( %d, %zu ) failed\n", __func__, numDetectors, sizeof(*(ret->data)) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
ret->length = numDetectors;
......
......@@ -847,13 +847,13 @@ XLALComputeMultiAMCoeffs ( const MultiDetectorStateSeries *multiDetStates, /**<
/* prepare output vector */
MultiAMCoeffs *ret;
if ( ( ret = XLALCalloc( 1, sizeof( *ret ) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc( 1, %lu)\n", __func__, sizeof( *ret ) );
XLALPrintError ("%s: failed to XLALCalloc( 1, %zu)\n", __func__, sizeof( *ret ) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
ret->length = numDetectors;
if ( ( ret->data = XLALCalloc ( numDetectors, sizeof ( *ret->data ) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc(%d, %lu)\n", __func__, numDetectors, sizeof ( *ret->data ) );
XLALPrintError ("%s: failed to XLALCalloc(%d, %zu)\n", __func__, numDetectors, sizeof ( *ret->data ) );
XLALFree ( ret );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......@@ -893,7 +893,7 @@ XLALCreateAMCoeffs ( UINT4 numSteps )
AMCoeffs *ret;
if ( ( ret = XLALCalloc ( 1, sizeof (*ret) ) ) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( 1, %lu )\n", __func__, sizeof (*ret) );
XLALPrintError ("%s: failed to XLALCalloc ( 1, %zu )\n", __func__, sizeof (*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
......@@ -105,7 +105,7 @@ XLALInitTimeCorrections ( const CHAR *timeCorrectionFile /**< File containing Ea
/* prepare output ephemeris struct for returning */
TimeCorrectionData *tdat;
if ( ( tdat = XLALCalloc ( 1, sizeof(*tdat) ) ) == NULL )
XLAL_ERROR_NULL ( XLAL_ENOMEM, "XLALCalloc ( 1, %lu ) failed.\n", sizeof(*tdat) );
XLAL_ERROR_NULL ( XLAL_ENOMEM, "XLALCalloc ( 1, %zu ) failed.\n", sizeof(*tdat) );
numLines = flines->lines->nTokens;
......@@ -249,7 +249,7 @@ XLALInitBarycenter ( const CHAR *earthEphemerisFile, /**< File containin
/* prepare output ephemeris struct for returning */
EphemerisData *edat;
if ( ( edat = XLALCalloc ( 1, sizeof(*edat) ) ) == NULL )
XLAL_ERROR_NULL ( XLAL_ENOMEM, "XLALCalloc ( 1, %lu ) failed.\n", sizeof(*edat) );
XLAL_ERROR_NULL ( XLAL_ENOMEM, "XLALCalloc ( 1, %zu ) failed.\n", sizeof(*edat) );
/* store in ephemeris-struct */
edat->nentriesE = ephemV->length;
......@@ -331,12 +331,12 @@ XLALCreateEphemerisVector ( UINT4 length )
{
EphemerisVector * ret;
if ( ( ret = XLALCalloc ( 1, sizeof (*ret) )) == NULL )
XLAL_ERROR_NULL ( XLAL_ENOMEM, "Failed to XLALCalloc(1, %lu)\n", sizeof (*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM, "Failed to XLALCalloc(1, %zu)\n", sizeof (*ret) );
if ( ( ret->data = XLALCalloc ( length, sizeof(*ret->data) ) ) == NULL )
{
XLALFree ( ret );
XLAL_ERROR_NULL ( XLAL_ENOMEM, "Failed to XLALCalloc (%d, %lu)\n", length, sizeof(*ret->data) );
XLAL_ERROR_NULL ( XLAL_ENOMEM, "Failed to XLALCalloc (%d, %zu)\n", length, sizeof(*ret->data) );
}
ret->length = length;
......
......@@ -73,7 +73,7 @@ xmlNodePtr XLALPulsarSpins2VOTNode(const PulsarSpins *const spins, const char *n
XLAL_ERROR_NULL(XLAL_EINVAL);
}
if(sizeof(*spins)/sizeof(REAL8) != PULSAR_MAX_SPINS) {
XLALPrintError("Invalid input parameter: spins (actual size %lu differs from defined size %i)\n", sizeof(*spins)/sizeof(REAL8), PULSAR_MAX_SPINS);
XLALPrintError("Invalid input parameter: spins (actual size %zu differs from defined size %i)\n", sizeof(*spins)/sizeof(REAL8), PULSAR_MAX_SPINS);
XLAL_ERROR_NULL(XLAL_EINVAL);
}
if(!name || strlen(name) <= 0) {
......
......@@ -126,7 +126,7 @@ XLALNormalizeSFTVect ( SFTVector *sftVect, /**< [in/out] pointer to a vector o
/* allocate memory for a single rngmed */
REAL8FrequencySeries *rngmed;
XLAL_CHECK ( ( rngmed = XLALCalloc(1, sizeof(*rngmed))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1,%lu)", sizeof(*rngmed) );
XLAL_CHECK ( ( rngmed = XLALCalloc(1, sizeof(*rngmed))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1,%zu)", sizeof(*rngmed) );
XLAL_CHECK ( ( rngmed->data = XLALCreateREAL8Vector ( lengthsft ) ) != NULL, XLAL_EFUNC, "XLALCreateREAL8Vector ( %d ) failed.", lengthsft );
/* loop over sfts and normalize them */
......@@ -168,7 +168,7 @@ XLALNormalizeMultiSFTVect ( MultiSFTVector *multsft, /**< [in/out] multi-vector
UINT4 numifo = multsft->length;
multiPSD->length = numifo;
XLAL_CHECK_NULL ( ( multiPSD->data = XLALCalloc ( numifo, sizeof(*multiPSD->data))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc ( %d, %lu)", numifo, sizeof(*multiPSD->data) );
XLAL_CHECK_NULL ( ( multiPSD->data = XLALCalloc ( numifo, sizeof(*multiPSD->data))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc ( %d, %zu)", numifo, sizeof(*multiPSD->data) );
/* loop over ifos */
for ( UINT4 X = 0; X < numifo; X++ )
......@@ -176,10 +176,10 @@ XLALNormalizeMultiSFTVect ( MultiSFTVector *multsft, /**< [in/out] multi-vector
UINT4 numsft = multsft->data[X]->length;
/* allocation of psd vector over SFTs for this detector X */
XLAL_CHECK_NULL ( (multiPSD->data[X] = XLALCalloc(1, sizeof(*multiPSD->data[X]))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1, %lu)", sizeof(*multiPSD->data[X]));
XLAL_CHECK_NULL ( (multiPSD->data[X] = XLALCalloc(1, sizeof(*multiPSD->data[X]))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1, %zu)", sizeof(*multiPSD->data[X]));
multiPSD->data[X]->length = numsft;
XLAL_CHECK_NULL ( (multiPSD->data[X]->data = XLALCalloc ( numsft, sizeof(*(multiPSD->data[X]->data)))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc ( %d, %lu)", numsft, sizeof(*(multiPSD->data[X]->data)) );
XLAL_CHECK_NULL ( (multiPSD->data[X]->data = XLALCalloc ( numsft, sizeof(*(multiPSD->data[X]->data)))) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc ( %d, %zu)", numsft, sizeof(*(multiPSD->data[X]->data)) );
/* loop over sfts for this IFO X */
for ( UINT4 j = 0; j < numsft; j++ )
......
......@@ -226,7 +226,7 @@ XLALCreateSingularPDF1D ( REAL8 x0 /**< domain of pdf is a single point: x0 */
pdf1D_t *ret;
if ( ( ret = XLALCalloc ( 1, sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( 1, %lu)\n", __func__, sizeof(*ret) );
XLALPrintError ("%s: failed to XLALCalloc ( 1, %zu)\n", __func__, sizeof(*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......@@ -263,7 +263,7 @@ XLALCreateUniformPDF1D ( REAL8 xMin, /**< lower boundary of domain interval */
pdf1D_t *ret;
if ( ( ret = XLALCalloc ( 1, sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( 1, %lu)\n", __func__, sizeof(*ret) );
XLALPrintError ("%s: failed to XLALCalloc ( 1, %zu)\n", __func__, sizeof(*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......@@ -308,7 +308,7 @@ XLALCreateDiscretePDF1D ( REAL8 xMin, /**< lower boundary of domain interval */
pdf1D_t *ret;
if ( ( ret = XLALCalloc ( 1, sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( 1, %lu)\n", __func__, sizeof(*ret) );
XLALPrintError ("%s: failed to XLALCalloc ( 1, %zu)\n", __func__, sizeof(*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
......@@ -67,7 +67,7 @@ XLALCreateSFT ( UINT4 numBins )
SFTtype *sft;
if ( (sft = XLALCalloc (1, sizeof(*sft) )) == NULL )
XLAL_ERROR_NULL ( XLAL_ENOMEM, "XLALCalloc (1, %lu) failed.\n", sizeof(*sft) );
XLAL_ERROR_NULL ( XLAL_ENOMEM, "XLALCalloc (1, %zu) failed.\n", sizeof(*sft) );
if ( numBins )
{
......@@ -432,12 +432,12 @@ XLALExtractMultiTimestampsFromSFTs ( const MultiSFTVector *multiSFTs )
/* create output vector */
MultiLIGOTimeGPSVector *ret = NULL;
if ( (ret = XLALCalloc ( 1, sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( 1, %lu ).\n", __func__, sizeof(*ret));
XLALPrintError ("%s: failed to XLALCalloc ( 1, %zu ).\n", __func__, sizeof(*ret));
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
if ( (ret->data = XLALCalloc ( numIFOs, sizeof(*ret->data) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc ( %d, %lu ).\n", __func__, numIFOs, sizeof(ret->data[0]) );
XLALPrintError ("%s: failed to XLALCalloc ( %d, %zu ).\n", __func__, numIFOs, sizeof(ret->data[0]) );
XLALFree (ret);
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
......@@ -174,12 +174,12 @@ XLALGenerateMultiFstatAtomVector ( const MultiDetectorStateSeries *multiDetState
/* create multi-atoms vector */
MultiFstatAtomVector *multiAtoms;
if ( ( multiAtoms = XLALCalloc ( 1, sizeof(*multiAtoms) )) == NULL ) {
XLALPrintError ("%s: XLALCalloc ( 1, %lu) failed.\n", __func__, sizeof(*multiAtoms) );
XLALPrintError ("%s: XLALCalloc ( 1, %zu) failed.\n", __func__, sizeof(*multiAtoms) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
multiAtoms->length = numDet;
if ( ( multiAtoms->data = XLALCalloc ( numDet, sizeof(*multiAtoms->data) ) ) == NULL ) {
XLALPrintError ("%s: XLALCalloc ( %d, %lu) failed.\n", __func__, numDet, sizeof(*multiAtoms->data) );
XLALPrintError ("%s: XLALCalloc ( %d, %zu) failed.\n", __func__, numDet, sizeof(*multiAtoms->data) );
XLALFree ( multiAtoms );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
......@@ -649,7 +649,7 @@ XLALComputeTransientFstatMap ( const MultiFstatAtomVector *multiFstatAtoms, /**
/* ----- pepare return container ----- */
transientFstatMap_t *ret;
if ( (ret = XLALCalloc ( 1, sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: XLALCalloc(1,%lu) failed.\n", __func__, sizeof(*ret) );
XLALPrintError ("%s: XLALCalloc(1,%zu) failed.\n", __func__, sizeof(*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
......@@ -1618,7 +1618,7 @@ XLALComputeAtomsForFmetric ( const DopplerMetricParams *metricParams, /**< inp
coordSys = &(metricParams->coordSys);
/* ----- create output structure ---------- */
XLAL_CHECK_NULL ( ( ret = XLALCalloc(1,sizeof(*ret))) != NULL, XLAL_ENOMEM, "%s: XLALCalloc(1,%lu) failed.\n", __func__, sizeof(*ret));
XLAL_CHECK_NULL ( ( ret = XLALCalloc(1,sizeof(*ret))) != NULL, XLAL_ENOMEM, "%s: XLALCalloc(1,%zu) failed.\n", __func__, sizeof(*ret));
XLAL_CHECK_NULL ( ( ret->a_a_i = gsl_vector_calloc (dim)) != NULL, XLAL_ENOMEM, "%s: a_a_i = gsl_vector_calloc (%d) failed.\n", __func__, dim );
XLAL_CHECK_NULL ( ( ret->a_b_i = gsl_vector_calloc (dim)) != NULL, XLAL_ENOMEM, "%s: a_b_i = gsl_vector_calloc (%d) failed.\n", __func__, dim );
XLAL_CHECK_NULL ( ( ret->b_b_i = gsl_vector_calloc (dim)) != NULL, XLAL_ENOMEM, "%s: b_b_i = gsl_vector_calloc (%d) failed.\n", __func__, dim );
......@@ -2096,7 +2096,7 @@ XLALComputeFmetricFromAtoms ( const FmetricAtoms_t *atoms, REAL8 cosi, REAL8 psi
/* allocate output metric structure */
if ( (metric = XLALCalloc ( 1, sizeof(*metric) )) == NULL ) {
XLALPrintError ("%s: XLALCalloc ( 1, %lu) failed.\n\n", __func__, sizeof(*metric) );
XLALPrintError ("%s: XLALCalloc ( 1, %zu) failed.\n\n", __func__, sizeof(*metric) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
metric->gF_ij = gsl_matrix_calloc ( dim, dim );
......@@ -2466,12 +2466,12 @@ XLALComputeOrbitalDerivatives ( UINT4 maxorder, /**< [in] highest derivative-o
/* allocate return list */
if ( (ret = XLALCalloc ( 1, sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc(1,%lu)\n", __func__, sizeof(*ret) );
XLALPrintError ("%s: failed to XLALCalloc(1,%zu)\n", __func__, sizeof(*ret) );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
ret->length = maxorder + 1;
if ( (ret->data = XLALCalloc ( ret->length, sizeof(*ret->data) )) == NULL ) {
XLALPrintError ("%s: failed to XLALCalloc(%d,%lu)\n", __func__, ret->length, sizeof(*ret->data) );
XLALPrintError ("%s: failed to XLALCalloc(%d,%zu)\n", __func__, ret->length, sizeof(*ret->data) );
XLALFree ( ret );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
......@@ -488,17 +488,17 @@ XLALCreateVOTTabledataNode ( xmlNode *fieldNodeList, /**< [in] linked list of F
/* ---------- prepare column writing from varargs input list ---------- */
if ( (dataColumns = XLALCalloc ( numFields, sizeof(*dataColumns) )) == NULL ) {
XLALPrintError ("%s: XLALCalloc ( %d, %lu ) failed.\n", __func__, numFields, sizeof(*dataColumns) );
XLALPrintError ("%s: XLALCalloc ( %d, %" LAL_UINT4_FORMAT " ) failed.\n", __func__, numFields, sizeof(*dataColumns) );
err = XLAL_ENOMEM;
goto failed;
}
if ( (dataTypes = XLALCalloc ( numFields, sizeof(*dataTypes) )) == NULL ) {
XLALPrintError ("%s: XLALCalloc ( %d, %lu ) failed.\n", __func__, numFields, sizeof(*dataTypes) );
XLALPrintError ("%s: XLALCalloc ( %d, %" LAL_UINT4_FORMAT " ) failed.\n", __func__, numFields, sizeof(*dataTypes) );
err = XLAL_ENOMEM;
goto failed;
}
if ( (dataFmts = XLALCalloc ( numFields, sizeof(char*) )) == NULL ) {
XLALPrintError ("%s: XLALCalloc ( %d, %lu ) failed.\n", __func__, numFields, sizeof(*dataTypes) );
XLALPrintError ("%s: XLALCalloc ( %d, %" LAL_UINT4_FORMAT " ) failed.\n", __func__, numFields, sizeof(*dataTypes) );
err = XLAL_ENOMEM;
goto failed;
}
......@@ -1153,7 +1153,7 @@ XLALReadVOTAttributeFromNamedElement ( const xmlDocPtr xmlDocument, /**< [in] Th
/* copy attribute-content into a standard CHAR string, so caller can XLALFree() it */
UINT4 len = strlen ( (const char*)xmlContent ) + 1;
if ( (ret = XLALMalloc ( len * sizeof(*ret) )) == NULL ) {
XLALPrintError ("%s: failed to XLALMalloc (%lu)\n", __func__, len * sizeof(*ret) );
XLALPrintError ("%s: failed to XLALMalloc (%" LAL_UINT4_FORMAT ")\n", __func__, len * sizeof(*ret) );
xmlFree ( xmlContent );
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......@@ -1652,7 +1652,7 @@ XMLCleanVOTTableWhitespace ( const char *xmlString )
char *ret;
/* ----- second pass: copy all chars skipping all ZEROS */
if ( (ret = XLALMalloc ( (numChars + 1) * sizeof(char) )) == NULL ) {
XLALPrintError ("%s: XLALMalloc ( %lu ) failed.\n", __func__, numChars * sizeof(char));
XLALPrintError ("%s: XLALMalloc ( %" LAL_UINT4_FORMAT " ) failed.\n", __func__, numChars * sizeof(char));
XLAL_ERROR_NULL ( XLAL_ENOMEM );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment