Index: /branches/binary/server/memcached.c
===================================================================
--- /branches/binary/server/memcached.c (revision 758)
+++ /branches/binary/server/memcached.c (revision 759)
@@ -166,5 +166,5 @@
 
 static void settings_init(void) {
-    settings.access=0700;
+    settings.access = 0700;
     settings.port = 11211;
     settings.udpport = 0;
@@ -296,17 +296,17 @@
 
 static char *prot_text(enum protocol prot) {
-    char *rv="unknown";
+    char *rv = "unknown";
     switch(prot) {
         case ascii_prot:
-            rv="ascii";
+            rv = "ascii";
             break;
         case binary_prot:
-            rv="binary";
+            rv = "binary";
             break;
         case ascii_udp_prot:
-            rv="ascii-udp";
+            rv = "ascii-udp";
             break;
         case negotiating_prot:
-            rv="auto-negotiate";
+            rv = "auto-negotiate";
             break;
     }
@@ -351,5 +351,5 @@
             if (c->rbuf != 0) free(c->rbuf);
             if (c->wbuf != 0) free(c->wbuf);
-            if (c->ilist !=0) free(c->ilist);
+            if (c->ilist != 0) free(c->ilist);
             if (c->suffixlist != 0) free(c->suffixlist);
             if (c->iov != 0) free(c->iov);
@@ -515,16 +515,16 @@
 
 static enum conn_states get_init_state(conn *c) {
-    int rv=0;
+    int rv = 0;
     assert(c != NULL);
 
     switch(c->protocol) {
         case binary_prot:
-            rv=conn_bin_init;
+            rv = conn_bin_init;
             break;
         case negotiating_prot:
-            rv=conn_negotiate;
+            rv = conn_negotiate;
             break;
         default:
-            rv=conn_read;
+            rv = conn_read;
     }
     return rv;
@@ -865,5 +865,5 @@
 
 static void add_bin_header(conn *c, int err, int hdr_len, int body_len) {
-    int i=0;
+    int i = 0;
     uint32_t *res_header;
 
@@ -896,5 +896,5 @@
     }
 
-    for(i=0; i<BIN_PKT_HDR_WORDS; i++) {
+    for(i = 0; i<BIN_PKT_HDR_WORDS; i++) {
         res_header[i] = htonl(res_header[i]);
     }
@@ -905,26 +905,26 @@
 
 static void write_bin_error(conn *c, int err, int swallow) {
-    char *errstr="Unknown error";
+    char *errstr = "Unknown error";
     switch(err) {
         case ERR_UNKNOWN_CMD:
-            errstr="Unknown command";
+            errstr = "Unknown command";
             break;
         case ERR_NOT_FOUND:
-            errstr="Not found";
+            errstr = "Not found";
             break;
         case ERR_INVALID_ARGUMENTS:
-            errstr="Invalid arguments";
+            errstr = "Invalid arguments";
             break;
         case ERR_EXISTS:
-            errstr="Data exists for key.";
+            errstr = "Data exists for key.";
             break;
         case ERR_TOO_LARGE:
-            errstr="Too large.";
+            errstr = "Too large.";
             break;
         case ERR_NOT_STORED:
-            errstr="Not stored.";
+            errstr = "Not stored.";
             break;
         default:
-            errstr="UNHANDLED ERROR";
+            errstr = "UNHANDLED ERROR";
             fprintf(stderr, "UNHANDLED ERROR:  %d\n", err);
     }
@@ -937,5 +937,5 @@
     conn_set_state(c, conn_mwrite);
     if(swallow > 0) {
-        c->sbytes=swallow;
+        c->sbytes = swallow;
         c->write_and_go = conn_swallow;
     } else {
@@ -959,7 +959,7 @@
     /* Little endian, flip the bytes around until someone makes a faster/better
     * way to do this. */
-    int64_t rv=0;
-    int i=0;
-     for(i=0; i<8; i++) {
+    int64_t rv = 0;
+    int i = 0;
+     for(i = 0; i<8; i++) {
         rv = (rv << 8) | (in & 0xff);
         in >>= 8;
@@ -984,7 +984,7 @@
     assert(c != NULL);
 
-    key=c->rbuf + BIN_INCR_HDR_LEN;
-    nkey=c->keylen;
-    key[nkey]=0x00;
+    key = c->rbuf + BIN_INCR_HDR_LEN;
+    nkey = c->keylen;
+    key[nkey] = 0x00;
 
     delta = swap64(*((int64_t*)(c->rbuf)));
@@ -994,5 +994,5 @@
     if(settings.verbose) {
         fprintf(stderr, "incr ");
-        for(i=0; i<nkey; i++) {
+        for(i = 0; i<nkey; i++) {
             fprintf(stderr, "%c", key[i]);
         }
@@ -1004,9 +1004,9 @@
         /* Weird magic in add_delta forces me to pad here */
         char tmpbuf[INCR_MAX_STORAGE_LEN];
-        uint64_t l=0;
+        uint64_t l = 0;
         memset(tmpbuf, ' ', INCR_MAX_STORAGE_LEN);
-        tmpbuf[INCR_MAX_STORAGE_LEN]=0x00;
+        tmpbuf[INCR_MAX_STORAGE_LEN] = 0x00;
         add_delta(it, c->cmd == CMD_INCR, delta, tmpbuf);
-        *response_buf=swap64(strtoull(tmpbuf, NULL, 10));
+        *response_buf = swap64(strtoull(tmpbuf, NULL, 10));
 
         write_bin_response(c, response_buf, BIN_INCR_HDR_LEN, INCR_RES_LEN);
@@ -1016,5 +1016,5 @@
             /* Save some room for the response */
             assert(c->wsize > BIN_INCR_HDR_LEN + BIN_DEL_HDR_LEN);
-            *response_buf=swap64(initial);
+            *response_buf = swap64(initial);
             it = item_alloc(key, nkey, 0, realtime(exptime),
                 INCR_MAX_STORAGE_LEN);
@@ -1035,5 +1035,5 @@
 
 static void complete_update_bin(conn *c) {
-    int eno=-1, ret=0;
+    int eno = -1, ret = 0;
     assert(c != NULL);
 
@@ -1062,9 +1062,9 @@
         default:
             if(c->item_comm == NREAD_ADD) {
-                eno=ERR_EXISTS;
+                eno = ERR_EXISTS;
             } else if(c->item_comm == NREAD_REPLACE) {
-                eno=ERR_NOT_FOUND;
+                eno = ERR_NOT_FOUND;
             } else {
-                eno=ERR_NOT_STORED;
+                eno = ERR_NOT_STORED;
             }
             write_bin_error(c, eno, 0);
@@ -1087,6 +1087,6 @@
         /* This is a bit of magic.  I'm using wbuf as the header, so I'll place
         this is int in far enough to cover the header */
-        flags=(int*)(c->wbuf + MIN_BIN_PKT_LENGTH);
-        *flags=htonl(strtoul(ITEM_suffix(it), NULL, 10));
+        flags = (int*)(c->wbuf + MIN_BIN_PKT_LENGTH);
+        *flags = htonl(strtoul(ITEM_suffix(it), NULL, 10));
 
         /* the length has two unnecessary bytes, and then we write four more */
@@ -1094,6 +1094,6 @@
         /* Flags */
         add_iov(c, flags, 4);
-        identifier=(uint64_t*)(c->wbuf + MIN_BIN_PKT_LENGTH + 4);
-        *identifier=swap64((uint32_t)it->cas_id);
+        identifier = (uint64_t*)(c->wbuf + MIN_BIN_PKT_LENGTH + 4);
+        *identifier = swap64((uint32_t)it->cas_id);
         add_iov(c, identifier, 8);
         /* bytes minus the CRLF */
@@ -1165,11 +1165,11 @@
     item *it;
     int comm;
-    int hdrlen=BIN_SET_HDR_LEN;
+    int hdrlen = BIN_SET_HDR_LEN;
 
     assert(c != NULL);
 
-    key=c->rbuf + hdrlen;
-    nkey=c->keylen;
-    key[nkey]=0x00;
+    key = c->rbuf + hdrlen;
+    nkey = c->keylen;
+    key[nkey] = 0x00;
 
     flags = ntohl(*((int*)(c->rbuf)));
@@ -1236,5 +1236,5 @@
     key = c->rbuf + 4;
     nkey = c->keylen;
-    key[nkey]=0x00;
+    key[nkey] = 0x00;
 
     if(settings.verbose) {
@@ -1254,5 +1254,5 @@
         } else {
             /* XXX:  This is really lame, but defer_delete returns a string */
-            char *res=defer_delete(it, exptime);
+            char *res = defer_delete(it, exptime);
             if(res[0] == 'D') {
                 write_bin_response(c, NULL, 0, 0);
@@ -1271,8 +1271,8 @@
     if(c->cmd < 0) {
         /* No command defined.  Figure out what they're trying to say. */
-        int i=0;
+        int i = 0;
         /* I did a bit of hard-coding around the packet sizes */
         assert(BIN_PKT_HDR_WORDS == 3);
-        for(i=0; i<BIN_PKT_HDR_WORDS; i++) {
+        for(i = 0; i<BIN_PKT_HDR_WORDS; i++) {
             c->bin_header[i] = ntohl(c->bin_header[i]);
         }
@@ -1368,6 +1368,6 @@
     /* We've already got the first letter of the command, so pretend like we
      * Did a single byte read from try_read_command */
-    c->rcurr=c->rbuf;
-    c->rbytes=1;
+    c->rcurr = c->rbuf;
+    c->rbytes = 1;
     conn_set_state(c, conn_read);
 }
@@ -2113,5 +2113,5 @@
     }
     if(value < 0) {
-        value=0;
+        value = 0;
     }
     sprintf(buf, "%llu", value);
@@ -2665,5 +2665,5 @@
             return TRANSMIT_SOFT_ERROR;
         }
-        /* if res==0 or res==-1 and error is not EAGAIN or EWOULDBLOCK,
+        /* if res == 0 or res == -1 and error is not EAGAIN or EWOULDBLOCK,
            we have a real error, on which we close the connection */
         if (settings.verbose > 0)
@@ -3155,5 +3155,5 @@
     addr.sun_family = AF_UNIX;
     strcpy(addr.sun_path, path);
-    old_umask=umask( ~(access_mask&0777));
+    old_umask = umask( ~(access_mask&0777));
     if (bind(sfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
         perror("bind()");
@@ -3675,5 +3675,5 @@
 
     /*
-     * ignore SIGPIPE signals; we can use errno==EPIPE if we
+     * ignore SIGPIPE signals; we can use errno == EPIPE if we
      * need that information
      */
