Ignore:
Timestamp:
Jan 31, 2012 12:13:39 PM (11 years ago)
Author:
srkline
Message:

Changes to the XOP code to upgrade to ToolKit? v6. Changes are the ones outlined in the Appendix A of the TK6 manual. SOme of the XOP support routines and the #pragma for 2-byte structures have changed. Per Howard Rodstein, there is no need to change the c files to cpp. c should work and compile just fine.

These changes work correctly on my mac. Next is to make sure that they work correctly on the two build machines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/XOP_Dev/MonteCarlo/MonteCarlo3.c

    r825 r834  
    5858        waveHndl wavH; 
    5959        //      int waveType,hState; 
    60         long numDimensions; 
    61         long dimensionSizes[MAX_DIMENSIONS+1]; 
     60        //changed for TK6 
     61        int numDimensions; 
     62        CountInt dimensionSizes[MAX_DIMENSIONS+1]; 
    6263        //      char* dataStartPtr; 
    6364        //      long dataOffset; 
     
    110111        p->retVal = 0; 
    111112         
    112         // trusting that all inputs are DOUBLE PRECISION WAVES!!! 
    113         inputWave = WaveData(p->inputWaveH); 
    114         ran_dev = WaveData(p->ran_devH); 
    115         nt = WaveData(p->ntH); 
    116         j1 = WaveData(p->j1H); 
    117         j2 = WaveData(p->j2H); 
    118         nn = WaveData(p->nnH); 
    119         //      MC_linear_data = WaveData(p->MC_linear_dataH); 
    120         results = WaveData(p->resultsH); 
     113        // trusting that all inputs are double PRECISION WAVES!!! 
     114        inputWave = (double*)WaveData(p->inputWaveH); 
     115        ran_dev = (double*)WaveData(p->ran_devH); 
     116        nt = (double*)WaveData(p->ntH); 
     117        j1 = (double*)WaveData(p->j1H); 
     118        j2 = (double*)WaveData(p->j2H); 
     119        nn = (double*)WaveData(p->nnH); 
     120        //      MC_linear_data = (double*)WaveData(p->MC_linear_dataH); 
     121        results = (double*)WaveData(p->resultsH); 
    121122         
    122123        seed = (long)results[0]; 
     
    162163                return NOWAV; 
    163164         
    164         //      waveType = WaveType(wavH); 
    165         //      if (waveType & NT_CMPLX) 
    166         //              return NO_COMPLEX_WAVE; 
    167         //      if (waveType==TEXT_WAVE_TYPE) 
    168         //              return NUMERIC_ACCESS_ON_TEXT_WAVE; 
    169         //      if (retVal = MDGetWaveDimensions(wavH, &numDimensions, dimensionSizes)) 
    170         //              return retVal; 
    171         //      numRows = dimensionSizes[0]; 
    172         //      numColumns = dimensionSizes[1]; 
    173          
    174         //      if (retVal = MDAccessNumericWaveData(wavH, kMDWaveAccessMode0, &dataOffset)) 
    175         //              return retVal; 
    176          
    177         //      hState = MoveLockHandle(wavH);          // So wave data can't move. Remember to call HSetState when done. 
    178         //      dataStartPtr = (char*)(*wavH) + dataOffset; 
    179         //      dp0 = (double*)dataStartPtr;                    // Pointer to the start of the 2D wave data. 
    180165         
    181166        //scattering power and maximum qvalue to bin 
     
    498483                return retVal; 
    499484         
    500         //      HSetState((Handle)wavH, hState);                //release the handle of the 2D data wave 
    501485        //      WaveHandleModified(wavH);                       // Inform Igor that we have changed the wave. (CALLBACK! needed, but not allowed in Threading) 
    502486         
Note: See TracChangeset for help on using the changeset viewer.