From 79703f03cde61be1023813486ed3a9521b88f689 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 16 Aug 2017 19:48:43 +0200 Subject: [PATCH] Make member variables in public structs more const. --- src/meshlink.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/meshlink.h b/src/meshlink.h index a89a6c48..8810b626 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -93,18 +93,18 @@ extern __thread meshlink_errno_t meshlink_errno; #ifndef MESHLINK_INTERNAL_H struct meshlink_handle { - char *name; ///< Textual name of ourself. It is stored in a nul-terminated C string, which is allocated by MeshLink. - void *priv; ///< Private pointer which may be set freely by the application, and is never used or modified by MeshLink. + const char *const name; ///< Textual name of ourself. It is stored in a nul-terminated C string, which is allocated by MeshLink. + void *priv; ///< Private pointer which may be set freely by the application, and is never used or modified by MeshLink. }; struct meshlink_node { - char *name; ///< Textual name of this node. It is stored in a nul-terminated C string, which is allocated by MeshLink. - void *priv; ///< Private pointer which may be set freely by the application, and is never used or modified by MeshLink. + const char *const name; ///< Textual name of this node. It is stored in a nul-terminated C string, which is allocated by MeshLink. + void *priv; ///< Private pointer which may be set freely by the application, and is never used or modified by MeshLink. }; struct meshlink_channel { - struct meshlink_node *node; ///< Pointer to the peer of this channel. - void *priv; ///< Private pointer which may be set freely by the application, and is never used or modified by MeshLink. + struct meshlink_node *const node; ///< Pointer to the peer of this channel. + void *priv; ///< Private pointer which may be set freely by the application, and is never used or modified by MeshLink. }; #endif // MESHLINK_INTERNAL_H -- 2.39.2