mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-24 06:50:47 +02:00
glib-aux/trivial: fix indentation of code comment
This commit is contained in:
parent
db41f2afad
commit
38c57ec4b9
1 changed files with 15 additions and 15 deletions
|
|
@ -418,21 +418,21 @@ NM_G_ERROR_MSG(GError *error)
|
|||
|
||||
#if _NM_CC_SUPPORT_GENERIC
|
||||
/* these macros cast (value) to
|
||||
* - "const char **" (for "MC", mutable-const)
|
||||
* - "const char *const*" (for "CC", const-const)
|
||||
* The point is to do this cast, but only accepting pointers
|
||||
* that are compatible already.
|
||||
*
|
||||
* The problem is, if you add a function like g_strdupv(), the input
|
||||
* argument is not modified (CC), but you want to make it work also
|
||||
* for "char **". C doesn't allow this form of casting (for good reasons),
|
||||
* so the function makes a choice like g_strdupv(char**). That means,
|
||||
* every time you want to call it with a const argument, you need to
|
||||
* explicitly cast it.
|
||||
*
|
||||
* These macros do the cast, but they only accept a compatible input
|
||||
* type, otherwise they will fail compilation.
|
||||
*/
|
||||
* - "const char **" (for "MC", mutable-const)
|
||||
* - "const char *const*" (for "CC", const-const)
|
||||
* The point is to do this cast, but only accepting pointers
|
||||
* that are compatible already.
|
||||
*
|
||||
* The problem is, if you add a function like g_strdupv(), the input
|
||||
* argument is not modified (CC), but you want to make it work also
|
||||
* for "char **". C doesn't allow this form of casting (for good reasons),
|
||||
* so the function makes a choice like g_strdupv(char**). That means,
|
||||
* every time you want to call it with a const argument, you need to
|
||||
* explicitly cast it.
|
||||
*
|
||||
* These macros do the cast, but they only accept a compatible input
|
||||
* type, otherwise they will fail compilation.
|
||||
*/
|
||||
#define NM_CAST_STRV_MC(value) \
|
||||
(_Generic ((value), \
|
||||
const char * *: (const char * *) (value), \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue