comparison Histogram.c @ 16:f4d96eaf374a

updated for VMS name chgs from VMS__malloc to VMS_int__malloc
author Me@portablequad
date Sun, 12 Feb 2012 01:45:40 -0800
parents 32489b8b763c
children cd8275f62ee1 4d9af65ad3df
comparison
equal deleted inserted replaced
11:3bb1824c33a7 12:f182ad11c6fa
27 */ 27 */
28 28
29 29
30 Histogram * 30 Histogram *
31 makeHistogram( int32 numBins, int32 startOfRange, int32 endOfRange ) 31 makeHistogram( int32 numBins, int32 startOfRange, int32 endOfRange )
32
33 { 32 {
34 Histogram *hist; 33 Histogram *hist;
35 int32 i; 34 int32 i;
36 35
37 36
38 hist = VMS__malloc( sizeof(Histogram) ); 37 hist = VMS_int__malloc( sizeof(Histogram) );
39 hist->bins = VMS__malloc( numBins * sizeof(int32) ); 38 hist->bins = VMS_int__malloc( numBins * sizeof(int32) );
40 39
41 hist->numBins = numBins; 40 hist->numBins = numBins;
42 hist->binWidth = (endOfRange - startOfRange) / numBins; 41 hist->binWidth = (endOfRange - startOfRange) / numBins;
43 hist->endOfRange = startOfRange + hist->binWidth * numBins; 42 hist->endOfRange = startOfRange + hist->binWidth * numBins;
44 hist->startOfRange = startOfRange; 43 hist->startOfRange = startOfRange;
70 char *name ) 69 char *name )
71 70
72 { 71 {
73 Histogram *hist; 72 Histogram *hist;
74 73
75 hist = VMS__malloc( sizeof(Histogram) ); 74 hist = VMS_int__malloc( sizeof(Histogram) );
76 hist->bins = VMS__malloc( numBins * sizeof(int32) ); 75 hist->bins = VMS_int__malloc( numBins * sizeof(int32) );
77 76
78 makeHist_helper( hist, numBins, startOfRange, binWidth,VMS__strDup(name)); 77 makeHist_helper( hist, numBins, startOfRange, binWidth,VMS_int__strDup(name));
79 78
80 return hist; 79 return hist;
81 } 80 }
82 81
83 Histogram * 82 Histogram *
344 } 343 }
345 344
346 void 345 void
347 freeHist( Histogram *hist ) 346 freeHist( Histogram *hist )
348 { 347 {
349 VMS__free( hist->bins ); 348 VMS_int__free( hist->bins );
350 VMS__free( hist->name ); 349 VMS_int__free( hist->name );
351 VMS__free( hist ); 350 VMS_int__free( hist );
352 } 351 }
353 void 352 void
354 freeHistExt( Histogram *hist ) 353 freeHistExt( Histogram *hist )
355 { 354 {
356 free( hist->bins ); 355 free( hist->bins );