示例#1
0
文件: ntpdc.c 项目: pexip/os-ntp
/*
 * my_delay - set delay for auth requests
 */
static void
my_delay(
	struct parse *pcmd,
	FILE *fp
	)
{
	int isneg;
	u_long val;

	if (pcmd->nargs == 0) {
		val = delay_time.l_ui * 1000 + delay_time.l_uf / 4294967;
		(void) fprintf(fp, "delay %lu ms\n", val);
	} else {
		if (pcmd->argval[0].ival < 0) {
			isneg = 1;
			val = (u_long)(-pcmd->argval[0].ival);
		} else {
			isneg = 0;
			val = (u_long)pcmd->argval[0].ival;
		}

		delay_time.l_ui = val / 1000;
		val %= 1000;
		delay_time.l_uf = val * 4294967;	/* 2**32/1000 */

		if (isneg)
		    L_NEG(&delay_time);
	}
}
示例#2
0
文件: lfpfunc.cpp 项目: benjit89/ntp
LFP
LFP::neg() const
{
	LFP tmp(*this);
	L_NEG(&tmp._v);
	return tmp;
}
示例#3
0
文件: lfpfunc.cpp 项目: benjit89/ntp
LFP
LFP::abs() const
{
	LFP tmp(*this);
	if (L_ISNEG(&tmp._v))
		L_NEG(&tmp._v);
	return tmp;
}
示例#4
0
文件: lfpfunc.c 项目: 2asoft/freebsd
l_fp
l_fp_abs(const l_fp first)
{
	l_fp temp = first;
	if (L_ISNEG(&temp))
		L_NEG(&temp);
	return temp;
}
示例#5
0
文件: lfpfunc.c 项目: 2asoft/freebsd
l_fp
l_fp_negate(const l_fp first)
{
	l_fp temp = first;
	L_NEG(&temp);

	return temp;
}
示例#6
0
文件: lfpfunc.cpp 项目: benjit89/ntp
LFP LFP::operator-() const
{
	LFP tmp(*this);
	L_NEG(&tmp._v);
	return tmp;
}