]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/libjorte/JORTEDomainAppDestroy.c
Reformat the sources with orte/uncrustify script
[orte.git] / orte / libjorte / JORTEDomainAppDestroy.c
index 460682b34863f9d2400df29c9283dba3c6328f1e..d7087cd16c5c68e3e87f18ca27aba89583e82b74 100644 (file)
@@ -36,7 +36,7 @@
 
 JNIEXPORT jboolean JNICALL
 Java_org_ocera_orte_DomainApp_jORTEDomainAppDestroy
-(JNIEnv *env, jobject obj, jlong dhandle)
+  (JNIEnv *env, jobject obj, jlong dhandle)
 {
   jlong       h;
   jclass      cls;
@@ -45,16 +45,14 @@ Java_org_ocera_orte_DomainApp_jORTEDomainAppDestroy
 
   do {
     // check domain handle
-    if (dhandle == 0)
-    {
+    if (dhandle == 0) {
       printf(":!c: ORTEDomainAppDestroy failed! [bad handle] \n");
       break;
     }
     // call ORTE function
-    if (!ORTEDomainAppDestroy((ORTEDomain *) dhandle))
-    {
+    if (!ORTEDomainAppDestroy((ORTEDomain *)dhandle)) {
       #ifdef TEST_STAGE
-         printf(":c: ORTEDomainAppDestroy failed.. \n");
+      printf(":c: ORTEDomainAppDestroy failed.. \n");
       #endif
       break;
     }
@@ -62,45 +60,40 @@ Java_org_ocera_orte_DomainApp_jORTEDomainAppDestroy
     // free domainEvents object
     // find cls
     cls = (*env)->GetObjectClass(env, obj);
-    if(cls == 0)
-    {
+    if (cls == 0) {
       #ifdef TEST_STAGE
-        printf(":!c: cls = NULL! \n");
+      printf(":!c: cls = NULL! \n");
       #endif
       break;
     }
     // fieldID
     fid = (*env)->GetFieldID(env,
-                             cls,
-                             "domainEventsContextHandle",
-                             "J");
-    if(fid == 0)
-    {
+                            cls,
+                            "domainEventsContextHandle",
+                            "J");
+    if (fid == 0) {
      #ifdef TEST_STAGE
-       printf(":!c: fid = NULL! \n");
+      printf(":!c: fid = NULL! \n");
      #endif
-     break;
+      break;
     }
     // get value
     h = (*env)->GetLongField(env, obj, fid);
-    if(h)
-    {
-      JORTEDomainEventsContext_t *ctx = (JORTEDomainEventsContext_t*)h;
-      if(ctx->obj_de)
-      {
-        #ifdef TEST_STAGE
-          printf(":c: deleting ctx->obj_de \n");
-        #endif
-        (*env)->DeleteGlobalRef(env, ctx->obj_de);
+    if (h) {
+      JORTEDomainEventsContext_t *ctx = (JORTEDomainEventsContext_t *)h;
+      if (ctx->obj_de) {
+       #ifdef TEST_STAGE
+       printf(":c: deleting ctx->obj_de \n");
+       #endif
+       (*env)->DeleteGlobalRef(env, ctx->obj_de);
       }
       //
-      free((void*)h);
+      free((void *)h);
     }
     flag_ok = 1;
-  } while(0);
+  } while (0);
 
-  if(flag_ok == 0)
-  {
+  if (flag_ok == 0) {
     printf(":!c: ORTEDomainAppDestroy failed!  \n");
     return 0;
   }