From: Ken Raeburn Date: Wed, 16 Feb 2005 19:57:15 +0000 (+0000) Subject: * init_ctx.c (init_common): Delete redundant library initialization call that X-Git-Tag: ms-bug-test-20060525~332 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cb520648a0aa4739c9605fd75293a9496e71dfed;p=krb5.git * init_ctx.c (init_common): Delete redundant library initialization call that was run only on UNIX. Test assertion that krb5_ui_8 really did get a proper 64-bit type. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17103 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index c3e43123d..cc0d58cd3 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +2005-02-16 Ken Raeburn + + * init_ctx.c (init_common): Delete redundant library + initialization call that was run only on UNIX. Test assertion + that krb5_ui_8 really did get a proper 64-bit type. + 2005-02-09 Tom Yu * gic_pwd.c (krb5_get_init_creds_password): Fix so empty password diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c index c3f66105b..3cbf99e5b 100644 --- a/src/lib/krb5/krb/init_ctx.c +++ b/src/lib/krb5/krb/init_ctx.c @@ -109,6 +109,22 @@ init_common (krb5_context *context, krb5_boolean secure) krb5_data seed; int tmp; + /* Verify some assumptions. If the assumptions hold and the + compiler is optimizing, this should result in no code being + executed. If we're guessing "unsigned long long" instead + of using uint64_t, the possibility does exist that we're + wrong. */ + { + krb5_ui_8 i64; + assert(sizeof(i64) == 8); + i64 = 0, i64--, i64 >>= 62; + assert(i64 == 3); + i64 = 1, i64 <<= 31, i64 <<= 31, i64 <<= 1; + assert(i64 != 0); + i64 <<= 1; + assert(i64 == 0); + } + retval = krb5int_initialize_library(); if (retval) return retval; @@ -128,10 +144,6 @@ init_common (krb5_context *context, krb5_boolean secure) retval = krb5_vercheck(); if (retval) return retval; -#else /* assume UNIX for now */ - retval = krb5int_initialize_library (); - if (retval) - return retval; #endif *context = 0;