You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2019/10/12 08:50:30 UTC

[rocketmq-client-cpp] branch master updated: style(example):format the code style in example

This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new d5f82b5  style(example):format the code style in example
d5f82b5 is described below

commit d5f82b5b678716f4e761117515d76e34ad0a70a7
Author: ShannonDing <li...@163.com>
AuthorDate: Sat Oct 12 16:33:19 2019 +0800

    style(example):format the code style in example
---
 example/AsyncProducer.cpp | 30 +++++++++++++++---------------
 example/Producer.c        | 40 ++++++++++++++++++++--------------------
 2 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/example/AsyncProducer.cpp b/example/AsyncProducer.cpp
index dae0459..279cea3 100644
--- a/example/AsyncProducer.cpp
+++ b/example/AsyncProducer.cpp
@@ -1,19 +1,19 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/example/Producer.c b/example/Producer.c
index 7965df6..5d5c549 100644
--- a/example/Producer.c
+++ b/example/Producer.c
@@ -1,30 +1,30 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #include <stdio.h>
-#include "CProducer.h"
 #include "CCommon.h"
 #include "CMessage.h"
+#include "CProducer.h"
 #include "CSendResult.h"
 #ifdef _WIN32
 #include <windows.h>
 #else
-#include <unistd.h>
 #include <memory.h>
+#include <unistd.h>
 #endif
 
 void thread_sleep(unsigned int milliseconds) {
@@ -47,10 +47,10 @@ void StartSendMessage(CProducer* producer) {
     snprintf(body, sizeof(body), "new message body, index %d", i);
     SetMessageBody(msg, body);
     int status = SendMessageSync(producer, msg, &result);
-    if(status == OK){
+    if (status == OK) {
       printf("send message[%d] result status:%d, msgId:%s\n", i, (int)result.sendStatus, result.msgId);
-    }else{
-      printf("send message[%d] failed !\n",i);
+    } else {
+      printf("send message[%d] failed !\n", i);
     }
     thread_sleep(1000);
   }