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

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