freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master cc99c83: Don't use macro names that start with


From: Werner LEMBERG
Subject: [freetype2-demos] master cc99c83: Don't use macro names that start with `_[A-Z]' or contain `__'.
Date: Thu, 14 Jan 2016 06:44:28 +0000

branch: master
commit cc99c833e83462634640ff0834c18c98bd3aff3e
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    Don't use macro names that start with `_[A-Z]' or contain `__'.
    
    Such macro names are reserved for both C and C++.
    
    * *.h: Harmonize ID macros so that file `foo.h' uses `FOO_H_'.
    * *.c: s/_Translator/Translator_'.
    
    * graph/x11/grx11.c (gr_x11_surface_init):
    s/_NET_WM_PID/NET_WM_PID/.
    * src/ftdiff.c: Replace structure names `_foo' with `foo_'.
---
 ChangeLog               |   13 +++++++++++++
 graph/allegro/gralleg.h |    6 +++---
 graph/beos/grbeos.cpp   |    2 +-
 graph/beos/grbeos.h     |    6 +++---
 graph/gblblit.h         |    6 +++---
 graph/gblender.h        |    6 +++---
 graph/graph.h           |    6 +++---
 graph/grblit.h          |    8 +++++---
 graph/grconfig.h        |    6 +++---
 graph/grdevice.h        |    6 +++---
 graph/grevents.h        |    6 +++---
 graph/grfont.h          |    6 +++---
 graph/grobjs.h          |    6 +++---
 graph/grswizzle.h       |    6 +++---
 graph/grtypes.h         |    6 +++---
 graph/mac/grmac.c       |    2 +-
 graph/mac/grmac.h       |    6 +++---
 graph/os2/gros2pm.h     |    6 +++---
 graph/win32/grwin32.c   |    2 +-
 graph/win32/grwin32.h   |    6 +++---
 graph/x11/grx11.c       |    6 +++---
 graph/x11/grx11.h       |    6 +++---
 src/common.h            |    6 +++---
 src/ftcommon.h          |    6 +++---
 src/ftdiff.c            |   14 +++++++-------
 src/gbench.h            |    6 +++---
 src/output.h            |    6 +++---
 27 files changed, 91 insertions(+), 76 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a19adb5..58bb578 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2016-01-14  Werner Lemberg  <address@hidden>
+
+       Don't use macro names that start with `_[A-Z]' or contain `__'.
+
+       Such macro names are reserved for both C and C++.
+
+       * *.h: Harmonize ID macros so that file `foo.h' uses `FOO_H_'.
+       * *.c: s/_Translator/Translator_'.
+
+       * graph/x11/grx11.c (gr_x11_surface_init):
+       s/_NET_WM_PID/NET_WM_PID/.
+       * src/ftdiff.c: Replace structure names `_foo' with `foo_'.
+
 2016-01-13  Alexei Podtelezhnikov  <address@hidden>
 
        [ftview] Cycle through available LCD filtering.
diff --git a/graph/allegro/gralleg.h b/graph/allegro/gralleg.h
index 57be163..a2aaaba 100644
--- a/graph/allegro/gralleg.h
+++ b/graph/allegro/gralleg.h
@@ -1,5 +1,5 @@
-#ifndef GRALLEG_H
-#define GRALLEG_H
+#ifndef GRALLEG_H_
+#define GRALLEG_H_
 
 #include "grobjs.h"
 
@@ -20,4 +20,4 @@
 
 #endif  /* GR_INIT_BUILD */
 
-#endif /* GRALLEG_H */
+#endif /* GRALLEG_H_ */
diff --git a/graph/beos/grbeos.cpp b/graph/beos/grbeos.cpp
index b69ad17..c9bfb8c 100644
--- a/graph/beos/grbeos.cpp
+++ b/graph/beos/grbeos.cpp
@@ -55,7 +55,7 @@
  }
 #endif
 
