Просмотр исходного кода

Merge pull request #22 from greedyhao/master

solve some compile warming
朱天龙 (Armink) 4 лет назад
Родитель
Сommit
ad6f6b515c

+ 1 - 1
iotkit-embedded/src/dev_model/client/dm_client_adapter.h

@@ -15,4 +15,4 @@ int dm_client_unsubscribe(char *uri);
 int dm_client_publish(char *uri, unsigned char *payload, int payload_len, iotx_cm_data_handle_cb callback);
 int dm_client_yield(unsigned int timeout);
 
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_model/dm_cota.c

@@ -233,4 +233,4 @@ int dm_cota_status_check(void)
 
     return SUCCESS_RETURN;
 }
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_model/dm_cota.h

@@ -17,4 +17,4 @@ int dm_cota_perform_sync(_OU_ char *output, _IN_ int output_len);
 int dm_cota_get_config(const char *config_scope, const char *get_type, const char *attribute_keys);
 int dm_cota_status_check(void);
 
-#endif
+#endif

+ 6 - 6
iotkit-embedded/src/dev_model/dm_log_report.c

@@ -18,7 +18,7 @@ const char THING_LOG_POST_PARAMS_END[] =
 char *g_log_poll = NULL;
 static char *current_log_pos = NULL;
 
-int remove_log_poll()
+int remove_log_poll(void)
 {
     if (NULL != g_log_poll) {
         HAL_Free(g_log_poll);
@@ -40,21 +40,21 @@ unsigned int push_log(const char *input_log, int input_log_size)
     return (current_log_pos - g_log_poll);
 }
 
-unsigned int add_tail()
+unsigned int add_tail(void)
 {
     const char *tail = "]}";
     current_log_pos -= 1;
     return push_log(tail, strlen(tail));
 }
 
-void add_log_header()
+void add_log_header(void)
 {
     const char *subprefix = "{\"template\": \"traceContext logContent\",\"contents\":[";
     int sublen = strlen(subprefix);
     push_log(subprefix, sublen);
 }
 
-int reset_log_poll()
+int reset_log_poll(void)
 {
     if (NULL == g_log_poll) {
         dm_log_err("log buffer is NULL");
@@ -66,7 +66,7 @@ int reset_log_poll()
     return 0;
 }
 
-int create_log_poll()
+int create_log_poll(void)
 {
     int ret;
     remove_log_poll();
@@ -124,7 +124,7 @@ void parse_msg_id(_IN_ char *payload, _IN_ int payload_len, _OU_ dm_msg_request_
     dm_utils_json_object_item(&lite, DM_MSG_KEY_ID, strlen(DM_MSG_KEY_ID), cJSON_String, &request->id);
 }
 
-int stop_sample()
+int stop_sample(void)
 {
     if (current_log_pos > g_log_poll) {
         dm_mgr_upstream_thing_log_post(0, NULL, 0, 1);

+ 1 - 1
iotkit-embedded/src/dev_model/dm_message_cache.c

@@ -174,4 +174,4 @@ void dm_msg_cache_tick(void)
     }
     _dm_msg_cache_mutex_unlock();
 }
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_model/dm_message_cache.h

@@ -34,4 +34,4 @@ int dm_msg_cache_remove(int msg_id);
 void dm_msg_cache_tick(void);
 
 #endif
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_model/dm_shadow.h

@@ -530,4 +530,4 @@ void dm_shw_destroy(_IN_ dm_shw_t **shadow);
 #endif
 
 #endif
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_model/dm_tsl_alink.h

@@ -21,4 +21,4 @@
         int dm_tsl_alink_create(_IN_ const char *tsl, _IN_ int tsl_len, _OU_ dm_shw_t **shadow);
 
     #endif
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_model/dm_utils.c

@@ -425,4 +425,4 @@ void dm_utils_free(void *ptr)
 #else
     HAL_Free((void *)ptr);
 #endif
-}
+}

+ 1 - 1
iotkit-embedded/src/dev_model/iotx_dm_config.h

@@ -33,4 +33,4 @@
     #define CONFIG_MSGCACHE_QUEUE_MAXLEN    (50)
 #endif
 
-#endif
+#endif

+ 3 - 3
iotkit-embedded/src/dev_model/iotx_dm_internal.h

@@ -115,9 +115,9 @@ typedef enum {
     RUNNING,
     DONE
 } REPORT_STATE;
-unsigned int add_tail();
-int reset_log_poll();
-int remove_log_poll();
+unsigned int add_tail(void);
+int reset_log_poll(void);
+int remove_log_poll(void);
 unsigned int push_log(const char *perform_data, int perform_data_size);
 #endif
 

+ 1 - 1
iotkit-embedded/src/dev_model/server/dm_server.h

@@ -26,4 +26,4 @@ void dm_server_thing_dev_core_service_dev(CoAPContext *context, const char *path
 void dm_server_thing_service_request(CoAPContext *context, const char *paths, NetworkAddr *remote,
                                      CoAPMessage *message);
 #endif
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_model/server/dm_server_adapter.h

@@ -31,4 +31,4 @@ int dm_server_del_device(char product_key[IOTX_PRODUCT_KEY_LEN + 1], char device
 int dm_server_yield(void);
 
 #endif
-#endif
+#endif

+ 1 - 1
iotkit-embedded/src/dev_sign/dev_sign_mqtt.c

@@ -214,7 +214,7 @@ int32_t IOT_Sign_MQTT(iotx_mqtt_region_types_t region, iotx_dev_meta_info_t *met
             strlen(g_infra_mqtt_domain[region]));
     }
     rt_strlwr(signout->hostname);
-    rt_kprintf("host name:%s\r\n", signout->hostname);
+    HAL_Printf("host name:%s\r\n", signout->hostname);
 
     /* setup username */
     length = strlen(meta->device_name) + strlen(meta->product_key) + 2;

+ 6 - 1
iotkit-embedded/src/dev_sign/dev_sign_wrapper.h

@@ -1,4 +1,9 @@
-
+#ifndef _DEV_SIGN_WRAPPER_H
+#define _DEV_SIGN_WRAPPER_H
 
 #include "infra_types.h"
 #include "infra_defs.h"
+
+void HAL_Printf(const char *fmt, ...);
+
+#endif