Ignore:
Timestamp:
02/07/13 17:36:07 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Use CountedPtr instead of raw C pointer.


Location:
trunk/external-alma/atnf/PKSIO
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/NRODataRecord.h

    r1757 r2765  
    3838#include <vector>
    3939
    40 using namespace std ;
     40#include <casa/Utilities/CountedPtr.h>
     41
    4142
    4243// <summary>
     
    191192  //
    192193  // 2009/02/26 Takeshi Nakazato  Moved to NROReader
    193   char *LDATA ;
     194  casa::CountedPtr<char> LDATA ;
    194195  // Spectral data for FITS data
    195196  //vector<int> JDATA ;
  • trunk/external-alma/atnf/PKSIO/NRODataset.cc

    r2748 r2765  
    229229{
    230230  if ( record_ ) {
    231     if ( record_->LDATA != NULL ) {
    232       delete record_->LDATA ;
    233       record_->LDATA = NULL ;
    234     }
    235     delete record_ ;
    236231    record_ = NULL ;
    237232  }
     
    296291    return -1 ;
    297292  }
    298   if ( (int)fread( record_->LDATA, 1, dataLen_, fp_ ) != dataLen_ ) {
     293  if ( (int)fread( &(*record_->LDATA), 1, dataLen_, fp_ ) != dataLen_ ) {
    299294    //cerr << "Failed to read spectral data: " << i << endl ;
    300295    LogIO os( LogOrigin( "NRODataset", "fillRecord()", WHERE ) ) ;
     
    385380    return spec ;
    386381  }
    387   unsigned char *cdata = (unsigned char *)record->LDATA ;
     382  unsigned char *cdata = (unsigned char *)&(*record->LDATA) ;
    388383  vector<double> mscale = MLTSCF ;
    389384  double dscale = mscale[getIndex( i )] ;
Note: See TracChangeset for help on using the changeset viewer.