]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/libjorte/setType.c
Reformat the sources with orte/uncrustify script
[orte.git] / orte / libjorte / setType.c
index 436f0e8eb8fea8d0cd31246fe2166f812de24352..b433ee521eec51d62d3105406c4719d970bfb878 100644 (file)
@@ -4,38 +4,37 @@
 #include "jorte/4all.h"
 #include "jorte/jorte_protos_api.h"
 
-int setType(JNIEnv *env, jclass cls, jobject obj, const char *typeName)
+int
+setType(JNIEnv *env, jclass cls, jobject obj, const char *typeName)
 {
-    jfieldID  fid;
-    jstring   jstr;
+  jfieldID  fid;
+  jstring   jstr;
 
-    // field ID - type
-    fid = (*env)->GetFieldID(env,
-                             cls,
-                             "typeName",
-                             "Ljava/lang/String;");
-    if(fid == 0)
-    {
+  // field ID - type
+  fid = (*env)->GetFieldID(env,
+                          cls,
+                          "typeName",
+                          "Ljava/lang/String;");
+  if (fid == 0) {
       #ifdef TEST_STAGE
-        printf(":!c: type - fid = NULL \n");
+    printf(":!c: type - fid = NULL \n");
       #endif
-      return 0;
-    }
+    return 0;
+  }
     #ifdef TEST_STAGE
-       printf(":c: type = %s \n",typeName);
+  printf(":c: type = %s \n", typeName);
     #endif
-   // create a new string
-   jstr = (*env)->NewStringUTF(env,typeName);
-   if (jstr == 0)
-   {
+  // create a new string
+  jstr = (*env)->NewStringUTF(env, typeName);
+  if (jstr == 0) {
      #ifdef TEST_STAGE
-       printf(":!c: type - fid = NULL \n");
+    printf(":!c: type - 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;
 
 }