]> granicus.if.org Git - graphviz/commitdiff
lefty: replace header guards with more modern #pragma once
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Sep 2021 01:52:00 +0000 (18:52 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 27 Sep 2021 14:45:27 +0000 (07:45 -0700)
This omits the `_COMMON_H` guards as these are used in multiple files and may
have some other interaction.

18 files changed:
cmd/lefty/code.h
cmd/lefty/cs2l/cs2l.h
cmd/lefty/display.h
cmd/lefty/dot2l/dot2l.h
cmd/lefty/exec.h
cmd/lefty/g.h
cmd/lefty/gfxview.h
cmd/lefty/internal.h
cmd/lefty/leftyio.h
cmd/lefty/lex.h
cmd/lefty/mem.h
cmd/lefty/parse.h
cmd/lefty/str.h
cmd/lefty/tbl.h
cmd/lefty/txtview.h
cmd/lefty/ws/mswin32/gcommon.h
cmd/lefty/ws/none/gcommon.h
cmd/lefty/ws/x11/gcommon.h

index d3e59b109bc47709c021992eeaea38e2e7ca0d02..c6d91c74cd93b45910a06214fa9ac548b1ea4cd1 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _CODE_H
-#define _CODE_H
 #define C_NULL -1
 
 #define C_ISSTMT(ct) (ct >= C_STMT && ct <= C_RETURN)
@@ -94,7 +94,6 @@ int Cnew (int);
 int Cinteger (long);
 int Creal (double);
 int Cstring (char *);
-#endif /* _CODE_H */
 
 #ifdef __cplusplus
 }
index a21b68958cb6e192e8a4389487982d48d9c1866e..5d8a6ad6efbe3d687fa58f795c5f5bdbd91c787f 100644 (file)
@@ -8,15 +8,13 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
-#ifndef _C2L_H
-#define _C2L_H
     int C2Lopen(char *, char *, FILE **, FILE **);
-#endif                         /* _C2L_H */
 
 #ifdef __cplusplus
 }
index bd68e9ff736bf33fda029e8db3fea7c24526d82e..4c8e461d1452578a80ecf0cc2bd8971fe52f5b96 100644 (file)
@@ -7,19 +7,18 @@
  *
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
-    
+
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _DISPLAY_H
-#define _DISPLAY_H
 void Dinit (void);
 void Dterm (void);
 void Dtrace (Tobj, int);
-#endif /* _DISPLAY_H */
 
 #ifdef __cplusplus
 }   
index 11d73c8312bc32988c23feca04b7aa2171bf3b37..4a90db555327b33f1e44a0b5a3e6a795ba16c8bb 100644 (file)
@@ -8,13 +8,12 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
-#ifndef _DOT2L_H
-#define _DOT2L_H
 #define SMALLBUF 128
 
 int yyparse(void);
@@ -63,7 +62,6 @@ void D2Lbeginedge (int, Tobj, char *);
 void D2Lmidedge (int, Tobj, char *);
 void D2Lendedge (void);
 void D2Lsetattr (char *, char *);
-#endif /* _DOT2L_H */
 
 #ifdef __cplusplus
 }
index 4e7c8a3c4bb16a3960142ca6ca5b8f4c7f814e6f..4a8a2abfe417016cd821c011e31aaae57251e257 100644 (file)
@@ -7,15 +7,15 @@
  *
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
-    
+
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _EXEC_H
-#define _EXEC_H
 typedef struct Tonm_t lvar_t;
 
 extern Tobj root, null;
@@ -27,7 +27,6 @@ void Einit (void);
 void Eterm (void);
 Tobj Eunit (Tobj);
 Tobj Efunction (Tobj, char *);
-#endif /* _EXEC_H */
 
 #ifdef __cplusplus
 }
