comparison Histogram.c @ 15:32489b8b763c

added MC_shared brch
author Me@portablequad
date Sat, 11 Feb 2012 19:20:37 -0800
parents 1fbaedaac2c7
children f4d96eaf374a
comparison
equal deleted inserted replaced
10:4c6bac8365ea 11:3bb1824c33a7
33 { 33 {
34 Histogram *hist; 34 Histogram *hist;
35 int32 i; 35 int32 i;
36 36
37 37
38 hist = malloc( sizeof(Histogram) ); 38 hist = VMS__malloc( sizeof(Histogram) );
39 hist->bins = malloc( numBins * sizeof(int32) ); 39 hist->bins = VMS__malloc( numBins * sizeof(int32) );
40 40
41 hist->numBins = numBins; 41 hist->numBins = numBins;
42 hist->binWidth = (endOfRange - startOfRange) / numBins; 42 hist->binWidth = (endOfRange - startOfRange) / numBins;
43 hist->endOfRange = startOfRange + hist->binWidth * numBins; 43 hist->endOfRange = startOfRange + hist->binWidth * numBins;
44 hist->startOfRange = startOfRange; 44 hist->startOfRange = startOfRange;
70 char *name ) 70 char *name )
71 71
72 { 72 {
73 Histogram *hist; 73 Histogram *hist;
74 74
75 hist = malloc( sizeof(Histogram) ); 75 hist = VMS__malloc( sizeof(Histogram) );
76 hist->bins = malloc( numBins * sizeof(int32) ); 76 hist->bins = VMS__malloc( numBins * sizeof(int32) );
77 77
78 makeHist_helper( hist, numBins, startOfRange, binWidth,strDup(name)); 78 makeHist_helper( hist, numBins, startOfRange, binWidth,VMS__strDup(name));
79 79
80 return hist; 80 return hist;
81 } 81 }
82 82
83 Histogram * 83 Histogram *
84 makeFixedBinHist( int32 numBins, int32 startOfRange, int32 binWidth, 84 makeFixedBinHistExt( int32 numBins, int32 startOfRange, int32 binWidth,
85 char *name ) 85 char *name )
86 86
87 { 87 {
88 Histogram *hist; 88 Histogram *hist;
89 89
344 } 344 }
345 345
346 void 346 void
347 freeHist( Histogram *hist ) 347 freeHist( Histogram *hist )
348 { 348 {
349 VMS__free( hist->bins );
350 VMS__free( hist->name );
351 VMS__free( hist );
352 }
353 void
354 freeHistExt( Histogram *hist )
355 {
349 free( hist->bins ); 356 free( hist->bins );
350 free( hist->name ); 357 free( hist->name );
351 free( hist ); 358 free( hist );
352 } 359 }