Skip to content

Commit

Permalink
INTERNAL: Remove whitespace and typos in source files
Browse files Browse the repository at this point in the history
  • Loading branch information
ing-eoking authored and jhpark816 committed Mar 21, 2024
1 parent 35d8fd5 commit 8cfdcba
Show file tree
Hide file tree
Showing 124 changed files with 237 additions and 237 deletions.
6 changes: 3 additions & 3 deletions arcus/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

ARCUS_LDADD= \
libmemcached/libmemcached.la \
libmemcached/libmemcachedutil.la
libmemcached/libmemcachedutil.la

# Multi-Threaded Example

noinst_PROGRAMS+= arcus/multi_threaded
arcus_multi_threaded_SOURCES= arcus/multi_threaded.c

arcus_multi_threaded_LDFLAGS= -g -O0
arcus_multi_threaded_LDADD= $(ARCUS_LDADD)
arcus_multi_threaded_DEPENDENCIES= $(ARCUS_LDADD)
Expand All @@ -19,7 +19,7 @@ arcus_multi_threaded_DEPENDENCIES= $(ARCUS_LDADD)

noinst_PROGRAMS+= arcus/multi_process
arcus_multi_process_SOURCES= arcus/multi_process.c

arcus_multi_process_LDFLAGS= -g -O0
arcus_multi_process_LDADD= $(ARCUS_LDADD)
arcus_multi_process_DEPENDENCIES= $(ARCUS_LDADD)
16 changes: 8 additions & 8 deletions arcus/multi_threaded.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,21 @@ sample_sop_piped_exist(memcached_st *mc, int id, uint32_t userid)

memcached_coll_create_attrs_st attributes;
memcached_coll_create_attrs_init(&attributes, flags, exptime, 10000);

memcached_return_t rc;
memcached_return_t piped_rc;
memcached_return_t results[MANY_PIPED_COUNT];

char **values = (char **)malloc(sizeof(char *) * MANY_PIPED_COUNT);
size_t valuelengths[MANY_PIPED_COUNT];

for (i=0; i<maxcount; i++)
{
{
values[i]= (char *)malloc(sizeof(char) * 15);
valuelengths[i]= snprintf(values[i], 15, "%u", i);
//valuelengths[i]= snprintf(values[i], 15, "value%llu", (unsigned long long)i);
}

memcached_sop_create(mc, key, strlen(key), &attributes);
memcached_sop_insert(mc, key, strlen(key), "0", 1, NULL);
memcached_sop_insert(mc, key, strlen(key), "499", 3, NULL);
Expand All @@ -204,14 +204,14 @@ sample_sop_piped_exist(memcached_st *mc, int id, uint32_t userid)
gettimeofday(&e_time, NULL);
double elapsed_ms = ((e_time.tv_sec - s_time.tv_sec) * 1000.0)
+ ((e_time.tv_usec - s_time.tv_usec) / 1000.0);

if (rc != MEMCACHED_SUCCESS && piped_rc != MEMCACHED_ALL_EXIST)
fprintf(stderr, "sop_piped_exist failed, reason=%s\n", memcached_strerror(NULL, rc));
else
fprintf(stderr, "elapsed time : %lf ms\n", elapsed_ms);

for (i=0; i<maxcount; i++)
{
{
free((void*)values[i]);
}

Expand Down
4 changes: 2 additions & 2 deletions arcus/sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ main(int argc, char *argv[])
false /* do not delete the empty key */,
&result))
return -1;

/* Print */
printf("Retrieved the element. value=%s\n",
memcached_coll_result_get_value(&result, 0));
memcached_coll_result_free(&result);

