From 5ad0671cd2f43ba00429074c7a026df26ba61663 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 9 Jul 2013 18:53:22 -0400 Subject: [PATCH] Switch to #pragma once for headers It's just less tedious, and we're GCC/LLVM specific anyways. --- src/libostree/ostree-chain-input-stream.h | 4 +--- src/libostree/ostree-checksum-input-stream.h | 4 +--- src/libostree/ostree-core.h | 6 +++--- src/libostree/ostree-diff.h | 4 +--- src/libostree/ostree-libarchive-input-stream.h | 4 +--- src/libostree/ostree-mutable-tree.h | 4 +--- src/libostree/ostree-repo-file-enumerator.h | 4 +--- src/libostree/ostree-repo-file.h | 4 +--- src/libostree/ostree-repo.h | 4 +--- src/libostree/ostree-traverse.h | 4 +--- src/libostree/ostree-types.h | 4 +--- src/libostree/ostree.h | 4 +--- src/libotutil/ot-checksum-utils.h | 5 +---- src/libotutil/ot-gio-utils.h | 4 +--- src/libotutil/ot-keyfile-utils.h | 4 +--- src/libotutil/ot-opt-utils.h | 4 +--- src/libotutil/ot-spawn-utils.h | 4 +--- src/libotutil/ot-unix-utils.h | 4 +--- src/libotutil/ot-variant-utils.h | 4 +--- src/libotutil/ot-waitable-queue.h | 4 +--- src/libotutil/otutil.h | 4 +--- src/ostree/ostree-curl-fetcher.h | 4 +--- src/ostree/ostree-fetcher.h | 4 +--- src/ostree/ostree-prune.h | 4 +--- src/ostree/ostree-pull.h | 4 +--- src/ostree/ot-admin-builtins.h | 4 +--- src/ostree/ot-admin-deploy.h | 4 +--- src/ostree/ot-admin-functions.h | 4 +--- src/ostree/ot-bootloader-syslinux.h | 4 +--- src/ostree/ot-bootloader.h | 4 +--- src/ostree/ot-builtins.h | 4 +--- src/ostree/ot-config-parser.h | 4 +--- src/ostree/ot-deployment.h | 4 +--- src/ostree/ot-main.h | 2 ++ src/ostree/ot-ordered-hash.h | 4 +--- src/switchroot/ostree-mount-util.h | 4 +--- 36 files changed, 39 insertions(+), 106 deletions(-) diff --git a/src/libostree/ostree-chain-input-stream.h b/src/libostree/ostree-chain-input-stream.h index ac9a8ac5..dbfea36d 100644 --- a/src/libostree/ostree-chain-input-stream.h +++ b/src/libostree/ostree-chain-input-stream.h @@ -19,8 +19,7 @@ * */ -#ifndef __OSTREE_CHAIN_INPUT_STREAM_H__ -#define __OSTREE_CHAIN_INPUT_STREAM_H__ +#pragma once #include @@ -64,4 +63,3 @@ OstreeChainInputStream * ostree_chain_input_stream_new (GPtrArray *stre G_END_DECLS -#endif /* __OSTREE_CHAIN_INPUT_STREAM_H__ */ diff --git a/src/libostree/ostree-checksum-input-stream.h b/src/libostree/ostree-checksum-input-stream.h index 32676b07..88b1a0a2 100644 --- a/src/libostree/ostree-checksum-input-stream.h +++ b/src/libostree/ostree-checksum-input-stream.h @@ -19,8 +19,7 @@ * */ -#ifndef __OSTREE_CHECKSUM_INPUT_STREAM_H__ -#define __OSTREE_CHECKSUM_INPUT_STREAM_H__ +#pragma once #include @@ -65,4 +64,3 @@ OstreeChecksumInputStream * ostree_checksum_input_stream_new (GInputStr G_END_DECLS -#endif /* __OSTREE_CHECKSUM_INPUT_STREAM_H__ */ diff --git a/src/libostree/ostree-core.h b/src/libostree/ostree-core.h index 93ec5ec7..c9402507 100644 --- a/src/libostree/ostree-core.h +++ b/src/libostree/ostree-core.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_CORE -#define _OSTREE_CORE +#pragma once #include @@ -308,4 +307,5 @@ gboolean ostree_validate_structureof_dirtree (GVariant *index, gboolean ostree_validate_structureof_dirmeta (GVariant *index, GError **error); -#endif /* _OSTREE_REPO */ + +G_END_DECLS diff --git a/src/libostree/ostree-diff.h b/src/libostree/ostree-diff.h index ba6d63f9..c193e948 100644 --- a/src/libostree/ostree-diff.h +++ b/src/libostree/ostree-diff.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_DIFF -#define _OSTREE_DIFF +#pragma once #include "ostree-core.h" #include "ostree-types.h" @@ -62,4 +61,3 @@ void ostree_diff_print (GFile *a, G_END_DECLS -#endif /* _OSTREE_REPO */ diff --git a/src/libostree/ostree-libarchive-input-stream.h b/src/libostree/ostree-libarchive-input-stream.h index e31b1ecb..df18c054 100644 --- a/src/libostree/ostree-libarchive-input-stream.h +++ b/src/libostree/ostree-libarchive-input-stream.h @@ -20,8 +20,7 @@ * Author: Alexander Larsson */ -#ifndef __OSTREE_LIBARCHIVE_INPUT_STREAM_H__ -#define __OSTREE_LIBARCHIVE_INPUT_STREAM_H__ +#pragma once #include @@ -65,4 +64,3 @@ GInputStream * ostree_libarchive_input_stream_new (struct archive *a); G_END_DECLS -#endif /* __OSTREE_LIBARCHIVE_INPUT_STREAM_H__ */ diff --git a/src/libostree/ostree-mutable-tree.h b/src/libostree/ostree-mutable-tree.h index 643c6fb9..a288b1a1 100644 --- a/src/libostree/ostree-mutable-tree.h +++ b/src/libostree/ostree-mutable-tree.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_MUTABLE_TREE -#define _OSTREE_MUTABLE_TREE +#pragma once #include "ostree-types.h" @@ -94,4 +93,3 @@ GHashTable * ostree_mutable_tree_get_files (OstreeMutableTree *self); G_END_DECLS -#endif diff --git a/src/libostree/ostree-repo-file-enumerator.h b/src/libostree/ostree-repo-file-enumerator.h index 4c3d2245..6acf1006 100644 --- a/src/libostree/ostree-repo-file-enumerator.h +++ b/src/libostree/ostree-repo-file-enumerator.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_REPO_FILE_ENUMERATOR -#define _OSTREE_REPO_FILE_ENUMERATOR +#pragma once #include "ostree-repo-file.h" @@ -54,4 +53,3 @@ GFileEnumerator * _ostree_repo_file_enumerator_new (OstreeRepoFile *d G_END_DECLS -#endif diff --git a/src/libostree/ostree-repo-file.h b/src/libostree/ostree-repo-file.h index b8cc23c6..8541641f 100644 --- a/src/libostree/ostree-repo-file.h +++ b/src/libostree/ostree-repo-file.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_REPO_FILE -#define _OSTREE_REPO_FILE +#pragma once #include "ostree-types.h" @@ -96,4 +95,3 @@ GVariant *ostree_repo_file_tree_get_metadata (OstreeRepoFile *self); G_END_DECLS -#endif diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h index 6417b917..6a694ee5 100644 --- a/src/libostree/ostree-repo.h +++ b/src/libostree/ostree-repo.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_REPO -#define _OSTREE_REPO +#pragma once #include "ostree-core.h" #include "ostree-types.h" @@ -320,4 +319,3 @@ gboolean ostree_repo_list_objects (OstreeRepo *self, G_END_DECLS -#endif /* _OSTREE_REPO */ diff --git a/src/libostree/ostree-traverse.h b/src/libostree/ostree-traverse.h index 9d5cb7f0..59a9adea 100644 --- a/src/libostree/ostree-traverse.h +++ b/src/libostree/ostree-traverse.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_TRAVERSE -#define _OSTREE_TRAVERSE +#pragma once #include "ostree-core.h" #include "ostree-types.h" @@ -45,4 +44,3 @@ gboolean ostree_traverse_commit (OstreeRepo *repo, G_END_DECLS -#endif /* _OSTREE_REPO */ diff --git a/src/libostree/ostree-types.h b/src/libostree/ostree-types.h index af1ae0dc..5370aac7 100644 --- a/src/libostree/ostree-types.h +++ b/src/libostree/ostree-types.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef _OSTREE_TYPES -#define _OSTREE_TYPES +#pragma once #include @@ -36,4 +35,3 @@ typedef struct OstreeRepoFile OstreeRepoFile; G_END_DECLS -#endif diff --git a/src/libostree/ostree.h b/src/libostree/ostree.h index 3734af66..ea75f6f7 100644 --- a/src/libostree/ostree.h +++ b/src/libostree/ostree.h @@ -20,7 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_H__ +#pragma once #include #include @@ -30,5 +30,3 @@ #include #include #include - -#endif diff --git a/src/libotutil/ot-checksum-utils.h b/src/libotutil/ot-checksum-utils.h index 67ff9dba..7778ed09 100644 --- a/src/libotutil/ot-checksum-utils.h +++ b/src/libotutil/ot-checksum-utils.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_CHECKSUM_UTILS_H__ -#define __OSTREE_CHECKSUM_UTILS_H__ +#pragma once #include @@ -65,5 +64,3 @@ guchar * ot_gio_checksum_stream_finish (GInputStream *in, GError **error); G_END_DECLS - -#endif diff --git a/src/libotutil/ot-gio-utils.h b/src/libotutil/ot-gio-utils.h index 5ebf04a3..184c770b 100644 --- a/src/libotutil/ot-gio-utils.h +++ b/src/libotutil/ot-gio-utils.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_GIO_UTILS_H__ -#define __OSTREE_GIO_UTILS_H__ +#pragma once #include @@ -81,4 +80,3 @@ gboolean ot_gfile_atomic_symlink_swap (GFile *path, G_END_DECLS -#endif diff --git a/src/libotutil/ot-keyfile-utils.h b/src/libotutil/ot-keyfile-utils.h index b5fb74da..057cc638 100644 --- a/src/libotutil/ot-keyfile-utils.h +++ b/src/libotutil/ot-keyfile-utils.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_KEYFILE_UTILS_H__ -#define __OSTREE_KEYFILE_UTILS_H__ +#pragma once #include @@ -46,4 +45,3 @@ ot_keyfile_get_value_with_default (GKeyFile *keyfile, G_END_DECLS -#endif diff --git a/src/libotutil/ot-opt-utils.h b/src/libotutil/ot-opt-utils.h index fdcfd331..d538d529 100644 --- a/src/libotutil/ot-opt-utils.h +++ b/src/libotutil/ot-opt-utils.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_OPT_UTILS_H__ -#define __OSTREE_OPT_UTILS_H__ +#pragma once #include @@ -31,4 +30,3 @@ void ot_util_usage_error (GOptionContext *context, const char *message, GError * G_END_DECLS -#endif diff --git a/src/libotutil/ot-spawn-utils.h b/src/libotutil/ot-spawn-utils.h index 4e85fc85..158bd261 100644 --- a/src/libotutil/ot-spawn-utils.h +++ b/src/libotutil/ot-spawn-utils.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_SPAWN_UTILS_H__ -#define __OSTREE_SPAWN_UTILS_H__ +#pragma once #include @@ -33,4 +32,3 @@ GThreadPool * ot_thread_pool_new_nproc (GFunc func, G_END_DECLS -#endif diff --git a/src/libotutil/ot-unix-utils.h b/src/libotutil/ot-unix-utils.h index 58dd59b5..ed15379f 100644 --- a/src/libotutil/ot-unix-utils.h +++ b/src/libotutil/ot-unix-utils.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_UNIX_UTILS_H__ -#define __OSTREE_UNIX_UTILS_H__ +#pragma once #include @@ -51,4 +50,3 @@ void ot_util_set_error_from_errno (GError **error, gint saved_errno); G_END_DECLS -#endif diff --git a/src/libotutil/ot-variant-utils.h b/src/libotutil/ot-variant-utils.h index 1dec5c47..e8f8f5ff 100644 --- a/src/libotutil/ot-variant-utils.h +++ b/src/libotutil/ot-variant-utils.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_VARIANT_UTILS_H__ -#define __OSTREE_VARIANT_UTILS_H__ +#pragma once #include @@ -56,4 +55,3 @@ GInputStream *ot_variant_read (GVariant *variant); G_END_DECLS -#endif diff --git a/src/libotutil/ot-waitable-queue.h b/src/libotutil/ot-waitable-queue.h index 0fcd7de8..9f23c8f8 100644 --- a/src/libotutil/ot-waitable-queue.h +++ b/src/libotutil/ot-waitable-queue.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_WAITABLE_QUEUE_H__ -#define __OSTREE_WAITABLE_QUEUE_H__ +#pragma once #include @@ -44,4 +43,3 @@ void ot_waitable_queue_unref (OtWaitableQueue *queue); G_END_DECLS -#endif diff --git a/src/libotutil/otutil.h b/src/libotutil/otutil.h index 014e7fc2..57f32743 100644 --- a/src/libotutil/otutil.h +++ b/src/libotutil/otutil.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_UTIL_H__ -#define __OSTREE_UTIL_H__ +#pragma once #include #include @@ -48,4 +47,3 @@ void ot_ptrarray_add_many (GPtrArray *a, ...) G_GNUC_NULL_TERMINATED; -#endif diff --git a/src/ostree/ostree-curl-fetcher.h b/src/ostree/ostree-curl-fetcher.h index d7276aac..2351ea6f 100644 --- a/src/ostree/ostree-curl-fetcher.h +++ b/src/ostree/ostree-curl-fetcher.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef _OSTREE_CURL_FETCHER -#define _OSTREE_CURL_FETCHER +#pragma once #include @@ -56,4 +55,3 @@ GFile *ostree_curl_fetcher_request_uri_finish (OstreeCurlFetcher *self, G_END_DECLS -#endif diff --git a/src/ostree/ostree-fetcher.h b/src/ostree/ostree-fetcher.h index 4692f6a0..8be7b01f 100644 --- a/src/ostree/ostree-fetcher.h +++ b/src/ostree/ostree-fetcher.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef _OSTREE_FETCHER -#define _OSTREE_FETCHER +#pragma once #define LIBSOUP_USE_UNSTABLE_REQUEST_API #include @@ -71,4 +70,3 @@ GFile *ostree_fetcher_request_uri_finish (OstreeFetcher *self, G_END_DECLS -#endif diff --git a/src/ostree/ostree-prune.h b/src/ostree/ostree-prune.h index a5ce9350..882fb603 100644 --- a/src/ostree/ostree-prune.h +++ b/src/ostree/ostree-prune.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __OT_PRUNE_H__ -#define __OT_PRUNE_H__ +#pragma once #include "ostree.h" @@ -42,4 +41,3 @@ gboolean ostree_prune (OstreeRepo *repo, G_END_DECLS -#endif /* __OT_PRUNE_H__ */ diff --git a/src/ostree/ostree-pull.h b/src/ostree/ostree-pull.h index bf287502..ee6927ee 100644 --- a/src/ostree/ostree-pull.h +++ b/src/ostree/ostree-pull.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __OT_PULL_H__ -#define __OT_PULL_H__ +#pragma once #include "ostree.h" @@ -39,4 +38,3 @@ gboolean ostree_pull (OstreeRepo *repo, G_END_DECLS -#endif /* __OT_PRUNE_H__ */ diff --git a/src/ostree/ot-admin-builtins.h b/src/ostree/ot-admin-builtins.h index 307e0e26..29392282 100644 --- a/src/ostree/ot-admin-builtins.h +++ b/src/ostree/ot-admin-builtins.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OT_ADMIN_BUILTINS__ -#define __OT_ADMIN_BUILTINS__ +#pragma once #include @@ -42,4 +41,3 @@ gboolean ot_admin_builtin_upgrade (int argc, char **argv, OtAdminBuiltinOpts *ad G_END_DECLS -#endif diff --git a/src/ostree/ot-admin-deploy.h b/src/ostree/ot-admin-deploy.h index 1eab703c..d5dfa833 100644 --- a/src/ostree/ot-admin-deploy.h +++ b/src/ostree/ot-admin-deploy.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OT_ADMIN_DEPLOY__ -#define __OT_ADMIN_DEPLOY_ +#pragma once #include #include "ot-deployment.h" @@ -48,4 +47,3 @@ gboolean ot_admin_deploy (GFile *sysroot, G_END_DECLS -#endif diff --git a/src/ostree/ot-admin-functions.h b/src/ostree/ot-admin-functions.h index 21195b56..a7714728 100644 --- a/src/ostree/ot-admin-functions.h +++ b/src/ostree/ot-admin-functions.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OT_ADMIN_FUNCTIONS__ -#define __OT_ADMIN_FUNCTIONS__ +#pragma once #include #include "ostree.h" @@ -120,4 +119,3 @@ GKeyFile *ot_origin_new_from_refspec (const char *refspec); G_END_DECLS -#endif diff --git a/src/ostree/ot-bootloader-syslinux.h b/src/ostree/ot-bootloader-syslinux.h index 8a810895..3324b781 100644 --- a/src/ostree/ot-bootloader-syslinux.h +++ b/src/ostree/ot-bootloader-syslinux.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __OT_BOOTLOADER_SYSLINUX_H__ -#define __OT_BOOTLOADER_SYSLINUX_H__ +#pragma once #include "ot-bootloader.h" @@ -37,4 +36,3 @@ OtBootloaderSyslinux * ot_bootloader_syslinux_new (GFile *sysroot); G_END_DECLS -#endif /* __OT_BOOTLOADER_SYSLINUX_H__ */ diff --git a/src/ostree/ot-bootloader.h b/src/ostree/ot-bootloader.h index 6043b83c..098291a8 100644 --- a/src/ostree/ot-bootloader.h +++ b/src/ostree/ot-bootloader.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __OT_BOOTLOADER_H__ -#define __OT_BOOTLOADER_H__ +#pragma once #include @@ -56,4 +55,3 @@ gboolean ot_bootloader_write_config (OtBootloader *self, G_END_DECLS -#endif /* __OT_BOOTLOADER_H__ */ diff --git a/src/ostree/ot-builtins.h b/src/ostree/ot-builtins.h index 9847c5a4..6719f0f2 100644 --- a/src/ostree/ot-builtins.h +++ b/src/ostree/ot-builtins.h @@ -20,8 +20,7 @@ * Author: Colin Walters */ -#ifndef __OSTREE_BUILTINS__ -#define __OSTREE_BUILTINS__ +#pragma once #include @@ -50,4 +49,3 @@ gboolean ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, G_END_DECLS -#endif diff --git a/src/ostree/ot-config-parser.h b/src/ostree/ot-config-parser.h index 8b7b47a9..37424faa 100644 --- a/src/ostree/ot-config-parser.h +++ b/src/ostree/ot-config-parser.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __OT_CONFIG_PARSER_H__ -#define __OT_CONFIG_PARSER_H__ +#pragma once #include @@ -55,4 +54,3 @@ const char *ot_config_parser_get (OtConfigParser *self, G_END_DECLS -#endif /* __OT_CONFIG_PARSER_H__ */ diff --git a/src/ostree/ot-deployment.h b/src/ostree/ot-deployment.h index 66470d46..bb9a3c07 100644 --- a/src/ostree/ot-deployment.h +++ b/src/ostree/ot-deployment.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __OT_DEPLOYMENT_H__ -#define __OT_DEPLOYMENT_H__ +#pragma once #include #include "ot-config-parser.h" @@ -63,4 +62,3 @@ OtDeployment *ot_deployment_clone (OtDeployment *self); G_END_DECLS -#endif /* __OT_DEPLOYMENT_H__ */ diff --git a/src/ostree/ot-main.h b/src/ostree/ot-main.h index f7e632b0..c7981b50 100644 --- a/src/ostree/ot-main.h +++ b/src/ostree/ot-main.h @@ -20,6 +20,8 @@ * Author: Colin Walters */ +#pragma once + #include typedef enum { diff --git a/src/ostree/ot-ordered-hash.h b/src/ostree/ot-ordered-hash.h index a3a4ef82..1a3aa09b 100644 --- a/src/ostree/ot-ordered-hash.h +++ b/src/ostree/ot-ordered-hash.h @@ -18,8 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#ifndef __OT_ORDERED_HASH_H__ -#define __OT_ORDERED_HASH_H__ +#pragma once #include @@ -43,4 +42,3 @@ void ot_ordered_hash_replace_key (OtOrderedHash *ohash, G_END_DECLS -#endif /* __OT_ORDERED_HASH_H__ */ diff --git a/src/switchroot/ostree-mount-util.h b/src/switchroot/ostree-mount-util.h index a6fdaffe..a149d525 100644 --- a/src/switchroot/ostree-mount-util.h +++ b/src/switchroot/ostree-mount-util.h @@ -19,9 +19,7 @@ * */ -#ifndef _OSTREE_MOUNT_UTIL_H -#define _OSTREE_MOUNT_UTIL_H +#pragma once int perrorv (const char *format, ...) __attribute__ ((format (printf, 1, 2))); -#endif