- typedef struct  _Translator
+ typedef struct  Translator_
  {
    int32   beoskey;
 grKey   grkey;
diff --git a/graph/beos/grbeos.h b/graph/beos/grbeos.h
index 4177410..a421880 100644
--- a/graph/beos/grbeos.h
+++ b/graph/beos/grbeos.h
@@ -1,5 +1,5 @@
-#ifndef GRBEOS_H
-#define GRBEOS_H
+#ifndef GRBEOS_H_
+#define GRBEOS_H_
 
 #include "grobjs.h"
 
@@ -20,5 +20,5 @@
 
 #endif  /* GR_INIT_BUILD */
 
-#endif /* GRBEOS_H */
+#endif /* GRBEOS_H_ */
 
diff --git a/graph/gblblit.h b/graph/gblblit.h
index b33ef99..4412178 100644
--- a/graph/gblblit.h
+++ b/graph/gblblit.h
@@ -1,5 +1,5 @@
-#ifndef __GBLENDER_BLIT_H__
-#define __GBLENDER_BLIT_H__
+#ifndef GBLBLIT_H_
+#define GBLBLIT_H_
 
 #include "gblender.h"
 
@@ -80,4 +80,4 @@ gblender_blit_init( GBlenderBlit           blit,
 #define  gblender_blit_run(b,color)  (b)->blit_func( (b), (color) )
 
 
-#endif /* __GBLENDER_BLIT_H__ */
+#endif /* GBLBLIT_H_ */
diff --git a/graph/gblender.h b/graph/gblender.h
index 2adc9ba..0b080cf 100644
--- a/graph/gblender.h
+++ b/graph/gblender.h
@@ -6,8 +6,8 @@
  *
  */
 
-#ifndef __GBLENDER_H__
-#define __GBLENDER_H__
+#ifndef GBLENDER_H_
+#define GBLENDER_H_
 
 #ifndef GBLENDER_API
 #define GBLENDER_API(x)  extern x
@@ -233,4 +233,4 @@
    }
 
 
-#endif /* __GBENCH_CACHE_H__ */
+#endif /* GBLENDER_H_ */
diff --git a/graph/graph.h b/graph/graph.h
index 27eec00..d87eb6e 100644
--- a/graph/graph.h
+++ b/graph/graph.h
@@ -9,8 +9,8 @@
  *
  ***************************************************************************/
 
-#ifndef GRAPH_H
-#define GRAPH_H
+#ifndef GRAPH_H_
+#define GRAPH_H_
 
 #include "grevents.h"
 
@@ -690,4 +690,4 @@
 
 /* */
 
-#endif /* GRAPH_H */
+#endif /* GRAPH_H_ */
diff --git a/graph/grblit.h b/graph/grblit.h
index 4d0b6e5..a9254f5 100644
--- a/graph/grblit.h
+++ b/graph/grblit.h
@@ -9,8 +9,8 @@
 /*                                                                          */
 /****************************************************************************/
 
-#ifndef GRBLIT_H
-#define GRBLIT_H
+#ifndef GRBLIT_H_
+#define GRBLIT_H_
 
 #include "grobjs.h"
 
@@ -21,5 +21,7 @@
                    grColor    color );
 
 
-#endif /* GRBLIT_H */
+#endif /* GRBLIT_H_ */
+
+
 /* End */
diff --git a/graph/grconfig.h b/graph/grconfig.h
index 02d8f4d..8db2448 100644
--- a/graph/grconfig.h
+++ b/graph/grconfig.h
@@ -1,9 +1,9 @@
-#ifndef GRCONFIG_H
-#define GRCONFIG_H
+#ifndef GRCONFIG_H_
+#define GRCONFIG_H_
 
 #define GR_MAX_SATURATIONS  8
 #define GR_MAX_CONVERSIONS  16
 
 #define GR_MAX_DEVICES  8
 
-#endif /* GRCONFIG_H */
+#endif /* GRCONFIG_H_ */
diff --git a/graph/grdevice.h b/graph/grdevice.h
index eb031bb..84438fd 100644
--- a/graph/grdevice.h
+++ b/graph/grdevice.h
@@ -9,8 +9,8 @@
  *
  ***************************************************************************/
 
-#ifndef GRDEVICE_H
-#define GRDEVICE_H
+#ifndef GRDEVICE_H_
+#define GRDEVICE_H_
 
 #include "graph.h"
 
