static int ConfigStringToKey( const char * );
static char *ConfigKeyToString( int );
-static inline void freenull (const void *p)
-{
- if (p != NULL)
- free ((void *)p);
-}
-
static inline char *strdupnull (const char *src)
{
if (src == NULL)
if (IsConfigStringType (p_item->i_type))
{
- freenull (p_item->value.psz);
- freenull (p_item->orig.psz);
- freenull (p_item->saved.psz);
+ free ((char *)p_item->value.psz);
+ free ((char *)p_item->orig.psz);
+ free ((char *)p_item->saved.psz);
}
if( p_item->i_list )
else
if (IsConfigStringType (p_module->p_config[i].i_type))
{
- freenull (p_module->p_config[i].value.psz);
+ free ((char *)p_module->p_config[i].value.psz);
p_module->p_config[i].value.psz =
strdupnull (p_module->p_config[i].orig.psz);
}
psz_key = ConfigKeyToString( i_value );
fprintf( file, "%s=%s\n", p_item->psz_name,
psz_key ? psz_key : "" );
- freenull (psz_key);
+ free (psz_key);
p_item->saved.i = i_value;
break;
if( b_autosave && !p_item->b_autosave ) break;
- freenull (p_item->saved.psz);
+ free ((char *)p_item->saved.psz);
if( (psz_value && p_item->orig.psz &&
strcmp( psz_value, p_item->orig.psz )) ||
!psz_value || !p_item->orig.psz)