From 46e1d70551333566d2ea6f1c29d97468c3865f9b Mon Sep 17 00:00:00 2001 From: ado Date: Sat, 27 Feb 2021 12:41:51 +0100 Subject: [PATCH] remove user defined warnings, remove win icc ci --- .github/workflows/win-icc.yml | 71 ----------------------------------- README.md | 1 + include/ss/extract.hpp | 13 ++----- 3 files changed, 4 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/win-icc.yml diff --git a/.github/workflows/win-icc.yml b/.github/workflows/win-icc.yml deleted file mode 100644 index 71c0899..0000000 --- a/.github/workflows/win-icc.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: win-icc-ci - -on: - push: - branches: - - master - - feature/** - - improvement/** - - bugfix/** - - pull_request: - branches: - - master - - feature/** - - improvement/** - - bugfix/** - -env: - WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17453/w_BaseKit_p_2021.1.0.2664_offline.exe - WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17392/w_HPCKit_p_2021.1.0.2682_offline.exe - -jobs: - icc_tests: - if: >- - ! contains(toJSON(github.event.commits.*.message), '[skip ci]') && - ! contains(toJSON(github.event.commits.*.message), '[skip github]') - - runs-on: windows-latest - defaults: - run: - shell: bash - - steps: - - uses: actions/checkout@v2 - - name: cache install - id: cache-install - uses: actions/cache@v2 - with: - path: C:\Program Files (x86)\Intel\oneAPI\compiler - key: >- - install-${{ env.WINDOWS_HPCKIT_URL }}- - ${{ env.WINDOWS_CPP_COMPONENTS }}- - compiler-${{ hashFiles('**/script/cache_exclude_windows.sh') }} - - - name: Install icc - run: >- - script/ci_win_install_icc.bat $WINDOWS_HPCKIT_URL - $WINDOWS_CPP_COMPONENTS - - - name: CMake - run: echo "/host_usr_local/bin" >> $GITHUB_PATH - - - name: Install dependencies - run: script/ci_install_deps.sh - - - name: Setup icc - run: script/ci_win_setup_icc.bat - - - name: Configure - run: >- - dpcpp -v && - cmake -DCMAKE_CXX_COMPILER=dpcpp -S test -B build - -DCMAKE_BUILD_TYPE=Debug - - - name: Build - run: >- - cmake --build build -j ${{ steps.cores.outputs.count }} - - - name: Run - working-directory: build - run: ctest --output-on-failure -j ${{ steps.cores.outputs.count }} diff --git a/README.md b/README.md index 9c43993..c815fe6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Static split parser +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) A header only "csv" parser which is fast and versatile with modern C++ api. Requires compiler with C++17 support. diff --git a/include/ss/extract.hpp b/include/ss/extract.hpp index be6511a..2634399 100644 --- a/include/ss/extract.hpp +++ b/include/ss/extract.hpp @@ -18,11 +18,11 @@ namespace ss { template std::enable_if_t, std::optional> to_num( - const char* begin, const char* const end) { + const char* const begin, const char* const end) { T ret; - auto answer = fast_float::from_chars(begin, end, ret); + auto [ptr, ec] = fast_float::from_chars(begin, end, ret); - if (answer.ec != std::errc() || answer.ptr != end) { + if (ec != std::errc() || ptr != end) { return std::nullopt; } return ret; @@ -169,13 +169,6 @@ bool shift_and_add_overflow(T& value, T digit, F add_last_digit_owerflow) { } #else -#ifndef SS_NO_WARNINGS -#ifdef _WIN32 -#pragma warning("Use clang or gcc if possible for performance reasons. Define SS_NO_WARNINGS to supress warning.") -#else -#warning "Use clang or gcc if possible for performance reasons. Define SS_NO_WARNINGS to supress warning." -#endif -#endif template bool shift_and_add_overflow(T& value, T digit, U is_negative) { digit = (is_negative) ? -digit : digit;