Browse Source

Perform all the casts

Ole 9 years ago
parent
commit
9b635f1aa9
2 changed files with 6 additions and 4 deletions
  1. 2 2
      lib/luwra/fields.hpp
  2. 4 2
      lib/luwra/functions.hpp

+ 2 - 2
lib/luwra/fields.hpp

@@ -32,7 +32,7 @@ namespace internal {
 				read<T*>(state, 1)->*field_pointer = read<R>(state, 2);
 				read<T*>(state, 1)->*field_pointer = read<R>(state, 2);
 				return 0;
 				return 0;
 			} else {
 			} else {
-				return push(state, read<T*>(state, 1)->*field_pointer);
+				return static_cast<int>(push(state, read<T*>(state, 1)->*field_pointer));
 			}
 			}
 		}
 		}
 	};
 	};
@@ -41,7 +41,7 @@ namespace internal {
 	struct FieldWrapper<const R T::*> {
 	struct FieldWrapper<const R T::*> {
 		template <const R T::* field_pointer> static inline
 		template <const R T::* field_pointer> static inline
 		int invoke(State* state) {
 		int invoke(State* state) {
-			return push(state, read<T*>(state, 1)->*field_pointer);
+			return static_cast<int>(push(state, read<T*>(state, 1)->*field_pointer));
 		}
 		}
 	};
 	};
 }
 }

+ 4 - 2
lib/luwra/functions.hpp

@@ -26,13 +26,15 @@ namespace internal {
 	struct FunctionWrapper<R(A...)> {
 	struct FunctionWrapper<R(A...)> {
 		template <R (* fun)(A...)> static inline
 		template <R (* fun)(A...)> static inline
 		int invoke(State* state) {
 		int invoke(State* state) {
-			return static_cast<int>(map<R(A...)>(state, fun));
+			return static_cast<int>(
+				map<R(A...)>(state, fun)
+			);
 		}
 		}
 	};
 	};
 
 
 	// We need an alias, because function pointers are weird
 	// We need an alias, because function pointers are weird
 	template <typename R, typename... A>
 	template <typename R, typename... A>
-	struct FunctionWrapper<R(*)(A...)>: FunctionWrapper<R(A...)> {};
+	struct FunctionWrapper<R (*)(A...)>: FunctionWrapper<R (A...)> {};
 }
 }
 
 
 /**
 /**