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/MonteCarlo4.c

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