Fix warnings (clang 3.6)
This commit is contained in:
@@ -608,7 +608,7 @@ _kdc_do_digest(krb5_context context,
|
||||
}
|
||||
t = p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
|
||||
|
||||
if (abs((kdc_time & 0xffffffff) - t) > context->max_skew) {
|
||||
if (labs((kdc_time & 0xffffffff) - t) > context->max_skew) {
|
||||
ret = EINVAL;
|
||||
krb5_set_error_message(context, ret, "time screw in server nonce ");
|
||||
goto out;
|
||||
|
@@ -516,7 +516,7 @@ pa_enc_chal_validate(kdc_request_t r, const PA_DATA *pa)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (abs(kdc_time - p.patimestamp) > r->context->max_skew) {
|
||||
if (labs(kdc_time - p.patimestamp) > r->context->max_skew) {
|
||||
char client_time[100];
|
||||
|
||||
krb5_crypto_destroy(r->context, challangecrypto);
|
||||
@@ -528,7 +528,7 @@ pa_enc_chal_validate(kdc_request_t r, const PA_DATA *pa)
|
||||
_kdc_r_log(r, 0, "Too large time skew, "
|
||||
"client time %s is out by %u > %u seconds -- %s",
|
||||
client_time,
|
||||
(unsigned)abs(kdc_time - p.patimestamp),
|
||||
(unsigned)labs(kdc_time - p.patimestamp),
|
||||
r->context->max_skew,
|
||||
r->client_name);
|
||||
|
||||
@@ -680,7 +680,7 @@ pa_enc_ts_validate(kdc_request_t r, const PA_DATA *pa)
|
||||
r->client_name);
|
||||
goto out;
|
||||
}
|
||||
if (abs(kdc_time - p.patimestamp) > r->context->max_skew) {
|
||||
if (labs(kdc_time - p.patimestamp) > r->context->max_skew) {
|
||||
char client_time[100];
|
||||
|
||||
krb5_format_time(r->context, p.patimestamp,
|
||||
@@ -690,7 +690,7 @@ pa_enc_ts_validate(kdc_request_t r, const PA_DATA *pa)
|
||||
_kdc_r_log(r, 0, "Too large time skew, "
|
||||
"client time %s is out by %u > %u seconds -- %s",
|
||||
client_time,
|
||||
(unsigned)abs(kdc_time - p.patimestamp),
|
||||
(unsigned)labs(kdc_time - p.patimestamp),
|
||||
r->context->max_skew,
|
||||
r->client_name);
|
||||
|
||||
|
@@ -101,7 +101,7 @@ pk_check_pkauthenticator_win2k(krb5_context context,
|
||||
krb5_timeofday (context, &now);
|
||||
|
||||
/* XXX cusec */
|
||||
if (a->ctime == 0 || abs(a->ctime - now) > context->max_skew) {
|
||||
if (a->ctime == 0 || labs(a->ctime - now) > context->max_skew) {
|
||||
krb5_clear_error_message(context);
|
||||
return KRB5KRB_AP_ERR_SKEW;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ pk_check_pkauthenticator(krb5_context context,
|
||||
krb5_timeofday (context, &now);
|
||||
|
||||
/* XXX cusec */
|
||||
if (a->ctime == 0 || abs(a->ctime - now) > context->max_skew) {
|
||||
if (a->ctime == 0 || labs(a->ctime - now) > context->max_skew) {
|
||||
krb5_clear_error_message(context);
|
||||
return KRB5KRB_AP_ERR_SKEW;
|
||||
}
|
||||
|
@@ -709,7 +709,7 @@ get_new_tickets(krb5_context context,
|
||||
}
|
||||
|
||||
if (ticket_life != 0) {
|
||||
if (abs(cred.times.endtime - cred.times.starttime - ticket_life) > 30) {
|
||||
if (labs(cred.times.endtime - cred.times.starttime - ticket_life) > 30) {
|
||||
char life[64];
|
||||
unparse_time_approx(cred.times.endtime - cred.times.starttime,
|
||||
life, sizeof(life));
|
||||
@@ -717,7 +717,7 @@ get_new_tickets(krb5_context context,
|
||||
}
|
||||
}
|
||||
if (renew_life) {
|
||||
if (abs(cred.times.renew_till - cred.times.starttime - renew) > 30) {
|
||||
if (labs(cred.times.renew_till - cred.times.starttime - renew) > 30) {
|
||||
char life[64];
|
||||
unparse_time_approx(cred.times.renew_till - cred.times.starttime,
|
||||
life, sizeof(life));
|
||||
|
@@ -29,7 +29,7 @@ mp_rand (mp_int * a, int digits)
|
||||
|
||||
/* first place a random non-zero digit */
|
||||
do {
|
||||
d = ((mp_digit) abs (rand ())) & MP_MASK;
|
||||
d = ((mp_digit) labs (rand ())) & MP_MASK;
|
||||
} while (d == 0);
|
||||
|
||||
if ((res = mp_add_d (a, d, a)) != MP_OKAY) {
|
||||
@@ -41,7 +41,7 @@ mp_rand (mp_int * a, int digits)
|
||||
return res;
|
||||
}
|
||||
|
||||
if ((res = mp_add_d (a, ((mp_digit) abs (rand ())), a)) != MP_OKAY) {
|
||||
if ((res = mp_add_d (a, ((mp_digit) labs (rand ())), a)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ int main(void)
|
||||
|
||||
// now test a random reduction
|
||||
for (ix = 0; ix < 100; ix++) {
|
||||
mp_rand(&c, 1 + abs(rand()) % (2*i));
|
||||
mp_rand(&c, 1 + labs(rand()) % (2*i));
|
||||
mp_copy(&c, &d);
|
||||
mp_copy(&c, &e);
|
||||
|
||||
@@ -286,7 +286,7 @@ printf("compare no compare!\n"); exit(EXIT_FAILURE); }
|
||||
|
||||
if (!(++cnt & 127))
|
||||
printf("%9d\r", cnt);
|
||||
mp_rand(&a, abs(rand()) % 128 + 1);
|
||||
mp_rand(&a, labs(rand()) % 128 + 1);
|
||||
mp_div(&a, &d, &b, &e);
|
||||
mp_div_3(&a, &c, &r2);
|
||||
|
||||
@@ -394,7 +394,7 @@ printf("compare no compare!\n"); exit(EXIT_FAILURE); }
|
||||
|
||||
for (;;) {
|
||||
/* randomly clear and re-init one variable, this has the affect of triming the alloc space */
|
||||
switch (abs(rand()) % 7) {
|
||||
switch (labs(rand()) % 7) {
|
||||
case 0:
|
||||
mp_clear(&a);
|
||||
mp_init(&a);
|
||||
|
@@ -163,7 +163,7 @@ mp_digit prime_digit(void)
|
||||
int n;
|
||||
mp_digit d;
|
||||
|
||||
n = abs(rand()) % n_prime;
|
||||
n = labs(rand()) % n_prime;
|
||||
fseek(primes, n * sizeof(mp_digit), SEEK_SET);
|
||||
fread(&d, 1, sizeof(mp_digit), primes);
|
||||
return d;
|
||||
|
@@ -492,7 +492,7 @@ void mp_set(mp_int *mp, mp_digit d)
|
||||
mp_err mp_set_int(mp_int *mp, long z)
|
||||
{
|
||||
int ix;
|
||||
unsigned long v = abs(z);
|
||||
unsigned long v = labs(z);
|
||||
mp_err res;
|
||||
|
||||
ARGCHK(mp != NULL, MP_BADARG);
|
||||
|
@@ -281,7 +281,7 @@ int main(void)
|
||||
printf("%s\n", buf);
|
||||
} else if (n == 13) {
|
||||
rand_num2(&a);
|
||||
tmp = abs(rand()) & THE_MASK;
|
||||
tmp = labs(rand()) & THE_MASK;
|
||||
mp_add_d(&a, tmp, &b);
|
||||
printf("add_d\n");
|
||||
mp_to64(&a, buf);
|
||||
@@ -290,7 +290,7 @@ int main(void)
|
||||
printf("%s\n", buf);
|
||||
} else if (n == 14) {
|
||||
rand_num2(&a);
|
||||
tmp = abs(rand()) & THE_MASK;
|
||||
tmp = labs(rand()) & THE_MASK;
|
||||
mp_sub_d(&a, tmp, &b);
|
||||
printf("sub_d\n");
|
||||
mp_to64(&a, buf);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
\def\gcd{{\rm gcd}}
|
||||
\def\log{{\rm log}}
|
||||
\def\ord{{\rm ord}}
|
||||
\def\abs{{\mathit abs}}
|
||||
\def\labs{{\mathit labs}}
|
||||
\def\rep{{\mathit rep}}
|
||||
\def\mod{{\mathit\ mod\ }}
|
||||
\renewcommand{\pmod}[1]{\ ({\rm mod\ }{#1})}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
\def\gcd{{\rm gcd}}
|
||||
\def\log{{\rm log}}
|
||||
\def\ord{{\rm ord}}
|
||||
\def\abs{{\mathit abs}}
|
||||
\def\labs{{\mathit labs}}
|
||||
\def\rep{{\mathit rep}}
|
||||
\def\mod{{\mathit\ mod\ }}
|
||||
\renewcommand{\pmod}[1]{\ ({\rm mod\ }{#1})}
|
||||
|
@@ -346,7 +346,7 @@ krb5_process_last_request(krb5_context context,
|
||||
|
||||
for (i = 0; i < lr->len; ++i) {
|
||||
if (lr->val[i].lr_value <= t) {
|
||||
switch (abs(lr->val[i].lr_type)) {
|
||||
switch (lr->val[i].lr_type) {
|
||||
case LR_PW_EXPTIME :
|
||||
report_expiration(context, ctx->prompter,
|
||||
ctx->prompter_data,
|
||||
@@ -361,6 +361,8 @@ krb5_process_last_request(krb5_context context,
|
||||
lr->val[i].lr_value);
|
||||
reported = TRUE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -222,7 +222,7 @@ krb5_rd_cred(krb5_context context,
|
||||
|
||||
if (enc_krb_cred_part.timestamp == NULL ||
|
||||
enc_krb_cred_part.usec == NULL ||
|
||||
abs(*enc_krb_cred_part.timestamp - sec)
|
||||
labs(*enc_krb_cred_part.timestamp - sec)
|
||||
> context->max_skew) {
|
||||
krb5_clear_error_message (context);
|
||||
ret = KRB5KRB_AP_ERR_SKEW;
|
||||
|
@@ -136,7 +136,7 @@ krb5_rd_priv(krb5_context context,
|
||||
krb5_timeofday (context, &sec);
|
||||
if (part.timestamp == NULL ||
|
||||
part.usec == NULL ||
|
||||
abs(*part.timestamp - sec) > context->max_skew) {
|
||||
labs(*part.timestamp - sec) > context->max_skew) {
|
||||
krb5_clear_error_message (context);
|
||||
ret = KRB5KRB_AP_ERR_SKEW;
|
||||
goto failure_part;
|
||||
|
@@ -409,7 +409,7 @@ krb5_verify_ap_req2(krb5_context context,
|
||||
|
||||
krb5_timeofday (context, &now);
|
||||
|
||||
if (abs(ac->authenticator->ctime - now) > context->max_skew) {
|
||||
if (labs(ac->authenticator->ctime - now) > context->max_skew) {
|
||||
ret = KRB5KRB_AP_ERR_SKEW;
|
||||
krb5_clear_error_message (context);
|
||||
goto out;
|
||||
|
@@ -159,7 +159,7 @@ krb5_rd_safe(krb5_context context,
|
||||
|
||||
if (safe.safe_body.timestamp == NULL ||
|
||||
safe.safe_body.usec == NULL ||
|
||||
abs(*safe.safe_body.timestamp - sec) > context->max_skew) {
|
||||
labs(*safe.safe_body.timestamp - sec) > context->max_skew) {
|
||||
ret = KRB5KRB_AP_ERR_SKEW;
|
||||
krb5_clear_error_message (context);
|
||||
goto failure;
|
||||
|
@@ -54,11 +54,11 @@ check_set_time(krb5_context context)
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_us_timeofday");
|
||||
|
||||
diff2 = abs(sec - tv.tv_sec);
|
||||
diff2 = labs(sec - tv.tv_sec);
|
||||
|
||||
if (diff2 < 9 || diff > 11)
|
||||
krb5_errx(context, 1, "set time error: diff: %d",
|
||||
abs(sec - tv.tv_sec));
|
||||
krb5_errx(context, 1, "set time error: diff: %ld",
|
||||
labs(sec - tv.tv_sec));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -768,12 +768,12 @@ _krb5_extract_ticket(krb5_context context,
|
||||
tmp_time = rep->enc_part.authtime;
|
||||
|
||||
if (creds->times.starttime == 0
|
||||
&& abs(tmp_time - sec_now) > context->max_skew) {
|
||||
&& labs(tmp_time - sec_now) > context->max_skew) {
|
||||
ret = KRB5KRB_AP_ERR_SKEW;
|
||||
krb5_set_error_message (context, ret,
|
||||
N_("time skew (%d) larger than max (%d)", ""),
|
||||
abs(tmp_time - sec_now),
|
||||
(int)context->max_skew);
|
||||
N_("time skew (%ld) larger than max (%ld)", ""),
|
||||
labs(tmp_time - sec_now),
|
||||
(long)context->max_skew);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@@ -1619,7 +1619,7 @@ history_search_prefix(const char *str, int direction)
|
||||
|
||||
/*
|
||||
* search for event in history containing str, starting at offset
|
||||
* abs(pos); continue backward, if pos<0, forward otherwise
|
||||
* labs(pos); continue backward, if pos<0, forward otherwise
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
|
@@ -1777,7 +1777,7 @@ verify_ntlm2(const void *key, size_t len,
|
||||
|
||||
authtime = heim_ntlm_ts2unixtime(t);
|
||||
|
||||
if (abs((int)(authtime - now)) > authtimediff) {
|
||||
if (labs((int)(authtime - now)) > authtimediff) {
|
||||
ret = HNTLM_ERR_TIME_SKEW;
|
||||
goto out;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: getcap.c,v 1.29 1999/03/29 09:27:29 abs Exp $ */
|
||||
/* $NetBSD: getcap.c,v 1.29 1999/03/29 09:27:29 labs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
|
Reference in New Issue
Block a user