Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oberon00 committed Jul 23, 2013
1 parent 050fd8f commit 2a99a68
Show file tree
Hide file tree
Showing 25 changed files with 109 additions and 116 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(CMakeDependentOption)

option(LUABIND_ENABLE_WARNINGS
"Enable compiler warnings during the build of luabind and the tests.")

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang")
option(LUABIND_NO_CXX11 "Disable C++11 support." OFF)
endif()
Expand Down Expand Up @@ -41,7 +41,7 @@ if (MSVC)
if (LUABIND_ENABLE_WARNINGS)
add_definitions(
"/W4" # Warning level 4

# Disable incorrect warning C4709
# ("comma operator within array index expression"):
"/wd4709")
Expand Down
1 change: 0 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
// OR OTHER DEALINGS IN THE SOFTWARE.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ luabind release (0.9) are described.
with the provided arguments sometimes only contained the function signatures
but not the actual error message. mrwonko's commit [9d15e0][c-errmsg] (and
previous).
* Luabind did not work over shared library (DLL) boundaries on some
* Luabind did not work over shared library (DLL) boundaries on some
platforms. fhoefling's commit [a83af3][c-dll] and my minor improvement
[a8349d][c-dll2].
* Calling `call_function` with a return type but not using it resulted in a
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLua52.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ IF(_LUA_LIBRARY_RELEASE OR _LUA_LIBRARY_DEBUG)
ELSE()
SET(_LUA_LIBRARY ${_LUA_LIBRARY_DEBUG})
ENDIF()

IF(UNIX AND NOT APPLE)
FIND_LIBRARY(_LUA_MATH_LIBRARY m)
mark_as_advanced(_LUA_MATH_LIBRARY)
Expand Down
2 changes: 1 addition & 1 deletion luabind/class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ namespace luabind
{
context[name] = property(get_);
}

