<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -334,7 +334,7 @@ char *do_item_cachedump(const unsigned int slabs_clsid, const unsigned int limit
 }
 
 char *do_item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
-                    const char *key, const char *val, const uint16_t klen,
+                    const char *key, const uint16_t klen, const char *val,
                     const uint32_t vlen), bool bin_prot) {
 
     size_t bufleft = (size_t) LARGEST_ID * 240;
@@ -359,31 +359,31 @@ char *do_item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
 
                 sprintf(key, &quot;%d:number&quot;, i);
                 sprintf(val, &quot;%u&quot;, sizes[i]);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:age&quot;, i);
                 sprintf(val, &quot;%u&quot;, now - tails[i]-&gt;time);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:evicted&quot;, i);
                 sprintf(val, &quot;%u&quot;, itemstats[i].evicted);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:evicted_time&quot;, i);
                 sprintf(val, &quot;%u&quot;, itemstats[i].evicted_time);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:outofmemory&quot;, i);
                 sprintf(val, &quot;%u&quot;, itemstats[i].outofmemory);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
@@ -419,7 +419,7 @@ char *do_item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
 
     /* append message terminator */
     if (bin_prot) {
-        bufcurr += append_bin_stats(bufcurr, NULL, NULL, 0, 0);
+        bufcurr += add_stats(bufcurr, NULL, 0, NULL, 0);
         *bytes = linelen + hdrsiz;
     } else {
         memcpy(bufcurr, &quot;END\r\n&quot;, 6);
@@ -433,7 +433,7 @@ char *do_item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
 /** dumps out a list of objects of each size, with granularity of 32 bytes */
 /*@null@*/
 char *do_item_stats_sizes(int *bytes, uint32_t (*add_stats)(char *buf,
-                          const char *key, const char *val, const uint16_t klen,
+                          const char *key, const uint16_t klen, const char *val,
                           const uint32_t vlen), bool bin_prot) {
 
     const int num_buckets = 32768;   /* max 1MB object, divided into 32 bytes size buckets */
@@ -475,7 +475,7 @@ char *do_item_stats_sizes(int *bytes, uint32_t (*add_stats)(char *buf,
             if (bin_prot) {
                 sprintf(key, &quot;%d&quot;, i * 32);
                 sprintf(val, &quot;%u&quot;, histogram[i]);
-                nbytes = add_stats(ptr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(ptr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 ptr += nbytes;
             } else {
@@ -486,7 +486,7 @@ char *do_item_stats_sizes(int *bytes, uint32_t (*add_stats)(char *buf,
     }
 
     if (bin_prot) {
-        nbytes = add_stats(ptr, NULL, NULL, 0, 0);
+        nbytes = add_stats(ptr, NULL, 0, NULL, 0);
         *bytes = linelen + nbytes;
     } else {
         *bytes += sprintf(&amp;buf[*bytes], &quot;END\r\n&quot;);</diff>
      <filename>items.c</filename>
    </modified>
    <modified>
      <diff>@@ -14,11 +14,11 @@ int  do_item_replace(item *it, item *new_it);
 /*@null@*/
 char *do_item_cachedump(const unsigned int slabs_clsid, const unsigned int limit, unsigned int *bytes);
 char *do_item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
-                    const char *key, const char *val, const uint16_t klen,
+                    const char *key, const uint16_t klen, const char *val,
                     const uint32_t vlen), bool bin_prot);
 /*@null@*/
 char *do_item_stats_sizes(int *bytes, uint32_t (*add_stats)(char *buf,
-                          const char *key, const char *val, const uint16_t klen,
+                          const char *key, const uint16_t klen, const char *val,
                           const uint32_t vlen), bool bin_prot);
 
 void do_item_flush_expired(void);</diff>
      <filename>items.h</filename>
    </modified>
    <modified>
      <diff>@@ -1189,8 +1189,8 @@ static void process_bin_get(conn *c) {
     }
 }
 
-uint32_t append_bin_stats(char *buf, const char *key, const char *val,
-                          const uint16_t klen, const uint32_t vlen) {
+uint32_t append_bin_stats(char *buf, const char *key, const uint16_t klen,
+                          const char *val, const uint32_t vlen) {
     protocol_binary_response_header *header;
     char *ptr = buf;
     uint32_t bodylen = klen + vlen;
@@ -1267,7 +1267,7 @@ static void process_bin_stat(conn *c) {
         memcpy(ptr, engine_statbuf, engine_statlen);
         ptr += engine_statlen;
 
-        append_bin_stats(ptr, NULL, NULL, 0, 0); /* append termination packet */
+        append_bin_stats(ptr, NULL, 0, NULL, 0); /* append termination packet */
 
         free(server_statbuf);
         free(engine_statbuf);
@@ -1280,7 +1280,7 @@ static void process_bin_stat(conn *c) {
 
         stats_reset();
 
-        append_bin_stats(buf, NULL, NULL, 0, 0);
+        append_bin_stats(buf, NULL, 0, NULL, 0);
         write_and_free(c, buf, sizeof(header-&gt;response));
     } else {
         int len = 0;
@@ -1954,7 +1954,7 @@ static char *server_stats(bool binprot, int *buflen) {
         memcpy(val, pos, (size_t)(end_attr - pos));
 
         pos = end_row + 1; /* increment pointer to next row */
-        bodylen = append_bin_stats(bufptr, key, val, strlen(key), strlen(val));
+        bodylen = append_bin_stats(bufptr, key, strlen(key), val, strlen(val));
         bufptr += bodylen;
         *buflen += bodylen;
     }</diff>
      <filename>memcached.c</filename>
    </modified>
    <modified>
      <diff>@@ -317,10 +317,10 @@ int   item_link(item *it);
 void  item_remove(item *it);
 int   item_replace(item *it, item *new_it);
 char *item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
-                 const char *key, const char *val, const uint16_t klen,
+                 const char *key, const uint16_t klen, const char *val,
                  const uint32_t vlen), bool bin_prot);
 char *item_stats_sizes(int *bytes, uint32_t (*add_stats)(char *buf,
-                       const char *key, const char *val, const uint16_t klen,
+                       const char *key, const uint16_t klen, const char *val,
                        const uint32_t vlen), bool bin_prot);
 void  item_unlink(item *it);
 void  item_update(item *it);
@@ -328,7 +328,7 @@ void *slabs_alloc(size_t size, unsigned int id);
 void  slabs_free(void *ptr, size_t size, unsigned int id);
 int   slabs_reassign(unsigned char srcid, unsigned char dstid);
 char *slabs_stats(int *buflen, uint32_t (*add_stats)(char *buf,
-                  const char *key, const char *val, const uint16_t klen,
+                  const char *key, const uint16_t klen, const char *val,
                   const uint32_t vlen), bool bin_prot);
 void  STATS_LOCK(void);
 void  STATS_UNLOCK(void);</diff>
      <filename>memcached.h</filename>
    </modified>
    <modified>
      <diff>@@ -310,7 +310,7 @@ void do_slabs_free(void *ptr, const size_t size, unsigned int id) {
 
 char *get_stats(const bool bin_prot, const char *stat_type,
                 uint32_t (*add_stats)(char *buf, const char *key,
-                const char *val, const uint16_t klen, const uint32_t vlen),
+                const uint16_t klen, const char *val, const uint32_t vlen),
                 int *buflen) {
 
     char *buf, *pos;
@@ -332,25 +332,25 @@ char *get_stats(const bool bin_prot, const char *stat_type,
                 return NULL;
             }
             sprintf(val, &quot;%llu&quot;, stats.curr_bytes);
-            size = add_stats(pos, &quot;bytes&quot;, val, strlen(&quot;bytes&quot;), strlen(val));
+            size = add_stats(pos, &quot;bytes&quot;, strlen(&quot;bytes&quot;), val, strlen(val));
             *buflen += size;
             pos += size;
 
             sprintf(val, &quot;%u&quot;, stats.curr_items);
-            size = add_stats(pos, &quot;curr_items&quot;, val, strlen(&quot;curr_items&quot;),
+            size = add_stats(pos, &quot;curr_items&quot;, strlen(&quot;curr_items&quot;), val,
                              strlen(val));
             *buflen += size;
             pos += size;
 
             sprintf(val, &quot;%u&quot;, stats.total_items);
-            size = add_stats(pos, &quot;total_items&quot;, val, strlen(&quot;total_items&quot;),
+            size = add_stats(pos, &quot;total_items&quot;, strlen(&quot;total_items&quot;), val,
                              strlen(val));
             *buflen += size;
             pos += size;
 
             sprintf(val, &quot;%llu&quot;, stats.evictions);
-            size = add_stats(pos, &quot;evictions_items&quot;, val,
-                             strlen(&quot;evictions_items&quot;), strlen(val));
+            size = add_stats(pos, &quot;evictions_items&quot;, strlen(&quot;evictions_items&quot;),
+                             val, strlen(val));
             *buflen += size;
             pos += size;
             return buf;
@@ -397,66 +397,66 @@ char *get_stats(const bool bin_prot, const char *stat_type,
             uint32_t nbytes = 0;
 
             sprintf(val, &quot;%d&quot;, info.arena);
-            nbytes = add_stats(pos, &quot;arena_size&quot;, val, strlen(&quot;arena_size&quot;),
+            nbytes = add_stats(pos, &quot;arena_size&quot;, strlen(&quot;arena_size&quot;), val,
                                strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.ordblks);
-            nbytes = add_stats(pos, &quot;free_chunks&quot;, val, strlen(&quot;free_chunks&quot;),
+            nbytes = add_stats(pos, &quot;free_chunks&quot;, strlen(&quot;free_chunks&quot;), val,
                                strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.smblks);
-            nbytes = add_stats(pos, &quot;fastbin_blocks&quot;, val,
-                               strlen(&quot;fastbin_blocks&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;fastbin_blocks&quot;, strlen(&quot;fastbin_blocks&quot;),
+                               val, strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.hblks);
-            nbytes = add_stats(pos, &quot;mmapped_regions&quot;, val,
-                               strlen(&quot;mmapped_regions&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;mmapped_regions&quot;, strlen(&quot;mmapped_regions&quot;),
+                               val, strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.hblkhd);
-            nbytes = add_stats(pos, &quot;mmapped_space&quot;, val,
-                               strlen(&quot;mmapped_space&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;mmapped_space&quot;, strlen(&quot;mmapped_space&quot;),
+                               val, strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.usmblks);
-            nbytes = add_stats(pos, &quot;max_total_alloc&quot;, val,
-                               strlen(&quot;max_total_alloc&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;max_total_alloc&quot;, strlen(&quot;max_total_alloc&quot;),
+                               val, strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.fsmblks);
-            nbytes = add_stats(pos, &quot;fastbin_space&quot;, val,
-                               strlen(&quot;fastbin_space&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;fastbin_space&quot;, strlen(&quot;fastbin_space&quot;),
+                               val, strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.uordblks);
-            nbytes = add_stats(pos, &quot;total_alloc&quot;, val,
-                               strlen(&quot;total_alloc&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;total_alloc&quot;, strlen(&quot;total_alloc&quot;), val,
+                               strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.fordblks);
-            nbytes = add_stats(pos, &quot;total_free&quot;, val,
-                               strlen(&quot;total_free&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;total_free&quot;, strlen(&quot;total_free&quot;), val,
+                                strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
             sprintf(val, &quot;%d&quot;, info.keepcost);
-            nbytes = add_stats(pos, &quot;releasable_space&quot;, val,
-                               strlen(&quot;releasable_space&quot;), strlen(val));
+            nbytes = add_stats(pos, &quot;releasable_space&quot;,
+                               strlen(&quot;releasable_space&quot;), val, strlen(val));
             linelen += nbytes;
             pos += nbytes;
 
-            linelen += append_bin_stats(pos, NULL, NULL, 0, 0);
+            linelen += add_stats(pos, NULL, 0, NULL, 0);
             *buflen = linelen;
         } else {
             pos += sprintf(pos, &quot;STAT arena_size %d\r\n&quot;, info.arena);
@@ -483,7 +483,7 @@ char *get_stats(const bool bin_prot, const char *stat_type,
 
 /*@null@*/
 char *do_slabs_stats(int *buflen, uint32_t (*add_stats)(char *buf,
-                     const char *key, const char *val, const uint16_t klen,
+                     const char *key, const uint16_t klen, const char *val,
                      const uint32_t vlen), bool bin_prot) {
     int i, total, linelen;
     char *buf = (char *)malloc(power_largest * 200 + 100);
@@ -512,43 +512,43 @@ char *do_slabs_stats(int *buflen, uint32_t (*add_stats)(char *buf,
 
                 sprintf(key, &quot;%d:chunk_size&quot;, i);
                 sprintf(val, &quot;%u&quot;, p-&gt;size);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:chunks_per_page&quot;, i);
                 sprintf(val, &quot;%u&quot;, perslab);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:total_page&quot;, i);
                 sprintf(val, &quot;%u&quot;, slabs);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:total_chunks&quot;, i);
                 sprintf(val, &quot;%u&quot;, slabs*perslab);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:used_chunks&quot;, i);
                 sprintf(val, &quot;%u&quot;, ((slabs*perslab) - p-&gt;sl_curr));
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:free_chunks&quot;, i);
                 sprintf(val, &quot;%u&quot;, p-&gt;sl_curr);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
 
                 sprintf(key, &quot;%d:free_chunks_end&quot;, i);
                 sprintf(val, &quot;%u&quot;, p-&gt;end_page_free);
-                nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+                nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
                 linelen += nbytes;
                 bufcurr += nbytes;
             } else {
@@ -580,17 +580,17 @@ char *do_slabs_stats(int *buflen, uint32_t (*add_stats)(char *buf,
 
         sprintf(key, &quot;active_slabs&quot;);
         sprintf(val, &quot;%d&quot;, total);
-        nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+        nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
         linelen += nbytes;
         bufcurr += nbytes;
 
         sprintf(key, &quot;total_malloced&quot;);
         sprintf(val, &quot;%llu&quot;, (uint64_t)mem_malloced);
-        nbytes = add_stats(bufcurr, key, val, strlen(key), strlen(val));
+        nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val));
         linelen += nbytes;
         bufcurr += nbytes;
 
-        bufcurr += append_bin_stats(bufcurr, NULL, NULL, 0, 0);
+        bufcurr += add_stats(bufcurr, NULL, 0, NULL, 0);
         *buflen = linelen + sizeof(header-&gt;response);
     } else {
         bufcurr += sprintf(bufcurr, &quot;STAT active_slabs %d\r\nSTAT total_malloced %llu\r\n&quot;,</diff>
      <filename>slabs.c</filename>
    </modified>
    <modified>
      <diff>@@ -24,13 +24,13 @@ void do_slabs_free(void *ptr, size_t size, unsigned int id);
 
 /** Return a datum for stats in binary protocol */
 char *get_stats(const bool bin_prot, const char *stat_type,
-                uint32_t (*callback)(char *buf, const char *key,
-                const char *val, const uint16_t klen, const uint32_t vlen),
+                uint32_t (*add_stats)(char *buf, const char *key,
+                const uint16_t klen, const char *val, const uint32_t vlen),
                 int *buflen);
 
 /** Fill buffer with stats */ /*@null@*/
 char *do_slabs_stats(int *buflen, uint32_t (*add_stats)(char *buf,
-                     const char *key, const char *val, const uint16_t klen,
+                     const char *key, const uint16_t klen, const char *val,
                      const uint32_t vlen), bool bin_prot);
 
 /* Request some slab be moved between classes</diff>
      <filename>slabs.h</filename>
    </modified>
    <modified>
      <diff>@@ -523,7 +523,7 @@ char *item_cachedump(unsigned int slabs_clsid, unsigned int limit, unsigned int
  * Dumps statistics about slab classes
  */
 char *item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
-                 const char *key, const char *val, const uint16_t klen,
+                 const char *key, const uint16_t klen, const char *val,
                  const uint32_t vlen), bool bin_prot) {
     char *ret;
 
@@ -537,7 +537,7 @@ char *item_stats(int *bytes, uint32_t (*add_stats)(char *buf,
  * Dumps a list of objects of each size in 32-byte increments
  */
 char *item_stats_sizes(int *bytes, uint32_t (*add_stats)(char *buf,
-                       const char *key, const char *val, const uint16_t klen,
+                       const char *key, const uint16_t klen, const char *val,
                        const uint32_t vlen), bool bin_prot) {
     char *ret;
 
@@ -573,7 +573,7 @@ void slabs_free(void *ptr, size_t size, unsigned int id) {
 }
 
 char *slabs_stats(int *buflen, uint32_t (*add_stats)(char *buf,
-                  const char *key, const char *val, const uint16_t klen,
+                  const char *key, const uint16_t klen, const char *val,
                   const uint32_t vlen), bool bin_prot) {
     char *ret;
 </diff>
      <filename>thread.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b2943f4076d4758df3c3b41a6b12d2a28f5efc5b</id>
    </parent>
  </parents>
  <author>
    <name>Toru Maesaka</name>
    <email>dev@torum.net</email>
  </author>
  <url>http://github.com/dustin/memcached/commit/a91d357cab4f82e1c262705bf598f0c343bea8b3</url>
  <id>a91d357cab4f82e1c262705bf598f0c343bea8b3</id>
  <committed-date>2009-01-03T00:09:11-08:00</committed-date>
  <authored-date>2008-10-01T04:59:46-07:00</authored-date>
  <message>Changed the argument ordering for stats callback to something more common.</message>
  <tree>e02800982862b2b160a428501702a2e0683f5eec</tree>
  <committer>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </committer>
</commit>