index ddf768eedfa4b3eeee7265e3072e89bd7b2ee626..2aa1ca74a168dd54d4cb59c0c8ee9571ad155a0f 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _G_H
-#define _G_H
 #ifdef FEATURE_X11
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
@@ -547,8 +547,6 @@ void Gerr (char *, int, int, ...);
 #define G_ERRNOBITMAP           21
 #define G_ERRCANNOTREADBITMAP   22
 
-#endif /* _G_H */
-
 #ifdef __cplusplus
 }
 #endif
index 0fb8a18ebd037cd00317d63281aadd54e1b230d8..4ea84471015086682ea447dd14f6cf91409cdcfa 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _GFXVIEW_H
-#define _GFXVIEW_H
 void GFXinit (void);
 void GFXterm (void);
 void GFXprune (void);
@@ -51,7 +51,6 @@ int GFXclearpick (int, lvar_t *);
 int GFXsetpick (int, lvar_t *);
 int GFXdisplaymenu (int, lvar_t *);
 int GFXcolormap (int, lvar_t *);
-#endif /* _GFXVIEW_H */
 
 #ifdef __cplusplus
 }
index 389d7ee9b654bda289c92020474319351ca2b3b6..c20b63b197db303368543cff86e015167e6b5f6d 100644 (file)
@@ -7,15 +7,15 @@
  *
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
-    
+
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _INTERNAL_H
-#define _INTERNAL_H
 typedef struct Ifunc_t {
     char *name;
     int (*func) (int, Tonm_t *);
@@ -28,7 +28,6 @@ int Igetfunc (char *);
 
 extern Ifunc_t Ifuncs[];
 extern int Ifuncn;
-#endif /* _INTERNAL_H */
 
 #ifdef __cplusplus
 }
index b214cf8a4fab1b15a0c61b85a543f1443045548f..a4c3a25cebacfab6db49a60c2bb44d2c7f300a7e 100644 (file)
@@ -8,15 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _IO_H
-#define _IO_H
-
 #define IO_FILE   0
 #define IO_PTY    1
 #define IO_PIPE   2
@@ -70,8 +69,6 @@ int IOreadline (int, char *, int);
 int IOread (int, char *, int);
 int IOwriteline (int, char *);
 
-#endif /* _IO_H */
-
 #ifdef __cplusplus
 }
 #endif
index c3729a5dd9eacdcc5f19d9b30283cae49b17d027..e8605d4489ec2cd98b91d28e1f46e8339f4b44dc 100644 (file)
@@ -8,15 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _LEX_H
-#define _LEX_H
-
 #define L_SEMI      0
 #define L_ASSIGN    1
 #define L_OR        2
@@ -70,7 +69,6 @@ void Lsetsrc (int, char *, FILE *, int, int);
 void Lgetsrc (int *, char **, FILE **, int *, int *);
 void Lprintpos (void);
 void Lgtok (void);
-#endif /* _LEX_H */
 
 #ifdef __cplusplus
 }
index 9bfa7751b84a1cc4e90e49ec4e54ad6ea968b35c..680e08843a769ad727a7f94a2b5f95e1a70fb034 100644 (file)
@@ -7,16 +7,15 @@
  *
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
-            
+
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif  
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _MEM_H
-#define _MEM_H
-
 #ifdef FEATURE_MINTSIZE
 typedef int Msize_t;
 #define M_SIZEMAX INT_MAX
@@ -60,7 +59,6 @@ void Mresetmark (long, void *);
 void Mmkcurr (void *);
 void Mdogc (int);
 void Mreport (void);
-#endif /* _MEM_H */
 
 #ifdef __cplusplus
 }
index a8c2af2e8ea1c5fde10d4f2020e1bac5bdf52385..87990db7f9af68ba087b7661acd82f2d1c17fd22 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _PARSE_H
-#define _PARSE_H
 typedef struct Psrc_t {
     int flag;
     char *s;
@@ -29,7 +29,6 @@ void Pterm (void);
 Tobj Punit (Psrc_t *);
 Tobj Pfcall (Tobj, Tobj);
 Tobj Pfunction (char *, int);
-#endif /* _PARSE_H */
 
 #ifdef __cplusplus
 }
