Skip to content

Instantly share code, notes, and snippets.

@tammojan
Created July 9, 2014 12:06
Show Gist options
  • Save tammojan/fa1eb666c5ec50238bdc to your computer and use it in GitHub Desktop.
Save tammojan/fa1eb666c5ec50238bdc to your computer and use it in GitHub Desktop.
Empty CountedPtr is not 0
Index: msvis/MSVis/AveragingTvi2.cc
===================================================================
--- msvis/MSVis/AveragingTvi2.cc (revision 30403)
+++ msvis/MSVis/AveragingTvi2.cc (working copy)
@@ -1384,7 +1384,7 @@
srcVb->isNewSpectralWindow(),
subchunk,
srcVb->getCorrelationTypes (),
- CountedPtr <WeightScaling> (0));
+ CountedPtr <WeightScaling> ());
// Request info from the VB which will cause it to be filled
// into cache from the input VII at its current position.
Index: msvis/MSVis/VisBufferImpl2Internal.h
===================================================================
--- msvis/MSVis/VisBufferImpl2Internal.h (revision 30403)
+++ msvis/MSVis/VisBufferImpl2Internal.h (working copy)
@@ -777,8 +777,8 @@
validShapes_p (N_ShapePatterns),
vi_p (0),
viC_p (0),
- visModelData_p (0),
- weightScaling_p (0)
+ visModelData_p (),
+ weightScaling_p ()
{}
Int appendCapacity_p;
Index: msvis/MSVis/VisibilityIteratorImpl2.cc
===================================================================
--- msvis/MSVis/VisibilityIteratorImpl2.cc (revision 30403)
+++ msvis/MSVis/VisibilityIteratorImpl2.cc (working copy)
@@ -819,7 +819,7 @@
more_p (False),
msIndex_p (0),
msIterAtOrigin_p (False),
- msIter_p (0),
+ msIter_p (),
nCorrelations_p (-1),
nRowBlocking_p (0),
reportingFrame_p (VisBuffer2::FrameNotSpecified),
@@ -830,7 +830,7 @@
timeInterval_p (timeInterval),
vb_p (0),
vi_p (0),
- weightScaling_p (0),
+ weightScaling_p (),
writable_p (writable)
{
// Make sure the pointer to the containing ROVI (vi_p) is NULL when calling initialize
Index: nrao/VLA/VLALogicalRecord.cc
===================================================================
--- nrao/VLA/VLALogicalRecord.cc (revision 30403)
+++ nrao/VLA/VLALogicalRecord.cc (working copy)
@@ -33,7 +33,7 @@
#include <casa/Arrays/Matrix.h>
VLALogicalRecord::VLALogicalRecord()
- :itsRecordPtr(0),
+ :itsRecordPtr(),
itsRCA(),
itsSDA(),
itsADA(0),
Index: synthesis/ImagerObjects/SIImageStore.cc
===================================================================
--- synthesis/ImagerObjects/SIImageStore.cc (revision 30403)
+++ synthesis/ImagerObjects/SIImageStore.cc (working copy)
@@ -615,7 +615,7 @@
// Add checks for all dimensions..
if((facet>(nfacets-1))||(facet<0)) {
os << LogIO::SEVERE << "Illegal facet " << facet << LogIO::POST;
- return NULL;
+ return CountedPtr<ImageInterface<Float> >();
}
IPosition imshp=image.shape();
IPosition blc(imshp.nelements(), 0);
Index: synthesis/ImagerObjects/SIImageStoreMultiTerm.cc
===================================================================
--- synthesis/ImagerObjects/SIImageStoreMultiTerm.cc (revision 30403)
+++ synthesis/ImagerObjects/SIImageStoreMultiTerm.cc (working copy)
@@ -345,14 +345,14 @@
// Set these to null, to be set later upon first access.
// Setting to null will hopefully set all elements of each array, to NULL.
- itsPsfs=NULL;
- itsModels=NULL;
- itsResiduals=NULL;
- itsWeights=NULL;
- itsImages=NULL;
- itsSumWts=NULL;
+ itsPsfs=CountedPtr<ImageInterface<Float> >();
+ itsModels=CountedPtr<ImageInterface<Float> >();
+ itsResiduals=CountedPtr<ImageInterface<Float> >();
+ itsWeights=CountedPtr<ImageInterface<Float> >();
+ itsImages=CountedPtr<ImageInterface<Float> >();
+ itsSumWts=CountedPtr<ImageInterface<Float> >();
- itsMask=NULL;
+ itsMask=CountedPtr<ImageInterface<Float> >();
validate();
Index: synthesis/ImagerObjects/SIMapperCollection.cc
===================================================================
--- synthesis/ImagerObjects/SIMapperCollection.cc (revision 30403)
+++ synthesis/ImagerObjects/SIMapperCollection.cc (working copy)
@@ -429,7 +429,7 @@
{
return (itsMappers[id])->imageStore();
}
- return NULL;
+ return CountedPtr<SIImageStore>();
}
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
Index: synthesis/ImagerObjects/SynthesisDeconvolver.cc
===================================================================
--- synthesis/ImagerObjects/SynthesisDeconvolver.cc (revision 30403)
+++ synthesis/ImagerObjects/SynthesisDeconvolver.cc (working copy)
@@ -58,8 +58,8 @@
namespace casa { //# NAMESPACE CASA - BEGIN
SynthesisDeconvolver::SynthesisDeconvolver() :
- itsDeconvolver(NULL),
- itsMaskHandler(NULL),
+ itsDeconvolver(),
+ itsMaskHandler(),
itsImages(CountedPtr<SIImageStore>()),
// itsPartImages(Vector<CountedPtr<SIImageStore> >()),
itsImageName(""),
Index: synthesis/ImagerObjects/SynthesisImager.cc
===================================================================
--- synthesis/ImagerObjects/SynthesisImager.cc (revision 30403)
+++ synthesis/ImagerObjects/SynthesisImager.cc (working copy)
@@ -95,7 +95,7 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SynthesisImager::SynthesisImager() : itsMappers(SIMapperCollection()),
- mss_p(0),vi_p(0), writeAccess_p(True), mss4vi_p(0)
+ mss_p(0),vi_p(), writeAccess_p(True), mss4vi_p(0)
{
imwgt_p=VisImagingWeight("natural");
@@ -952,7 +952,7 @@
{
LogIO os( LogOrigin("SynthesisImager","createSIMapper",WHERE) );
- CountedPtr<SIMapper> localMapper=NULL;
+ CountedPtr<SIMapper> localMapper;
try
{
@@ -1214,7 +1214,7 @@
if( mType=="imagemosaic" &&
(ftname != "awprojectft" && ftname != "mawprojectft" && ftname != "proroft") )
{
- CountedPtr<SkyJones> vp = NULL;
+ CountedPtr<SkyJones> vp;
ROMSColumns msc(*mss_p[0]);
Quantity parang(0.0,"deg");
Quantity skyposthreshold(0.0,"deg");
Index: synthesis/MSVis/AveragingTvi2.cc
===================================================================
--- synthesis/MSVis/AveragingTvi2.cc (revision 30403)
+++ synthesis/MSVis/AveragingTvi2.cc (working copy)
@@ -1384,7 +1384,7 @@
srcVb->isNewSpectralWindow(),
subchunk,
srcVb->getCorrelationTypes (),
- CountedPtr <WeightScaling> (0));
+ CountedPtr <WeightScaling> ());
// Request info from the VB which will cause it to be filled
// into cache from the input VII at its current position.
Index: synthesis/MSVis/VisBufferImpl2Internal.h
===================================================================
--- synthesis/MSVis/VisBufferImpl2Internal.h (revision 30403)
+++ synthesis/MSVis/VisBufferImpl2Internal.h (working copy)
@@ -778,7 +778,7 @@
vi_p (0),
viC_p (0),
visModelData_p (),
- weightScaling_p (0)
+ weightScaling_p ()
{}
Int appendCapacity_p;
Index: synthesis/MSVis/VisibilityIteratorImpl2.cc
===================================================================
--- synthesis/MSVis/VisibilityIteratorImpl2.cc (revision 30403)
+++ synthesis/MSVis/VisibilityIteratorImpl2.cc (working copy)
@@ -819,7 +819,7 @@
more_p (False),
msIndex_p (0),
msIterAtOrigin_p (False),
- msIter_p (0),
+ msIter_p (),
nCorrelations_p (-1),
nRowBlocking_p (0),
reportingFrame_p (VisBuffer2::FrameNotSpecified),
@@ -830,7 +830,7 @@
timeInterval_p (timeInterval),
vb_p (0),
vi_p (0),
- weightScaling_p (0),
+ weightScaling_p (),
writable_p (writable)
{
// Make sure the pointer to the containing ROVI (vi_p) is NULL when calling initialize
Index: synthesis/MeasurementComponents/MFMSCleanImageSkyModel.cc
===================================================================
--- synthesis/MeasurementComponents/MFMSCleanImageSkyModel.cc (revision 30403)
+++ synthesis/MeasurementComponents/MFMSCleanImageSkyModel.cc (working copy)
@@ -203,7 +203,7 @@
}*/
Block<CountedPtr<ImageMSCleaner > > cleaner(numberOfModels());
- cleaner=0;
+ //cleaner=0;
Int cycle=0;
Bool stop=False;
Index: synthesis/MeasurementComponents/nPBWProjectFT.cc
===================================================================
--- synthesis/MeasurementComponents/nPBWProjectFT.cc (revision 30403)
+++ synthesis/MeasurementComponents/nPBWProjectFT.cc (working copy)
@@ -150,7 +150,7 @@
Bool usezero)
: FTMachine(), padding_p(1.0), nWPlanes_p(nWPlanes),
imageCache(0), cachesize(icachesize), tilesize(itilesize),
- gridder(0), isTiled(False), arrayLattice(0), lattice(0),
+ gridder(0), isTiled(False), arrayLattice(), lattice(),
maxAbsData(0.0), centerLoc(IPosition(4,0)), offsetLoc(IPosition(4,0)),
mspc(0), msac(0), pointingToImage(0), usezero_p(usezero),
doPBCorrection(doPBCorr),
Index: synthesis/MeasurementEquations/Deconvolver.cc
===================================================================
--- synthesis/MeasurementEquations/Deconvolver.cc (revision 30403)
+++ synthesis/MeasurementEquations/Deconvolver.cc (working copy)
@@ -121,7 +121,7 @@
: dirty_p(0),
psf_p(0),
convolver_p(0),
- cleaner_p(0),
+ cleaner_p(),
mt_nterms_p(-1),
mt_cleaner_p(),
mt_valid_p(False)
@@ -138,7 +138,7 @@
beam_p = GaussianBeam();
residEqn_p = 0;
latConvEqn_p = 0;
- cleaner_p = 0;
+ cleaner_p = CountedPtr<ImageMSCleaner>();
dirtyName_p = "";
psfName_p = "";
nx_p=0; ny_p=0; npol_p=0; nchan_p=0;
@@ -146,7 +146,7 @@
}
Deconvolver::Deconvolver(const String& dirty, const String& psf)
- : dirty_p(0), psf_p(0), convolver_p(0), cleaner_p(0),
+ : dirty_p(0), psf_p(0), convolver_p(0), cleaner_p(),
mt_nterms_p(-1), mt_cleaner_p(), mt_valid_p(False)
{
LogIO os(LogOrigin("Deconvolver", "Deconvolver(String& dirty, Strong& psf)", WHERE));
@@ -155,7 +155,7 @@
}
Deconvolver::Deconvolver(const Deconvolver &other)
- : dirty_p(0), psf_p(0), convolver_p(0), cleaner_p(0),
+ : dirty_p(0), psf_p(0), convolver_p(0), cleaner_p(),
mt_nterms_p(-1), mt_cleaner_p(), mt_valid_p(False)
{
defaults();
Index: synthesis/MeasurementEquations/Imager2.cc
===================================================================
--- synthesis/MeasurementEquations/Imager2.cc (revision 30403)
+++ synthesis/MeasurementEquations/Imager2.cc (working copy)
@@ -2096,7 +2096,7 @@
Double availablemem=Double(HostInfo::memoryFree())*1024.0;
Bool nomemory=False;
- Block<CountedPtr< TempImage<Float> > > tempfluximage(modelNames.nelements(), NULL);
+ Block<CountedPtr< TempImage<Float> > > tempfluximage(modelNames.nelements()) ;
//The convolution needs in ram 3 complex x-y planes ...lets multiply it by 5 for safety
if((availablemem < Double(nx_p*ny_p)*15.0*8.0 ) && (ft_p->name() != "MosaicFT") && !(doWideBand_p && ntaylor_p>1)){
// very large for convolution ...destroy Skyequations to release memory
Index: synthesis/MeasurementEquations/MatrixCleaner.cc
===================================================================
--- synthesis/MeasurementEquations/MatrixCleaner.cc (revision 30403)
+++ synthesis/MeasurementEquations/MatrixCleaner.cc (working copy)
@@ -81,11 +81,11 @@
MatrixCleaner::MatrixCleaner():
- itsMask(0),
+ itsMask(),
itsSmallScaleBias(0.6),
itsMaskThreshold(0.9),
- itsDirty(0),
- itsXfr(0),
+ itsDirty(),
+ itsXfr(),
itsScaleSizes(0),
itsMaximumResidual(0.0),
itsStrengthOptimum(0.0),
@@ -115,7 +115,7 @@
MatrixCleaner::MatrixCleaner(const Matrix<Float> & psf,
const Matrix<Float> &dirty):
- itsMask(0),
+ itsMask(),
itsSmallScaleBias(0.6),
itsScaleSizes(0),
itsMaximumResidual(0.0),
Index: synthesis/TransformMachines/AWProjectFT.cc
===================================================================
--- synthesis/TransformMachines/AWProjectFT.cc (revision 30403)
+++ synthesis/TransformMachines/AWProjectFT.cc (working copy)
@@ -109,7 +109,7 @@
AWProjectFT::AWProjectFT()
: FTMachine(), padding_p(1.0), nWPlanes_p(1),
imageCache(0), cachesize(0), tilesize(16),
- gridder(0), isTiled(False), arrayLattice(0), lattice(0),
+ gridder(0), isTiled(False), arrayLattice(), lattice(),
maxAbsData(0.0), centerLoc(IPosition(4,0)), offsetLoc(IPosition(4,0)),
pointingToImage(0), usezero_p(False),
// convFunc_p(), convWeights_p(),
@@ -165,7 +165,7 @@
Bool doublePrecGrid)
: FTMachine(cfcache,cf), padding_p(1.0), nWPlanes_p(nWPlanes),
imageCache(0), cachesize(icachesize), tilesize(itilesize),
- gridder(0), isTiled(False), arrayLattice(0), lattice(0),
+ gridder(0), isTiled(False), arrayLattice(), lattice(),
maxAbsData(0.0), centerLoc(IPosition(4,0)), offsetLoc(IPosition(4,0)),
pointingToImage(0), usezero_p(usezero),
// convFunc_p(), convWeights_p(),
Index: synthesis/TransformMachines/FTMachine.cc
===================================================================
--- synthesis/TransformMachines/FTMachine.cc (revision 30403)
+++ synthesis/TransformMachines/FTMachine.cc (working copy)
@@ -86,7 +86,7 @@
freqInterpMethod_p(InterpolateArray1D<Double,Complex>::nearestNeighbour),
pointingDirCol_p("DIRECTION"),
cfStokes_p(), cfCache_p(), cfs_p(), cfwts_p(), canComputeResiduals_p(False),
- numthreads_p(-1), pbLimit_p(0.05),sj_p(0), cmplxImage_p(NULL)
+ numthreads_p(-1), pbLimit_p(0.05),sj_p(0), cmplxImage_p()
{
spectralCoord_p=SpectralCoordinate();
isIOnly=False;
@@ -105,7 +105,7 @@
pointingDirCol_p("DIRECTION"),
cfStokes_p(), cfCache_p(cfcache), cfs_p(), cfwts_p(),
convFuncCtor_p(cf),canComputeResiduals_p(False), toVis_p(True), numthreads_p(-1),
- pbLimit_p(0.05),sj_p(0), cmplxImage_p(NULL)
+ pbLimit_p(0.05),sj_p(0), cmplxImage_p()
{
spectralCoord_p=SpectralCoordinate();
isIOnly=False;
Index: synthesis/TransformMachines/MosaicFT.cc
===================================================================
--- synthesis/TransformMachines/MosaicFT.cc (revision 30403)
+++ synthesis/TransformMachines/MosaicFT.cc (working copy)
@@ -92,7 +92,7 @@
isTiled(False),
maxAbsData(0.0), centerLoc(IPosition(4,0)), offsetLoc(IPosition(4,0)),
mspc(0), msac(0), pointingToImage(0), usezero_p(usezero), convSampling(1),
- skyCoverage_p(0), machineName_p("MosaicFT"), stokes_p(stokes)
+ skyCoverage_p(), machineName_p("MosaicFT"), stokes_p(stokes)
{
convSize=0;
lastIndex_p=0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment