summaryrefslogtreecommitdiff
path: root/camlibs/sonix
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-05 15:50:32 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-05 16:07:20 +0200
commit0dbeaf7cbf30ab88ac7aea3e7d3f24df8dc0309f (patch)
tree5473eb1125e904a86e479180689167280a2e81dc /camlibs/sonix
parentbacd4128617e1dd613998c0268ded8304cef6f19 (diff)
downloadlibgphoto2-0dbeaf7cbf30ab88ac7aea3e7d3f24df8dc0309f.tar.gz
Use consistently named non-reserved CPP macros for header files
C preprocessor macros beginning/ending with underscores are reserved for system use as well as macros containing a double underscore anywhere, so application software macros are supposed to be named differently. For a header file gphoto2-abilities-list.h, this consistently uses a macro name LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H for the usual #ifndef LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H #define LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H ... content of the header file ... #endif /* !defined(LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H) */ Found using "clang -Weverything". This should work, unless when run with an ancient C preprocessor which might only the first 8 or 10 characters to distinguish macro names and ignores the remainder of the name.
Diffstat (limited to 'camlibs/sonix')
-rw-r--r--camlibs/sonix/sakar-avi-header.h6
-rw-r--r--camlibs/sonix/sonix.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/camlibs/sonix/sakar-avi-header.h b/camlibs/sonix/sakar-avi-header.h
index 1b52dbb01..e164c42d6 100644
--- a/camlibs/sonix/sakar-avi-header.h
+++ b/camlibs/sonix/sakar-avi-header.h
@@ -1,5 +1,5 @@
-#ifndef __SAKAR_AVI_HEADER_H
-#define __SAKAR_AVI_HEADER_H
+#ifndef CAMLIBS_SONIX_SAKAR_AVI_HEADER_H
+#define CAMLIBS_SONIX_SAKAR_AVI_HEADER_H
#define SAKAR_AVI_FRAME_HEADER_LENGTH 8
static const unsigned char SakarAviFrameHeader[SAKAR_AVI_FRAME_HEADER_LENGTH] = {
@@ -73,4 +73,4 @@ static const unsigned char SakarAviHeader[SAKAR_AVI_HEADER_LENGTH] = {
0x6D, 0x6F, 0x76, 0x69 /* 0xda: movi */
};
-#endif /* __SAKAR_AVI_HEADER_H */
+#endif /* !defined(CAMLIBS_SONIX_SAKAR_AVI_HEADER_H) */
diff --git a/camlibs/sonix/sonix.h b/camlibs/sonix/sonix.h
index b13981c0b..8af1af04c 100644
--- a/camlibs/sonix/sonix.h
+++ b/camlibs/sonix/sonix.h
@@ -18,8 +18,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __SONIX_H__
-#define __SONIX_H__
+#ifndef CAMLIBS_SONIX_SONIX_H
+#define CAMLIBS_SONIX_SONIX_H
#include <gphoto2/gphoto2-port.h>
@@ -55,5 +55,5 @@ int sonix_rows_reverse (unsigned char *imagedata, int width, int height);
int sonix_cols_reverse (unsigned char *imagedata, int width, int height);
int white_balance (unsigned char *data, unsigned int size, float saturation);
-#endif
+#endif /* !defined(CAMLIBS_SONIX_SONIX_H) */