From 2e215418fcdf907cb491872bcf4a0c88fca24bcc Mon Sep 17 00:00:00 2001 From: Zeex Date: Sat, 25 Jan 2014 23:59:53 +0700 Subject: [PATCH] Fix lots of compile warnings --- source/compiler/CMakeLists.txt | 4 ++++ source/compiler/sc2.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/compiler/CMakeLists.txt b/source/compiler/CMakeLists.txt index d7e3244..28083d0 100644 --- a/source/compiler/CMakeLists.txt +++ b/source/compiler/CMakeLists.txt @@ -23,6 +23,10 @@ IF(HAVE_ALLOCA_H) ADD_DEFINITIONS(-DHAVE_ALLOCA_H) ENDIF(HAVE_ALLOCA_H) +IF(MSVC) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) +ENDIF(MSVC) + IF(UNIX) ADD_DEFINITIONS(-DLINUX -DENABLE_BINRELOC -g) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../linux) diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index 4f0f14e..9e63396 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -231,7 +231,6 @@ static void check_empty(const unsigned char *lptr) static void doinclude(int silent) { char name[_MAX_PATH]; - char *ptr; char c; int i, result; @@ -1760,7 +1759,7 @@ SC_FUNC void preprocess(void) static const unsigned char *unpackedstring(const unsigned char *lptr,int *flags) { - unsigned char *stringize; + const unsigned char *stringize; int instring=1; if (*flags & STRINGIZE) /* ignore leading spaces after the # */ while (*lptr==' ' || *lptr=='\t') /* this is as defines with parameters may add them */ @@ -1831,7 +1830,7 @@ static const unsigned char *packedstring(const unsigned char *lptr,int *flags) { int i; ucell val,c; - unsigned char *stringize; + const unsigned char *stringize; int instring=1; if (*flags & STRINGIZE) while (*lptr==' ' || *lptr=='\t')