[glib-networking/mcatanzaro/#73] Use #pragma once



commit 0f9eae53c5b856155b571eec785a1e637ce0258c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Jun 24 11:39:49 2019 -0500

    Use #pragma once
    
    Fixes #73

 proxy/gnome/gproxyresolvergnome.h          |  5 +----
 proxy/libproxy/glibproxyresolver.h         |  5 +----
 tls/base/gtlsconnection-base.h             |  5 +----
 tls/base/gtlsinputstream.h                 |  5 +----
 tls/base/gtlsoutputstream.h                |  5 +----
 tls/gnutls/gtlsbackend-gnutls.h            |  5 +----
 tls/gnutls/gtlscertificate-gnutls.h        |  5 +----
 tls/gnutls/gtlsclientconnection-gnutls.h   |  5 +----
 tls/gnutls/gtlsconnection-gnutls.h         |  5 +----
 tls/gnutls/gtlsdatabase-gnutls.h           |  5 +----
 tls/gnutls/gtlsfiledatabase-gnutls.h       |  5 +----
 tls/gnutls/gtlsserverconnection-gnutls.h   |  5 +----
 tls/openssl/gtlsbackend-openssl.h          |  5 +----
 tls/openssl/gtlsbio.h                      |  5 +----
 tls/openssl/gtlscertificate-openssl.h      |  5 +----
 tls/openssl/gtlsclientconnection-openssl.h |  5 +----
 tls/openssl/gtlsconnection-openssl.h       |  5 +----
 tls/openssl/gtlsdatabase-openssl.h         |  5 +----
 tls/openssl/gtlsfiledatabase-openssl.h     |  5 +----
 tls/openssl/gtlsserverconnection-openssl.h |  5 +----
 tls/openssl/openssl-include.h              | 12 ++++--------
 tls/openssl/openssl-util.h                 |  7 +------
 tls/tests/mock-interaction.h               |  5 +----
 23 files changed, 26 insertions(+), 98 deletions(-)
---
diff --git a/proxy/gnome/gproxyresolvergnome.h b/proxy/gnome/gproxyresolvergnome.h
index 415d679..c2efecd 100644
--- a/proxy/gnome/gproxyresolvergnome.h
+++ b/proxy/gnome/gproxyresolvergnome.h
@@ -19,8 +19,7 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __G_PROXY_RESOLVER_GNOME_H__
-#define __G_PROXY_RESOLVER_GNOME_H__
+#pragma once
 
 #include <glib-object.h>
 #include <gio/gio.h>
@@ -34,5 +33,3 @@ G_DECLARE_FINAL_TYPE (GProxyResolverGnome, g_proxy_resolver_gnome, G, PROXY_RESO
 void  g_proxy_resolver_gnome_register (GIOModule *module);
 
 G_END_DECLS
-
-#endif /* __G_PROXY_RESOLVER_GNOME_H__ */
diff --git a/proxy/libproxy/glibproxyresolver.h b/proxy/libproxy/glibproxyresolver.h
index bbb9315..c27cdb3 100644
--- a/proxy/libproxy/glibproxyresolver.h
+++ b/proxy/libproxy/glibproxyresolver.h
@@ -21,8 +21,7 @@
  * Author: Nicolas Dufresne <nicolas dufresne collabora co uk>
  */
 
-#ifndef __G_LIBPROXY_RESOLVER_H__
-#define __G_LIBPROXY_RESOLVER_H__
+#pragma once
 
 #include <glib-object.h>
 #include <gio/gio.h>
@@ -36,5 +35,3 @@ G_DECLARE_FINAL_TYPE (GLibproxyResolver, g_libproxy_resolver, G, LIBPROXY_RESOLV
 void  g_libproxy_resolver_register (GIOModule *module);
 
 G_END_DECLS
-
-#endif /* __G_LIBPROXY_RESOLVER_H__ */
diff --git a/tls/base/gtlsconnection-base.h b/tls/base/gtlsconnection-base.h
index a24bd3f..3cbb14c 100644
--- a/tls/base/gtlsconnection-base.h
+++ b/tls/base/gtlsconnection-base.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_CONNECTION_BASE_H__
-#define __G_TLS_CONNECTION_BASE_H__
+#pragma once
 
 #include <gio/gio.h>
 
@@ -196,5 +195,3 @@ void                      GTLS_DEBUG                                    (gpointe
                                                                          ...);
 
 G_END_DECLS
-
-#endif /* __G_TLS_CONNECTION_BASE_H___ */
diff --git a/tls/base/gtlsinputstream.h b/tls/base/gtlsinputstream.h
index 5ef698d..1433138 100644
--- a/tls/base/gtlsinputstream.h
+++ b/tls/base/gtlsinputstream.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_INPUT_STREAM_H__
-#define __G_TLS_INPUT_STREAM_H__
+#pragma once
 
 #include <gio/gio.h>
 #include "gtlsconnection-base.h"
@@ -37,5 +36,3 @@ G_DECLARE_FINAL_TYPE (GTlsInputStream, g_tls_input_stream, G, TLS_INPUT_STREAM,
 GInputStream *g_tls_input_stream_new      (GTlsConnectionBase *conn);
 
 G_END_DECLS
-
-#endif /* __G_TLS_INPUT_STREAM_BASE_H___ */
diff --git a/tls/base/gtlsoutputstream.h b/tls/base/gtlsoutputstream.h
index 1e5448d..32d6e54 100644
--- a/tls/base/gtlsoutputstream.h
+++ b/tls/base/gtlsoutputstream.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_OUTPUT_STREAM_H__
-#define __G_TLS_OUTPUT_STREAM_H__
+#pragma once
 
 #include <gio/gio.h>
 #include "gtlsconnection-base.h"
@@ -37,5 +36,3 @@ G_DECLARE_FINAL_TYPE (GTlsOutputStream, g_tls_output_stream, G, TLS_OUTPUT_STREA
 GOutputStream *g_tls_output_stream_new      (GTlsConnectionBase *conn);
 
 G_END_DECLS
-
-#endif /* __G_TLS_OUTPUT_STREAM_BASE_H___ */
diff --git a/tls/gnutls/gtlsbackend-gnutls.h b/tls/gnutls/gtlsbackend-gnutls.h
index c9d2244..7b92bf3 100644
--- a/tls/gnutls/gtlsbackend-gnutls.h
+++ b/tls/gnutls/gtlsbackend-gnutls.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_BACKEND_GNUTLS_H__
-#define __G_TLS_BACKEND_GNUTLS_H__
+#pragma once
 
 #include <gio/gio.h>
 #include <gnutls/gnutls.h>
@@ -45,5 +44,3 @@ GBytes *g_tls_backend_gnutls_lookup_session (unsigned int             type,
                                              GBytes                  *session_id);
 
 G_END_DECLS
-
-#endif /* __G_TLS_BACKEND_GNUTLS_H___ */
diff --git a/tls/gnutls/gtlscertificate-gnutls.h b/tls/gnutls/gtlscertificate-gnutls.h
index c5aff43..74ad7f7 100644
--- a/tls/gnutls/gtlscertificate-gnutls.h
+++ b/tls/gnutls/gtlscertificate-gnutls.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_CERTIFICATE_GNUTLS_H__
-#define __G_TLS_CERTIFICATE_GNUTLS_H__
+#pragma once
 
 #include <gio/gio.h>
 #include <gnutls/abstract.h>
@@ -71,5 +70,3 @@ GTlsCertificateGnutls*       g_tls_certificate_gnutls_build_chain     (const gnu
                                                                        gnutls_x509_crt_fmt_t  format);
 
 G_END_DECLS
-
-#endif /* __G_TLS_CERTIFICATE_GNUTLS_H___ */
diff --git a/tls/gnutls/gtlsclientconnection-gnutls.h b/tls/gnutls/gtlsclientconnection-gnutls.h
index 87b88fc..eb72ed9 100644
--- a/tls/gnutls/gtlsclientconnection-gnutls.h
+++ b/tls/gnutls/gtlsclientconnection-gnutls.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_CLIENT_CONNECTION_GNUTLS_H__
-#define __G_TLS_CLIENT_CONNECTION_GNUTLS_H__
+#pragma once
 
 #include "gtlsconnection-gnutls.h"
 
@@ -34,5 +33,3 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (GTlsClientConnectionGnutls, g_tls_client_connection_gnutls, G, 
TLS_CLIENT_CONNECTION_GNUTLS, GTlsConnectionGnutls)
 
 G_END_DECLS
-
-#endif /* __G_TLS_CLIENT_CONNECTION_GNUTLS_H___ */
diff --git a/tls/gnutls/gtlsconnection-gnutls.h b/tls/gnutls/gtlsconnection-gnutls.h
index 182afef..d60f9e3 100644
--- a/tls/gnutls/gtlsconnection-gnutls.h
+++ b/tls/gnutls/gtlsconnection-gnutls.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_CONNECTION_GNUTLS_H__
-#define __G_TLS_CONNECTION_GNUTLS_H__
+#pragma once
 
 #include <gio/gio.h>
 #include <gnutls/abstract.h>
@@ -54,5 +53,3 @@ void     g_tls_connection_gnutls_get_certificate     (GTlsConnectionGnutls  *gnu
                                                       gnutls_privkey_t      *pkey);
 
 G_END_DECLS
-
-#endif /* __G_TLS_CONNECTION_GNUTLS_H___ */
diff --git a/tls/gnutls/gtlsdatabase-gnutls.h b/tls/gnutls/gtlsdatabase-gnutls.h
index b4b72ce..0a31dd5 100644
--- a/tls/gnutls/gtlsdatabase-gnutls.h
+++ b/tls/gnutls/gtlsdatabase-gnutls.h
@@ -24,8 +24,7 @@
  * Author: Stef Walter <stefw collabora co uk>
  */
 
-#ifndef __G_TLS_DATABASE_GNUTLS_H__
-#define __G_TLS_DATABASE_GNUTLS_H__
+#pragma once
 
 #include <gio/gio.h>
 #include <gnutls/x509.h>
@@ -52,5 +51,3 @@ struct _GTlsDatabaseGnutlsClass
 GTlsDatabaseGnutls *g_tls_database_gnutls_new (GError **error);
 
 G_END_DECLS
-
-#endif /* __G_TLS_DATABASE_GNUTLS_H___ */
diff --git a/tls/gnutls/gtlsfiledatabase-gnutls.h b/tls/gnutls/gtlsfiledatabase-gnutls.h
index 9feccc3..6eb5892 100644
--- a/tls/gnutls/gtlsfiledatabase-gnutls.h
+++ b/tls/gnutls/gtlsfiledatabase-gnutls.h
@@ -24,8 +24,7 @@
  * Author: Stef Walter <stefw collabora co uk>
  */
 
-#ifndef __G_TLS_FILE_DATABASE_GNUTLS_H__
-#define __G_TLS_FILE_DATABASE_GNUTLS_H__
+#pragma once
 
 #include <gio/gio.h>
 
@@ -40,5 +39,3 @@ G_DECLARE_FINAL_TYPE (GTlsFileDatabaseGnutls, g_tls_file_database_gnutls, G, TLS
 GTlsDatabase*                g_tls_file_database_gnutls_new                   (const gchar *anchor_file);
 
 G_END_DECLS
-
-#endif /* __G_TLS_FILE_DATABASE_GNUTLS_H___ */
diff --git a/tls/gnutls/gtlsserverconnection-gnutls.h b/tls/gnutls/gtlsserverconnection-gnutls.h
index 288dab4..5f77f35 100644
--- a/tls/gnutls/gtlsserverconnection-gnutls.h
+++ b/tls/gnutls/gtlsserverconnection-gnutls.h
@@ -22,8 +22,7 @@
  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
  */
 
-#ifndef __G_TLS_SERVER_CONNECTION_GNUTLS_H__
-#define __G_TLS_SERVER_CONNECTION_GNUTLS_H__
+#pragma once
 
 #include <gio/gio.h> 
 #include "gtlsconnection-gnutls.h"
@@ -35,5 +34,3 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE(GTlsServerConnectionGnutls, g_tls_server_connection_gnutls, G, 
TLS_SERVER_CONNECTION_GNUTLS, GTlsConnectionGnutls)
 
 G_END_DECLS
-
-#endif /* __G_TLS_SERVER_CONNECTION_GNUTLS_H___ */
diff --git a/tls/openssl/gtlsbackend-openssl.h b/tls/openssl/gtlsbackend-openssl.h
index 557691f..9e53806 100644
--- a/tls/openssl/gtlsbackend-openssl.h
+++ b/tls/openssl/gtlsbackend-openssl.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_BACKEND_OPENSSL_H__
-#define __G_TLS_BACKEND_OPENSSL_H__
+#pragma once
 
 #include <gio/gio.h>
 
@@ -37,5 +36,3 @@ G_DECLARE_FINAL_TYPE (GTlsBackendOpenssl, g_tls_backend_openssl, G, TLS_BACKEND_
 void    g_tls_backend_openssl_register       (GIOModule *module);
 
 G_END_DECLS
-
-#endif /* __G_TLS_BACKEND_OPENSSL_H___ */
diff --git a/tls/openssl/gtlsbio.h b/tls/openssl/gtlsbio.h
index 4809c17..09dccd3 100644
--- a/tls/openssl/gtlsbio.h
+++ b/tls/openssl/gtlsbio.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_BIO_H__
-#define __G_TLS_BIO_H__
+#pragma once
 
 #include <gio/gio.h>
 #include "openssl-include.h"
@@ -56,5 +55,3 @@ void       g_tls_bio_wait_available        (BIO          *bio,
                                             GCancellable *cancellable);
 
 G_END_DECLS
-
-#endif /* __G_TLS_BIO_H__ */
diff --git a/tls/openssl/gtlscertificate-openssl.h b/tls/openssl/gtlscertificate-openssl.h
index 70b322f..2072bd6 100644
--- a/tls/openssl/gtlscertificate-openssl.h
+++ b/tls/openssl/gtlscertificate-openssl.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_CERTIFICATE_OPENSSL_H__
-#define __G_TLS_CERTIFICATE_OPENSSL_H__
+#pragma once
 
 #include <gio/gio.h>
 #include "openssl-include.h"
@@ -61,5 +60,3 @@ GTlsCertificateOpenssl      *g_tls_certificate_openssl_build_chain     (X509
                                                                         STACK_OF (X509)        *chain);
 
 G_END_DECLS
-
-#endif /* __G_TLS_CERTIFICATE_OPENSSL_H___ */
diff --git a/tls/openssl/gtlsclientconnection-openssl.h b/tls/openssl/gtlsclientconnection-openssl.h
index 41ca42e..360b9d6 100644
--- a/tls/openssl/gtlsclientconnection-openssl.h
+++ b/tls/openssl/gtlsclientconnection-openssl.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_CLIENT_CONNECTION_OPENSSL_H__
-#define __G_TLS_CLIENT_CONNECTION_OPENSSL_H__
+#pragma once
 
 #include "gtlsconnection-openssl.h"
 
@@ -35,5 +34,3 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (GTlsClientConnectionOpenssl, g_tls_client_connection_openssl, G, 
TLS_CLIENT_CONNECTION_OPENSSL, GTlsConnectionOpenssl)
 
 G_END_DECLS
-
-#endif /* __G_TLS_CLIENT_CONNECTION_OPENSSL_H___ */
diff --git a/tls/openssl/gtlsconnection-openssl.h b/tls/openssl/gtlsconnection-openssl.h
index be6b9ec..7b85fdc 100644
--- a/tls/openssl/gtlsconnection-openssl.h
+++ b/tls/openssl/gtlsconnection-openssl.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_CONNECTION_OPENSSL_H__
-#define __G_TLS_CONNECTION_OPENSSL_H__
+#pragma once
 
 #include <gio/gio.h>
 
@@ -49,5 +48,3 @@ SSL *g_tls_connection_openssl_get_ssl (GTlsConnectionOpenssl *connection);
 GTlsConnectionOpenssl *g_tls_connection_openssl_get_connection_from_ssl (SSL *ssl);
 
 G_END_DECLS
-
-#endif /* __G_TLS_CONNECTION_OPENSSL_H___ */
diff --git a/tls/openssl/gtlsdatabase-openssl.h b/tls/openssl/gtlsdatabase-openssl.h
index 9d7f45e..f3203c0 100644
--- a/tls/openssl/gtlsdatabase-openssl.h
+++ b/tls/openssl/gtlsdatabase-openssl.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_DATABASE_OPENSSL_H__
-#define __G_TLS_DATABASE_OPENSSL_H__
+#pragma once
 
 #include <gio/gio.h>
 
@@ -52,5 +51,3 @@ GTlsCertificateFlags      g_tls_database_openssl_verify_ocsp_response     (GTlsD
                                                                            OCSP_RESPONSE       *resp);
 
 G_END_DECLS
-
-#endif /* __G_TLS_DATABASE_OPENSSL_H___ */
diff --git a/tls/openssl/gtlsfiledatabase-openssl.h b/tls/openssl/gtlsfiledatabase-openssl.h
index 25b645e..a077816 100644
--- a/tls/openssl/gtlsfiledatabase-openssl.h
+++ b/tls/openssl/gtlsfiledatabase-openssl.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_FILE_DATABASE_OPENSSL_H__
-#define __G_TLS_FILE_DATABASE_OPENSSL_H__
+#pragma once
 
 #include <gio/gio.h>
 
@@ -37,5 +36,3 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (GTlsFileDatabaseOpenssl, g_tls_file_database_openssl, G, TLS_FILE_DATABASE_OPENSSL, 
GTlsDatabaseOpenssl)
 
 G_END_DECLS
-
-#endif /* __G_TLS_FILE_DATABASE_OPENSSL_H___ */
diff --git a/tls/openssl/gtlsserverconnection-openssl.h b/tls/openssl/gtlsserverconnection-openssl.h
index 7ec2e63..565d6cd 100644
--- a/tls/openssl/gtlsserverconnection-openssl.h
+++ b/tls/openssl/gtlsserverconnection-openssl.h
@@ -23,8 +23,7 @@
  * Authors: Ignacio Casal Quinteiro
  */
 
-#ifndef __G_TLS_SERVER_CONNECTION_OPENSSL_H__
-#define __G_TLS_SERVER_CONNECTION_OPENSSL_H__
+#pragma once
 
 #include <gio/gio.h> 
 #include "gtlsconnection-openssl.h"
@@ -36,5 +35,3 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (GTlsServerConnectionOpenssl, g_tls_server_connection_openssl, G, 
TLS_SERVER_CONNECTION_OPENSSL, GTlsConnectionOpenssl)
 
 G_END_DECLS
-
-#endif /* __G_TLS_SERVER_CONNECTION_OPENSSL_H___ */
diff --git a/tls/openssl/openssl-include.h b/tls/openssl/openssl-include.h
index 7f37e53..a0083d5 100644
--- a/tls/openssl/openssl-include.h
+++ b/tls/openssl/openssl-include.h
@@ -24,16 +24,14 @@
  *          Christoph Reiter
  */
 
+#pragma once
+
+#include "glib.h"
+
 /* Due to name clashes between Windows and openssl headers we have to
  * make sure windows.h is included before openssl and that we undef the
  * clashing macros.
  */
-
-#ifndef __G_TLS_OPENSSL_INCLUDE_H__
-#define __G_TLS_OPENSSL_INCLUDE_H__
-
-#include "glib.h"
-
 #ifdef G_OS_WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -55,5 +53,3 @@
 #if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_OCSP)
 #include <openssl/ocsp.h>
 #endif
-
-#endif /* __G_TLS_OPENSSL_INCLUDE_H__ */
diff --git a/tls/openssl/openssl-util.h b/tls/openssl/openssl-util.h
index 10618cc..98a1751 100644
--- a/tls/openssl/openssl-util.h
+++ b/tls/openssl/openssl-util.h
@@ -61,8 +61,7 @@
  */
 /* X509 v3 extension utilities */
 
-#ifndef __G_TLS_OPENSSL_UTIL_H__
-#define __G_TLS_OPENSSL_UTIL_H__
+#pragma once
 
 #include "openssl-include.h"
 
@@ -93,7 +92,3 @@ int g_tls_X509_check_email(X509 *x, const char *chk, size_t chklen,
 
 int g_tls_X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,
                   unsigned int flags);
-
-#endif /* __G_TLS_OPENSSL_UTIL_H__ */
-
-
diff --git a/tls/tests/mock-interaction.h b/tls/tests/mock-interaction.h
index 875207a..2ffd38d 100644
--- a/tls/tests/mock-interaction.h
+++ b/tls/tests/mock-interaction.h
@@ -22,8 +22,7 @@
 
 #include <gio/gio.h>
 
-#ifndef __MOCK_INTERACTION_H__
-#define __MOCK_INTERACTION_H__
+#pragma once
 
 G_BEGIN_DECLS
 
@@ -40,5 +39,3 @@ GTlsInteraction *mock_interaction_new_static_error          (GQuark domain,
                                                              const gchar *message);
 
 G_END_DECLS
-
-#endif /* __MOCK_INTERACTION_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]