]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: buffer: rename the "data" field to "area"
authorWilly Tarreau <w@1wt.eu>
Mon, 9 Jul 2018 08:55:37 +0000 (10:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:43 +0000 (16:23 +0200)
Since we use "_data" for the amount of data at many places, as opposed to
"_space" for the amount of space, let's rename the "data" field to "area"
so that we can reuse "data" later for the amount of data in the buffer
(currently called "len" despite not being contigous).

include/common/buf.h
src/flt_http_comp.c

index b223b21fa02c145a095c49c0f1a3d8a8165f5d37..e028f90c844018346ef1aacbb49484c6b6523caf 100644 (file)
 
 /* Structure defining a buffer's head */
 struct buffer {
-       size_t head;                /* start offset of remaining data relative to data */
+       size_t head;                /* start offset of remaining data relative to area */
        size_t len;                 /* length of data after head */
        size_t size;                /* buffer size in bytes */
        size_t output;              /* TEMPORARY: part of <len> which is to be forwarded */
-       char data[0];               /* <size> bytes of stored data */
+       char   area[0];             /* <size> bytes of stored data */
 };
 
 
@@ -53,7 +53,7 @@ struct buffer {
  */
 static inline char *b_orig(const struct buffer *b)
 {
-       return (char *)b->data;
+       return (char *)b->area;
 }
 
 /* b_size() : returns the size of the buffer. */
@@ -67,7 +67,7 @@ static inline size_t b_size(const struct buffer *b)
  */
 static inline char *b_wrap(const struct buffer *b)
 {
-       return (char *)b->data + b->size;
+       return (char *)b->area + b->size;
 }
 
 /* b_data() : returns the number of bytes present in the buffer. */
index f8c82c4b7d8a3a83176591d29ae741d911639cbe..2c15d795d9fbdf977530c90aa1b717fac933f1aa 100644 (file)
@@ -705,7 +705,7 @@ http_compression_buffer_end(struct comp_state *st, struct stream *s,
         *     data        p                           size
         *
         * <out> is the room reserved to copy the channel output. It starts at
-        * ob->data and has not yet been filled. <c> is the room reserved to
+        * ob->area and has not yet been filled. <c> is the room reserved to
         * write the chunk size (10 bytes). <comp_in> is the compressed
         * equivalent of the data part of ib->len. <empty> is the amount of
         * empty bytes at the end of  the buffer, into which we may have to