From: Matthew Fernandez Date: Thu, 11 Aug 2022 02:05:53 +0000 (-0700) Subject: cgraph: clang-format agxbuf.h X-Git-Tag: 5.0.1~12^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f6fb26721dd0e6ebf131ff3e6ee56596f02bcd2;p=graphviz cgraph: clang-format agxbuf.h 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. --- diff --git a/ci/clang_format.py b/ci/clang_format.py index 0b6681771..47116d7d6 100644 --- a/ci/clang_format.py +++ b/ci/clang_format.py @@ -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", diff --git a/lib/cgraph/agxbuf.h b/lib/cgraph/agxbuf.h index 9272f510f..b3d391bd4 100644 --- a/lib/cgraph/agxbuf.h +++ b/lib/cgraph/agxbuf.h @@ -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 @@ -19,12 +19,12 @@ /* 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); }