Ejemplo n.º 1
0
Archivo: sort_3.c Proyecto: mdambrev/42
void				tri_basic(t_content *axx)
{
	TMP_A(4) = LIST_A(3);
	LIST_I(NB_LIST + 4, 0);
	norm(axx);
	while (check_list(axx, 0) != 0)
	{
		TMP_A(3) = LIST_A(0);
		LIST_I(NB_LIST + 3, 1);
		TMP_A(8) = LIST_A(0);
		LIST_I(NB_LIST + 8, 0);
		LIST_I(NB_LIST + 8, 0);
		if (VALUE_IN(0, 0) < VALUE_IN(0, 1))
		{
			op(axx, 5);
		}
		else if (TMP_IN(3, 1) < VALUE_IN(0, 1))
		{
			op(axx, 0);
		}
		else
		{
			push_b(axx, pos_x(axx, TMP_I(4, 0)));
			LIST_I(NB_LIST + 4, 0);
		}
	}
}
Ejemplo n.º 2
0
static int qb_get_varaible_details(qb_storage *storage, qb_variable *qvar, qb_debug_variable_details **p_details) {
	qb_debug_variable_details *details = NULL;
	if(qvar) {
		details = malloc(sizeof(qb_debug_variable_details));
		if(details) {
			uint32_t i, element_count;
			qb_address *address = qvar->address;
			details->bitness = BYTE_COUNT(8, address->type);
			details->flags = 0;
			if(address->type & QB_TYPE_UNSIGNED) {
				details->flags |= QB_VAR_IS_UNSIGNED;
			}
			if(address->type >= QB_TYPE_F32) {
				details->flags |= QB_VAR_IS_FLOAT;
			} else {
				details->flags |= QB_VAR_IS_INTEGER;
			}
			if(address->flags & QB_ADDRESS_STRING) {
				details->flags |= QB_VAR_IS_STRING;
			} else if(address->flags & QB_ADDRESS_BOOLEAN) {
				details->flags |= QB_VAR_IS_BOOL;
			} else if(address->flags & QB_ADDRESS_IMAGE) {
				details->flags |= QB_VAR_IS_IMAGE;
			} else {
				if(qvar->value) {
					gdImagePtr image = qb_get_gd_image(qvar->value);
					if(image && image->trueColor) {
						details->flags |= QB_VAR_IS_IMAGE;
					}
				}
			}
			details->dimension_count = address->dimension_count;
			for(i = 0; i < QB_MAXIMUM_DIMENSION_COUNT; i++) {
				if(i < details->dimension_count) {
					details->dimensions[i] = VALUE_IN(storage, U32, address->dimension_addresses[i]);
				} else {
					details->dimensions[i] = 0;
				}
			}
			if(details->dimension_count > 0) {
				element_count = VALUE_IN(storage, U32, address->array_size_address);
			} else {
				element_count = 1;
			}
			details->byte_count = BYTE_COUNT(element_count, address->type);
			details->data = ARRAY_IN(storage, I08, address);
			details->variable = qvar;
		}
	}
	if(p_details) {
		*p_details = details;
	} else {
		qb_debug_free_variable_details(details);
	}
	return (details != NULL);
}
Ejemplo n.º 3
0
Archivo: sort_3.c Proyecto: mdambrev/42
static	void		norm(t_content *axx)
{
	TMP_A(7) = LIST_A(0);
	LIST_I(NB_LIST + 7, 0);
	TMP_A(8) = LIST_A(0);
	LIST_R(NB_LIST + 8 );
	LIST_I(NB_LIST + 8, 0);
	LIST_I(NB_LIST + 8, 0);
	if (VALUE_IN(0, 0) < TMP_IN(7, 0)
			&& VALUE_IN(0, 0) > TMP_IN(8, 0)
				&& check_list(axx, NB_LIST + 8) == 0)
	{
		op(axx, 8);
		op(axx, 8);
		op(axx, 0);
		op(axx, 5);
		op(axx, 5);
	}
}