فهرست منبع

fix clang warnings

ambrop7 14 سال پیش
والد
کامیت
17d80db0b5
3فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 2 2
      ncd-request/ncd-request.c
  2. 2 2
      ncd/NCDRequestClient.c
  3. 2 2
      ncd/modules/sys_request_server.c

+ 2 - 2
ncd-request/ncd-request.c

@@ -145,10 +145,10 @@ static void request_handler_reply (void *user, NCDValue reply_data)
         goto fail0;
     }
     
-    if (!write_all(1, str, strlen(str))) {
+    if (!write_all(1, (uint8_t *)str, strlen(str))) {
         goto fail1;
     }
-    if (!write_all(1, "\n", 1)) {
+    if (!write_all(1, (const uint8_t *)"\n", 1)) {
         goto fail1;
     }
     

+ 2 - 2
ncd/NCDRequestClient.c

@@ -205,7 +205,7 @@ static void recv_if_handler_send (NCDRequestClient *o, uint8_t *data, int data_l
                 case RSTATE_READY: {
                     // parse payload
                     NCDValue payload_value;
-                    if (!NCDValueParser_Parse(payload, payload_len, &payload_value)) {
+                    if (!NCDValueParser_Parse((char *)payload, payload_len, &payload_value)) {
                         BLog(BLOG_ERROR, "failed to parse reply payload");
                         goto fail;
                     }
@@ -330,7 +330,7 @@ static int build_requestproto_packet (uint32_t request_id, uint32_t type, NCDVal
         goto fail1;
     }
     
-    uint8_t *packet = ExpString_Get(&str);
+    uint8_t *packet = (uint8_t *)ExpString_Get(&str);
     
     struct header *header = (void *)packet;
     header->pp.len = htol16(len - sizeof(struct packetproto_header));

+ 2 - 2
ncd/modules/sys_request_server.c

@@ -361,7 +361,7 @@ static int request_init (struct connection *c, uint32_t request_id, const uint8_
     
     LinkedList0_Prepend(&c->requests_list, &r->requests_list_node);
     
-    if (!NCDValueParser_Parse(data, data_len, &r->request_data)) {
+    if (!NCDValueParser_Parse((const char *)data, data_len, &r->request_data)) {
         ModuleLog(o->i, BLOG_ERROR, "NCDValueParser_Parse failed");
         goto fail1;
     }
@@ -533,7 +533,7 @@ static struct reply * reply_init (struct connection *c, uint32_t request_id, uin
         goto fail2;
     }
     
-    r->send_buf = ExpString_Get(&str);
+    r->send_buf = (uint8_t *)ExpString_Get(&str);
     
     struct reply_header *header = (void *)r->send_buf;
     header->pp.len = htol16(len - sizeof(header->pp));