src: move pseudo-toplevel methods from Object
authorJean Privat <jean@pryen.org>
Fri, 16 Oct 2015 12:42:02 +0000 (08:42 -0400)
committerJean Privat <jean@pryen.org>
Fri, 16 Oct 2015 17:58:42 +0000 (13:58 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/ffi/cpp.nit
src/ffi/light_c.nit
src/nitni/nitni_utilities.nit

index b96c600..8bcd56c 100644 (file)
@@ -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)
index e0cd788..4c99e9b 100644 (file)
@@ -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
index 7de8053..c0a8a15 100644 (file)
@@ -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