Set set;
SetPolicies set_policies;
Get get;
Expand Down
2 changes: 1 addition & 1 deletion luabind/detail/debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace luabind { namespace detail {
#include <cassert>

namespace luabind { namespace detail
{
{
struct stack_checker_type
{
stack_checker_type(lua_State* L)
Expand Down
2 changes: 1 addition & 1 deletion luabind/detail/object_rep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace luabind { namespace detail
// on the top of the stack (the input self reference will
// be popped)
LUABIND_API void do_call_member_selection(lua_State* L, char const* name);

class class_rep;

void finalize(lua_State* L, class_rep* crep);
Expand Down
4 changes: 2 additions & 2 deletions luabind/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ namespace luabind

#endif

LUABIND_API void set_pcall_callback(pcall_callback_fun e);
LUABIND_API pcall_callback_fun get_pcall_callback();
LUABIND_API void set_pcall_callback(pcall_callback_fun e);
LUABIND_API pcall_callback_fun get_pcall_callback();
}

#endif // LUABIND_ERROR_HPP_INCLUDED
8 changes: 4 additions & 4 deletions luabind/error_callback_fun.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@

namespace luabind
{
class type_id;
class type_id;

typedef void(*error_callback_fun)(lua_State*);
typedef void(*cast_failed_callback_fun)(lua_State*, type_id const&);
typedef int(*pcall_callback_fun)(lua_State*);
typedef void(*error_callback_fun)(lua_State*);
typedef void(*cast_failed_callback_fun)(lua_State*, type_id const&);
typedef int(*pcall_callback_fun)(lua_State*);
}

#endif // INCLUDED_error_callback_fun_hpp_GUID_1150976a_4348_495f_99ce_9d7edd00a0b8
18 changes: 9 additions & 9 deletions luabind/function_introspection.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** @file
@brief Header
@brief Header
@date 2012
@date 2012
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
*/

// Copyright Iowa State University 2012.
Expand Down Expand Up @@ -48,7 +48,7 @@

namespace luabind {

LUABIND_API int bind_function_introspection(lua_State * L);
LUABIND_API int bind_function_introspection(lua_State * L);

} // end of namespace luabind

Expand Down
2 changes: 1 addition & 1 deletion luabind/iterator_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace luabind {

detail::policy_cons<detail::iterator_policy, detail::null_type> const
return_stl_iterator = {};

namespace detail
{
inline void ignore_unused_return_stl_iterator()
Expand Down
1 change: 0 additions & 1 deletion luabind/lua_state_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ struct lua_State;
#endif

#endif // LUABIND_BACK_REFERENCE_FWD_040510_HPP

16 changes: 8 additions & 8 deletions luabind/set_package_preload.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** @file
@brief Header
@brief Header
@date 2012
@date 2012
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
*/

// Copyright Iowa State University 2012.
Expand Down
2 changes: 1 addition & 1 deletion luabind/typeid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
|| (defined(__sgi) && defined(__host_mips)) \
|| (defined(__hpux) && defined(__HP_aCC)) \
|| (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC))
# define LUABIND_SAFE_TYPEID
# define LUABIND_SAFE_TYPEID
# endif

namespace luabind {
Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ set(luabind_detail_HDRS
../luabind/detail/call_function.hpp
../luabind/detail/call_member.hpp
../luabind/detail/call_operator_iterate.hpp
../luabind/detail/class_cache.hpp
../luabind/detail/class_registry.hpp
../luabind/detail/class_rep.hpp
../luabind/detail/compute_score.hpp
../luabind/detail/constructor.hpp
../luabind/detail/convert_to_lua.hpp
../luabind/detail/debug.hpp
Expand Down
2 changes: 1 addition & 1 deletion src/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ namespace luabind { namespace detail {
{
m_registration->m_casts.push_back(cast_entry(src, target, cast));
}


std::string get_class_name(lua_State* L, type_id const& i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace luabind

void set_error_callback(error_callback_fun e)
{
error_callback = e;
error_callback = e;
}

void set_cast_failed_callback(cast_failed_callback_fun c)
Expand Down
98 changes: 49 additions & 49 deletions src/function_introspection.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
@file
@brief Implementation
@file
@brief Implementation
@date 2012
@date 2012
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
*/

// Copyright Iowa State University 2012.
Expand Down Expand Up @@ -55,56 +55,56 @@
namespace luabind {

namespace {
detail::function_object* get_function_object(argument const& fn) {
lua_State * L = fn.interpreter();
{
fn.push(L);
detail::stack_pop pop(L, 1);
if (!detail::is_luabind_function(L, -1)) {
return NULL;
}
}
return *touserdata<detail::function_object*>(getupvalue(fn, 1));
}

std::string get_function_name(argument const& fn) {
detail::function_object * f = get_function_object(fn);
if (!f) {
return "";
}
return f->name;
}

object get_function_overloads(argument const& fn) {
lua_State * L = fn.interpreter();
detail::function_object * fobj = get_function_object(fn);
if (!fobj) {
return object();
}
object overloadTable(newtable(L));
int count = 1;
const char * function_name = fobj->name.c_str();
for (detail::function_object const* f = fobj; f != 0; f = f->next)
detail::function_object* get_function_object(argument const& fn) {
lua_State * L = fn.interpreter();
{
fn.push(L);
detail::stack_pop pop(L, 1);
if (!detail::is_luabind_function(L, -1)) {
return NULL;
}
}
return *touserdata<detail::function_object*>(getupvalue(fn, 1));
}

std::string get_function_name(argument const& fn) {
detail::function_object * f = get_function_object(fn);
if (!f) {
return "";
}
return f->name;
}

object get_function_overloads(argument const& fn) {
lua_State * L = fn.interpreter();
detail::function_object * fobj = get_function_object(fn);
if (!fobj) {
return object();
}
object overloadTable(newtable(L));
int count = 1;
const char * function_name = fobj->name.c_str();
for (detail::function_object const* f = fobj; f != 0; f = f->next)
{
f->format_signature(L, function_name);
detail::stack_pop pop(L, 1);
overloadTable[count] = object(from_stack(L, -1));

++count;
}
/// @todo
return overloadTable;
}
/// @todo

return overloadTable;
}

}

LUABIND_API int bind_function_introspection(lua_State * L) {
module(L, "function_info")[
def("get_function_overloads", &get_function_overloads),
def("get_function_name", &get_function_name)
];
return 0;
module(L, "function_info")[
def("get_function_overloads", &get_function_overloads),
def("get_function_name", &get_function_name)
];
return 0;
}

} // end of namespace luabind
1 change: 0 additions & 1 deletion src/operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ namespace luabind
LUABIND_API self_type self;
LUABIND_API const_self_type const_self;
}

18 changes: 9 additions & 9 deletions src/set_package_preload.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
@file
@brief Implementation
@file
@brief Implementation
@date 2012
@date 2012
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
@author
Ryan Pavlik
<[email protected]> and <[email protected]>
http://academic.cleardefinition.com/
Iowa State University Virtual Reality Applications Center
Human-Computer Interaction Graduate Program
*/

// Copyright Iowa State University 2012.
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_directories(
${Boost_INCLUDE_DIRS} ${LUA_INCLUDE_DIR} ${CMAKE_SOURCE_DIR})

add_executable(benchmark "benchmark.cpp")
target_link_libraries(benchmark luabind)

Expand All @@ -9,7 +9,7 @@ add_library(testmain STATIC
# These tests consist only of compile time asserts and define no test_main
# function:
"test_has_get_pointer.cpp")

target_link_libraries(testmain luabind)

if (BUILD_SHARED_LIBS AND MSVC)
Expand Down
2 changes: 1 addition & 1 deletion test/test_construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct A : counted_type<A>
// Explicit call to default ctor to avoid g++'s "warning: base class
// ‘struct counted_type<A>’ should be explicitly initialized in the copy
// constructor [-Wextra]"
A(const A&): counted_type<A>() { test = 1; } //
A(const A&): counted_type<A>() { test = 1; } //
A() { test = 2; }
~A() {}
};
Expand Down
4 changes: 2 additions & 2 deletions test/test_exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ struct exception_thrower : counted_type<exception_thrower>
#endif
LUABIND_ATTRIBUTE_NORETURN exception_thrower(int)
{ throw ex("exception description"); }

LUABIND_ATTRIBUTE_NORETURN exception_thrower(int, int)
{ throw "a string exception"; }

LUABIND_ATTRIBUTE_NORETURN exception_thrower(int, int, int)
{ throw 10; }
#ifdef BOOST_MSVC
Expand Down
Loading

0 comments on commit 2a99a68

Please sign in to comment.