Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Fixup whitespace
Browse files Browse the repository at this point in the history
Run astyle on the code to enforce our coding style guide

Change-Id: Idf5eb41cafe1ec481ea91706ba2170723e01d818
Reviewed-on: http://review.couchbase.org/22700
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
  • Loading branch information
trondn authored and avsej committed Nov 21, 2012
1 parent 0fc2b38 commit 6fc9168
Show file tree
Hide file tree
Showing 26 changed files with 546 additions and 547 deletions.
28 changes: 14 additions & 14 deletions apidecl.c
Expand Up @@ -813,7 +813,7 @@ PHP_METHOD(couchbase, getResultCode)
{
php_couchbase_res *couchbase_res;
PHP_COUCHBASE_GET_PARAMS(couchbase_res,
PHP_COUCHBASE_ARG_F_OO | PHP_COUCHBASE_ARG_F_ONLYVALID, "");
PHP_COUCHBASE_ARG_F_OO | PHP_COUCHBASE_ARG_F_ONLYVALID, "");
RETURN_LONG(couchbase_res->rc);
}
/* }}} */
Expand Down Expand Up @@ -861,13 +861,13 @@ PHP_METHOD(couchbase, getClientVersion)
PHP_METHOD(couchbase, getNumReplicas)
{
php_couchbase_get_num_replicas_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU,
PHP_COUCHBASE_ARG_F_OO);
PHP_COUCHBASE_ARG_F_OO);
}

PHP_METHOD(couchbase, getServers)
{
php_couchbase_get_servers_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU,
PHP_COUCHBASE_ARG_F_OO);
PHP_COUCHBASE_ARG_F_OO);
}

/* {{{ proto Couchbase::observe(string $key, string $cas, &$details)
Expand Down Expand Up @@ -1099,8 +1099,8 @@ PHP_FUNCTION(couchbase_get_result_code)
{
php_couchbase_res *couchbase_res;
PHP_COUCHBASE_GET_PARAMS(couchbase_res,
PHP_COUCHBASE_ARG_F_FUNCTIONAL|PHP_COUCHBASE_ARG_F_ONLYVALID,
"");
PHP_COUCHBASE_ARG_F_FUNCTIONAL | PHP_COUCHBASE_ARG_F_ONLYVALID,
"");

RETURN_LONG(couchbase_res->rc);
}
Expand Down Expand Up @@ -1153,7 +1153,7 @@ PHP_FUNCTION(couchbase_get_client_version)
PHP_FUNCTION(couchbase_get_num_replicas)
{
php_couchbase_get_num_replicas_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU,
PHP_COUCHBASE_ARG_F_FUNCTIONAL);
PHP_COUCHBASE_ARG_F_FUNCTIONAL);
}
/* }}} */

Expand All @@ -1163,7 +1163,7 @@ PHP_FUNCTION(couchbase_get_num_replicas)
PHP_FUNCTION(couchbase_get_servers)
{
php_couchbase_get_servers_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU,
PHP_COUCHBASE_ARG_F_FUNCTIONAL);
PHP_COUCHBASE_ARG_F_FUNCTIONAL);
}
/* }}} */

Expand Down Expand Up @@ -1311,22 +1311,22 @@ static PHP_INI_MH(OnUpdateSerializer)
*/
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY(PCBC_INIENT_SERIALIZER, PCBC_INIDEFL_SERIALIZER,
PHP_INI_ALL, OnUpdateSerializer, serializer, zend_couchbase_globals, couchbase_globals)
PHP_INI_ALL, OnUpdateSerializer, serializer, zend_couchbase_globals, couchbase_globals)

STD_PHP_INI_ENTRY(PCBC_INIENT_COMPALGO, PCBC_INIDEFL_COMPALGO,
PHP_INI_ALL, OnUpdateCompressor, compressor, zend_couchbase_globals, couchbase_globals)
PHP_INI_ALL, OnUpdateCompressor, compressor, zend_couchbase_globals, couchbase_globals)

STD_PHP_INI_ENTRY(PCBC_INIENT_COMPFACTOR, PCBC_INIDEFL_COMPFACTOR,
PHP_INI_ALL, OnUpdateReal, compression_factor, zend_couchbase_globals, couchbase_globals)
PHP_INI_ALL, OnUpdateReal, compression_factor, zend_couchbase_globals, couchbase_globals)

STD_PHP_INI_ENTRY(PCBC_INIENT_COMPTHRESH, PCBC_INIDEFL_COMPTHRESH,
PHP_INI_ALL, OnUpdateLong, compression_threshold, zend_couchbase_globals, couchbase_globals)
PHP_INI_ALL, OnUpdateLong, compression_threshold, zend_couchbase_globals, couchbase_globals)

STD_PHP_INI_ENTRY(PCBC_INIENT_OBS_INTERVAL, PCBC_INIDEFL_OBS_INTERVAL,
PHP_INI_ALL, OnUpdateLong, durability_default_poll_interval, zend_couchbase_globals, couchbase_globals) /* units of microseconds, 100k = a tenth of a second */
PHP_INI_ALL, OnUpdateLong, durability_default_poll_interval, zend_couchbase_globals, couchbase_globals) /* units of microseconds, 100k = a tenth of a second */

