From e783dc858cbf3370c80a46b6bfef6d14580b6764 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期五, 13 一月 2023 18:07:14 +0800 Subject: [PATCH] code format --- versionctrlapi.cpp | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/versionctrlapi.cpp b/versionctrlapi.cpp index 1bc6fd7..6f92671 100644 --- a/versionctrlapi.cpp +++ b/versionctrlapi.cpp @@ -4,30 +4,30 @@ using namespace protomsg; //鑾峰彇鏈嶅姟鍣ㄦ湰鏈洪厤缃俊鎭� -bool dbapi_get_server_get_sn(void *handle, char * reply_msg){ - const char *topic = DATA_URL_PREFIX("/version/snBus"); - return bus_dbapi_get_str(handle, topic, &reply_msg); +bool dbapi_get_server_get_sn(void *handle, char *reply_msg) { + const char *topic = DATA_URL_PREFIX("/version/snBus"); + return bus_dbapi_get_str(handle, topic, &reply_msg); } -bool dbapi_get_server_get_is_sys_expired(void *handle) { - char * reply_msg = NULL; +bool dbapi_get_server_get_is_sys_expired(void *handle) { + char *reply_msg = NULL; bool is_expired = false; - bool ret = false; - bool expire_val = false; + bool ret = false; + bool expire_val = false; - ret = dbapi_get_server_get_sn(handle, reply_msg); - if(ret && reply_msg != NULL) - { - // Read JSON and get root - yyjson_doc *doc = yyjson_read(reply_msg, strlen(reply_msg), 0); - yyjson_val *root = yyjson_doc_get_root(doc); + ret = dbapi_get_server_get_sn(handle, reply_msg); + if (ret && reply_msg != NULL) { + // Read JSON and get root + yyjson_doc *doc = yyjson_read(reply_msg, strlen(reply_msg), 0); + yyjson_val *root = yyjson_doc_get_root(doc); yyjson_val *data = yyjson_obj_get(root, "expire"); expire_val = yyjson_get_bool(data); - printf("expire: %d\n", expire_val); - yyjson_doc_free(doc); - } + printf("expire: %d\n", expire_val); + yyjson_doc_free(doc); + } free(reply_msg); - return expire_val; + + return expire_val; } -- Gitblit v1.8.0