index 080a30c69963573d8a7ae432bdb28d836cfb5921..d010269265f47e8bf9f22c2d705117b7020bd427 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _STR_H
-#define _STR_H
 void Sinit (void);
 void Sterm (void);
 char *Spath (char *, Tobj);
@@ -24,7 +24,6 @@ char *Sabstract (Tobj, Tobj);
 char *Stfull (Tobj);
 char *Ssfull (Tobj, Tobj);
 char *Scfull (Tobj, int, int);
-#endif /* _STR_H */
 
 #ifdef __cplusplus
 }
index b583675eb01ae8fea90a95b7722834c739d7a76a..d383a7dd5f362f0dd10e958a2b2f6ebaa599585e 100644 (file)
@@ -14,8 +14,8 @@ extern "C" {
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _TBL_H
-#define _TBL_H
+#pragma once
+
 #ifdef _WIN32
 #include "mem.h"
 #endif
@@ -132,7 +132,6 @@ void Tdelo (Tobj, Tobj);
 Tobj Tcopy (Tobj);
 void Tgetfirst (Tobj, Tkvindex_t *);
 void Tgetnext (Tkvindex_t *);
-#endif /* _TBL_H */
 
 #ifdef __cplusplus
 }
index 190e87b54e0749e5309865cc162b843073c9df97..3da1d97f471e6be172be6e6ecdeb2790587e06a9 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _TXTVIEW_H
-#define _TXTVIEW_H
 void TXTinit (Grect_t);
 void TXTterm (void);
 int TXTmode (int argc, lvar_t *argv);
@@ -23,7 +23,6 @@ int TXTask (int argc, lvar_t *argv);
 void TXTprocess (int, char *);
 void TXTupdate (void);
 void TXTtoggle (int, void *);
-#endif /* _TXTVIEW_H */
 
 #ifdef __cplusplus
 }
index 3eb76d66c4ea25212d6bc90248082b04c63d9b17..8e34f74c0615c167f9155bc1d510065aea9c6790 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _GCOMMON_H
-#define _GCOMMON_H
 extern HANDLE hinstance, hprevinstance;
 
 /* point and rect structures */
@@ -169,7 +169,6 @@ void Gawdeletechild (Gwidget_t *, Gwidget_t *);
 void Gadjustwrect (Gwidget_t *, PIXsize_t *);
 void Gadjustclip (Gwidget_t *);
 Gpoint_t ppixtodraw (Gwidget_t *, PIXpoint_t);
-#endif /* _GCOMMON_H */
 
 #ifdef __cplusplus
 }
index 53d9734f1fb8feaacaf2017edf898f26ced93275..52bb4d41327d172e32720b5b244f1caa7c862f34 100644 (file)
@@ -8,15 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _GCOMMON_H
-#define _GCOMMON_H
-
 typedef struct {
     int x, y;
 } XPoint;
@@ -126,8 +125,6 @@ int GVdestroywidget (Gwidget_t *);
 
 void Gawdefcoordscb (int, Gawdata_t *);
 
-#endif /* _GCOMMON_H */
-
 #ifdef __cplusplus
 }
 #endif
index eedb58081acd44c2a5ee2c4ae4625281228ce456..75cd6d62dab5cf710cbc8faaf82ba748264f5d42 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Lefteris Koutsofios - AT&T Labs Research */
 
-#ifndef _GCOMMON_H
-#define _GCOMMON_H
 #if XlibSpecificationRelease < 5
 typedef char *XPointer;
 #endif
@@ -207,8 +207,6 @@ extern XtTranslations Gwmdeltable;
 
 extern Atom Gqwdelatom, Gwmdelatom;
 
-#endif /* _GCOMMON_H */
-
 #ifdef __cplusplus
 }
 #endif