X-Git-Url: https://rtime.felk.cvut.cz/gitweb/orte.git/blobdiff_plain/e80a6f5e0540d9e10ee957240e6f5b3faaa54021..44b53e7b789fa481a19db83e52cb3f15f0d90e85:/orte/libjorte/createSubInfo.c diff --git a/orte/libjorte/createSubInfo.c b/orte/libjorte/createSubInfo.c index d919004..634b913 100644 --- a/orte/libjorte/createSubInfo.c +++ b/orte/libjorte/createSubInfo.c @@ -5,7 +5,8 @@ #include "jorte/4all.h" #include "jorte/jorte_protos_api.h" -jobject createSubInfo(JNIEnv *env, const ORTESubInfo *sinfo) +jobject +createSubInfo(JNIEnv *env, const ORTESubInfo *sinfo) { jclass cls; jobject obj; @@ -14,62 +15,55 @@ jobject createSubInfo(JNIEnv *env, const ORTESubInfo *sinfo) // int flag_ok = 0; - do - { + do { // find cls cls = findClass(env, "org.ocera.orte.types.SubInfo"); - if(cls == 0) - { + if (cls == 0) { #ifdef TEST_STAGE - printf(":!c: cls = NULL \n"); + printf(":!c: cls = NULL \n"); #endif break; } // call object constructor mid = (*env)->GetMethodID(env, cls, "", "()V"); - if(mid == 0) - { + if (mid == 0) { #ifdef TEST_STAGE - printf(":!c: constructor failed! \n"); + printf(":!c: constructor failed! \n"); #endif break; } // create new object obj = (*env)->NewObject(env, cls, mid); - if(obj == 0) - { + if (obj == 0) { #ifdef TEST_STAGE - printf(":!c: obj = NULL \n"); + printf(":!c: obj = NULL \n"); #endif break; } ///////////////////////////////////////////////// // set topic - if(!setTopic(env,cls,obj,sinfo->topic)) - { + if (!setTopic(env, cls, obj, sinfo->topic)) { #ifdef TEST_STAGE - printf(":!c: seTopic() failed! \n"); + printf(":!c: seTopic() failed! \n"); #endif break; } // set type - if(!setType(env,cls,obj,sinfo->type)) - { + if (!setType(env, cls, obj, sinfo->type)) { #ifdef TEST_STAGE - printf(":!c: seType() failed! \n"); + printf(":!c: seType() failed! \n"); #endif break; } ///////////////////////////////////////////////// flag_ok = 1; - } while(0); + } while (0); - if(!flag_ok) - { + if (!flag_ok) { //detach...() return NULL; } -return obj; + return obj; }