Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Histogram
comparison FloatHist.c @ 20:cd8275f62ee1
added pure C brch
| author | Me@portablequad |
|---|---|
| date | Mon, 13 Feb 2012 12:57:42 -0800 |
| parents | f4d96eaf374a |
| children |
comparison
equal
deleted
inserted
replaced
| 6:d4e8197ce4f9 | 7:27c46ba6533b |
|---|---|
| 24 makeFloatHistogram( int32 numBins, float32 startOfRange, float32 binWidth ) | 24 makeFloatHistogram( int32 numBins, float32 startOfRange, float32 binWidth ) |
| 25 { | 25 { |
| 26 FloatHist *hist; | 26 FloatHist *hist; |
| 27 int i; | 27 int i; |
| 28 | 28 |
| 29 hist = VMS_int__malloc( sizeof(FloatHist) ); | 29 hist = malloc( sizeof(FloatHist) ); |
| 30 hist->bins = VMS_int__malloc( numBins * sizeof(int) ); | 30 hist->bins = malloc( numBins * sizeof(int) ); |
| 31 | 31 |
| 32 hist->numBins = numBins; | 32 hist->numBins = numBins; |
| 33 hist->binWidth = binWidth; | 33 hist->binWidth = binWidth; |
| 34 hist->endOfRange = startOfRange + hist->binWidth * numBins; | 34 hist->endOfRange = startOfRange + hist->binWidth * numBins; |
| 35 hist->startOfRange = startOfRange; | 35 hist->startOfRange = startOfRange; |
| 98 | 98 |
| 99 | 99 |
| 100 void | 100 void |
| 101 freeFloatHist( FloatHist *hist ) | 101 freeFloatHist( FloatHist *hist ) |
| 102 { | 102 { |
| 103 VMS_int__free( hist->bins ); | 103 free( hist->bins ); |
| 104 VMS_int__free( hist ); | 104 free( hist ); |
| 105 } | 105 } |
