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

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