return 0;
}
2 changes: 1 addition & 1 deletion clients/execute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ unsigned int execute_set(memcached_st *memc, pairs_st *pairs, unsigned int numbe
0, 0);
if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_BUFFERED)
{
fprintf(stderr, "Failured on insert of %.*s\n",
fprintf(stderr, "Failure on insert of %.*s\n",
(unsigned int)pairs[x].key_length, pairs[x].key);
}
else
Expand Down
8 changes: 4 additions & 4 deletions clients/memcapable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#undef ntohl
#endif

/* Should we generate coredumps when we enounter an error (-c) */
/* Should we generate coredumps when we encounter an error (-c) */
static bool do_core= false;
/* connection to the server */
static memcached_socket_t sock;
Expand Down Expand Up @@ -199,7 +199,7 @@ static ssize_t timeout_io_op(memcached_socket_t fd, short direction, void *buf,
ret= recv(fd, buf, len, 0);
}

if (ret == SOCKET_ERROR && get_socket_errno() == EWOULDBLOCK)
if (ret == SOCKET_ERROR && get_socket_errno() == EWOULDBLOCK)
{
struct pollfd fds;
memset(&fds, 0, sizeof(struct pollfd));
Expand Down Expand Up @@ -258,7 +258,7 @@ static enum test_return ensure(bool val, const char *expression, const char *fil
#define execute(expression) do { if (ensure(expression == TEST_PASS, #expression, __FILE__, __LINE__) == TEST_FAIL) return TEST_FAIL; } while (0)

/**
* Send a chunk of memory over the socket (retry if the call is iterrupted
* Send a chunk of memory over the socket (retry if the call is interrupted
*/
static enum test_return retry_write(const void* buf, size_t len)
{
Expand Down Expand Up @@ -334,7 +334,7 @@ static enum test_return retry_read(void *buf, size_t len)
}

/**
* Receive a response from the server and conver the fields in the header
* Receive a response from the server and convert the fields in the header
* to local byte order
*/
static enum test_return recv_packet(response *rsp)
Expand Down
2 changes: 1 addition & 1 deletion clients/memcat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int main(int argc, char *argv[])
}

written= fwrite(string, 1, string_length, fp);
if (written != string_length)
if (written != string_length)
{
fprintf(stderr, "error writing file (written %lu, should be %lu)\n", (unsigned long)written, (unsigned long)string_length);
return_code= -1;
Expand Down
4 changes: 2 additions & 2 deletions clients/memerror.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "utilities.h"

#define PROGRAM_NAME "memerror"
#define PROGRAM_DESCRIPTION "Translate a memcached errror code into a string."
#define PROGRAM_DESCRIPTION "Translate a memcached error code into a string."


/* Prototypes */
Expand Down Expand Up @@ -71,7 +71,7 @@ void options_parse(int argc, char *argv[])
bool opt_version= false;
bool opt_help= false;
int option_index= 0;
while (1)
while (1)
{
int option_rv= getopt_long(argc, argv, "Vhvds:", long_options, &option_index);
if (option_rv == -1)
Expand Down
2 changes: 1 addition & 1 deletion clients/memexist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static void options_parse(int argc, char *argv[])
while (1)
{
int option_rv= getopt_long(argc, argv, "Vhvds:", long_options, &option_index);
if (option_rv == -1)
if (option_rv == -1)
{
break;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/memparse.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down
2 changes: 1 addition & 1 deletion clients/memrm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static void options_parse(int argc, char *argv[])
while (1)
{
int option_rv= getopt_long(argc, argv, "Vhvds:", long_options, &option_index);
if (option_rv == -1)
if (option_rv == -1)
{
break;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/memslap.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down
6 changes: 3 additions & 3 deletions clients/memstat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Summary:
*
* Authors:
* Authors:
* Brian Aker
* Toru Maesaka
*/
Expand Down Expand Up @@ -266,7 +266,7 @@ static void run_analyzer(memcached_st *memc, memcached_stat_st *memc_stat)

static void print_analysis_report(memcached_st *memc,
memcached_analysis_st *report)

{
uint32_t server_count= memcached_server_count(memc);
memcached_server_instance_st most_consumed_server= memcached_server_instance_by_position(memc, report->most_consumed_server);
Expand Down Expand Up @@ -313,7 +313,7 @@ static void options_parse(int argc, char *argv[])

bool opt_version= false;
bool opt_help= false;
while (1)
while (1)
{
int option_rv= getopt_long(argc, argv, "Vhvds:a", long_options, &option_index);

Expand Down
2 changes: 1 addition & 1 deletion clients/ms_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ static int ms_network_connect(ms_conn_t *c,
int flags= 1;

/*
* the memset call clears nonstandard fields in some impementations
* the memset call clears nonstandard fields in some implementations
* that otherwise mess things up.
*/
memset(&hints, 0, sizeof(hints));
Expand Down
2 changes: 1 addition & 1 deletion clients/ms_memslap.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ typedef struct global
ms_sync_lock_t warmup_lock;
ms_sync_lock_t run_lock;

/* mutex for outputing error log synchronously when memslap crashes */
/* mutex for outputting error log synchronously when memslap crashes */
pthread_mutex_t quit_mutex;

/* mutex for generating key prefix */
Expand Down
2 changes: 1 addition & 1 deletion clients/ms_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static void ms_no_config_file()
perror(strerror(errno));
exit(1);
}
fprintf(fd, "%s", DEFAULT_CONGIF_STR);
fprintf(fd, "%s", DEFAULT_CONFIG_STR);
fclose(fd);

exit:
Expand Down
2 changes: 1 addition & 1 deletion clients/ms_setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C" {
#define MAX_VALUE_SIZE (1024 * 1024)

/* the content of the configuration file for memslap running without configuration file */
#define DEFAULT_CONGIF_STR \
#define DEFAULT_CONFIG_STR \
"key\n" \
"64 64 1\n" \
"value\n" \
Expand Down
2 changes: 1 addition & 1 deletion example/byteorder.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down
2 changes: 1 addition & 1 deletion example/byteorder.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
*
* Byteorder for example
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
Expand Down
2 changes: 1 addition & 1 deletion example/memcached_light.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ int main(int argc, char **argv)

/*
* Create and initialize the handles to the protocol handlers. I want
* to be able to trace the traffic throught the pre/post handlers, and
* to be able to trace the traffic through the pre/post handlers, and
* set up a common handler for unknown messages
*/
interface->pre_execute= pre_execute;
Expand Down
Loading

0 comments on commit 8cfdcba

Please sign in to comment.