STD_PHP_INI_ENTRY(PCBC_INIENT_OBS_TIMEOUT, PCBC_INIDEFL_OBS_TIMEOUT,
PHP_INI_ALL, OnUpdateLong, durability_default_timeout, zend_couchbase_globals, couchbase_globals) /* also units of microseconds, 40M = 40sec */
PHP_INI_ALL, OnUpdateLong, durability_default_timeout, zend_couchbase_globals, couchbase_globals) /* also units of microseconds, 40M = 40sec */
PHP_INI_END()
/* }}} */

Expand Down Expand Up @@ -1401,7 +1401,7 @@ PHP_MINIT_FUNCTION(couchbase)
#undef XX

zend_declare_property_null(couchbase_ce, ZEND_STRL(COUCHBASE_PROPERTY_HANDLE), ZEND_ACC_PRIVATE TSRMLS_CC);
init_couchbase_cluster(module_number TSRMLS_CC);
init_couchbase_cluster(module_number TSRMLS_CC);

return SUCCESS;
}
Expand Down
4 changes: 2 additions & 2 deletions apidecl.h
Expand Up @@ -94,14 +94,14 @@ void php_couchbase_view_impl(INTERNAL_FUNCTION_PARAMETERS, int oo, int uri_only)

PHP_COUCHBASE_LOCAL
void php_couchbase_observe_impl(
INTERNAL_FUNCTION_PARAMETERS, int multi, int oo, int poll);
INTERNAL_FUNCTION_PARAMETERS, int multi, int oo, int poll);

PHP_COUCHBASE_LOCAL
void php_couchbase_get_servers_impl(INTERNAL_FUNCTION_PARAMETERS, int style);

PHP_COUCHBASE_LOCAL
void php_couchbase_get_num_replicas_impl(INTERNAL_FUNCTION_PARAMETERS,
int style);
int style);

#endif

Expand Down
16 changes: 8 additions & 8 deletions arithmetic.c
Expand Up @@ -3,9 +3,9 @@
/* {{{ static void php_couchbase_arithmetic_callback(...) */
static void
php_couchbase_arithmetic_callback(lcb_t instance,
const void *cookie,
lcb_error_t error,
const lcb_arithmetic_resp_t *resp)
const void *cookie,
lcb_error_t error,
const lcb_arithmetic_resp_t *resp)
{
php_couchbase_ctx *ctx = (php_couchbase_ctx *)cookie;
php_ignore_value(instance);
Expand Down Expand Up @@ -38,7 +38,7 @@ void php_couchbase_arithmetic_impl(INTERNAL_FUNCTION_PARAMETERS, char op, int oo
int argflags = oo ? PHP_COUCHBASE_ARG_F_OO : PHP_COUCHBASE_ARG_F_FUNCTIONAL;

PHP_COUCHBASE_GET_PARAMS(couchbase_res, argflags,
"s|llll", &key, &klen, &offset, &create, &expire, &initial);
"s|llll", &key, &klen, &offset, &create, &expire, &initial);

{
lcb_error_t retval;
Expand All @@ -65,12 +65,12 @@ void php_couchbase_arithmetic_impl(INTERNAL_FUNCTION_PARAMETERS, char op, int oo
cmd.v.v0.exptime = exp;

retval = lcb_arithmetic(couchbase_res->handle, ctx, 1,
(const lcb_arithmetic_cmd_t * const *)commands);
(const lcb_arithmetic_cmd_t * const *)commands);
}
if (LCB_SUCCESS != retval) {
efree(ctx);
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Failed to schedule rithmetic request: %s", lcb_strerror(couchbase_res->handle, retval));
"Failed to schedule rithmetic request: %s", lcb_strerror(couchbase_res->handle, retval));
RETURN_FALSE;
}

Expand All @@ -80,7 +80,7 @@ void php_couchbase_arithmetic_impl(INTERNAL_FUNCTION_PARAMETERS, char op, int oo
// Just return false and don't print a warning when no key is present and create is false
if (!(LCB_KEY_ENOENT == ctx->res->rc && create == 0)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Failed to %s value in server: %s", (op == '+') ? "increment" : "decrement", lcb_strerror(couchbase_res->handle, ctx->res->rc));
"Failed to %s value in server: %s", (op == '+') ? "increment" : "decrement", lcb_strerror(couchbase_res->handle, ctx->res->rc));
}
efree(ctx);
RETURN_FALSE;
Expand All @@ -95,7 +95,7 @@ PHP_COUCHBASE_LOCAL
void php_couchbase_callbacks_arithmetic_init(lcb_t handle)
{
php_ignore_value(
lcb_set_arithmetic_callback(handle, php_couchbase_arithmetic_callback));
lcb_set_arithmetic_callback(handle, php_couchbase_arithmetic_callback));
}

