From b7c5ddcdd05ceba73acb1a298500892d6157f360 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 31 Jan 2018 12:29:46 +0300 Subject: connectivity: MSVC: pragma warning: make more specific, remove obsolete Change-Id: I22553d7cbbae7cfaac3f39a17db54dfe06e2e5bc Reviewed-on: https://gerrit.libreoffice.org/48989 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- .../source/drivers/firebird/Connection.cxx | 12 ++++---- .../source/drivers/mork/post_include_windows.h | 24 ---------------- .../source/drivers/mork/pre_include_windows.h | 25 ---------------- connectivity/source/inc/ado/Aolevariant.hxx | 2 -- connectivity/source/inc/ado/Awrapado.hxx | 2 -- connectivity/source/inc/ado/Awrapadox.hxx | 2 -- connectivity/source/inc/ado/WrapColumn.hxx | 2 -- connectivity/source/inc/ado/ado_post_sys_include.h | 26 ----------------- connectivity/source/inc/ado/ado_pre_sys_include.h | 33 ---------------------- connectivity/source/inc/ado/adoimp.hxx | 2 -- connectivity/source/parse/sqlbison.y | 13 +++++---- connectivity/source/parse/sqlflex.l | 14 +++++---- include/connectivity/odbc.hxx | 9 ------ 13 files changed, 23 insertions(+), 143 deletions(-) delete mode 100644 connectivity/source/drivers/mork/post_include_windows.h delete mode 100644 connectivity/source/drivers/mork/pre_include_windows.h delete mode 100644 connectivity/source/inc/ado/ado_post_sys_include.h delete mode 100644 connectivity/source/inc/ado/ado_pre_sys_include.h diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 619f324720e9..9cb9fc340cc8 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -55,11 +55,6 @@ #include -#ifdef _WIN32 -// for ADD_SPB_NUMERIC -#pragma warning(disable: 4310) // cast truncates data -#endif - using namespace connectivity::firebird; using namespace connectivity; @@ -637,7 +632,14 @@ void Connection::runBackupService(const short nAction) aRequest.append(char(isc_spb_options)); // 4-Byte bitmask char sOptions[4]; char * pOptions = sOptions; +#ifdef _WIN32 +#pragma warning(push) +#pragma warning(disable: 4310) // cast truncates data +#endif ADD_SPB_NUMERIC(pOptions, isc_spb_res_create); +#ifdef _WIN32 +#pragma warning(pop) +#endif aRequest.append(sOptions, 4); } diff --git a/connectivity/source/drivers/mork/post_include_windows.h b/connectivity/source/drivers/mork/post_include_windows.h deleted file mode 100644 index bd49753b7bd7..000000000000 --- a/connectivity/source/drivers/mork/post_include_windows.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifdef _MSC_VER - #pragma warning(pop) -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mork/pre_include_windows.h b/connectivity/source/drivers/mork/pre_include_windows.h deleted file mode 100644 index 7d68ce298f9e..000000000000 --- a/connectivity/source/drivers/mork/pre_include_windows.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifdef _MSC_VER - #pragma warning(push,1) - #pragma warning(disable:4668 4917) -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/Aolevariant.hxx b/connectivity/source/inc/ado/Aolevariant.hxx index a9af47ee042e..732880a7c088 100644 --- a/connectivity/source/inc/ado/Aolevariant.hxx +++ b/connectivity/source/inc/ado/Aolevariant.hxx @@ -23,9 +23,7 @@ #include #include -#include #include -#include namespace com { diff --git a/connectivity/source/inc/ado/Awrapado.hxx b/connectivity/source/inc/ado/Awrapado.hxx index f8b6d818f6d7..c7817a75b326 100644 --- a/connectivity/source/inc/ado/Awrapado.hxx +++ b/connectivity/source/inc/ado/Awrapado.hxx @@ -22,11 +22,9 @@ #include // Includes for ADO -#include #include #include #include -#include #include #include #include diff --git a/connectivity/source/inc/ado/Awrapadox.hxx b/connectivity/source/inc/ado/Awrapadox.hxx index 83374761ac9b..ea32f5895464 100644 --- a/connectivity/source/inc/ado/Awrapadox.hxx +++ b/connectivity/source/inc/ado/Awrapadox.hxx @@ -53,10 +53,8 @@ typedef struct _ADOTable Table; #endif -#include #include #include -#include #include diff --git a/connectivity/source/inc/ado/WrapColumn.hxx b/connectivity/source/inc/ado/WrapColumn.hxx index fd50fee44287..7f3dd3d86903 100644 --- a/connectivity/source/inc/ado/WrapColumn.hxx +++ b/connectivity/source/inc/ado/WrapColumn.hxx @@ -21,9 +21,7 @@ #include -#include #include -#include namespace connectivity { diff --git a/connectivity/source/inc/ado/ado_post_sys_include.h b/connectivity/source/inc/ado/ado_post_sys_include.h deleted file mode 100644 index ee808f82e109..000000000000 --- a/connectivity/source/inc/ado/ado_post_sys_include.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#undef ADO_REDUCED_WARN_LEVEL - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ado_pre_sys_include.h b/connectivity/source/inc/ado/ado_pre_sys_include.h deleted file mode 100644 index 70f77a708cf6..000000000000 --- a/connectivity/source/inc/ado/ado_pre_sys_include.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifdef ADO_REDUCED_WARN_LEVEL - #error "ado_pre_sys_include.h included twice!" -#endif - -#ifdef _MSC_VER -#pragma warning(push,1) -#pragma warning(disable:4917) -#endif - -#include - -#define ADO_REDUCED_WARN_LEVEL - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/adoimp.hxx b/connectivity/source/inc/ado/adoimp.hxx index a0ab03e369ee..8393ca731aa3 100644 --- a/connectivity/source/inc/ado/adoimp.hxx +++ b/connectivity/source/inc/ado/adoimp.hxx @@ -21,9 +21,7 @@ #include -#include #include -#include struct ADOConnection; namespace connectivity diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index 0f21bcc6fcc9..dbf203f814a1 100644 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -47,8 +47,10 @@ #include #if defined _MSC_VER -#pragma warning(push, 1) -#pragma warning(disable:4273 4701) +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to alignment specifier +#pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels +#pragma warning(disable: 4702) // unreachable code #endif #ifdef __GNUC__ @@ -4260,6 +4262,9 @@ trigger_name: ; %% +#if defined _MSC_VER +#pragma warning(pop) +#endif using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::beans; @@ -4818,7 +4823,3 @@ int OSQLParser::SQLlex() { return OSQLScanner::SQLlex(); } - -#if defined _MSC_VER -#pragma warning(pop) -#endif diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index 9bbf3d173b67..54f253651447 100644 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -28,7 +28,16 @@ #include +#if defined _MSC_VER +#pragma warning ( push ) +// Silence warnings about redefinition of INT8_MIN etc in stdint.h +// The flex-generated workdir/LexTarget/idlc/source/scanner.cxx defines them prior to these includes +#pragma warning ( disable : 4005 ) +#endif #include +#if defined _MSC_VER +#pragma warning(pop) +#endif #ifndef INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L #define INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L @@ -47,7 +56,6 @@ #include #if defined _MSC_VER -#pragma warning(push, 1) /**/ #ifdef yywrap #undef yywrap @@ -793,7 +801,3 @@ sal_Int32 OSQLScanner::SQLlex() { return SQLyylex(); } - -#if defined _MSC_VER -#pragma warning(pop) -#endif diff --git a/include/connectivity/odbc.hxx b/include/connectivity/odbc.hxx index a39a426975fc..896001477293 100644 --- a/include/connectivity/odbc.hxx +++ b/include/connectivity/odbc.hxx @@ -23,11 +23,6 @@ #if defined(_WIN32) -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4005) -#endif - #include // just to go with calling convention of windows @@ -45,10 +40,6 @@ #undef SQL_API #define SQL_API __stdcall -#ifdef _MSC_VER -#pragma warning(pop) -#endif - #ifndef SQL_C_BOOKMARK #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */ #endif -- cgit