@@ -133,4 +133,4 @@ gr_swizzle_rgb24( unsigned char*    read_buff,
                   int               width,
                   int               height );
 
-#endif /* GRDEVICE_H */
+#endif /* GRDEVICE_H_ */
diff --git a/graph/grevents.h b/graph/grevents.h
index 1c8a117..6f02efc 100644
--- a/graph/grevents.h
+++ b/graph/grevents.h
@@ -1,5 +1,5 @@
-#ifndef GREVENTS_H
-#define GREVENTS_H
+#ifndef GREVENTS_H_
+#define GREVENTS_H_
 
 
 #define gr_event_none   0
@@ -174,4 +174,4 @@
   } grEvent;
 
 
-#endif /* GREVENTS_H */
+#endif /* GREVENTS_H_ */
diff --git a/graph/grfont.h b/graph/grfont.h
index d90cbea..676bd90 100644
--- a/graph/grfont.h
+++ b/graph/grfont.h
@@ -1,7 +1,7 @@
 /* grfont.h */
 
-#ifndef GRFONT_H
-#define GRFONT_H
+#ifndef GRFONT_H_
+#define GRFONT_H_
 
 #include "graph.h"
 
@@ -36,7 +36,7 @@
   void
   grLn( void );
 
-#endif /* GRFONT_H */
+#endif /* GRFONT_H_ */
 
 
 /* eof */
diff --git a/graph/grobjs.h b/graph/grobjs.h
index 274f31e..159056c 100644
--- a/graph/grobjs.h
+++ b/graph/grobjs.h
@@ -11,8 +11,8 @@
  *
  ***************************************************************************/
 
-#ifndef GROBJS_H
-#define GROBJS_H
+#ifndef GROBJS_H_
+#define GROBJS_H_
 
 #include "graph.h"
 #include "grconfig.h"
@@ -160,4 +160,4 @@
   extern void  grFree( const void*  block );
 
 
