8000 Merge branch 'develop' of github.com:ChaiScript/ChaiScript into develop · ChaiScript/ChaiScript@064a385 · GitHub
[go: up one dir, main page]

Skip to content

Commit 064a385

Browse files
committed
Merge branch 'develop' of github.com:ChaiScript/ChaiScript into develop
2 parents 87f1242 + e342243 commit 064a385

35 files changed

+168
-21
lines changed

include/chaiscript/chaiscript.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_HPP_
812
#define CHAISCRIPT_HPP_
913

include/chaiscript/chaiscript_threading.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_THREADING_HPP_
812
#define CHAISCRIPT_THREADING_HPP_
913

include/chaiscript/dispatchkit/bad_boxed_cast.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_BAD_BOXED_CAST_HPP_
812
#define CHAISCRIPT_BAD_BOXED_CAST_HPP_
913

include/chaiscript/dispatchkit/bind_first.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_BIND_FIRST_HPP_
812
#define CHAISCRIPT_BIND_FIRST_HPP_
913

include/chaiscript/dispatchkit/bootstrap.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_BOOTSTRAP_HPP_
812
#define CHAISCRIPT_BOOTSTRAP_HPP_
913

include/chaiscript/dispatchkit/bootstrap_stl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
/// \file
812
/// This file contains utility functions for registration of STL container
913
/// classes. The methodology used is based on the SGI STL concepts.

include/chaiscript/dispatchkit/boxed_cast.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_BOXED_CAST_HPP_
812
#define CHAISCRIPT_BOXED_CAST_HPP_
913

include/chaiscript/dispatchkit/boxed_cast_helper.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_BOXED_CAST_HELPER_HPP_
812
#define CHAISCRIPT_BOXED_CAST_HELPER_HPP_
913

include/chaiscript/dispatchkit/boxed_number.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
710
#ifndef CHAISCRIPT_BOXED_NUMERIC_HPP_
811
#define CHAISCRIPT_BOXED_NUMERIC_HPP_
912

@@ -588,12 +591,20 @@ namespace chaiscript
588591
template<typename Source, typename Target>
589592
static void check_type()
590593
{
594+
#ifdef CHAISCRIPT_MSVC
595+
// MSVC complains about this being redundant / tautologica l
596+
#pragma warning(push)
597+
#pragma warning(disable : 4127 6287)
598+
#endif
591599
if (sizeof(Source) != sizeof(Target)
592600
|| std::is_signed<Source>() != std::is_signed<Target>()
593601
|| std::is_floating_point<Source>() != std::is_floating_point<Target>())
594602
{
595603
throw chaiscript::detail::exception::bad_any_cast();
596604
}
605+
#ifdef CHAISCRIPT_MSVC
606+
#pragma warning(pop)
607+
#endif
597608
}
598609

599610
template<typename Target> Target get_as_checked() const

include/chaiscript/dispatchkit/boxed_value.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_BOXED_VALUE_HPP_
812
#define CHAISCRIPT_BOXED_VALUE_HPP_
913

include/chaiscript/dispatchkit/dispatchkit.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_DISPATCHKIT_HPP_
812
#define CHAISCRIPT_DISPATCHKIT_HPP_
913

include/chaiscript/dispatchkit/dynamic_object.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_DYNAMIC_OBJECT_HPP_
812
#define CHAISCRIPT_DYNAMIC_OBJECT_HPP_
913

include/chaiscript/dispatchkit/exception_specification.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711 10000
#ifndef CHAISCRIPT_EXCEPTION_SPECIFICATION_HPP_
812
#define CHAISCRIPT_EXCEPTION_SPECIFICATION_HPP_
913

include/chaiscript/dispatchkit/function_call.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_FUNCTION_CALL_HPP_
812
#define CHAISCRIPT_FUNCTION_CALL_HPP_
913

include/chaiscript/dispatchkit/function_call_detail.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_FUNCTION_CALL_DETAIL_HPP_
812
#define CHAISCRIPT_FUNCTION_CALL_DETAIL_HPP_
913

include/chaiscript/dispatchkit/handle_return.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_HANDLE_RETURN_HPP_
812
#define CHAISCRIPT_HANDLE_RETURN_HPP_
913

include/chaiscript/dispatchkit/operators.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_OPERATORS_HPP_
812
#define CHAISCRIPT_OPERATORS_HPP_
913

include/chaiscript/dispatchkit/proxy_constructors.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
710

811
#ifndef CHAISCRIPT_PROXY_CONSTRUCTORS_HPP_
912
#define CHAISCRIPT_PROXY_CONSTRUCTORS_HPP_

