aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/config
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-02-10 13:34:22 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-02-10 14:23:51 +0100
commit1ac41cb08281bf5460dfea5fc40ff6f8e14873a1 (patch)
tree3926983e45afa7e805cca1429fc3452c57a5b6c3 /hicn-light/src/config
parent13ec18b4b3ec8455daad674a0c0e616885b83608 (diff)
[HICN-49] Remove warnings hicn-light on windows
Change-Id: I106713c285ad5cc47cb5ae3aaf9c837685156e36 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'hicn-light/src/config')
-rw-r--r--hicn-light/src/config/commandOps.c2
-rw-r--r--hicn-light/src/config/commandParser.c4
-rw-r--r--hicn-light/src/config/configuration.c2
-rw-r--r--hicn-light/src/config/controlRemoveRoute.c8
-rw-r--r--hicn-light/src/config/controlState.c2
5 files changed, 11 insertions, 7 deletions
diff --git a/hicn-light/src/config/commandOps.c b/hicn-light/src/config/commandOps.c
index 2f7ebe49d..28d3369e1 100644
--- a/hicn-light/src/config/commandOps.c
+++ b/hicn-light/src/config/commandOps.c
@@ -24,9 +24,11 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#else
+#ifndef _WIN32
extern int errno;
#endif
#endif
+#endif
#include <parc/algol/parc_Memory.h>
#include <parc/assert/parc_Assert.h>
diff --git a/hicn-light/src/config/commandParser.c b/hicn-light/src/config/commandParser.c
index 9a947d8b7..9759d2e37 100644
--- a/hicn-light/src/config/commandParser.c
+++ b/hicn-light/src/config/commandParser.c
@@ -35,9 +35,11 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#else
+#ifndef _WIN32
extern int errno;
#endif
#endif
+#endif
struct command_parser {
// key = command, value = CommandOps
@@ -122,7 +124,7 @@ static PARCList *parseStringIntoTokens(const char *originalString) {
char *tofree =
parcMemory_StringDuplicate(originalString, strlen(originalString) + 1);
char *string = tofree;
-
+
token = strtok(string, " \t\n");
while (token != NULL) {
if (strlen(token) > 0) {
diff --git a/hicn-light/src/config/configuration.c b/hicn-light/src/config/configuration.c
index 71616cd78..1a41a9642 100644
--- a/hicn-light/src/config/configuration.c
+++ b/hicn-light/src/config/configuration.c
@@ -285,7 +285,7 @@ struct iovec *configuration_ProcessRegistrationList(Configuration *config,
// send response
header_control_message *header = request[0].iov_base;
header->messageType = RESPONSE_LIGHT;
- header->length = payloadSize;
+ header->length = (unsigned)payloadSize;
struct iovec *response =
parcMemory_AllocateAndClear(sizeof(struct iovec) * 2);
diff --git a/hicn-light/src/config/controlRemoveRoute.c b/hicn-light/src/config/controlRemoveRoute.c
index f654718f8..c4efb04df 100644
--- a/hicn-light/src/config/controlRemoveRoute.c
+++ b/hicn-light/src/config/controlRemoveRoute.c
@@ -16,14 +16,14 @@
#include <src/config.h>
#include <ctype.h>
+#include <parc/algol/parc_List.h>
+#include <parc/algol/parc_Memory.h>
+#include <parc/algol/parc_Network.h>
+#include <parc/assert/parc_Assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <parc/assert/parc_Assert.h>
-#include <parc/algol/parc_List.h>
-#include <parc/algol/parc_Memory.h>
-#include <parc/algol/parc_Network.h>
#include <src/utils/address.h>
diff --git a/hicn-light/src/config/controlState.c b/hicn-light/src/config/controlState.c
index 96c0529ed..c3b7d535b 100644
--- a/hicn-light/src/config/controlState.c
+++ b/hicn-light/src/config/controlState.c
@@ -55,7 +55,7 @@ int controlState_connectToFwdDeamon() {
int sockfd;
struct sockaddr_in servaddr;
- if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+ if ((sockfd = (int)socket(AF_INET, SOCK_STREAM, 0)) < 0) {
printf("\nSocket Creation Failed \n");
exit(EXIT_FAILURE);
}