From 2fe6a7b4f53cb3238d36c1f8f66733ab71ecf0d3 Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Thu, 10 Dec 2015 18:25:35 +0530 Subject: [PATCH] Fix typos in source code comment. --- src/ae_evport.c | 2 +- src/aof.c | 6 +++--- src/bitops.c | 2 +- src/cluster.c | 16 ++++++++-------- src/config.c | 4 ++-- src/db.c | 4 ++-- src/debug.c | 2 +- src/dict.c | 2 +- src/help.h | 6 +++--- src/hyperloglog.c | 14 +++++++------- src/latency.c | 10 +++++----- src/networking.c | 4 ++-- src/notify.c | 2 +- src/object.c | 2 +- src/rdb.c | 20 ++++++++++---------- src/redis-check-rdb.c | 2 +- src/redis-cli.c | 12 ++++++------ src/replication.c | 8 ++++---- src/scripting.c | 14 +++++++------- src/sds.c | 16 ++++++++-------- src/sentinel.c | 12 ++++++------ src/server.c | 16 ++++++++-------- src/server.h | 4 ++-- src/slowlog.c | 2 +- src/sort.c | 2 +- src/t_hash.c | 2 +- src/t_list.c | 2 +- src/t_set.c | 16 ++++++++-------- src/t_string.c | 2 +- src/t_zset.c | 2 +- src/util.c | 2 +- 31 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/ae_evport.c b/src/ae_evport.c index 5c317becb..b79ed9bc7 100644 --- a/src/ae_evport.c +++ b/src/ae_evport.c @@ -232,7 +232,7 @@ static void aeApiDelEvent(aeEventLoop *eventLoop, int fd, int mask) { /* * ENOMEM is a potentially transient condition, but the kernel won't * generally return it unless things are really bad. EAGAIN indicates - * we've reached an resource limit, for which it doesn't make sense to + * we've reached a resource limit, for which it doesn't make sense to * retry (counter-intuitively). All other errors indicate a bug. In any * of these cases, the best we can do is to abort. */ diff --git a/src/aof.c b/src/aof.c index f1a972c23..110754a4c 100644 --- a/src/aof.c +++ b/src/aof.c @@ -263,7 +263,7 @@ int startAppendOnly(void) { * About the 'force' argument: * * When the fsync policy is set to 'everysec' we may delay the flush if there - * is still an fsync() going on in the background thread, since for instance + * is still a fsync() going on in the background thread, since for instance * on Linux write(2) will be blocked by the background fsync anyway. * When this happens we remember that there is some aof buffer to be * flushed ASAP, and will try to do that in the serverCron() function. @@ -458,7 +458,7 @@ sds catAppendOnlyGenericCommand(sds dst, int argc, robj **argv) { return dst; } -/* Create the sds representation of an PEXPIREAT command, using +/* Create the sds representation of a PEXPIREAT command, using * 'seconds' as time to live and 'cmd' to understand what command * we are translating into a PEXPIREAT. * @@ -1376,7 +1376,7 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) { * * There are two possible scenarios: * - * 1) AOF is DISABLED and this was a one time rewrite. The temporary + * 1) AOF is DISABLED and this was one time rewrite. The temporary * file will be renamed to the configured file. When this file already * exists, it will be unlinked, which may block the server. * diff --git a/src/bitops.c b/src/bitops.c index e4c383612..20a546f0f 100644 --- a/src/bitops.c +++ b/src/bitops.c @@ -57,7 +57,7 @@ static int getBitOffsetFromArgument(client *c, robj *o, size_t *offset) { /* Count number of bits set in the binary array pointed by 's' and long * 'count' bytes. The implementation of this function is required to - * work with a input string length up to 512 MB. */ + * work with an input string length up to 512 MB. */ size_t redisPopcount(void *s, long count) { size_t bits = 0; unsigned char *p = s; diff --git a/src/cluster.c b/src/cluster.c index 86a34578b..3949c4166 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1072,7 +1072,7 @@ void clusterHandleConfigEpochCollision(clusterNode *sender) { * in the cluster without dealing with the problem of other nodes re-adding * back the node to nodes we already sent the FORGET command to. * - * The data structure used is a hash table with an sds string representing + * The data structure used is a hash table with a sds string representing * the node ID as key, and the time when it is ok to re-add the node as * value. * -------------------------------------------------------------------------- */ @@ -1117,7 +1117,7 @@ void clusterBlacklistAddNode(clusterNode *node) { } /* Return non-zero if the specified node ID exists in the blacklist. - * You don't need to pass an sds string here, any pointer to 40 bytes + * You don't need to pass a sds string here, any pointer to 40 bytes * will work. */ int clusterBlacklistExists(char *nodeid) { sds id = sdsnewlen(nodeid,CLUSTER_NAMELEN); @@ -1233,12 +1233,12 @@ int clusterHandshakeInProgress(char *ip, int port) { return de != NULL; } -/* Start an handshake with the specified address if there is not one +/* Start a handshake with the specified address if there is not one * already in progress. Returns non-zero if the handshake was actually * started. On error zero is returned and errno is set to one of the * following values: * - * EAGAIN - There is already an handshake in progress for this address. + * EAGAIN - There is already a handshake in progress for this address. * EINVAL - IP or port are not valid. */ int clusterStartHandshake(char *ip, int port) { clusterNode *n; @@ -3634,7 +3634,7 @@ sds representClusterNodeFlags(sds ci, uint16_t flags) { /* Generate a csv-alike representation of the specified cluster node. * See clusterGenNodesDescription() top comment for more information. * - * The function returns the string representation as an SDS string. */ + * The function returns the string representation as a SDS string. */ sds clusterGenNodeDescription(clusterNode *node) { int j, start; sds ci; @@ -3700,7 +3700,7 @@ sds clusterGenNodeDescription(clusterNode *node) { } /* Generate a csv-alike representation of the nodes we are aware of, - * including the "myself" node, and return an SDS string containing the + * including the "myself" node, and return a SDS string containing the * representation (it is up to the caller to free it). * * All the nodes matching at least one of the node flags specified in @@ -4932,7 +4932,7 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in } /* Handle the read-only client case reading from a slave: if this - * node is a slave and the request is about an hash slot our master + * node is a slave and the request is about a hash slot our master * is serving, we can reply without redirection. */ if (c->flags & CLIENT_READONLY && cmd->flags & CMD_READONLY && @@ -4987,7 +4987,7 @@ void clusterRedirectClient(client *c, clusterNode *n, int hashslot, int error_co * 3) The client may remain blocked forever (or up to the max timeout time) * waiting for a key change that will never happen. * - * If the client is found to be blocked into an hash slot this node no + * If the client is found to be blocked into a hash slot this node no * longer handles, the client is sent a redirection error, and the function * returns 1. Otherwise 0 is returned and no operation is performed. */ int clusterRedirectBlockedClientIfNeeded(client *c) { diff --git a/src/config.c b/src/config.c index 62f67b669..46ca1578d 100644 --- a/src/config.c +++ b/src/config.c @@ -962,7 +962,7 @@ void configSetCommand(client *c) { "cluster-slave-validity-factor",server.cluster_slave_validity_factor,0,LLONG_MAX) { } config_set_numerical_field( "hz",server.hz,0,LLONG_MAX) { - /* Hz is more an hint from the user, so we accept values out of range + /* Hz is more a hint from the user, so we accept values out of range * but cap them to reasonable values. */ if (server.hz < CONFIG_MIN_HZ) server.hz = CONFIG_MIN_HZ; if (server.hz > CONFIG_MAX_HZ) server.hz = CONFIG_MAX_HZ; @@ -1502,7 +1502,7 @@ void rewriteConfigNumericalOption(struct rewriteConfigState *state, char *option rewriteConfigRewriteLine(state,option,line,force); } -/* Rewrite a octal option. */ +/* Rewrite an octal option. */ void rewriteConfigOctalOption(struct rewriteConfigState *state, char *option, int value, int defvalue) { int force = value != defvalue; sds line = sdscatprintf(sdsempty(),"%s %o",option,value); diff --git a/src/db.c b/src/db.c index 9a4222fe2..fbd48c5b6 100644 --- a/src/db.c +++ b/src/db.c @@ -225,7 +225,7 @@ int dbDelete(redisDb *db, robj *key) { * o = dbUnshareStringValue(db,key,o); * * At this point the caller is ready to modify the object, for example - * using an sdscat() call to append some data, or anything else. + * using a sdscat() call to append some data, or anything else. */ robj *dbUnshareStringValue(redisDb *db, robj *key, robj *o) { serverAssert(o->type == OBJ_STRING); @@ -1115,7 +1115,7 @@ int *getKeysUsingCommandTable(struct redisCommand *cmd,robj **argv, int argc, in /* Return all the arguments that are keys in the command passed via argc / argv. * * The command returns the positions of all the key arguments inside the array, - * so the actual return value is an heap allocated array of integers. The + * so the actual return value is a heap allocated array of integers. The * length of the array is returned by reference into *numkeys. * * 'cmd' must be point to the corresponding entry into the redisCommand diff --git a/src/debug.c b/src/debug.c index ef6f4659f..c67dfe933 100644 --- a/src/debug.c +++ b/src/debug.c @@ -367,7 +367,7 @@ void debugCommand(client *c) { key = dictGetKey(de); if (val->type != OBJ_STRING || !sdsEncodedObject(val)) { - addReplyError(c,"Not an sds encoded string."); + addReplyError(c,"Not a sds encoded string."); } else { addReplyStatusFormat(c, "key_sds_len:%lld, key_sds_avail:%lld, " diff --git a/src/dict.c b/src/dict.c index 4425a94e8..2b2ba635c 100644 --- a/src/dict.c +++ b/src/dict.c @@ -188,7 +188,7 @@ int _dictInit(dict *d, dictType *type, } /* Resize the table to the minimal size that contains all the elements, - * but with the invariant of a USED/BUCKETS ratio near to <= 1 */ + * but with the invariant of an USED/BUCKETS ratio near to <= 1 */ int dictResize(dict *d) { int minimal; diff --git a/src/help.h b/src/help.h index fe47c3ee4..6892d2875 100644 --- a/src/help.h +++ b/src/help.h @@ -179,7 +179,7 @@ struct commandHelp { "3.0.0" }, { "CLUSTER SETSLOT", "slot IMPORTING|MIGRATING|STABLE|NODE [node-id]", - "Bind an hash slot to a specific node", + "Bind a hash slot to a specific node", 12, "3.0.0" }, { "CLUSTER SLAVES", @@ -304,7 +304,7 @@ struct commandHelp { "1.0.0" }, { "EXPIREAT", "key timestamp", - "Set the expiration for a key as a UNIX timestamp", + "Set the expiration for a key as an UNIX timestamp", 0, "1.2.0" }, { "FLUSHALL", @@ -574,7 +574,7 @@ struct commandHelp { "2.6.0" }, { "PEXPIREAT", "key milliseconds-timestamp", - "Set the expiration for a key as a UNIX timestamp specified in milliseconds", + "Set the expiration for a key as an UNIX timestamp specified in milliseconds", 0, "2.6.0" }, { "PFADD", diff --git a/src/hyperloglog.c b/src/hyperloglog.c index 8ccc16be2..152f0a456 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -295,7 +295,7 @@ static char *invalid_hll_err = "-INVALIDOBJ Corrupted HLL object detected\r\n"; * |11000000| <- Our byte at b0 * +--------+ * - * To create a AND-mask to clear the bits about this position, we just + * To create an AND-mask to clear the bits about this position, we just * initialize the mask with the value 63, left shift it of "fs" bits, * and finally invert the result. * @@ -750,10 +750,10 @@ int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) { * * The other cases are more complex: our register requires to be updated * and is either currently represented by a VAL opcode with len > 1, - * by a ZERO opcode with len > 1, or by an XZERO opcode. + * by a ZERO opcode with len > 1, or by a XZERO opcode. * * In those cases the original opcode must be split into muliple - * opcodes. The worst case is an XZERO split in the middle resuling into + * opcodes. The worst case is a XZERO split in the middle resuling into * XZERO - VAL - XZERO, so the resulting sequence max length is * 5 bytes. * @@ -1084,7 +1084,7 @@ int hllMerge(uint8_t *max, robj *hll) { /* ========================== HyperLogLog commands ========================== */ -/* Create an HLL object. We always create the HLL using sparse encoding. +/* Create a HLL object. We always create the HLL using sparse encoding. * This will be upgraded to the dense representation as needed. */ robj *createHLLObject(void) { robj *o; @@ -1205,7 +1205,7 @@ void pfcountCommand(client *c) { uint8_t max[HLL_HDR_SIZE+HLL_REGISTERS], *registers; int j; - /* Compute an HLL with M[i] = MAX(M[i]_j). */ + /* Compute a HLL with M[i] = MAX(M[i]_j). */ memset(max,0,sizeof(max)); hdr = (struct hllhdr*) max; hdr->encoding = HLL_RAW; /* Special internal-only encoding. */ @@ -1287,7 +1287,7 @@ void pfmergeCommand(client *c) { struct hllhdr *hdr; int j; - /* Compute an HLL with M[i] = MAX(M[i]_j). + /* Compute a HLL with M[i] = MAX(M[i]_j). * We we the maximum into the max array of registers. We'll write * it to the target variable later. */ memset(max,0,sizeof(max)); @@ -1335,7 +1335,7 @@ void pfmergeCommand(client *c) { HLL_INVALIDATE_CACHE(hdr); signalModifiedKey(c->db,c->argv[1]); - /* We generate an PFADD event for PFMERGE for semantical simplicity + /* We generate a PFADD event for PFMERGE for semantical simplicity * since in theory this is a mass-add of elements. */ notifyKeyspaceEvent(NOTIFY_STRING,"pfadd",c->argv[1],c->db->id); server.dirty++; diff --git a/src/latency.c b/src/latency.c index 6f8b2a59f..7e32cd35e 100644 --- a/src/latency.c +++ b/src/latency.c @@ -224,7 +224,7 @@ sds createLatencyReport(void) { int advise_data_writeback = 0; /* data=writeback. */ int advise_no_appendfsync = 0; /* don't fsync during rewrites. */ int advise_local_disk = 0; /* Avoid remote disks. */ - int advise_ssd = 0; /* Use an SSD drive. */ + int advise_ssd = 0; /* Use a SSD drive. */ int advise_write_load_info = 0; /* Print info about AOF and write load. */ int advise_hz = 0; /* Use higher HZ. */ int advise_large_objects = 0; /* Deletion of large objects. */ @@ -395,7 +395,7 @@ sds createLatencyReport(void) { /* Better VM. */ report = sdscat(report,"\nI have a few advices for you:\n\n"); if (advise_better_vm) { - report = sdscat(report,"- If you are using a virtual machine, consider upgrading it with a faster one using an hypervisior that provides less latency during fork() calls. Xen is known to have poor fork() performance. Even in the context of the same VM provider, certain kinds of instances can execute fork faster than others.\n"); + report = sdscat(report,"- If you are using a virtual machine, consider upgrading it with a faster one using a hypervisior that provides less latency during fork() calls. Xen is known to have poor fork() performance. Even in the context of the same VM provider, certain kinds of instances can execute fork faster than others.\n"); } /* Slow log. */ @@ -431,7 +431,7 @@ sds createLatencyReport(void) { } if (advise_data_writeback) { - report = sdscat(report,"- Mounting ext3/4 filesystems with data=writeback can provide a performance boost compared to data=ordered, however this mode of operation provides less guarantees, and sometimes it can happen that after a hard crash the AOF file will have an half-written command at the end and will require to be repaired before Redis restarts.\n"); + report = sdscat(report,"- Mounting ext3/4 filesystems with data=writeback can provide a performance boost compared to data=ordered, however this mode of operation provides less guarantees, and sometimes it can happen that after a hard crash the AOF file will have a half-written command at the end and will require to be repaired before Redis restarts.\n"); } if (advise_disk_contention) { @@ -439,7 +439,7 @@ sds createLatencyReport(void) { } if (advise_no_appendfsync) { - report = sdscat(report,"- Assuming from the point of view of data safety this is viable in your environment, you could try to enable the 'no-appendfsync-on-rewrite' option, so that fsync will not be performed while there is a child rewriting the AOF file or producing an RDB file (the moment where there is high disk contention).\n"); + report = sdscat(report,"- Assuming from the point of view of data safety this is viable in your environment, you could try to enable the 'no-appendfsync-on-rewrite' option, so that fsync will not be performed while there is a child rewriting the AOF file or producing a RDB file (the moment where there is high disk contention).\n"); } if (advise_relax_fsync_policy && server.aof_fsync == AOF_FSYNC_ALWAYS) { @@ -561,7 +561,7 @@ sds latencyCommandGenSparkeline(char *event, struct latencyTimeSeries *ts) { * * LATENCY SAMPLES: return time-latency samples for the specified event. * LATENCY LATEST: return the latest latency for all the events classes. - * LATENCY DOCTOR: returns an human readable analysis of instance latency. + * LATENCY DOCTOR: returns a human readable analysis of instance latency. * LATENCY GRAPH: provide an ASCII graph of the latency of the specified event. */ void latencyCommand(client *c) { diff --git a/src/networking.c b/src/networking.c index 74de7e920..07614ac2c 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1333,7 +1333,7 @@ char *getClientPeerId(client *c) { return c->peerid; } -/* Concatenate a string representing the state of a client in an human +/* Concatenate a string representing the state of a client in a human * readable format, into the sds string 's'. */ sds catClientInfoString(sds s, client *client) { char flags[16], events[3], *p; @@ -1629,7 +1629,7 @@ void rewriteClientCommandArgument(client *c, int i, robj *newval) { * enforcing the client output length limits. */ unsigned long getClientOutputBufferMemoryUsage(client *c) { unsigned long list_item_size = sizeof(listNode)+5; - /* The +5 above means we assume an sds16 hdr, may not be true + /* The +5 above means we assume a sds16 hdr, may not be true * but is not going to be a problem. */ return c->reply_bytes + (list_item_size*listLength(c->reply)); diff --git a/src/notify.c b/src/notify.c index 94a1f2e79..c82de6a9d 100644 --- a/src/notify.c +++ b/src/notify.c @@ -62,7 +62,7 @@ int keyspaceEventsStringToFlags(char *classes) { /* This function does exactly the revese of the function above: it gets * as input an integer with the xored flags and returns a string representing - * the selected classes. The string returned is an sds string that needs to + * the selected classes. The string returned is a sds string that needs to * be released with sdsfree(). */ sds keyspaceEventsFlagsToString(int flags) { sds res; diff --git a/src/object.c b/src/object.c index 167290d49..49daf38c1 100644 --- a/src/object.c +++ b/src/object.c @@ -710,7 +710,7 @@ robj *objectCommandLookupOrReply(client *c, robj *key, robj *reply) { return o; } -/* Object command allows to inspect the internals of an Redis Object. +/* Object command allows to inspect the internals of a Redis Object. * Usage: OBJECT */ void objectCommand(client *c) { robj *o; diff --git a/src/rdb.c b/src/rdb.c index 8d3e9d173..b01fb66bd 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -65,7 +65,7 @@ int rdbSaveType(rio *rdb, unsigned char type) { return rdbWriteRaw(rdb,&type,1); } -/* Load a "type" in RDB format, that is a one byte unsigned integer. +/* Load a "type" in RDB format, that is one byte unsigned integer. * This function is not only used to load object types, but also special * "types" like the end-of-file type, the EXPIRE type, and so forth. */ int rdbLoadType(rio *rdb) { @@ -121,7 +121,7 @@ int rdbSaveLen(rio *rdb, uint32_t len) { } /* Load an encoded length. The "isencoded" argument is set to 1 if the length - * is not actually a length but an "encoding type". See the RDB_ENC_* + * is not actually a length but a "encoding type". See the RDB_ENC_* * definitions in rdb.h for more information. */ uint32_t rdbLoadLen(rio *rdb, int *isencoded) { unsigned char buf[2]; @@ -216,7 +216,7 @@ void *rdbLoadIntegerObject(rio *rdb, int enctype, int flags) { } /* String objects in the form "2391" "-100" without any space and with a - * range of values that can fit in an 8, 16 or 32 bit signed value can be + * range of values that can fit in a 8, 16 or 32 bit signed value can be * encoded as integers to save space */ int rdbTryIntegerEncoding(char *s, size_t len, unsigned char *enc) { long long value; @@ -277,7 +277,7 @@ ssize_t rdbSaveLzfStringObject(rio *rdb, unsigned char *s, size_t len) { return nwritten; } -/* Load an LZF compressed string in RDB format. The returned value +/* Load a LZF compressed string in RDB format. The returned value * changes according to 'flags'. For more info check the * rdbGenericLoadStringObject() function. */ void *rdbLoadLzfStringObject(rio *rdb, int flags) { @@ -382,16 +382,16 @@ int rdbSaveStringObject(rio *rdb, robj *obj) { } } -/* Load a string object from an RDB file according to flags: +/* Load a string object from a RDB file according to flags: * - * RDB_LOAD_NONE (no flags): load an RDB object, unencoded. + * RDB_LOAD_NONE (no flags): load a RDB object, unencoded. * RDB_LOAD_ENC: If the returned type is a Redis object, try to * encode it in a special way to be more memory * efficient. When this flag is passed the function - * no longer guarantees that obj->ptr is an SDS string. + * no longer guarantees that obj->ptr is a SDS string. * RDB_LOAD_PLAIN: Return a plain string allocated with zmalloc() * instead of a Redis object. - * RDB_LOAD_SDS: Return an SDS string instead of a Redis object. + * RDB_LOAD_SDS: Return a SDS string instead of a Redis object. */ void *rdbGenericLoadStringObject(rio *rdb, int flags) { int encode = flags & RDB_LOAD_ENC; @@ -1355,7 +1355,7 @@ int rdbLoad(char *filename) { /* Read value */ if ((val = rdbLoadObject(type,&rdb)) == NULL) goto eoferr; /* Check if the key already expired. This function is used when loading - * an RDB file from disk, either at startup, or when an RDB was + * a RDB file from disk, either at startup, or when a RDB was * received from the master. In the latter case, the master is * responsible for key expiry. If we would expire keys here, the * snapshot taken by the master may not be reflected on the slave. */ @@ -1541,7 +1541,7 @@ void backgroundSaveDoneHandler(int exitcode, int bysignal) { } } -/* Spawn an RDB child that writes the RDB to the sockets of the slaves +/* Spawn a RDB child that writes the RDB to the sockets of the slaves * that are currently in SLAVE_STATE_WAIT_BGSAVE_START state. */ int rdbSaveToSlavesSockets(void) { int *fds; diff --git a/src/redis-check-rdb.c b/src/redis-check-rdb.c index 7bb93b60b..51bac4478 100644 --- a/src/redis-check-rdb.c +++ b/src/redis-check-rdb.c @@ -71,7 +71,7 @@ static errors_t errors; errors.level++; \ } -/* Data type to hold opcode with optional key name an success status */ +/* Data type to hold opcode with optional key name a success status */ typedef struct { char* key; int type; diff --git a/src/redis-cli.c b/src/redis-cli.c index f70c05846..4a3d6f7a8 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -491,7 +491,7 @@ int isColorTerm(void) { } /* Helpe function for sdsCatColorizedLdbReply() appending colorize strings - * to an SDS string. */ + * to a SDS string. */ sds sdscatcolor(sds o, char *s, size_t len, char *color) { if (!isColorTerm()) return sdscatlen(o,s,len); @@ -974,7 +974,7 @@ static void usage(void) { " Default time interval is 1 sec. Change it using -i.\n" " --lru-test Simulate a cache workload with an 80-20 distribution.\n" " --slave Simulate a slave showing commands received from the master.\n" -" --rdb Transfer an RDB dump from remote server to local file.\n" +" --rdb Transfer a RDB dump from remote server to local file.\n" " --pipe Transfer raw Redis protocol from stdin to server.\n" " --pipe-timeout In --pipe mode, abort with error if after sending all data.\n" " no reply is received within seconds.\n" @@ -1200,7 +1200,7 @@ static int evalMode(int argc, char **argv) { got_comma = 0; keys = 0; - /* Load the script from the file, as an sds string. */ + /* Load the script from the file, as a sds string. */ fp = fopen(config.eval,"r"); if (!fp) { fprintf(stderr, @@ -1321,7 +1321,7 @@ struct distsamples { }; /* Helper function for latencyDistMode(). Performs the spectrum visualization - * of the collected samples targeting an xterm 256 terminal. + * of the collected samples targeting a xterm 256 terminal. * * Takes an array of distsamples structures, ordered from smaller to bigger * 'max' value. Last sample max must be 0, to mean that it olds all the @@ -1334,7 +1334,7 @@ struct distsamples { void showLatencyDistSamples(struct distsamples *samples, long long tot) { int j; - /* We convert samples into a index inside the palette + /* We convert samples into an index inside the palette * proportional to the percentage a given bucket represents. * This way intensity of the different parts of the spectrum * don't change relative to the number of requests, which avoids to @@ -2275,7 +2275,7 @@ static void LRUTestMode(void) { * Intrisic latency mode. * * Measure max latency of a running process that does not result from - * syscalls. Basically this software should provide an hint about how much + * syscalls. Basically this software should provide a hint about how much * time the kernel leaves the process without a chance to run. *--------------------------------------------------------------------------- */ diff --git a/src/replication.c b/src/replication.c index 8aa0d807a..ee6c4027f 100644 --- a/src/replication.c +++ b/src/replication.c @@ -654,7 +654,7 @@ void syncCommand(client *c) { } else if (server.rdb_child_pid != -1 && server.rdb_child_type == RDB_CHILD_TYPE_SOCKET) { - /* There is an RDB child process but it is writing directly to + /* There is a RDB child process but it is writing directly to * children sockets. We need to wait for the next BGSAVE * in order to synchronize. */ serverLog(LL_NOTICE,"Waiting for next BGSAVE for SYNC"); @@ -862,9 +862,9 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type) { } else if (slave->replstate == SLAVE_STATE_WAIT_BGSAVE_END) { struct redis_stat buf; - /* If this was an RDB on disk save, we have to prepare to send + /* If this was a RDB on disk save, we have to prepare to send * the RDB from disk to the slave socket. Otherwise if this was - * already an RDB -> Slaves socket transfer, used in the case of + * already a RDB -> Slaves socket transfer, used in the case of * diskless replication, our work is trivial, we can just put * the slave online. */ if (type == RDB_CHILD_TYPE_SOCKET) { @@ -1155,7 +1155,7 @@ error: /* Send a synchronous command to the master. Used to send AUTH and * REPLCONF commands before starting the replication with SYNC. * - * The command returns an sds string representing the result of the + * The command returns a sds string representing the result of the * operation. On error the first byte is a "-". */ #define SYNC_CMD_READ (1<<0) diff --git a/src/scripting.c b/src/scripting.c index bec488b3e..31b7e21f8 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -555,7 +555,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) { * output buffers. */ if (listLength(c->reply) == 0 && c->bufpos < PROTO_REPLY_CHUNK_BYTES) { /* This is a fast path for the common case of a reply inside the - * client static buffer. Don't create an SDS string but just use + * client static buffer. Don't create a SDS string but just use * the client buffer directly. */ c->buf[c->bufpos] = '\0'; reply = c->buf; @@ -619,7 +619,7 @@ cleanup: if (raise_error) { /* If we are here we should have an error in the stack, in the - * form of a table with an "err" field. Extract the string to + * form of a table with a "err" field. Extract the string to * return the plain error. */ inuse--; return luaRaiseError(lua); @@ -1242,7 +1242,7 @@ void evalGenericCommand(client *c, int evalsha) { /* Hash the code if this is an EVAL call */ sha1hex(funcname+2,c->argv[1]->ptr,sdslen(c->argv[1]->ptr)); } else { - /* We already have the SHA if it is a EVALSHA */ + /* We already have the SHA if it is an EVALSHA */ int j; char *sha = c->argv[1]->ptr; @@ -1534,7 +1534,7 @@ void ldbLog(sds entry) { } /* A version of ldbLog() which prevents producing logs greater than - * ldb.maxlen. The first time the limit is reached an hint is generated + * ldb.maxlen. The first time the limit is reached a hint is generated * to inform the user that reply trimming can be disabled using the * debugger "maxlen" command. */ void ldbLogWithMaxLen(sds entry) { @@ -1637,7 +1637,7 @@ int ldbStartSession(client *c) { /* End a debugging session after the EVAL call with debugging enabled * returned. */ void ldbEndSession(client *c) { - /* Emit the remaining logs and an mark. */ + /* Emit the remaining logs and a mark. */ ldbLog(sdsnew("")); ldbSendLogs(); @@ -1835,7 +1835,7 @@ void ldbList(int around, int context) { } } -/* Append an human readable representation of the Lua value at position 'idx' +/* Append a human readable representation of the Lua value at position 'idx' * on the stack of the 'lua' state, to the SDS string passed as argument. * The new SDS string with the represented value attached is returned. * Used in order to implement ldbLogStackValue(). @@ -2002,7 +2002,7 @@ char *ldbRedisProtocolToHuman_MultiBulk(sds *o, char *reply) { return p; } -/* Log a Redis reply as debugger output, in an human readable format. +/* Log a Redis reply as debugger output, in a human readable format. * If the resulting string is longer than 'len' plus a few more chars * used as prefix, it gets truncated. */ void ldbLogRedisReply(char *reply) { diff --git a/src/sds.c b/src/sds.c index e3dd67352..f06b69752 100644 --- a/src/sds.c +++ b/src/sds.c @@ -71,7 +71,7 @@ static inline char sdsReqType(size_t string_size) { * If NULL is used for 'init' the string is initialized with zero bytes. * * The string is always null-termined (all the sds strings are, always) so - * even if you create an sds string with: + * even if you create a sds string with: * * mystring = sdsnewlen("abc",3); * @@ -146,12 +146,12 @@ sds sdsnew(const char *init) { return sdsnewlen(init, initlen); } -/* Duplicate an sds string. */ +/* Duplicate a sds string. */ sds sdsdup(const sds s) { return sdsnewlen(s, sdslen(s)); } -/* Free an sds string. No operation is performed if 's' is NULL. */ +/* Free a sds string. No operation is performed if 's' is NULL. */ void sdsfree(sds s) { if (s == NULL) return; s_free((char*)s-sdsHdrSize(s[-1])); @@ -176,7 +176,7 @@ void sdsupdatelen(sds s) { sdssetlen(s, reallen); } -/* Modify an sds string in-place to make it empty (zero length). +/* Modify a sds string in-place to make it empty (zero length). * However all the existing buffer is not discarded but set as free space * so that next append operations will not require allocations up to the * number of bytes previously available. */ @@ -432,7 +432,7 @@ int sdsll2str(char *s, long long value) { size_t l; /* Generate the string representation, this method produces - * an reversed string. */ + * a reversed string. */ v = (value < 0) ? -value : value; p = s; do { @@ -463,7 +463,7 @@ int sdsull2str(char *s, unsigned long long v) { size_t l; /* Generate the string representation, this method produces - * an reversed string. */ + * a reversed string. */ p = s; do { *p++ = '0'+(v%10); @@ -486,7 +486,7 @@ int sdsull2str(char *s, unsigned long long v) { return l; } -/* Create an sds string from a long long value. It is much faster than: +/* Create a sds string from a long long value. It is much faster than: * * sdscatprintf(sdsempty(),"%lld\n", value); */ @@ -1064,7 +1064,7 @@ sds sdsmapchars(sds s, const char *from, const char *to, size_t setlen) { } /* Join an array of C strings using the specified separator (also a C string). - * Returns the result as an sds string. */ + * Returns the result as a sds string. */ sds sdsjoin(char **argv, int argc, char *sep) { sds join = sdsempty(); int j; diff --git a/src/sentinel.c b/src/sentinel.c index a246a5b37..73e1aea33 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -949,7 +949,7 @@ instanceLink *createInstanceLink(void) { return link; } -/* Disconnect an hiredis connection in the context of an instance link. */ +/* Disconnect a hiredis connection in the context of an instance link. */ void instanceLinkCloseConnection(instanceLink *link, redisAsyncContext *c) { if (c == NULL) return; @@ -1080,7 +1080,7 @@ int sentinelUpdateSentinelAddressInAllMasters(sentinelRedisInstance *ri) { return reconfigured; } -/* This function is called when an hiredis connection reported an error. +/* This function is called when a hiredis connection reported an error. * We set it to NULL and mark the link as disconnected so that it will be * reconnected again. * @@ -2305,7 +2305,7 @@ void sentinelPublishReplyCallback(redisAsyncContext *c, void *reply, void *privd ri->last_pub_time = mstime(); } -/* Process an hello message received via Pub/Sub in master or slave instance, +/* Process a hello message received via Pub/Sub in master or slave instance, * or sent directly to this sentinel via the (fake) PUBLISH command of Sentinel. * * If the master name specified in the message is not known, the message is @@ -2428,7 +2428,7 @@ void sentinelReceiveHelloMessages(redisAsyncContext *c, void *reply, void *privd sentinelProcessHelloMessage(r->element[2]->str, r->element[2]->len); } -/* Send an "Hello" message via Pub/Sub to the specified 'ri' Redis +/* Send a "Hello" message via Pub/Sub to the specified 'ri' Redis * instance in order to broadcast the current configuraiton for this * master, and to advertise the existence of this Sentinel at the same time. * @@ -2480,7 +2480,7 @@ int sentinelSendHello(sentinelRedisInstance *ri) { } /* Reset last_pub_time in all the instances in the specified dictionary - * in order to force the delivery of an Hello update ASAP. */ + * in order to force the delivery of a Hello update ASAP. */ void sentinelForceHelloUpdateDictOfRedisInstances(dict *instances) { dictIterator *di; dictEntry *de; @@ -2494,7 +2494,7 @@ void sentinelForceHelloUpdateDictOfRedisInstances(dict *instances) { dictReleaseIterator(di); } -/* This function forces the delivery of an "Hello" message (see +/* This function forces the delivery of a "Hello" message (see * sentinelSendHello() top comment for further information) to all the Redis * and Sentinel instances related to the specified 'master'. * diff --git a/src/server.c b/src/server.c index 17bfcbbef..9a8e000e9 100644 --- a/src/server.c +++ b/src/server.c @@ -403,7 +403,7 @@ mstime_t mstime(void) { return ustime()/1000; } -/* After an RDB dump or AOF rewrite we exit from children using _exit() instead of +/* After a RDB dump or AOF rewrite we exit from children using _exit() instead of * exit(), because the latter may interact with the same file objects used by * the parent process. However if we are testing the coverage normal exit() is * used in order to obtain the right coverage information. */ @@ -962,7 +962,7 @@ int clientsCronHandleTimeout(client *c, mstime_t now_ms) { return 0; } -/* The client query buffer is an sds.c string that can end with a lot of +/* The client query buffer is a sds.c string that can end with a lot of * free space not used, this function reclaims space if needed. * * The function always returns 0 as it never terminates the client. */ @@ -1118,7 +1118,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { } /* We have just LRU_BITS bits per object for LRU information. - * So we use an (eventually wrapping) LRU clock. + * So we use a (eventually wrapping) LRU clock. * * Note that even if the counter wraps it's not a big problem, * everything will still work but some object will appear younger @@ -1264,7 +1264,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { /* AOF write errors: in this case we have a buffer to flush as well and * clear the AOF error in case of success to make the DB writable again, * however to try every second is enough in case of 'hz' is set to - * an higher frequency. */ + * a higher frequency. */ run_with_period(1000) { if (server.aof_last_write_status == C_ERR) flushAppendOnlyFile(0); @@ -2104,7 +2104,7 @@ struct redisCommand *lookupCommandOrOriginal(sds name) { /* Propagate the specified command (in the context of the specified database id) * to AOF and Slaves. * - * flags are an xor between: + * flags are a xor between: * + PROPAGATE_NONE (no propagation of command at all) * + PROPAGATE_AOF (propagate into the AOF file if is enabled) * + PROPAGATE_REPL (propagate into the replication link) @@ -2544,7 +2544,7 @@ int prepareForShutdown(int flags) { We want to avoid race conditions, for instance our saving child may overwrite the synchronous saving did by SHUTDOWN. */ if (server.rdb_child_pid != -1) { - serverLog(LL_WARNING,"There is a child saving an .rdb. Killing it!"); + serverLog(LL_WARNING,"There is a child saving a .rdb. Killing it!"); kill(server.rdb_child_pid,SIGUSR1); rdbRemoveTempFile(server.rdb_child_pid); } @@ -3357,7 +3357,7 @@ struct evictionPoolEntry *evictionPoolAlloc(void) { return ep; } -/* This is an helper function for freeMemoryIfNeeded(), it is used in order +/* This is a helper function for freeMemoryIfNeeded(), it is used in order * to populate the evictionPool with a few entries every time we want to * expire a key. Keys with idle time smaller than one of the current * keys are added. Keys are always added if there are free entries. @@ -3995,7 +3995,7 @@ int main(int argc, char **argv) { /* Check if we need to start in redis-check-rdb mode. We just execute * the program main. However the program is part of the Redis executable - * so that we can easily execute an RDB check on loading errors. */ + * so that we can easily execute a RDB check on loading errors. */ if (strstr(argv[0],"redis-check-rdb") != NULL) exit(redis_check_rdb_main(argv,argc)); diff --git a/src/server.h b/src/server.h index 0c5fcdb55..6b7e824ac 100644 --- a/src/server.h +++ b/src/server.h @@ -678,7 +678,7 @@ typedef struct redisOp { } redisOp; /* Defines an array of Redis operations. There is an API to add to this - * structure in a easy way. + * structure in an easy way. * * redisOpArrayInit(); * redisOpArrayAppend(); @@ -1279,7 +1279,7 @@ unsigned long aofRewriteBufferSize(void); /* Sorted sets data type */ -/* Struct to hold a inclusive/exclusive range spec by score comparison. */ +/* Struct to hold an inclusive/exclusive range spec by score comparison. */ typedef struct { double min, max; int minex, maxex; /* are min or max exclusive? */ diff --git a/src/slowlog.c b/src/slowlog.c index 484cf06bf..09d80c8f7 100644 --- a/src/slowlog.c +++ b/src/slowlog.c @@ -53,7 +53,7 @@ slowlogEntry *slowlogCreateEntry(robj **argv, int argc, long long duration) { se->argc = slargc; se->argv = zmalloc(sizeof(robj*)*slargc); for (j = 0; j < slargc; j++) { - /* Logging too many arguments is a useless memory waste, so we stop + /* Logging too many arguments is an useless memory waste, so we stop * at SLOWLOG_ENTRY_MAX_ARGC, but use the last argument to specify * how many remaining arguments there were in the original command. */ if (slargc != argc && j == slargc-1) { diff --git a/src/sort.c b/src/sort.c index 7ddd37d95..b349f6c19 100644 --- a/src/sort.c +++ b/src/sort.c @@ -222,7 +222,7 @@ void sortCommand(client *c) { else sortval = createQuicklistObject(); - /* The SORT command has an SQL-alike syntax, parse it */ + /* The SORT command has a SQL-alike syntax, parse it */ while(j < c->argc) { int leftargs = c->argc-j-1; if (!strcasecmp(c->argv[j]->ptr,"asc")) { diff --git a/src/t_hash.c b/src/t_hash.c index c75b391d7..2f6e2e643 100644 --- a/src/t_hash.c +++ b/src/t_hash.c @@ -629,7 +629,7 @@ void hincrbyfloatCommand(client *c) { notifyKeyspaceEvent(NOTIFY_HASH,"hincrbyfloat",c->argv[1],c->db->id); server.dirty++; - /* Always replicate HINCRBYFLOAT as an HSET command with the final value + /* Always replicate HINCRBYFLOAT as a HSET command with the final value * in order to make sure that differences in float pricision or formatting * will not create differences in replicas or after an AOF restart. */ robj *aux, *newobj; diff --git a/src/t_list.c b/src/t_list.c index 0008404dc..433222f81 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -898,7 +898,7 @@ void blockingPopGenericCommand(client *c, int where) { signalModifiedKey(c->db,c->argv[j]); server.dirty++; - /* Replicate it as an [LR]POP instead of B[LR]POP. */ + /* Replicate it as a [LR]POP instead of B[LR]POP. */ rewriteClientCommandVector(c,2, (where == LIST_HEAD) ? shared.lpop : shared.rpop, c->argv[j]); diff --git a/src/t_set.c b/src/t_set.c index 7a2a77ff6..2b96b7dce 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -193,7 +193,7 @@ sds setTypeNextObject(setTypeIterator *si) { } /* Return random element from a non empty set. - * The returned element can be a int64_t value if the set is encoded + * The returned element can be an int64_t value if the set is encoded * as an "intset" blob of integers, or an SDS string if the set * is a regular set. * @@ -426,7 +426,7 @@ void spopWithCountCommand(client *c) { size = setTypeSize(set); - /* Generate an SPOP keyspace notification */ + /* Generate a SPOP keyspace notification */ notifyKeyspaceEvent(NOTIFY_SET,"spop",c->argv[1],c->db->id); server.dirty += count; @@ -441,7 +441,7 @@ void spopWithCountCommand(client *c) { dbDelete(c->db,c->argv[1]); notifyKeyspaceEvent(NOTIFY_GENERIC,"del",c->argv[1],c->db->id); - /* Propagate this command as an DEL operation */ + /* Propagate this command as a DEL operation */ rewriteClientCommandVector(c,2,shared.del,c->argv[1]); signalModifiedKey(c->db,c->argv[1]); server.dirty++; @@ -484,7 +484,7 @@ void spopWithCountCommand(client *c) { setTypeRemove(set,sdsele); } - /* Replicate/AOF this command as an SREM operation */ + /* Replicate/AOF this command as a SREM operation */ propargv[2] = objele; alsoPropagate(server.sremCommand,c->db->id,propargv,3, PROPAGATE_AOF|PROPAGATE_REPL); @@ -531,7 +531,7 @@ void spopWithCountCommand(client *c) { objele = createStringObject(sdsele,sdslen(sdsele)); } - /* Replicate/AOF this command as an SREM operation */ + /* Replicate/AOF this command as a SREM operation */ propargv[2] = objele; alsoPropagate(server.sremCommand,c->db->id,propargv,3, PROPAGATE_AOF|PROPAGATE_REPL); @@ -542,7 +542,7 @@ void spopWithCountCommand(client *c) { } /* Don't propagate the command itself even if we incremented the - * dirty counter. We don't want to propagate an SPOP command since + * dirty counter. We don't want to propagate a SPOP command since * we propagated the command as a set of SREMs operations using * the alsoPropagate() API. */ decrRefCount(propargv[0]); @@ -582,7 +582,7 @@ void spopCommand(client *c) { notifyKeyspaceEvent(NOTIFY_SET,"spop",c->argv[1],c->db->id); - /* Replicate/AOF this command as an SREM operation */ + /* Replicate/AOF this command as a SREM operation */ aux = createStringObject("SREM",4); rewriteClientCommandVector(c,3,aux,c->argv[1],ele); decrRefCount(aux); @@ -979,7 +979,7 @@ void sunionDiffGenericCommand(client *c, robj **setkeys, int setnum, } /* We need a temp set object to store our union. If the dstkey - * is not NULL (that is, we are inside an SUNIONSTORE operation) then + * is not NULL (that is, we are inside a SUNIONSTORE operation) then * this set object will be the resulting object to set into the target key*/ dstset = createIntsetObject(); diff --git a/src/t_string.c b/src/t_string.c index 35eb9d7c1..15d85959a 100644 --- a/src/t_string.c +++ b/src/t_string.c @@ -444,7 +444,7 @@ void appendCommand(client *c) { if (checkType(c,o,OBJ_STRING)) return; - /* "append" is an argument, so always an sds */ + /* "append" is an argument, so always a sds */ append = c->argv[2]; totlen = stringObjectLen(o)+sdslen(append->ptr); if (checkStringLength(c,totlen) != C_OK) diff --git a/src/t_zset.c b/src/t_zset.c index 84bea5aa8..32e811b3f 100644 --- a/src/t_zset.c +++ b/src/t_zset.c @@ -686,7 +686,7 @@ double zzlGetScore(unsigned char *sptr) { return score; } -/* Return a ziplist element as an SDS string. */ +/* Return a ziplist element as a SDS string. */ sds ziplistGetObject(unsigned char *sptr) { unsigned char *vstr; unsigned int vlen; diff --git a/src/util.c b/src/util.c index c1494e021..775bda2bb 100644 --- a/src/util.c +++ b/src/util.c @@ -613,7 +613,7 @@ void getRandomHexChars(char *p, unsigned int len) { } } -/* Given the filename, return the absolute path as an SDS string, or NULL +/* Given the filename, return the absolute path as a SDS string, or NULL * if it fails for some reason. Note that "filename" may be an absolute path * already, this will be detected and handled correctly. *