crypto: make krb5_enomem a static inline function
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 2 Mar 2013 15:06:47 +0000 (10:06 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Mon, 4 Mar 2013 02:58:59 +0000 (18:58 -0800)
With the recent update to the imported heimdal code, krb5_enomem
is used in a few places as a simple statement that doesn't make
use of the value.  With the current definition, this triggers
compiler warnings because the statement has no effect.

Replace the definition with a static inline function that returns
the expected value.

Change-Id: I799022b69a43ab635560a1a5ea8f67f0a8f7230a
Reviewed-on: http://gerrit.openafs.org/9335
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/crypto/rfc3961/krb5_locl.h

index 4982e5f..79bf022 100644 (file)
@@ -143,7 +143,13 @@ void krb5_set_error_message(krb5_context, krb5_error_code, const char *, ...);
 krb5_error_code krb5_abortx(krb5_context, const char *, ...);
 
 #define krb5_clear_error_message(ctx)
-#define krb5_enomem(ctx) ENOMEM
+
+static_inline krb5_error_code
+krb5_enomem(krb5_context context)
+{
+    return ENOMEM;
+}
+
 
 /* Local prototypes. These are functions that we aren't admitting to in the
  * public API */