float h_val_f = atof(h_val); float value_f = atof(value); 
int h_val_f = atoi(h_val); int value_f = atoi(value); 
test_attr_expression(crm_data_t *expr, GHashTable *hash, pe_working_set_t *data_set){	gboolean accept = FALSE;	int cmp = 0;	const char *h_val = NULL;	const char *op      = NULL;	const char *type    = NULL;	const char *attr    = NULL;	const char *value   = NULL;		attr  = crm_element_value(expr, XML_EXPR_ATTR_ATTRIBUTE);	op    = crm_element_value(expr, XML_EXPR_ATTR_OPERATION);	value = crm_element_value(expr, XML_EXPR_ATTR_VALUE);	type  = crm_element_value(expr, XML_EXPR_ATTR_TYPE);		if(attr == NULL || op == NULL) {		pe_err("Invlaid attribute or operation in expression"			" (\'%s\' \'%s\' \'%s\')",			crm_str(attr), crm_str(op), crm_str(value));		return FALSE;	}	if(hash != NULL) {		h_val = (const char*)g_hash_table_lookup(hash, attr);	}		if(value != NULL && h_val != NULL) {		if(type == NULL || (safe_str_eq(type, "string"))) {			cmp = strcmp(h_val, value);					} else if(safe_str_eq(type, "number")) {			float h_val_f = atof(h_val);			float value_f = atof(value);						if(h_val_f < value_f) {				cmp = -1;			} else if(h_val_f > value_f)  {				cmp = 1;			} else {				cmp = 0;			}					} else if(safe_str_eq(type, "version")) {			cmp = compare_version(h_val, value);					}			} else if(value == NULL && h_val == NULL) {		cmp = 0;	} else if(value == NULL) {		cmp = 1;	} else {		cmp = -1;	}		if(safe_str_eq(op, "defined")) {		if(h_val != NULL) { accept = TRUE; }			} else if(safe_str_eq(op, "not_defined")) {		if(h_val == NULL) { accept = TRUE; }			} else if(safe_str_eq(op, "eq")) {		if((h_val == value) || cmp == 0) {			accept = TRUE;		}			} else if(safe_str_eq(op, "ne")) {		if((h_val == NULL && value != NULL)		   || (h_val != NULL && value == NULL)		   || cmp != 0) {			accept = TRUE;		}			} else if(value == NULL || h_val == NULL) {		/* the comparision is meaningless from this point on */		accept = FALSE;			} else if(safe_str_eq(op, "lt")) {		if(cmp < 0) { accept = TRUE; }			} else if(safe_str_eq(op, "lte")) {		if(cmp <= 0) { accept = TRUE; }			} else if(safe_str_eq(op, "gt")) {		if(cmp > 0) { accept = TRUE; }			} else if(safe_str_eq(op, "gte")) {		if(cmp >= 0) { accept = TRUE; }			}		return accept;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/ddaedc3752658d746e7f54aef2f182036b9a32e9/rules.c/buggy/crm/pengine/rules.c