comparison DblHist.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:75b14137c463 7:38c9ebd8489a
26 makeDblHistogram( int32 numBins, float64 startOfRange, float64 binWidth ) 26 makeDblHistogram( int32 numBins, float64 startOfRange, float64 binWidth )
27 { 27 {
28 DblHist *hist; 28 DblHist *hist;
29 int i; 29 int i;
30 30
31 hist = VMS_int__malloc( sizeof(DblHist) ); 31 hist = malloc( sizeof(DblHist) );
32 hist->bins = VMS_int__malloc( numBins * sizeof(int) ); 32 hist->bins = malloc( numBins * sizeof(int) );
33 33
34 hist->numBins = numBins; 34 hist->numBins = numBins;
35 hist->binWidth = binWidth; 35 hist->binWidth = binWidth;
36 hist->endOfRange = startOfRange + hist->binWidth * numBins; 36 hist->endOfRange = startOfRange + hist->binWidth * numBins;
37 hist->startOfRange = startOfRange; 37 hist->startOfRange = startOfRange;
100 100
101 101
102 void 102 void
103 freeDblHist( DblHist *hist ) 103 freeDblHist( DblHist *hist )
104 { 104 {
105 VMS_int__free( hist->bins ); 105 free( hist->bins );
106 VMS_int__free( hist ); 106 free( hist );
107 } 107 }