]> granicus.if.org Git - graphviz/commitdiff
cgraph agxbuf: rearrange 'agxbclear'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 15 Dec 2022 16:26:21 +0000 (08:26 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 21 Dec 2022 02:54:30 +0000 (18:54 -0800)
This will enable de-duplicating some code in an upcoming commit.

Gitlab: #2302

lib/cgraph/agxbuf.h

index 6ff51f5da75117afa16829d4dee2dcf6248d5f07..e2910fea2202a7bf8575dd17cd7ca0a0dce9050e 100644 (file)
@@ -202,6 +202,11 @@ static inline int agxbputc(agxbuf *xb, char c) {
   return 0;
 }
 
+/* agxbclear:
+ * Resets pointer to data;
+ */
+static inline void agxbclear(agxbuf *xb) { xb->size = 0; }
+
 /* agxbuse:
  * Null-terminates buffer; resets and returns pointer to data. The buffer is
  * still associated with the agxbuf and will be overwritten on the next, e.g.,
@@ -214,11 +219,6 @@ static inline char *agxbuse(agxbuf *xb) {
   return xb->buf;
 }
 
-/* agxbclear:
- * Resets pointer to data;
- */
-static inline void agxbclear(agxbuf *xb) { xb->size = 0; }
-
 /* agxbdisown:
  * Disassociate the backing buffer from this agxbuf and return it. The buffer is
  * NUL terminated before being returned. If the agxbuf is using stack memory,