/*
Expand Down
24 changes: 12 additions & 12 deletions compress.c
Expand Up @@ -53,7 +53,7 @@
#define CBCOMPHDR_SANITY_MAX 0x40000000

static char *cbcomp_new(php_couchbase_comp *str,
size_t cmpbuf_len, size_t origlen)
size_t cmpbuf_len, size_t origlen)
{
str->alloc = cmpbuf_len;
str->_base = emalloc(str->alloc + sizeof(pcbc_payload_len_t));
Expand Down Expand Up @@ -95,7 +95,7 @@ void cbcomp_deploy(php_couchbase_comp *str)
/* make sure to initialize info to zero before passing here */
PHP_COUCHBASE_LOCAL
int cbcomp_dcmp_init(const char *data, size_t len,
php_couchbase_decomp *info)
php_couchbase_decomp *info)
{
/* make a sane value size, say, 1GB? */
if (len < sizeof(pcbc_payload_len_t)) {
Expand Down Expand Up @@ -126,14 +126,14 @@ void cbcomp_dcmp_free(php_couchbase_decomp *info)
#ifdef HAVE_COMPRESSION_ZLIB
PHP_COUCHBASE_LOCAL
int php_couchbase_compress_zlib(const smart_str *input,
php_couchbase_comp *output)
php_couchbase_comp *output)
{
/* compressBound tells us the maximum size of the buffer we'll need.. */
cbcomp_new(output, compressBound(input->len), input->len);
uLongf tmp_ulen = output->alloc;
int status = compress(
(Bytef *)output->data, &tmp_ulen,
(Bytef *)input->c, input->len);
(Bytef *)output->data, &tmp_ulen,
(Bytef *)input->c, input->len);

if (status == Z_OK) {
output->compressed_len = tmp_ulen;
Expand Down Expand Up @@ -175,7 +175,7 @@ int php_couchbase_decompress_zlib(php_couchbase_decomp *info)

if (info->expanded_len < CBCOMPHDR_SANITY_MAX) {
status = uncompress((Bytef *)info->expanded, &dlen,
(Bytef *)info->compressed, info->orig_len);
(Bytef *)info->compressed, info->orig_len);
}

/* fall back to 'old-style' decompression */
Expand All @@ -186,7 +186,7 @@ int php_couchbase_decompress_zlib(php_couchbase_decomp *info)
dlen = n_alloc;

status = uncompress((Bytef *)info->expanded, &dlen,
(Bytef *)info->orig, info->orig_len);
(Bytef *)info->orig, info->orig_len);
}

if (status != Z_OK) {
Expand All @@ -202,14 +202,14 @@ int php_couchbase_decompress_zlib(php_couchbase_decomp *info)

PHP_COUCHBASE_LOCAL
int php_couchbase_compress_fastlz(const smart_str *input,
php_couchbase_comp *output)
php_couchbase_comp *output)
{
cbcomp_new(output,
(size_t)((input->len * 1.05) + 1),
input->len);
(size_t)((input->len * 1.05) + 1),
input->len);

return (output->compressed_len =
(fastlz_compress(input->c, input->len, output->data)));
(fastlz_compress(input->c, input->len, output->data)));
}

PHP_COUCHBASE_LOCAL
Expand All @@ -225,7 +225,7 @@ int php_couchbase_decompress_fastlz(php_couchbase_decomp *info)
}

info->expanded_len = fastlz_decompress(info->compressed,
info->compressed_len, info->expanded, info->expanded_len);
info->compressed_len, info->expanded, info->expanded_len);

return info->expanded_len;
}
Expand Down
8 changes: 4 additions & 4 deletions convert.c
Expand Up @@ -2,7 +2,7 @@

PHP_COUCHBASE_LOCAL
void pcbc_json_decode(zval *zv, char *data, int ndata, zend_bool assoc
TSRMLS_DC)
TSRMLS_DC)
{
#if HAVE_JSON_API_5_2
php_json_decode(zv, data, ndata, assoc TSRMLS_CC);
Expand Down Expand Up @@ -150,7 +150,7 @@ int php_couchbase_zval_from_payload(zval *value, char *payload, size_t payload_l

if (payload == NULL && payload_len > 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"could not handle non-existing value of length %zu", payload_len);
"could not handle non-existing value of length %zu", payload_len);
return 0;
} else if (payload == NULL) {
if ((flags & 127) == IS_BOOL) {
Expand Down Expand Up @@ -250,8 +250,8 @@ int php_couchbase_zval_from_payload(zval *value, char *payload, size_t payload_l

case COUCHBASE_VAL_IS_JSON:
pcbc_json_decode(value, payload, payload_len,
(serializer == COUCHBASE_SERIALIZER_JSON_ARRAY)
TSRMLS_CC);
(serializer == COUCHBASE_SERIALIZER_JSON_ARRAY)
TSRMLS_CC);
break;

default:
Expand Down

0 comments on commit 6fc9168

Please sign in to comment.