]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/libjorte/setTopic.c
Reformat the sources with orte/uncrustify script
[orte.git] / orte / libjorte / setTopic.c
index 455d58b1370eedba0b9d685e12588ba0a062be76..3e36e9a977ab89cfba942cb2e416fde51878f1f9 100644 (file)
@@ -4,38 +4,37 @@
 #include "jorte/4all.h"
 #include "jorte/jorte_protos_api.h"
 
-int setTopic(JNIEnv *env, jclass cls, jobject obj, const char *topic)
+int
+setTopic(JNIEnv *env, jclass cls, jobject obj, const char *topic)
 {
-    jfieldID  fid;
-    jstring   jstr;
+  jfieldID  fid;
+  jstring   jstr;
 
-    // field ID - topic
-    fid = (*env)->GetFieldID(env,
-                             cls,
-                             "topic",
-                             "Ljava/lang/String;");
-    if(fid == 0)
-    {
+  // field ID - topic
+  fid = (*env)->GetFieldID(env,
+                          cls,
+                          "topic",
+                          "Ljava/lang/String;");
+  if (fid == 0) {
       #ifdef TEST_STAGE
-        printf(":!c: topic - fid = NULL \n");
+    printf(":!c: topic - fid = NULL \n");
       #endif
-      return 0;
-    }
+    return 0;
+  }
     #ifdef TEST_STAGE
-       printf(":c: topic = %s \n",topic);
+  printf(":c: topic = %s \n", topic);
     #endif
-   // create a new string
-   jstr = (*env)->NewStringUTF(env, topic);
-   if (jstr == 0)
-   {
+  // create a new string
+  jstr = (*env)->NewStringUTF(env, topic);
+  if (jstr == 0) {
      #ifdef TEST_STAGE
-       printf(":!c: topic - fid = NULL \n");
+    printf(":!c: topic - fid = NULL \n");
      #endif
-     return 0;
-   }
-   // set field
-   (*env)->SetObjectField(env, obj, fid, jstr);
+    return 0;
+  }
+  // set field
+  (*env)->SetObjectField(env, obj, fid, jstr);
 
-   return 1;
+  return 1;
 
 }