From 99e22a825d0d86968d24fc6717b765055c8ac73b Mon Sep 17 00:00:00 2001 From: dongzhihong Date: Mon, 3 Jul 2017 14:53:31 +0800 Subject: [PATCH] "fix pre-commit hook failed" --- go/pserver/cclient/test/test_cclient.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/go/pserver/cclient/test/test_cclient.c b/go/pserver/cclient/test/test_cclient.c index 5bd4913ba3c..b16769b433e 100644 --- a/go/pserver/cclient/test/test_cclient.c +++ b/go/pserver/cclient/test/test_cclient.c @@ -16,7 +16,7 @@ void sendGrads(paddle_pserver_client c) { "param_a", PADDLE_ELEMENT_TYPE_FLOAT32, grad_a, 2000}; paddle_gradient grad2 = { "param_b", PADDLE_ELEMENT_TYPE_FLOAT32, grad_b, 3000}; - paddle_gradient* grads[2] = {&grad1, &grad2}; + paddle_gradient *grads[2] = {&grad1, &grad2}; if (paddle_send_grads(c, grads, 2)) { fail(); } @@ -39,14 +39,12 @@ void getParams(paddle_pserver_client c) { param_b.content = content_b; param_b.content_len = 3000; - paddle_parameter* params[2] = {¶m_a, ¶m_b}; + paddle_parameter *params[2] = {¶m_a, ¶m_b}; if (paddle_get_params(c, params, 2)) { fail(); } } - - int main() { char addr[] = "localhost:3000"; paddle_pserver_client c = paddle_new_pserver_client(addr, 1); @@ -54,8 +52,10 @@ int main() { size_t config_proto_len = 0; ssize_t nread; FILE *fp = fopen("testdata/optimizer.pb.txt", "r"); - if(!fp) { fail(); } - while((nread = getline(&config_proto, &config_proto_len, fp)) != -1) { + if (!fp) { + fail(); + } + while ((nread = getline(&config_proto, &config_proto_len, fp)) != -1) { printf("%s", config_proto); } fclose(fp); @@ -70,7 +70,8 @@ retry: param.name = name_a; param.content = content_a; param.content_len = 2000; - int error = paddle_init_param(c, param, (void *)config_proto, config_proto_len); + int error = + paddle_init_param(c, param, (void *)config_proto, config_proto_len); if (error != 0) { goto retry; } -- GitLab