diff options
author | Robert Moore <Robert.Moore@intel.com> | 2019-07-02 09:27:57 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2019-07-02 09:27:57 -0700 |
commit | 49e12510b341cd68def91c3e99983494c20368d2 (patch) | |
tree | 9ff34182d20a892d5684474ecbc20abf95db7fe2 /source | |
parent | a18df084aa242c8e1db69feacecf73c081851d94 (diff) | |
download | acpica-49e12510b341cd68def91c3e99983494c20368d2.tar.gz |
Update for MSVC 2017, no functional changes
eliminates some warnings on MSVC 2017.
Diffstat (limited to 'source')
-rw-r--r-- | source/compiler/aslsupport.l | 18 | ||||
-rw-r--r-- | source/include/platform/acmsvc.h | 15 | ||||
-rw-r--r-- | source/include/platform/acwin.h | 31 | ||||
-rw-r--r-- | source/include/platform/acwin64.h | 22 | ||||
-rw-r--r-- | source/tools/acpixtract/axmain.c | 2 |
5 files changed, 77 insertions, 11 deletions
diff --git a/source/compiler/aslsupport.l b/source/compiler/aslsupport.l index 69c1399a9..297bf2ee6 100644 --- a/source/compiler/aslsupport.l +++ b/source/compiler/aslsupport.l @@ -220,7 +220,7 @@ AslDoLineDirective ( while ((c = input()) != '\n' && c != EOF) { - *AslGbl_LineBufPtr = c; + *AslGbl_LineBufPtr = (char) c; AslGbl_LineBufPtr++; } *AslGbl_LineBufPtr = 0; @@ -498,7 +498,7 @@ AslInsertLineBuffer ( if (AcpiGbl_CaptureComments) { - CvProcessCommentState (SourceChar); + CvProcessCommentState ((char) SourceChar); } } } @@ -601,7 +601,7 @@ loop: AslInsertLineBuffer (c); if (AcpiGbl_CaptureComments && CurrentState.CaptureComments) { - *StringBuffer = c; + *StringBuffer = (char) c; ++StringBuffer; } c1 = c; @@ -629,7 +629,7 @@ loop: AslInsertLineBuffer (c); if (AcpiGbl_CaptureComments && CurrentState.CaptureComments) { - *StringBuffer = c; + *StringBuffer = (char) c; ++StringBuffer; } @@ -720,7 +720,7 @@ AslDoCommentType2 ( AslInsertLineBuffer (c); if (AcpiGbl_CaptureComments && CurrentState.CaptureComments) { - *StringBuffer = c; + *StringBuffer = (char) c; ++StringBuffer; } } @@ -878,7 +878,7 @@ DoCharacter: if (ACPI_IS_OCTAL_DIGIT (StringChar)) { State = ASL_OCTAL_CONSTANT; - ConvertBuffer[0] = StringChar; + ConvertBuffer[0] = (char) StringChar; i = 1; continue; } @@ -934,7 +934,7 @@ DoCharacter: /* Append another digit of the constant */ - ConvertBuffer[i] = StringChar; + ConvertBuffer[i] = (char) StringChar; i++; continue; @@ -978,7 +978,7 @@ DoCharacter: /* Append another digit of the constant */ - ConvertBuffer[i] = StringChar; + ConvertBuffer[i] = (char) StringChar; i++; continue; @@ -989,7 +989,7 @@ DoCharacter: /* Save the finished character */ - *StringBuffer = StringChar; + *StringBuffer = (char) StringChar; StringBuffer++; if (StringBuffer >= EndBuffer) { diff --git a/source/include/platform/acmsvc.h b/source/include/platform/acmsvc.h index d39fed71a..394b8095c 100644 --- a/source/include/platform/acmsvc.h +++ b/source/include/platform/acmsvc.h @@ -256,6 +256,10 @@ #endif #endif +/* warn C4001: use of slash-slash comments */ +/* NOTE: MSVC 2015 headers use these extensively */ +#pragma warning(disable:4001) + /* warn C4100: unreferenced formal parameter */ #pragma warning(disable:4100) @@ -268,10 +272,21 @@ /* warn C4131: uses old-style declarator (iASL compiler only) */ #pragma warning(disable:4131) +/* warn C4131: uses old-style declarator (iASL compiler only) */ +#pragma warning(disable:4459) + #if _MSC_VER > 1200 /* Versions above VC++ 6 */ #pragma warning( disable : 4295 ) /* needed for acpredef.h array */ #endif +/* + * MSVC 2015+ + */ + + /* warn C4459: xxxx (identifier) hides global declaration */ +#pragma warning(disable:4459) + + /* Debug support. */ diff --git a/source/include/platform/acwin.h b/source/include/platform/acwin.h index 5071f9486..51b28ca80 100644 --- a/source/include/platform/acwin.h +++ b/source/include/platform/acwin.h @@ -152,9 +152,33 @@ #ifndef __ACWIN_H__ #define __ACWIN_H__ +#include <io.h> + #define ACPI_USE_STANDARD_HEADERS #define ACPI_USE_SYSTEM_CLIBRARY + /* Note: do not include any C library headers here */ + + /* + * Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER + * as appropriate to enable editor functions like "Find all references". + * The editor isn't smart enough to dig through the include files to find + * out if these are actually defined. + */ + + /* Eliminate warnings for "old" (non-secure) versions of clib functions */ + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +/* Eliminate warnings for POSIX clib function names (open, write, etc.) */ + +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE +#endif + + #define ACPI_MACHINE_WIDTH 32 #define ACPI_USE_NATIVE_DIVIDE #define ACPI_USE_NATIVE_MATH64 @@ -183,7 +207,9 @@ typedef COMPILER_DEPENDENT_UINT64 u64; #define stat _stat #define fstat _fstat #define mkdir _mkdir -#define snprintf _snprintf +#define fileno _fileno +#define isatty _isatty + #if _MSC_VER <= 1200 /* Versions below VC++ 6 */ #define vsnprintf _vsnprintf #endif @@ -195,6 +221,9 @@ typedef COMPILER_DEPENDENT_UINT64 u64; #define S_IREAD _S_IREAD #define S_IWRITE _S_IWRITE #define S_IFDIR _S_IFDIR +#if _MSC_VER < 1900 +#define snprintf _snprintf +#endif /* diff --git a/source/include/platform/acwin64.h b/source/include/platform/acwin64.h index beb331d0e..9519c0395 100644 --- a/source/include/platform/acwin64.h +++ b/source/include/platform/acwin64.h @@ -155,6 +155,28 @@ #define ACPI_USE_STANDARD_HEADERS #define ACPI_USE_SYSTEM_CLIBRARY + /* Note: do not include any C library headers here */ + + /* + * Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER + * as appropriate to enable editor functions like "Find all references". + * The editor isn't smart enough to dig through the include files to find + * out if these are actually defined. + */ + + /* Eliminate warnings for "old" (non-secure) versions of clib functions */ + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +/* Eliminate warnings for POSIX clib function names (open, write, etc.) */ + +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE +#endif + + #define ACPI_MACHINE_WIDTH 64 /* diff --git a/source/tools/acpixtract/axmain.c b/source/tools/acpixtract/axmain.c index c53b39b3b..a027f786c 100644 --- a/source/tools/acpixtract/axmain.c +++ b/source/tools/acpixtract/axmain.c @@ -196,7 +196,7 @@ DisplayUsage ( * ******************************************************************************/ -int +int ACPI_SYSTEM_XFACE main ( int argc, char *argv[]) |