include/chaiscript/dispatchkit/proxy_functions.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
710

811
#ifndef CHAISCRIPT_PROXY_FUNCTIONS_HPP_
912
#define CHAISCRIPT_PROXY_FUNCTIONS_HPP_

include/chaiscript/dispatchkit/proxy_functions_detail.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_PROXY_FUNCTIONS_DETAIL_HPP_
812
#define CHAISCRIPT_PROXY_FUNCTIONS_DETAIL_HPP_
913

include/chaiscript/dispatchkit/register_function.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_REGISTER_FUNCTION_HPP_
812
#define CHAISCRIPT_REGISTER_FUNCTION_HPP_
913

include/chaiscript/dispatchkit/type_conversions.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_DYNAMIC_CAST_CONVERSION_HPP_
812
#define CHAISCRIPT_DYNAMIC_CAST_CONVERSION_HPP_
913

@@ -340,15 +344,11 @@ namespace chaiscript
340344
{
341345
}
342346

343-
Type_Conversions(const Type_Conversions &t_other)
344-
: m_mutex(),
345-
m_conversions(t_other.get_conversions()),
346-
m_convertableTypes(t_other.m_convertableTypes),
347-
m_num_types(m_conversions.size()),
348-
m_thread_cache(this),
349-
m_conversion_saves(this)
350-
{
351-
}
347+
Type_Conversions(const Type_Conversions &t_other) = delete;
348+
Type_Conversions(Type_Conversions &&) = default;
349+
350+
Type_Conversions &operator=(const Type_Conversions &) = delete;
351+
Type_Conversions &operator=(Type_Conversions &&) = default;
352352

353353
const std::set<const std::type_info *, Less_Than> &thread_cache() const
354354
{

include/chaiscript/dispatchkit/type_info.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_TYPE_INFO_HPP_
812
#define CHAISCRIPT_TYPE_INFO_HPP_
913

include/chaiscript/language/chaiscript_algebraic.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_ALGEBRAIC_HPP_
812
#define CHAISCRIPT_ALGEBRAIC_HPP_
913

include/chaiscript/language/chaiscript_common.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_COMMON_HPP_
812
#define CHAISCRIPT_COMMON_HPP_
913

include/chaiscript/language/chaiscript_engine.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_ENGINE_HPP_
812
#define CHAISCRIPT_ENGINE_HPP_
913

@@ -145,9 +149,6 @@ namespace chaiscript
145149
})
146150
, "call_exists");
147151

148-
// m_engine.add(fun<Boxed_Value (const dispatch::Proxy_Function_Base *, const std::vector<Boxed_Value> &)>(std::bind(&chaiscript::dispatch::Proxy_Function_Base::operator(), std::placeholders::_1, std::placeholders::_2, std::ref(m_engine.conversions()))), "call");
149-
//
150-
//
151152

152153
m_engine.add(fun(
153154
[=](const dispatch::Proxy_Function_Base &t_fun, const std::vector<Boxed_Value> &t_params) -> Boxed_Value {

include/chaiscript/language/chaiscript_eval.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_EVAL_HPP_
812
#define CHAISCRIPT_EVAL_HPP_
913

include/chaiscript/language/chaiscript_parser.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_PARSER_HPP_
812
#define CHAISCRIPT_PARSER_HPP_
913

include/chaiscript/utility/utility.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#ifndef CHAISCRIPT_UTILITY_UTILITY_HPP_
812
#define CHAISCRIPT_UTILITY_UTILITY_HPP_
913

releasenotes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Current Version: 6.0.0
2626

2727
* Modular optimization system; this can be accessed via the ChaiScript_Basic interface
2828
* Execution tracing capability; also accessed via ChaiScript_Basic interface
29-
* range-based for loops `for( id : container ) { }`
29+
* range-based for loops `for( id : container ) { }` (much better performance than other loop types)
3030
* If-init expressions (ala C++17)
3131
* Support for passing r-value references to functions
3232
* Support for containing unique_ptr
@@ -39,6 +39,7 @@ Current Version: 6.0.0
3939
* Compile size improvements
4040
* Significant runtime improvements (see "Modular optimization system")
4141
* Significant parser improvements, both with parse-time and parser initialization time (Thanks @niXman)
42+
* Fix type conversion to bool in conditionals
4243

4344
#### Improvements Still Need To Be Made
4445

samples/fun_call_performance.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Copyright 2009-2017, Jason Turner (jason@emptycrate.com)
55
// http://www.chaiscript.com
66

7+
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
8+
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
9+
10+
711
#include <iostream>
812
#include <list>
913
#include <regex>

0 commit comments

Comments
 (0)
0