[pacman-dev] [PATCH 2/2] libalpm: rename __foo tyes to _foo

morganamilo morganamilo at archlinux.org
Mon May 3 10:58:22 UTC 2021


__foo is reserved in c and should not be used.
---
 lib/libalpm/alpm.h      | 6 +++---
 lib/libalpm/alpm_list.h | 6 +++---
 lib/libalpm/db.h        | 2 +-
 lib/libalpm/diskspace.h | 2 +-
 lib/libalpm/graph.h     | 8 ++++----
 lib/libalpm/handle.h    | 2 +-
 lib/libalpm/package.h   | 2 +-
 lib/libalpm/pkghash.h   | 4 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 1413263b..988ba691 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -78,7 +78,7 @@ extern "C" {
  * This struct represents an instance of libalpm.
  * @ingroup libalpm_handle
  */
-typedef struct __alpm_handle_t alpm_handle_t;
+typedef struct _alpm_handle_t alpm_handle_t;
 
 /** A database.
  *
@@ -98,7 +98,7 @@ typedef struct __alpm_handle_t alpm_handle_t;
  * Databases are automatically unregistered when the \link alpm_handle_t \endlink is released.
  * @ingroup libalpm_databases
  */
-typedef struct __alpm_db_t alpm_db_t;
+typedef struct _alpm_db_t alpm_db_t;
 
 
 /** A package.
@@ -111,7 +111,7 @@ typedef struct __alpm_db_t alpm_db_t;
  * to be added or removed from the system.
  * @ingroup libalpm_packages
  */
-typedef struct __alpm_pkg_t alpm_pkg_t;
+typedef struct _alpm_pkg_t alpm_pkg_t;
 
 /** The time type used by libalpm. Represents a unix time stamp
  * @ingroup libalpm_misc */
diff --git a/lib/libalpm/alpm_list.h b/lib/libalpm/alpm_list.h
index 7f95feac..dd017b6e 100644
--- a/lib/libalpm/alpm_list.h
+++ b/lib/libalpm/alpm_list.h
@@ -48,13 +48,13 @@ extern "C" {
  */
 
 /** A doubly linked list */
-typedef struct __alpm_list_t {
+typedef struct _alpm_list_t {
 	/** data held by the list node */
 	void *data;
 	/** pointer to the previous node */
-	struct __alpm_list_t *prev;
+	struct _alpm_list_t *prev;
 	/** pointer to the next node */
-	struct __alpm_list_t *next;
+	struct _alpm_list_t *next;
 } alpm_list_t;
 
 /** Frees a list and its contents */
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index 92c69ba7..57933b82 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -62,7 +62,7 @@ struct db_operations {
 };
 
 /* Database */
-struct __alpm_db_t {
+struct _alpm_db_t {
 	alpm_handle_t *handle;
 	char *treename;
 	/* do not access directly, use _alpm_db_path(db) for lazy access */
diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h
index 8dac7bb6..5e2807cf 100644
--- a/lib/libalpm/diskspace.h
+++ b/lib/libalpm/diskspace.h
@@ -43,7 +43,7 @@ enum mount_fsinfo {
 	MOUNT_FSINFO_FAIL,
 };
 
-typedef struct __alpm_mountpoint_t {
+typedef struct _alpm_mountpoint_t {
 	/* mount point information */
 	char *mount_dir;
 	size_t mount_dir_len;
diff --git a/lib/libalpm/graph.h b/lib/libalpm/graph.h
index 8578d50d..321799ec 100644
--- a/lib/libalpm/graph.h
+++ b/lib/libalpm/graph.h
@@ -23,19 +23,19 @@
 
 #include "alpm_list.h"
 
-enum __alpm_graph_vertex_state {
+enum _alpm_graph_vertex_state {
 	ALPM_GRAPH_STATE_UNPROCESSED,
 	ALPM_GRAPH_STATE_PROCESSING,
 	ALPM_GRAPH_STATE_PROCESSED
 };
 
-typedef struct __alpm_graph_t {
+typedef struct _alpm_graph_t {
 	void *data;
-	struct __alpm_graph_t *parent; /* where did we come from? */
+	struct _alpm_graph_t *parent; /* where did we come from? */
 	alpm_list_t *children;
 	alpm_list_t *iterator; /* used for DFS without recursion */
 	off_t weight; /* weight of the node */
-	enum __alpm_graph_vertex_state state;
+	enum _alpm_graph_vertex_state state;
 } alpm_graph_t;
 
 alpm_graph_t *_alpm_graph_new(void);
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
index f2602057..2e85f283 100644
--- a/lib/libalpm/handle.h
+++ b/lib/libalpm/handle.h
@@ -51,7 +51,7 @@ do { \
 	} \
 } while(0)
 
-struct __alpm_handle_t {
+struct _alpm_handle_t {
 	/* internal usage */
 	alpm_db_t *db_local;    /* local db pointer */
 	alpm_list_t *dbs_sync;  /* List of (alpm_db_t *) */
diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h
index 9fd9be28..3332bbb3 100644
--- a/lib/libalpm/package.h
+++ b/lib/libalpm/package.h
@@ -85,7 +85,7 @@ struct pkg_operations {
  */
 extern const struct pkg_operations default_pkg_ops;
 
-struct __alpm_pkg_t {
+struct _alpm_pkg_t {
 	unsigned long name_hash;
 	char *filename;
 	char *base;
diff --git a/lib/libalpm/pkghash.h b/lib/libalpm/pkghash.h
index ff61742c..49460550 100644
--- a/lib/libalpm/pkghash.h
+++ b/lib/libalpm/pkghash.h
@@ -32,7 +32,7 @@
  * A combination of a hash table and a list, allowing for fast look-up
  * by package name but also iteration over the packages.
  */
-struct __alpm_pkghash_t {
+struct _alpm_pkghash_t {
 	/** data held by the hash table */
 	alpm_list_t **hash_table;
 	/** head node of the hash table data in normal list format */
@@ -45,7 +45,7 @@ struct __alpm_pkghash_t {
 	unsigned int limit;
 };
 
-typedef struct __alpm_pkghash_t alpm_pkghash_t;
+typedef struct _alpm_pkghash_t alpm_pkghash_t;
 
 alpm_pkghash_t *_alpm_pkghash_create(unsigned int size);
 
-- 
2.31.1


More information about the pacman-dev mailing list