本文整理汇总了C++中RETURN_VOID函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_VOID函数的具体用法?C++ RETURN_VOID怎么用?C++ RETURN_VOID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_VOID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dalvik_dalvik_system_VMDebug_startMethodTracingFd
/*
* static void startMethodTracingFd(String traceFileName, FileDescriptor fd,
* int bufferSize, int flags, boolean samplingEnabled, int intervalUs)
*
* Start method trace profiling, sending results to a file descriptor.
*/
static void Dalvik_dalvik_system_VMDebug_startMethodTracingFd(const u4* args,
JValue* pResult)
{
StringObject* traceFileStr = (StringObject*) args[0];
Object* traceFd = (Object*) args[1];
int bufferSize = args[2];
int flags = args[3];
bool samplingEnabled = args[4];
int intervalUs = args[5];
int origFd = getFileDescriptor(traceFd);
if (origFd < 0)
RETURN_VOID();
int fd = dup(origFd);
if (fd < 0) {
dvmThrowExceptionFmt(gDvm.exRuntimeException,
"dup(%d) failed: %s", origFd, strerror(errno));
RETURN_VOID();
}
char* traceFileName = dvmCreateCstrFromString(traceFileStr);
if (traceFileName == NULL) {
RETURN_VOID();
}
dvmMethodTraceStart(traceFileName, fd, bufferSize, flags, false,
samplingEnabled, intervalUs);
free(traceFileName);
RETURN_VOID();
}
示例2: Dalvik_dalvik_system_VMRuntime_newNonMovableArray
static void Dalvik_dalvik_system_VMRuntime_newNonMovableArray(const u4* args,
JValue* pResult)
{
ClassObject* elementClass = (ClassObject*) args[1];
int length = args[2];
if (elementClass == NULL) {
dvmThrowNullPointerException("elementClass == null");
RETURN_VOID();
}
if (length < 0) {
dvmThrowNegativeArraySizeException(length);
RETURN_VOID();
}
// TODO: right now, we don't have a copying collector, so there's no need
// to do anything special here, but we ought to pass the non-movability
// through to the allocator.
ClassObject* arrayClass = dvmFindArrayClassForElement(elementClass);
ArrayObject* newArray = dvmAllocArrayByClass(arrayClass,
length,
ALLOC_NON_MOVING);
if (newArray == NULL) {
assert(dvmCheckException(dvmThreadSelf()));
RETURN_VOID();
}
dvmReleaseTrackedAlloc((Object*) newArray, NULL);
RETURN_PTR(newArray);
}
示例3: Dalvik_dalvik_system_VMDebug_getHeapSpaceStats
/*
* public static native void getHeapSpaceStats(long[] data)
*/
static void Dalvik_dalvik_system_VMDebug_getHeapSpaceStats(const u4* args,
JValue* pResult)
{
ArrayObject* dataArray = (ArrayObject*) args[0];
if (dataArray == NULL || dataArray->length < 6) {
RETURN_VOID();
}
jlong* arr = (jlong*)(void*)dataArray->contents;
int j = 0;
size_t per_heap_allocated[2];
size_t per_heap_size[2];
memset(per_heap_allocated, 0, sizeof(per_heap_allocated));
memset(per_heap_size, 0, sizeof(per_heap_size));
dvmHeapSourceGetValue(HS_BYTES_ALLOCATED, (size_t*) &per_heap_allocated, 2);
dvmHeapSourceGetValue(HS_FOOTPRINT, (size_t*) &per_heap_size, 2);
jlong heapSize = per_heap_size[0];
jlong heapUsed = per_heap_allocated[0];
jlong heapFree = heapSize - heapUsed;
jlong zygoteSize = per_heap_size[1];
jlong zygoteUsed = per_heap_allocated[1];
jlong zygoteFree = zygoteSize - zygoteUsed;
arr[j++] = heapSize;
arr[j++] = heapUsed;
arr[j++] = heapFree;
arr[j++] = zygoteSize;
arr[j++] = zygoteUsed;
arr[j++] = zygoteFree;
RETURN_VOID();
}
示例4: print_dlopen_error
static void
print_dlopen_error(YogEnv* env, YogHandle* filename)
{
SAVE_LOCALS(env);
if (!env->vm->debug_import) {
RETURN_VOID(env);
}
const char* msg;
#if defined(__MINGW32__) || defined(_MSC_VER)
TCHAR buf[1024];
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, buf, array_sizeof(buf), NULL) != 0) {
RETURN_VOID(env);
}
msg = (const char*)buf;
#else
msg = dlerror();
if (msg == NULL) {
RETURN_VOID(env);
}
#endif
#if defined(__linux__)
fprintf(stderr, "%s\n", msg);
#else
YogVal bin = YogString_to_bin_in_default_encoding(env, filename);
fprintf(stderr, "%s: %s\n", BINARY_CSTR(bin), msg);
#endif
RETURN_VOID(env);
}
示例5: exec_get_attr
static void
exec_get_attr(YogEnv* env, YogVal self, ID name)
{
SAVE_ARG(env, self);
YogVal klass = YUNDEF;
YogVal attr = YUNDEF;
PUSH_LOCALS2(env, klass, attr);
klass = YogVal_get_class(env, self);
attr = YogClass_get_attr(env, klass, name);
if (!IS_UNDEF(attr)) {
attr = YogVal_get_descr(env, attr, self, klass);
YogScriptFrame_push_stack(env, env->frame, attr);
RETURN_VOID(env);
}
attr = YogObj_get_attr(env, self, name);
if (!IS_UNDEF(attr)) {
attr = YogVal_get_descr(env, attr, YNIL, self);
YogScriptFrame_push_stack(env, env->frame, attr);
RETURN_VOID(env);
}
YogError_raise_AttributeError(env, "%C object has no attribute \"%I\"", self, name);
/* NOTREACHED */
RETURN_VOID(env);
}
示例6: Dalvik_dalvik_system_VMDebug_dumpHprofData
/*
* static void dumpHprofData(String fileName, FileDescriptor fd)
*
* Cause "hprof" data to be dumped. We can throw an IOException if an
* error occurs during file handling.
*/
static void Dalvik_dalvik_system_VMDebug_dumpHprofData(const u4* args,
JValue* pResult)
{
#ifdef WITH_HPROF
StringObject* fileNameStr = (StringObject*) args[0];
Object* fileDescriptor = (Object*) args[1];
char* fileName;
int result;
/*
* Only one of these may be NULL.
*/
if (fileNameStr == NULL && fileDescriptor == NULL) {
dvmThrowException("Ljava/lang/NullPointerException;", NULL);
RETURN_VOID();
}
if (fileNameStr != NULL) {
fileName = dvmCreateCstrFromString(fileNameStr);
if (fileName == NULL) {
/* unexpected -- malloc failure? */
dvmThrowException("Ljava/lang/RuntimeException;", "malloc failure?");
RETURN_VOID();
}
} else {
fileName = strdup("[fd]");
}
int fd = -1;
if (fileDescriptor != NULL) {
fd = getFileDescriptor(fileDescriptor);
if (fd < 0)
RETURN_VOID();
}
result = hprofDumpHeap(fileName, fd, false);
free(fileName);
if (result != 0) {
/* ideally we'd throw something more specific based on actual failure */
dvmThrowException("Ljava/lang/RuntimeException;",
"Failure during heap dump -- check log output for details");
RETURN_VOID();
}
#else
dvmThrowException("Ljava/lang/UnsupportedOperationException;", NULL);
#endif
RETURN_VOID();
}
示例7: Dalvik_java_lang_reflect_Field_getField
/*
* private Object getField(Object o, Class declaringClass, Class type,
* int slot, boolean noAccessCheck)
*
* Primitive types need to be boxed.
*/
static void Dalvik_java_lang_reflect_Field_getField(const u4* args,
JValue* pResult)
{
// ignore thisPtr in args[0]
Object* obj = (Object*) args[1];
ClassObject* declaringClass = (ClassObject*) args[2];
ClassObject* fieldType = (ClassObject*) args[3];
int slot = args[4];
bool noAccessCheck = (args[5] != 0);
JValue value;
const JValue* fieldPtr;
DataObject* result;
//dvmDumpClass(obj->clazz, kDumpClassFullDetail);
/* get a pointer to the field's data; performs access checks */
fieldPtr = getFieldDataAddr(obj, declaringClass, slot, false,noAccessCheck);
if (fieldPtr == NULL)
RETURN_VOID();
/* copy 4 or 8 bytes out */
if (fieldType->primitiveType == PRIM_LONG ||
fieldType->primitiveType == PRIM_DOUBLE)
{
value.j = fieldPtr->j;
} else {
value.i = fieldPtr->i;
}
result = dvmWrapPrimitive(value, fieldType);
dvmReleaseTrackedAlloc((Object*) result, NULL);
RETURN_PTR(result);
}
示例8: YogRegexp_define_classes
void
YogRegexp_define_classes(YogEnv* env, YogVal pkg)
{
SAVE_ARG(env, pkg);
YogVal cRegexp = YUNDEF;
YogVal cMatch = YUNDEF;
PUSH_LOCALS2(env, cRegexp, cMatch);
YogVM* vm = env->vm;
cRegexp = YogClass_new(env, "Regexp", vm->cObject);
#define DEFINE_METHOD(name, ...) do { \
YogClass_define_method2(env, cRegexp, pkg, (name), __VA_ARGS__); \
} while (0)
DEFINE_METHOD("match", match, "s", "|", "pos", NULL);
DEFINE_METHOD("search", search, "s", "|", "pos", NULL);
#undef DEFINE_METHOD
vm->cRegexp = cRegexp;
cMatch = YogClass_new(env, "Match", vm->cObject);
#define DEFINE_METHOD(name, f) do { \
YogClass_define_method(env, cMatch, pkg, (name), (f)); \
} while (0)
DEFINE_METHOD("start", start);
DEFINE_METHOD("end", end);
#undef DEFINE_METHOD
#define DEFINE_METHOD2(name, ...) do { \
YogClass_define_method2(env, cMatch, pkg, (name), __VA_ARGS__); \
} while (0)
DEFINE_METHOD2("group", group, "|", "group", NULL);
#undef DEFINE_METHOD2
vm->cMatch = cMatch;
RETURN_VOID(env);
}
示例9: Dalvik_java_lang_Runtime_gc
/*
* public void gc()
*
* Initiate a gc.
*/
static void Dalvik_java_lang_Runtime_gc(const u4* args, JValue* pResult)
{
UNUSED_PARAMETER(args);
dvmCollectGarbage(false);
RETURN_VOID();
}
示例10: exec_set_descr
static void
exec_set_descr(YogEnv* env, YogVal attr, YogVal obj, YogVal val)
{
SAVE_ARGS3(env, attr, obj, val);
YogVal setter = YUNDEF;
YogVal class_of_setter = YUNDEF;
YogVal method = YUNDEF;
YogVal class_of_method = YUNDEF;
YogVal class_of_obj = YUNDEF;
PUSH_LOCALS5(env, setter, class_of_setter, method, class_of_method, class_of_obj);
YogHandle* args[] = { YogHandle_REGISTER(env, val) };
setter = PTR_AS(YogProperty, attr)->setter;
class_of_setter = YogVal_get_class(env, setter);
if (!IS_PTR(setter)) {
ID id = PTR_AS(YogClass, class_of_setter)->name;
YogError_raise_TypeError(env, "\"%I\" object is not callable", id);
}
class_of_obj = YogVal_get_class(env, obj);
YOG_ASSERT(env, PTR_AS(YogClass, class_of_setter)->call_get_descr != NULL, "can't make instance method");
method = PTR_AS(YogClass, class_of_setter)->call_get_descr(env, setter, obj, class_of_obj);
YOG_ASSERT(env, IS_PTR(method), "method isn't pointer");
class_of_method = YogVal_get_class(env, method);
Executor exec = PTR_AS(YogClass, class_of_method)->exec;
YOG_ASSERT(env, exec != NULL, "method isn't callable");
YogHandle* h_method = YogHandle_REGISTER(env, method);
exec(env, h_method, array_sizeof(args), args, 0, NULL, NULL, NULL, NULL);
RETURN_VOID(env);
}
示例11: exec_get_descr
static void
exec_get_descr(YogEnv* env, YogVal attr, YogVal obj, YogVal klass)
{
SAVE_ARGS3(env, attr, obj, klass);
YogVal getter = YUNDEF;
YogVal class_of_getter = YUNDEF;
YogVal method = YUNDEF;
YogVal class_of_method = YUNDEF;
PUSH_LOCALS4(env, getter, class_of_getter, method, class_of_method);
getter = PTR_AS(YogProperty, attr)->getter;
class_of_getter = YogVal_get_class(env, getter);
if (!IS_PTR(getter)) {
ID id = PTR_AS(YogClass, class_of_getter)->name;
YogError_raise_TypeError(env, "\"%I\" object is not callable", id);
}
YOG_ASSERT(env, PTR_AS(YogClass, class_of_getter)->call_get_descr != NULL, "can't make instance method");
method = PTR_AS(YogClass, class_of_getter)->call_get_descr(env, getter, obj, klass);
YOG_ASSERT(env, IS_PTR(method), "method isn't pointer");
class_of_method = YogVal_get_class(env, method);
Executor exec = PTR_AS(YogClass, class_of_method)->exec;
YOG_ASSERT(env, exec != NULL, "method isn't callable");
YogHandle* h_method = YogHandle_REGISTER(env, method);
exec(env, h_method, 0, NULL, 0, NULL, NULL, NULL, NULL);
RETURN_VOID(env);
}
示例12: CompetitorInfo
CompetitorInfo(ROLE* role)
{
memset(this, 0, sizeof(*this));
RETURN_VOID(role == NULL);
memcpy(this->szName, role->roleName.c_str(), sizeof(this->szName)-1);
this->dwID = role->dwRoleID;
this->bySex = role->bySex;
this->byJob = role->byJob;
this->dwFightValue = role->dwFightValue;
this->wLevel = role->wLevel;
auto it = ARENA::mapRoleIDRank.find( role->dwRoleID );
if ( it != ARENA::mapRoleIDRank.end() )
{
this->dwRank = it->second;
}
CONFIG::ARENA_BOUNS_CFG *arenaBounsCfg = CONFIG::getArenaBounsCfg(this->dwRank);
if( arenaBounsCfg != NULL)
{
this->dwMoney = arenaBounsCfg->goldNum;
this->wChipID = arenaBounsCfg->itemID;
this->wChipNum = arenaBounsCfg->itemNum;
}
}
示例13: raise_ZipError
static void
raise_ZipError(YogEnv* env, YogVal pkg, const char* msg)
{
SAVE_ARG(env, pkg);
YogVal eZipError = YUNDEF;
YogVal e = YUNDEF;
YogVal s = YUNDEF;
PUSH_LOCALS3(env, eZipError, e, s);
if (!IS_PTR(pkg) || (BASIC_OBJ_TYPE(pkg) != TYPE_ZIP_PKG)) {
YogError_raise_TypeError(env, "package type must be TYPE_ZIP_PKG");
}
eZipError = PTR_AS(Package, pkg)->eZipError;
if (msg != NULL) {
s = YogString_from_string(env, msg);
e = YogEval_call_method1(env, eZipError, "new", s);
}
else {
e = YogEval_call_method0(env, eZipError, "new");
}
YogError_raise(env, e);
/* NOTREACHED */
RETURN_VOID(env);
}
示例14: Dalvik_dalvik_system_VMRuntime_gcSoftReferences
/*
* public native void gcSoftReferences()
*
* Does a GC and forces collection of SoftReferences that are
* not strongly-reachable.
*/
static void Dalvik_dalvik_system_VMRuntime_gcSoftReferences(const u4* args,
JValue* pResult)
{
dvmCollectGarbage(true);
RETURN_VOID();
}
示例15: YogClass_class_init
void
YogClass_class_init(YogEnv* env, YogVal cClass, YogVal pkg)
{
SAVE_ARGS2(env, cClass, pkg);
YogClass_define_method(env, cClass, pkg, "new", new_);
RETURN_VOID(env);
}