예제 #1
0
	inline void getValue<double>(Dart_NativeArguments args, int index, double* value)
	{
		Dart_Handle handle = Dart_GetNativeArgument(args, index);

		assert(Dart_IsDouble(handle));

		Dart_DoubleValue(handle, value);
	}
예제 #2
0
	inline void getValue<float>(Dart_NativeArguments args, int index, float* value)
	{
		Dart_Handle handle = Dart_GetNativeArgument(args, index);

		assert(Dart_IsDouble(handle));

		double temp;
		Dart_DoubleValue(handle, &temp);

		*value = static_cast<float>(temp);
	}
gboolean _gdart_marshaller_check_argument_num(GdartBridgeContext *self,
    Dart_Handle element,
    gpointer arg_type,
    const TypeInfoKlass *arg_type_klass,
    Dart_Handle *dart_error_out,
    GError **error)
{
  if (!Dart_IsInteger(element) && !Dart_IsDouble(element)) {
    *dart_error_out = gdart_bridge_context_create_error_handle(self,
                      "%s: expected double or integer", G_STRFUNC);
    g_set_error(error, GDART_ERROR, 1,
                "%s: expected double or integer", G_STRFUNC);
    goto error;
  }
  return TRUE;
error:
  return FALSE;
}