Esempio n. 1
0
int handle_create_reserve()
{
	char name[CINDER_MAX_NAMELEN];
	char *retstr;
	unsigned int len;
	int ret;

	printf("Please enter the name for the reserve: ");
	retstr = fgets(name, sizeof(name), stdin);
	if (!retstr) {
		printf("Error reading name.\n");
		return -EINVAL;
	}
	name[CINDER_MAX_NAMELEN - 1] = 0;
	chomp(name);
	len = strlen(name) + 1;
	ret = create_reserve(name, len);
	if (ret < 0) {
		printf("Error creating reserve: %d\n", ret);
	}
	else
		printf("Created reserve with id %d\n", ret);

	return ret;
}
Esempio n. 2
0
CountedLoopReserveKit::CountedLoopReserveKit(PhaseIdealLoop* phase, IdealLoopTree *loop, bool active = true) :
  _phase(phase),
  _lpt(loop),
  _lp(NULL),
  _iff(NULL),
  _lp_reserved(NULL),
  _has_reserved(false),
  _use_new(false),
  _active(active)
  {
    create_reserve();
  };