-#endif /* GROBJS_H */
+#endif /* GROBJS_H_ */
diff --git a/graph/grswizzle.h b/graph/grswizzle.h
index bfb8199..b3736b2 100644
--- a/graph/grswizzle.h
+++ b/graph/grswizzle.h
@@ -1,5 +1,5 @@
-#ifndef __gr_swizzle_h__
-#define __gr_swizzle_h__
+#ifndef GRSWIZZLE_H_
+#define GRSWIZZLE_H_
 
 void
 gr_swizzle_rect_rgb24( unsigned char*    read_buff,
@@ -37,4 +37,4 @@ gr_swizzle_rect_xrgb32( unsigned char*    read_buff,
                         int               width,
                         int               height );
 
-#endif /* __gr_swizzle_h__ */
+#endif /* GRSWIZZLE_H_ */
diff --git a/graph/grtypes.h b/graph/grtypes.h
index e4f683f..f921785 100644
--- a/graph/grtypes.h
+++ b/graph/grtypes.h
@@ -11,8 +11,8 @@
  *
  ***************************************************************************/
 
-#ifndef GRTYPES_H
-#define GRTYPES_H
+#ifndef GRTYPES_H_
+#define GRTYPES_H_
 
   typedef unsigned char  byte;
 
@@ -49,4 +49,4 @@
 #define  GR_LOCAL_FUNC    /* void */
 #endif
 
-#endif /* GRTYPES_H */
+#endif /* GRTYPES_H_ */
diff --git a/graph/mac/grmac.c b/graph/mac/grmac.c
index b1b81ef..4e3a131 100644
--- a/graph/mac/grmac.c
+++ b/graph/mac/grmac.c
@@ -54,7 +54,7 @@
 
 /* Mac to FT key mapping */
 
-  typedef struct  _Translator
+  typedef struct  Translator_
   {
     short   mackey;
     grKey   grkey;
diff --git a/graph/mac/grmac.h b/graph/mac/grmac.h
index b62f53a..30f6be1 100644
--- a/graph/mac/grmac.h
+++ b/graph/mac/grmac.h
@@ -1,5 +1,5 @@
-#ifndef GRMAC_H
-#define GRMAC_H
+#ifndef GRMAC_H_
+#define GRMAC_H_
 
 #include "grobjs.h"
 
@@ -20,4 +20,4 @@
 
 #endif  /* GR_INIT_BUILD */
 
-#endif /* GRMAC_H */
+#endif /* GRMAC_H_ */
diff --git a/graph/os2/gros2pm.h b/graph/os2/gros2pm.h
index 2293580..f54128a 100644
--- a/graph/os2/gros2pm.h
+++ b/graph/os2/gros2pm.h
@@ -1,5 +1,5 @@
-#ifndef GROS2PM_H
-#define GROS2PM_H
+#ifndef GROS2PM_H_
+#define GROS2PM_H_
 
 #include "grobjs.h"
 
@@ -20,4 +20,4 @@
 
 #endif  /* GR_INIT_BUILD */
 
-#endif /* GROS2PM_H */
+#endif /* GROS2PM_H_ */
diff --git a/graph/win32/grwin32.c b/graph/win32/grwin32.c
index d707e70..c16c095 100644
--- a/graph/win32/grwin32.c
+++ b/graph/win32/grwin32.c
@@ -65,7 +65,7 @@
 /* These values can be changed, but WIN_WIDTH should remain for now a  */
 /* multiple of 32 to avoid padding issues.                             */
 
-  typedef struct  _Translator
+  typedef struct  Translator_
   {
     ULONG   winkey;
     grKey   grkey;
diff --git a/graph/win32/grwin32.h b/graph/win32/grwin32.h
index 2786473..3e80201 100644
--- a/graph/win32/grwin32.h
+++ b/graph/win32/grwin32.h
@@ -19,8 +19,8 @@
  *
  ******************************************************************/
 
-#ifndef GRWIN32_H
-#define GRWIN32_H
+#ifndef GRWIN32_H_
+#define GRWIN32_H_
 
 #include "grobjs.h"
 
@@ -41,4 +41,4 @@
 
 #endif  /* GR_INIT_BUILD */
 
-#endif /* GRWIN32_H */
+#endif /* GRWIN32_H_ */
diff --git a/graph/x11/grx11.c b/graph/x11/grx11.c
index 5757f4d..b757a15 100644
--- a/graph/x11/grx11.c
+++ b/graph/x11/grx11.c
@@ -1374,7 +1374,7 @@ typedef  unsigned long   uint32;
       unsigned long         xswa_mask = CWBackPixel | CWEventMask | CWCursor;
 
       pid_t                 pid;
-      Atom                  _NET_WM_PID;
+      Atom                  NET_WM_PID;
 
 
       xswa.border_pixel = BlackPixel( display, screen );
@@ -1438,8 +1438,8 @@ typedef  unsigned long   uint32;
                         NULL, 0, &xsh, NULL, NULL );
 
       pid = getpid();
-      _NET_WM_PID = XInternAtom( display, "_NET_WM_PID", False );
-      XChangeProperty( display, surface->win, _NET_WM_PID,
+      NET_WM_PID = XInternAtom( display, "_NET_WM_PID", False );
+      XChangeProperty( display, surface->win, NET_WM_PID,
                        XA_CARDINAL, 32, PropModeReplace,
                        (unsigned char *)&pid, 1 );
     }
diff --git a/graph/x11/grx11.h b/graph/x11/grx11.h
index 0ca8e98..fe21ef8 100644
--- a/graph/x11/grx11.h
+++ b/graph/x11/grx11.h
@@ -16,8 +16,8 @@
  *
  ******************************************************************/
 
-#ifndef GRX11_H
-#define GRX11_H
+#ifndef GRX11_H_
+#define GRX11_H_
 
 #ifdef __cplusplus
 #define class  c_class
@@ -43,4 +43,4 @@
 
 #endif  /* GR_INIT_BUILD */
 
-#endif /* GRX11_H */
+#endif /* GRX11_H_ */
diff --git a/src/common.h b/src/common.h
index bbaaa91..627bbd2 100644
--- a/src/common.h
+++ b/src/common.h
@@ -7,8 +7,8 @@
  *  10 October 1997
  */
 
-#ifndef _H_COMMON
-#define _H_COMMON
+#ifndef COMMON_H_
+#define COMMON_H_
 
 /* Note that by default, both functions are implemented in common.c */
 
@@ -66,7 +66,7 @@
   }
 #endif
 
-#endif /* _H_COMMON */
+#endif /* COMMON_H_ */
 
 
 /* End */
diff --git a/src/ftcommon.h b/src/ftcommon.h
index 1d73d6f..1f8667e 100644
--- a/src/ftcommon.h
+++ b/src/ftcommon.h
@@ -10,8 +10,8 @@
 /*                                                                          */
 /****************************************************************************/
 
-#ifndef _FT_COMMON_H_
-#define _FT_COMMON_H_
+#ifndef FT_COMMON_H_
+#define FT_COMMON_H_
 
 
 #include <ft2build.h>
@@ -338,6 +338,6 @@
   FTDemo_Make_Encoding_Tag( const char*  s );
 
 
-#endif /* _FTCOMMON_H_ */
+#endif /* FTCOMMON_H_ */
 
 /* End */
diff --git a/src/ftdiff.c b/src/ftdiff.c
index d92005a..8c85b05 100644
--- a/src/ftdiff.c
+++ b/src/ftdiff.c
@@ -85,7 +85,7 @@
 
   /** DISPLAY ABSTRACTION **/
 
-  typedef enum  _DisplayMode
+  typedef enum  DisplayMode_
   {
     DISPLAY_MODE_MONO = 0,
     DISPLAY_MODE_GRAY,
@@ -111,7 +111,7 @@
                        const char*  msg );
 
 
-  typedef struct  _DisplayRec
+  typedef struct  DisplayRec_
   {
     void*             disp;
     Display_drawFunc  disp_draw;
@@ -150,7 +150,7 @@
   /***********************************************************************/
   /***********************************************************************/
 
-  typedef enum  _HintMode
+  typedef enum  HintMode_
   {
     HINT_MODE_UNHINTED,
     HINT_MODE_AUTOHINT,
@@ -172,7 +172,7 @@
 
   /** RENDER STATE **/
 
-  typedef struct  _ColumnStateRec
+  typedef struct  ColumnStateRec_
   {
     int            use_cboxes;
     int            use_kerning;
@@ -193,7 +193,7 @@
   } ColumnStateRec, *ColumnState;
 
 
-  typedef struct  _FontFaceRec
+  typedef struct  FontFaceRec_
   {
     const char*  filepath;
     char*        family_name;
@@ -203,7 +203,7 @@
   } FontFaceRec, *FontFace;
 
 
-  typedef struct  _RenderStateRec
+  typedef struct  RenderStateRec_
   {
     FT_Library      library;
     const char*     text;
@@ -873,7 +873,7 @@
 #include "grobjs.h"
 #include "grfont.h"
 
-  typedef struct  _ADisplayRec
+  typedef struct  ADisplayRec_
   {
     int         width;
     int         height;
diff --git a/src/gbench.h b/src/gbench.h
index ac353ab..7c5e9b1 100644
--- a/src/gbench.h
+++ b/src/gbench.h
@@ -12,8 +12,8 @@
 /****************************************************************************/
 
 
-#ifndef __GBENCH_H__
-#define __GBENCH_H__
+#ifndef GBENCH_H_
+#define GBENCH_H_
 
   typedef enum
   {
@@ -80,7 +80,7 @@
 #define  gblitter_blit(b,c)   (b)->blit( (b), (c) )
 
 
-#endif /* __GBENCH_H__ */
+#endif /* GBENCH_H_ */
 
 
 /* End */
diff --git a/src/output.h b/src/output.h
index 94ba01a..37bd074 100644
--- a/src/output.h
+++ b/src/output.h
@@ -11,8 +11,8 @@
 /****************************************************************************/
 
 
-#ifndef _OUTPUT_H_
-#define _OUTPUT_H_
+#ifndef OUTPUT_H_
+#define OUTPUT_H_
 
 
 #include <ft2build.h>
@@ -56,6 +56,6 @@
                     FT_Int    as_utf8 );
 
 
-#endif /* _OUTPUT_H_ */
+#endif /* OUTPUT_H_ */
 
 /* End */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]