]> granicus.if.org Git - graphviz/commitdiff
cgraph: clang-format agxbuf.h
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 11 Aug 2022 02:05:53 +0000 (19:05 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 12 Aug 2022 04:27:02 +0000 (21:27 -0700)
We do not usually reformat existing code unless it is otherwise being edited.
But in this case the file was so close to compliant already, it seems worth it.

ci/clang_format.py
lib/cgraph/agxbuf.h

index 0b6681771164ef91cf3343fb03304dcf18e85aa2..47116d7d6b979e2752717513bf59e0e48f840de2 100644 (file)
@@ -164,7 +164,6 @@ EXCLUDE = (
   "lib/cdt/dtview.c",
   "lib/cdt/dtwalk.c",
   "lib/cgraph/agerror.c",
-  "lib/cgraph/agxbuf.h",
   "lib/cgraph/apply.c",
   "lib/cgraph/attr.c",
   "lib/cgraph/cghdr.h",
index 9272f510f80a511d0e605732a35f3e9a1ebf1cc2..b3d391bd4e4aab60e797cc82f26c28e94addd077 100644 (file)
@@ -1,5 +1,5 @@
 /*************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property 
+ * Copyright (c) 2011 AT&T Intellectual Property
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
 /* Extensible buffer:
  *  Malloc'ed memory is never released until agxbfree is called.
  */
-    typedef struct {
-       char *buf;      /* start of buffer */
-       char *ptr;      /* next place to write */
-       char *eptr;     /* end of buffer */
-       int stack_allocated; // false if buffer is malloc'ed
-    } agxbuf;
+typedef struct {
+  char *buf;           // start of buffer
+  char *ptr;           // next place to write
+  char *eptr;          // end of buffer
+  int stack_allocated; // false if buffer is malloc'ed
+} agxbuf;
 
 /* agxbinit:
  * Initializes new agxbuf; caller provides memory.
@@ -94,9 +94,9 @@ static inline void agxbmore(agxbuf *xb, size_t ssz) {
 
 /* support for extra API misuse warnings if available */
 #ifdef __GNUC__
-  #define PRINTF_LIKE(index, first) __attribute__((format(printf, index, first)))
+#define PRINTF_LIKE(index, first) __attribute__((format(printf, index, first)))
 #else
-  #define PRINTF_LIKE(index, first) /* nothing */
+#define PRINTF_LIKE(index, first) /* nothing */
 #endif
 
 /* agxbprint:
@@ -173,7 +173,7 @@ static inline size_t agxbput(agxbuf *xb, const char *s) {
  * Add character to buffer.
  *  int agxbputc(agxbuf*, char)
  */
-static inline int agxbputc(agxbuf * xb, char c) {
+static inline int agxbputc(agxbuf *xb, char c) {
   if (xb->ptr >= xb->eptr) {
     agxbmore(xb, 1);
   }