diff ParamBag.c @ 9:b80587574901

fixed #include and changed VMS__malloc to VMS_WL__malloc
author Me@portablequad
date Sun, 12 Feb 2012 01:06:02 -0800
parents 1bf28dddc45f
children
line diff
     1.1 --- a/ParamBag.c	Sat Feb 11 20:08:58 2012 -0800
     1.2 +++ b/ParamBag.c	Sun Feb 12 01:06:02 2012 -0800
     1.3 @@ -13,7 +13,7 @@
     1.4  #include <stdio.h>
     1.5  #include <stdlib.h>
     1.6  
     1.7 -#include "Param.h"
     1.8 +#include "ParamBag.h"
     1.9  
    1.10  void         freeParamStruc( ParamStruc * param );
    1.11  void         freeParamBagHashEntry( ParamBagHashEntry *entry );
    1.12 @@ -24,8 +24,8 @@
    1.13   ParamBag *
    1.14  makeParamBag()
    1.15   { ParamBag * retBag;
    1.16 -   retBag = VMS__malloc( sizeof( ParamBag ) );
    1.17 -   retBag->entries = VMS__malloc( PARAM_BAG_HASHSIZE * sizeof( ParamBagHashEntry *) );
    1.18 +   retBag = VMS_WL__malloc( sizeof( ParamBag ) );
    1.19 +   retBag->entries = VMS_WL__malloc( PARAM_BAG_HASHSIZE * sizeof( ParamBagHashEntry *) );
    1.20     retBag->bagSz = PARAM_BAG_HASHSIZE;
    1.21     nullOutParamBagHashEntries( retBag );
    1.22     
    1.23 @@ -80,7 +80,7 @@
    1.24     hashEntry = lookupKeyInHash( key, bag );
    1.25     if( hashEntry == NULL )
    1.26      { hashIdx = hashKey( key, bag->bagSz );
    1.27 -      hashEntry = (ParamBagHashEntry*) VMS__malloc( sizeof( ParamBagHashEntry ) );
    1.28 +      hashEntry = (ParamBagHashEntry*) VMS_WL__malloc( sizeof( ParamBagHashEntry ) );
    1.29              if( hashEntry == NULL )  return 0;
    1.30        hashEntry->key = strdup( key );
    1.31              if( hashEntry->key == NULL ) return 0;
    1.32 @@ -118,20 +118,20 @@
    1.33  freeParamBagHashEntry( ParamBagHashEntry *entry )
    1.34   {
    1.35     freeParamStruc( entry->param );
    1.36 -   VMS__free( entry->key ); //was malloc'd above, so free it
    1.37 -   VMS__free( entry );
    1.38 +   VMS_WL__free( entry->key ); //was malloc'd above, so free it
    1.39 +   VMS_WL__free( entry );
    1.40   }
    1.41  
    1.42   void
    1.43  freeParamStruc( ParamStruc * param )
    1.44 - { if( param->type == STRING_PARAM_TYPE ) VMS__free( param->strValue );
    1.45 -   VMS__free( param );
    1.46 + { if( param->type == STRING_PARAM_TYPE ) VMS_WL__free( param->strValue );
    1.47 +   VMS_WL__free( param );
    1.48   }
    1.49  
    1.50   ParamStruc *
    1.51  makeParamStruc()
    1.52   { ParamStruc *retStruc;
    1.53 -   retStruc = VMS__malloc( sizeof( ParamStruc ) );
    1.54 +   retStruc = VMS_WL__malloc( sizeof( ParamStruc ) );
    1.55     retStruc->floatValue = 0.0;
    1.56     retStruc->intValue   = 0;
    1.57     retStruc->strValue   = NULL;
    1.58 @@ -164,7 +164,7 @@
    1.59         } break;
    1.60        case 's':
    1.61         { retParam->type = STRING_PARAM_TYPE;
    1.62 -         retParam->strValue = VMS__malloc( strlen(value) + 1);
    1.63 +         retParam->strValue = VMS_WL__malloc( strlen(value) + 1);
    1.64           strcpy( retParam->strValue, value );
    1.65           removeEndWhtSpaceFromStr( retParam->strValue );
    1.66         } break;