summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorNathaniel McCallum <npmccallum@redhat.com>2016-05-24 10:18:43 -0400
committerMartin Basti <mbasti@redhat.com>2016-05-29 14:04:45 +0200
commit4bafba06f2b8cc51cd95a725e1c8adf7bbf9a5fc (patch)
tree25c3e7a633daac2d6e08a7031580f9d12b0cadf4 /util
parent9cbb54db99eb1855a5c840699072ead9b6d75d04 (diff)
downloadfreeipa-4bafba06f2b8cc51cd95a725e1c8adf7bbf9a5fc.tar.gz
freeipa-4bafba06f2b8cc51cd95a725e1c8adf7bbf9a5fc.tar.xz
freeipa-4bafba06f2b8cc51cd95a725e1c8adf7bbf9a5fc.zip
Migrate from #ifndef guards to #pragma once
Using a pragma instead of guards is easier to write, less error prone and avoids name clashes (a source of very subtle bugs). This pragma is supported on almost all compilers, including all the compilers we care about: https://en.wikipedia.org/wiki/Pragma_once#Portability. This patch does not change the autogenerated files: asn1/asn1c/*.h. Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/ipa_krb5.h4
-rw-r--r--util/ipa_mspac.h5
-rw-r--r--util/ipa_pwd.h5
3 files changed, 3 insertions, 11 deletions
diff --git a/util/ipa_krb5.h b/util/ipa_krb5.h
index c2a0dde2d..60a8ced5d 100644
--- a/util/ipa_krb5.h
+++ b/util/ipa_krb5.h
@@ -1,5 +1,4 @@
-#ifndef __IPA_KRB5_H_
-#define __IPA_KRB5_H_
+#pragma once
#include <lber.h>
#include <krb5/krb5.h>
@@ -83,4 +82,3 @@ int create_keys(krb5_context krbctx,
char **err_msg);
int ipa_kstuples_to_string(krb5_key_salt_tuple *kst, int n_kst, char **str);
-#endif /* __IPA_KRB5_H_ */
diff --git a/util/ipa_mspac.h b/util/ipa_mspac.h
index 152317b18..00a8f0d31 100644
--- a/util/ipa_mspac.h
+++ b/util/ipa_mspac.h
@@ -1,5 +1,4 @@
-#ifndef __IPA_MSPAC_H_
-#define __IPA_MSPAC_H_
+#pragma once
char *ipa_mspac_well_known_sids[] = {
"S-1-0",
@@ -28,5 +27,3 @@ char *ipa_mspac_well_known_sids[] = {
"S-1-5-20",
NULL
};
-
-#endif /* __IPA_MSPAC_H_ */
diff --git a/util/ipa_pwd.h b/util/ipa_pwd.h
index bc07549cc..15041c4e5 100644
--- a/util/ipa_pwd.h
+++ b/util/ipa_pwd.h
@@ -20,8 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _IPA_PWD_H_
-#define _IPA_PWD_H_
+#pragma once
/* 90 days default pwd max lifetime */
#define IPAPWD_DEFAULT_PWDLIFE (90 * 24 *3600)
@@ -75,5 +74,3 @@ int ipapwd_generate_new_history(char *password,
int *new_pwd_hlen);
int encode_nt_key(char *newPasswd, uint8_t *nt_key);
-
-#endif