diff mbox

[RFC,v2,03/47] qapi: Simplify guardname()

Message ID 55AD30AF.5070008@redhat.com
State New
Headers show

Commit Message

Eric Blake July 20, 2015, 5:32 p.m. UTC
On 07/01/2015 02:21 PM, Markus Armbruster wrote:
> The guards around built-in declarations lose their _H.  It never made
> much sense anyway.

Correct - the _H tail on the guard for the overall file makes sense
(when the overall file ends in .h), but for an unrelated use in the
middle of the file, it has no bearing on any file name and does not need
a _H tail.

> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi.py | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

For an example of what it changes, qapi-types.h sees changes like this
(while the original #ifndef QAPI_TYPES_H guard at the front of the file
remains unchanged, which is good):

...
diff mbox

Patch

--- qapi-types.h.old	2015-07-20 10:40:19.513650697 -0600
+++ qapi-types.h	2015-07-20 11:27:15.481152848 -0600
@@ -20,8 +20,8 @@ 
 #include <stdint.h>


-#ifndef QAPI_TYPES_BUILTIN_STRUCT_DECL_H
-#define QAPI_TYPES_BUILTIN_STRUCT_DECL_H
+#ifndef QAPI_TYPES_BUILTIN_STRUCT_DECL
+#define QAPI_TYPES_BUILTIN_STRUCT_DECL


 typedef struct int32List
@@ -141,7 +141,7 @@ 
     struct uint32List *next;
 } uint32List;

-#endif /* QAPI_TYPES_BUILTIN_STRUCT_DECL_H */
+#endif /* QAPI_TYPES_BUILTIN_STRUCT_DECL */


 extern const char * const ErrorClass_lookup[];