Skip to content

Commit

Permalink
No more trailing spaces in Redis source code.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jun 26, 2014
1 parent b4d378f commit b411678
Show file tree
Hide file tree
Showing 28 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion src/adlist.c
Expand Up @@ -178,7 +178,7 @@ void listDelNode(list *list, listNode *node)
listIter *listGetIterator(list *list, int direction)
{
listIter *iter;

if ((iter = zmalloc(sizeof(*iter))) == NULL) return NULL;
if (direction == AL_START_HEAD)
iter->next = list->head;
Expand Down
12 changes: 6 additions & 6 deletions src/ae_kqueue.c
Expand Up @@ -54,7 +54,7 @@ static int aeApiCreate(aeEventLoop *eventLoop) {
return -1;
}
eventLoop->apidata = state;
return 0;
return 0;
}

static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
Expand All @@ -75,7 +75,7 @@ static void aeApiFree(aeEventLoop *eventLoop) {
static int aeApiAddEvent(aeEventLoop *eventLoop, int fd, int mask) {
aeApiState *state = eventLoop->apidata;
struct kevent ke;

if (mask & AE_READABLE) {
EV_SET(&ke, fd, EVFILT_READ, EV_ADD, 0, 0, NULL);
if (kevent(state->kqfd, &ke, 1, NULL, 0, NULL) == -1) return -1;
Expand Down Expand Up @@ -118,16 +118,16 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {

if (retval > 0) {
int j;

numevents = retval;
for(j = 0; j < numevents; j++) {
int mask = 0;
struct kevent *e = state->events+j;

if (e->filter == EVFILT_READ) mask |= AE_READABLE;
if (e->filter == EVFILT_WRITE) mask |= AE_WRITABLE;
eventLoop->fired[j].fd = e->ident;
eventLoop->fired[j].mask = mask;
eventLoop->fired[j].fd = e->ident;
eventLoop->fired[j].mask = mask;
}
}
return numevents;
Expand Down
2 changes: 1 addition & 1 deletion src/anet.c
Expand Up @@ -137,7 +137,7 @@ int anetEnableTcpNoDelay(char *err, int fd)
return anetSetTcpNoDelay(err, fd, 1);
}

int anetDisableTcpNoDelay(char *err, int fd)
int anetDisableTcpNoDelay(char *err, int fd)
{
return anetSetTcpNoDelay(err, fd, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cluster.c
Expand Up @@ -3598,7 +3598,7 @@ void clusterCommand(redisClient *c) {
if (slots[j]) {
int retval;

/* If this slot was set as importing we can clear this
/* If this slot was set as importing we can clear this
* state as now we are the real owner of the slot. */
if (server.cluster->importing_slots_from[j])
server.cluster->importing_slots_from[j] = NULL;
Expand Down
6 changes: 3 additions & 3 deletions src/config.c
Expand Up @@ -1310,7 +1310,7 @@ struct rewriteConfigState *rewriteConfigReadOldFile(char *path) {
* "force" is non-zero, the line is appended to the configuration file.
* Usually "force" is true when an option has not its default value, so it
* must be rewritten even if not present previously.
*
*
* The first time a line is appended into a configuration file, a comment
* is added to show that starting from that point the config file was generated
* by CONFIG REWRITE.
Expand Down Expand Up @@ -1436,7 +1436,7 @@ void rewriteConfigEnumOption(struct rewriteConfigState *state, char *option, int
char *enum_name, *matching_name = NULL;
int enum_val, def_val, force;
sds line;

va_start(ap, value);
while(1) {
enum_name = va_arg(ap,char*);
Expand All @@ -1448,7 +1448,7 @@ void rewriteConfigEnumOption(struct rewriteConfigState *state, char *option, int
if (value == enum_val) matching_name = enum_name;
}
va_end(ap);

force = value != def_val;
line = sdscatprintf(sdsempty(),"%s %s",option,matching_name);
rewriteConfigRewriteLine(state,option,line,force);
Expand Down
4 changes: 2 additions & 2 deletions src/crc16.c
@@ -1,6 +1,6 @@
#include "redis.h"

/*
/*
* Copyright 2001-2010 Georges Menie (www.menie.org)
* Copyright 2010-2012 Salvatore Sanfilippo (adapted to Redis coding style)
* All rights reserved.
Expand Down Expand Up @@ -78,7 +78,7 @@ static const uint16_t crc16tab[256]= {
0xef1f,0xff3e,0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,
0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0
};

uint16_t crc16(const char *buf, int len) {
int counter;
uint16_t crc = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/db.c
Expand Up @@ -106,7 +106,7 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
* The program is aborted if the key was not already present. */
void dbOverwrite(redisDb *db, robj *key, robj *val) {
dictEntry *de = dictFind(db->dict,key->ptr);

redisAssertWithInfo(NULL,key,de != NULL);
dictReplace(db->dict, key->ptr, val);
}
Expand Down Expand Up @@ -831,7 +831,7 @@ int expireIfNeeded(redisDb *db, robj *key) {
* the slave key expiration is controlled by the master that will
* send us synthesized DEL operations for expired keys.
*
* Still we try to return the right information to the caller,
* Still we try to return the right information to the caller,
* that is, 0 if we think the key should be still valid, 1 if
* we think the key is expired at this time. */
if (server.masterhost != NULL) return now > when;
Expand Down
2 changes: 1 addition & 1 deletion src/endianconv.h
Expand Up @@ -28,7 +28,7 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

#ifndef __ENDIANCONV_H
#define __ENDIANCONV_H
Expand Down
12 changes: 6 additions & 6 deletions src/lzf.h
@@ -1,16 +1,16 @@
/*
* Copyright (c) 2000-2008 Marc Alexander Lehmann <schmorp@schmorp.de>
*
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
Expand Down Expand Up @@ -73,7 +73,7 @@
* and lzf_c.c.
*
*/
unsigned int
unsigned int
lzf_compress (const void *const in_data, unsigned int in_len,
void *out_data, unsigned int out_len);

Expand All @@ -92,7 +92,7 @@ lzf_compress (const void *const in_data, unsigned int in_len,
*
* This function is very fast, about as fast as a copying loop.
*/
unsigned int
unsigned int
lzf_decompress (const void *const in_data, unsigned int in_len,
void *out_data, unsigned int out_len);

Expand Down
8 changes: 4 additions & 4 deletions src/lzfP.h
@@ -1,16 +1,16 @@
/*
* Copyright (c) 2000-2007 Marc Alexander Lehmann <schmorp@schmorp.de>
*
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
Expand Down
8 changes: 4 additions & 4 deletions src/lzf_c.c
@@ -1,16 +1,16 @@
/*
* Copyright (c) 2000-2008 Marc Alexander Lehmann <schmorp@schmorp.de>
*
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
Expand Down
10 changes: 5 additions & 5 deletions src/lzf_d.c
@@ -1,16 +1,16 @@
/*
* Copyright (c) 2000-2007 Marc Alexander Lehmann <schmorp@schmorp.de>
*
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
Expand Down Expand Up @@ -52,7 +52,7 @@
#endif
*/

unsigned int
unsigned int
lzf_decompress (const void *const in_data, unsigned int in_len,
void *out_data, unsigned int out_len)
{
Expand Down
2 changes: 1 addition & 1 deletion src/multi.c
Expand Up @@ -214,7 +214,7 @@ void watchForKey(redisClient *c, robj *key) {
}
/* This key is not already watched in this DB. Let's add it */
clients = dictFetchValue(c->db->watched_keys,key);
if (!clients) {
if (!clients) {
clients = listCreate();
dictAdd(c->db->watched_keys,key,clients);
incrRefCount(key);
Expand Down
4 changes: 2 additions & 2 deletions src/networking.c
Expand Up @@ -1495,7 +1495,7 @@ void rewriteClientCommandVector(redisClient *c, int argc, ...) {
va_start(ap,argc);
for (j = 0; j < argc; j++) {
robj *a;

a = va_arg(ap, robj*);
argv[j] = a;
incrRefCount(a);
Expand All @@ -1517,7 +1517,7 @@ void rewriteClientCommandVector(redisClient *c, int argc, ...) {
* The new val ref count is incremented, and the old decremented. */
void rewriteClientCommandArgument(redisClient *c, int i, robj *newval) {
robj *oldval;

redisAssertWithInfo(c,NULL,i < c->argc);
oldval = c->argv[i];
c->argv[i] = newval;
Expand Down
6 changes: 3 additions & 3 deletions src/pqsort.c
Expand Up @@ -69,7 +69,7 @@ static inline void
swapfunc(char *a, char *b, size_t n, int swaptype)
{

if (swaptype <= 1)
if (swaptype <= 1)
swapcode(long, a, b, n)
else
swapcode(char, a, b, n)
Expand Down Expand Up @@ -160,9 +160,9 @@ loop: SWAPINIT(a, es);
(lrange > _r && rrange > _r)))
_pqsort(a, r / es, es, cmp, lrange, rrange);
}
if ((r = pd - pc) > es) {
if ((r = pd - pc) > es) {
void *_l, *_r;

/* Iterate rather than recurse to save stack space */
a = pn - r;
n = r / es;
Expand Down
2 changes: 1 addition & 1 deletion src/rdb.c
Expand Up @@ -671,7 +671,7 @@ int rdbSave(char *filename) {
sds keystr = dictGetKey(de);
robj key, *o = dictGetVal(de);
long long expire;

initStaticStringObject(key,keystr);
expire = getExpire(db,&key);
if (rdbSaveKeyValuePair(&rdb,&key,o,expire,now) == -1) goto werr;
Expand Down
4 changes: 2 additions & 2 deletions src/redis-check-dump.c
Expand Up @@ -143,7 +143,7 @@ static char types[256][16];

/* Return true if 't' is a valid object type. */
int checkType(unsigned char t) {
/* In case a new object type is added, update the following
/* In case a new object type is added, update the following
* condition as necessary. */
return
(t >= REDIS_HASH_ZIPMAP && t <= REDIS_HASH_ZIPLIST) ||
Expand Down Expand Up @@ -514,7 +514,7 @@ entry loadEntry() {
return e;
} else {
/* optionally consume expire */
if (e.type == REDIS_EXPIRETIME ||
if (e.type == REDIS_EXPIRETIME ||
e.type == REDIS_EXPIRETIME_MS) {
if (!processTime(e.type)) return e;
if (!loadType(&e)) return e;
Expand Down

0 comments on commit b411678

Please sign in to comment.