Exemplo n.º 1
0
CPPPrimitiveValue CPPBoolType::Divide(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue((AsInt(inLeftValue) / AsInt(inRightValue)) == 0 ? false:true);
}
Exemplo n.º 2
0
CPPPrimitiveValue CPPBoolType::NotEqual(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue(AsInt(inLeftValue) != AsInt(inRightValue));
}
Exemplo n.º 3
0
CPPPrimitiveValue CPPBoolType::Multiply(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue((AsInt(inLeftValue) * AsInt(inRightValue)) == 0 ? false:true);
}
Exemplo n.º 4
0
CPPPrimitiveValue CPPBoolType::LessThan(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue(AsInt(inLeftValue) < AsInt(inRightValue));
}
Exemplo n.º 5
0
CPPPrimitiveValue CPPBoolType::GreaterThanOrEqual(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue(AsInt(inLeftValue) >= AsInt(inRightValue));
}
Exemplo n.º 6
0
CPPPrimitiveValue CPPBoolType::LeftByteShift(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue((AsInt(inLeftValue)<<inRightValue.mULongLongValue) == 0 ? false:true);
}
Exemplo n.º 7
0
CPPPrimitiveValue CPPBoolType::Subtract(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue((AsInt(inLeftValue) - AsInt(inRightValue)) == 0 ? false:true);
}
Exemplo n.º 8
0
CPPPrimitiveValue CPPBoolType::Modulus(const CPPPrimitiveValue& inLeftValue,const CPPPrimitiveValue& inRightValue)
{
	return BoolValue((AsInt(inLeftValue) % AsInt(inRightValue)) == 0 ? false:true);
}
Exemplo n.º 9
0
Arquivo: Rlsf.c Projeto: cran/Rlsf
SEXP
lsf_job_submit2(SEXP ctrl) {
	char *name;
	char *val;
	char *vals[100];
	int jobId, debug, i, j;
	SEXP elmt = R_NilValue;
	SEXP names = getAttrib(ctrl, R_NamesSymbol);
	struct submit submitRequest;
	struct submitReply submitReply;

	memset(&submitRequest, 0, sizeof(submitRequest));
	for (i = 0; i < LSF_RLIM_NLIMITS; i++)
		submitRequest.rLimits[i] = DEFAULT_RLIMIT;
	for (i = 0; i < length(names); i++) {
		name = CHAR(STRING_ELT(names, i));
		elmt = VECTOR_ELT(ctrl, i);
		val = CHAR(STRING_ELT(elmt, 0));
		if (0) {
		} else if (!strcmp(name, "jobName")) {
			submitRequest.options |= SUB_JOB_NAME;
			submitRequest.jobName = val;
		} else if (!strcmp(name, "queue")) {
			submitRequest.options |= SUB_QUEUE;
			submitRequest.queue = val;
		} else if (!strcmp(name, "askedHosts")){
			submitRequest.options |= SUB_HOST;
			char **chars;
			chars = (char **)calloc(length(elmt), sizeof(char *));
			for (j = 0; j < length(elmt); j++){
				val=CHAR(STRING_ELT(elmt, j));
				chars[j] = val;
			}
			submitRequest.numAskedHosts = length(elmt);
			submitRequest.askedHosts = chars;
		} else if (!strcmp(name, "resReq")){
			submitRequest.options |= SUB_RES_REQ;
			submitRequest.resReq = val;
		} else if (!strcmp(name, "rlimit_cpu")) {
			submitRequest.rLimits[LSF_RLIMIT_CPU] = atoi(val);
		} else if (!strcmp(name, "rlimit_fsize")) {
			submitRequest.rLimits[LSF_RLIMIT_FSIZE] = atoi(val);
		} else if (!strcmp(name, "rlimit_data")) {
			submitRequest.rLimits[LSF_RLIMIT_DATA] = atoi(val);
		} else if (!strcmp(name, "rlimit_stack")) {
			submitRequest.rLimits[LSF_RLIMIT_STACK] = atoi(val);
		} else if (!strcmp(name, "rlimit_core")) {
			submitRequest.rLimits[LSF_RLIMIT_CORE] = atoi(val);
		} else if (!strcmp(name, "rlimit_rss")) {
			submitRequest.rLimits[LSF_RLIMIT_RSS] = atoi(val);
		} else if (!strcmp(name, "rlimit_nofile")) {
			submitRequest.rLimits[LSF_RLIMIT_NOFILE] = atoi(val);
		} else if (!strcmp(name, "rlimit_open_max")) {
			submitRequest.rLimits[LSF_RLIMIT_OPEN_MAX] = atoi(val);
		} else if (!strcmp(name, "rlimit_swap")) {
			submitRequest.rLimits[LSF_RLIMIT_SWAP] = atoi(val);
		} else if (!strcmp(name, "rlimit_run")) {
			submitRequest.rLimits[LSF_RLIMIT_RUN] = atoi(val);
		} else if (!strcmp(name, "rlimit_process")) {
			submitRequest.rLimits[LSF_RLIMIT_PROCESS] = atoi(val);
		} else if (!strcmp(name, "hostSpec")) {
			submitRequest.options |= SUB_HOST_SPEC;
			submitRequest.hostSpec = val;
		} else if (!strcmp(name, "numProcessors")){
			submitRequest.numProcessors = atoi(val);
		} else if (!strcmp(name, "dependCond")){
			submitRequest.options |= SUB_DEPEND_COND;
			submitRequest.dependCond = val;
		} else if (!strcmp(name, "beginTime")) {
			submitRequest.beginTime = atoi(val);
		} else if (!strcmp(name, "termTime")) {
			submitRequest.termTime = atoi(val);
		} else if (!strcmp(name, "sigValue")) {
			submitRequest.options |= SUB_WINDOW_SIG;
			submitRequest.sigValue= atoi(val);
		} else if (!strcmp(name, "command")){
			submitRequest.command = val;
		} else if (!strcmp(name, "inFile")){
			submitRequest.options |= SUB_IN_FILE;
			submitRequest.inFile = val;
		} else if (!strcmp(name, "outFile")){
			submitRequest.options |= SUB_OUT_FILE;
			submitRequest.outFile = val;
		} else if (!strcmp(name, "errFile")){
			submitRequest.options |= SUB_ERR_FILE;
			submitRequest.errFile = val;
		} else if (!strcmp(name, "chkpntPeriod")){
			submitRequest.options |= SUB_CHKPNTABLE;
			submitRequest.options |= SUB_CHKPNT_PERIOD;
			submitRequest.chkpntPeriod = atoi(val);
		} else if (!strcmp(name, "chkpntDir")){
			submitRequest.options |= SUB_CHKPNTABLE;
			submitRequest.options |= SUB_CHKPNT_DIR;
			submitRequest.chkpntDir = val;
		} else if (!strcmp(name, "xFile")){
			/*not implemented*/
			/* SUB_OTHER_FILES probably should be set  */
			/* submitRequest.nxf should be assigned */
		} else if (!strcmp(name, "preExecCmd")){
			submitRequest.options |= SUB_PRE_EXEC;
			submitRequest.preExecCmd = val;
		} else if (!strcmp(name, "mailUser")){
			submitRequest.options |= SUB_MAIL_USER;
			submitRequest.mailUser = val;
		} else if (!strcmp(name, "delOptions")){
			submitRequest.delOptions = atoi(val);
		} else if (!strcmp(name, "projectName")){
			submitRequest.options |= SUB_PROJECT_NAME;
			submitRequest.projectName = val;
		} else if (!strcmp(name, "maxNumProcessors")){
			submitRequest.maxNumProcessors = atoi(val);
		} else if (!strcmp(name, "loginShell")){
			submitRequest.options |= SUB_LOGIN_SHELL; 
			submitRequest.loginShell = val; }
		else if (!strcmp(name, "userGroup")){
			submitRequest.options |= SUB_USER_GROUP;
			submitRequest.loginShell = val;
		} else if (!strcmp(name, "exceptList")){
			submitRequest.exceptList = val;
		} else if (!strcmp(name, "exclusive")){
			submitRequest.options |= SUB_EXCLUSIVE;
		} else if (!strcmp(name, "notifyBegin")){
			submitRequest.options |= SUB_NOTIFY_BEGIN; 
		} else if (!strcmp(name, "notifyEnd")){
			submitRequest.options |= SUB_NOTIFY_END; 
		} else if (!strcmp(name, "restart")){
			submitRequest.options |= SUB_RESTART;
		} else if (!strcmp(name, "restartForce")){
			submitRequest.options |= SUB_RESTART_FORCE;
		} else if (!strcmp(name, "rerunnable")){
			submitRequest.options |= SUB_RERUNNABLE;
		/*} else if (!strcmp(name, "chkpnt_copy")){
			submitRequest.options |= SUB_CHKPNT_COPY;*/
		/*} else if (!strcmp(name, "chkpnt_force")){
			submitRequest.options |= SUB_CHKPNT_FORCE;*/
		} else if (!strcmp(name, "interactive")){
			submitRequest.options |= SUB_INTERACTIVE;
		} else if (!strcmp(name, "pty")){
			submitRequest.options |= SUB_PTY;
		} else if (!strcmp(name, "pty_shell")){
			submitRequest.options |= SUB_PTY_SHELL;
		} else if (!strcmp(name, "hold")){
			submitRequest.options2 |= SUB2_HOLD;
		} else if (!strcmp(name, "wait")){
			/* This will require forking */
			/*submitRequest.options2 |= SUB2_BSUB_BLOCK;*/
		} else if (!strcmp(name, "debug")){
			/* is debug used anymore? */
			if (val) debug = 1;
		}
		val = "";
	}

	jobId = lsb_submit(&submitRequest, &submitReply);
	if (jobId == -1) {
	 Rprintf("lsf_job_submit: lsb_submit: %s\n", lsb_sysmsg());
	 return AsInt(0);
	}
	return AsInt(jobId);
}
int Test1(const char* ptr) {
  int sum = 0;
  sum += sizeof(LEN);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(K)'
  sum += sizeof(LEN + 1);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(K)'
  sum += sizeof(sum, LEN);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(..., ...)'
  sum += sizeof(AsBool());
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
  sum += sizeof(AsInt());
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
  sum += sizeof(AsEnum());
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
  sum += sizeof(AsEnumClass());
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
  sum += sizeof(M{}.AsInt());
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
  sum += sizeof(M{}.AsEnum());
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof()' on an expression that results in an integer
  sum += sizeof(sizeof(X));
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
  sum += sizeof(LEN + sizeof(X));
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
  sum += sizeof(LEN + LEN + sizeof(X));
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
  sum += sizeof(LEN + (LEN + sizeof(X)));
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
  sum += sizeof(LEN + -sizeof(X));
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
  sum += sizeof(LEN + - + -sizeof(X));
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(sizeof(...))'
  sum += sizeof(char) / sizeof(char);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T)/sizeof(T)'
  sum += sizeof(A) / sizeof(S);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
  sum += sizeof(char) / sizeof(int);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
  sum += sizeof(char) / sizeof(A);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
  sum += sizeof(B[0]) / sizeof(A);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of 'sizeof(...)/sizeof(...)'; numerator is not a multiple of denominator
  sum += sizeof(ptr) / sizeof(char);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
  sum += sizeof(ptr) / sizeof(ptr[0]);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
  sum += sizeof(ptr) / sizeof(char*);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(P*)/sizeof(Q*)'
  sum += sizeof(ptr) / sizeof(void*);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(P*)/sizeof(Q*)'
  sum += sizeof(ptr) / sizeof(const void volatile*);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(P*)/sizeof(Q*)'
  sum += sizeof(ptr) / sizeof(char);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
  sum += sizeof(ptr) / sizeof(ptr[0]);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'
  sum += sizeof(int) * sizeof(char);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
  sum += sizeof(ptr) * sizeof(ptr[0]);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
  sum += sizeof(int) * (2 * sizeof(char));
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
  sum += (2 * sizeof(char)) * sizeof(int);
  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious 'sizeof' by 'sizeof' multiplication
  if (sizeof(A) < 0x100000) sum += 42;
  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: suspicious comparison of 'sizeof(expr)' to a constant
  if (sizeof(A) <= 0xFFFFFFFEU) sum += 42;
  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: suspicious comparison of 'sizeof(expr)' to a constant
  return sum;
}