From 85a302e496e163a0352c81bb2146d8344dc0a51b Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 16 Oct 2015 08:42:02 -0400 Subject: [PATCH] src: move pseudo-toplevel methods from Object Signed-off-by: Jean Privat --- src/ffi/cpp.nit | 8 +++----- src/ffi/light_c.nit | 10 ++++------ src/nitni/nitni_utilities.nit | 10 ++++------ 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/ffi/cpp.nit b/src/ffi/cpp.nit index b96c600..8bcd56c 100644 --- a/src/ffi/cpp.nit +++ b/src/ffi/cpp.nit @@ -195,11 +195,9 @@ redef class NitniCallback fun compile_callback_to_cpp(mmodule: MModule, mainmodule: MModule) do end end -redef class Object - private fun cpp_call_context: CppCallContext do return once new CppCallContext - private fun to_cpp_call_context: ToCppCallContext do return once new ToCppCallContext - private fun from_cpp_call_context: FromCppCallContext do return once new FromCppCallContext -end +fun cpp_call_context: CppCallContext do return once new CppCallContext +fun to_cpp_call_context: ToCppCallContext do return once new ToCppCallContext +fun from_cpp_call_context: FromCppCallContext do return once new FromCppCallContext redef class MExplicitCall redef fun compile_callback_to_cpp(mmodule, mainmodule) diff --git a/src/ffi/light_c.nit b/src/ffi/light_c.nit index e0cd788..4c99e9b 100644 --- a/src/ffi/light_c.nit +++ b/src/ffi/light_c.nit @@ -91,13 +91,11 @@ class ForeignCType redef var ctype: String end -redef class Object - # Context when calling user C code from generated code - fun to_c_call_context: ToCCallContext do return once new ToCCallContext +# Context when calling user C code from generated code +fun to_c_call_context: ToCCallContext do return once new ToCCallContext - # Context when calling generated code from user C code - fun from_c_call_context: FromCCallContext do return once new FromCCallContext -end +# Context when calling generated code from user C code +fun from_c_call_context: FromCCallContext do return once new FromCCallContext # Context when calling user C code from generated code class ToCCallContext diff --git a/src/nitni/nitni_utilities.nit b/src/nitni/nitni_utilities.nit index 7de8053..c0a8a15 100644 --- a/src/nitni/nitni_utilities.nit +++ b/src/nitni/nitni_utilities.nit @@ -140,12 +140,10 @@ class CallContext fun cast_to(mtype: MType, name: String): String do return name end -redef class Object - # Call context to use - protected fun internal_call_context: CallContext do return new CallContext - protected fun long_signature: SignatureLength do return once new SignatureLength(true) - protected fun short_signature: SignatureLength do return once new SignatureLength(false) -end +# Call context to use +fun internal_call_context: CallContext do return new CallContext +fun long_signature: SignatureLength do return once new SignatureLength(true) +fun short_signature: SignatureLength do return once new SignatureLength(false) # Length of the signature of a C function (long version hase the module name as prefix) class SignatureLength -- 1.7.9.5