]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/libjorte/JORTEPublicationPropertiesSet.c
JORTE: update license headers and clean-up includes
[orte.git] / orte / libjorte / JORTEPublicationPropertiesSet.c
index e785f9107aae46372792108c038176eb144cf0b0..066b0f164940d60e137873f2e6341e9a6db1ec1a 100644 (file)
@@ -7,6 +7,7 @@
   * (by command 'javah -jni class_with_native_function')
   *
   * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
+  * @author Martin Vajnar (martin.vajnar@gmail.com)
   * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
   * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
   * @author dedication to Kj
   *
   */
 
-#include <string.h>
-#include <stdlib.h>
-// library header file's path
-#include "orte.h"
-// getNtpTime function
-#include "jorte/jorte_protos_api.h"
-// enable TEST_STAGE run level
-#include "jorte/4all.h"
-// pregenerated header
-#include "jorte/org_ocera_orte_Publication.h"
+#include "jorte/jorte.h"
 
 
 JNIEXPORT jboolean JNICALL
 Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
-(JNIEnv *env, jobject obj, jint j_appDomain_handle, jobject obj_pp)
+(JNIEnv *env, jobject obj, jlong j_appDomain_handle, jobject obj_pp)
 {
   // jni types
   jclass         cls_pp = NULL;
@@ -96,7 +88,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     str = (*env)->GetStringUTFChars(env,obj_str,0);
     // set structure's field
-    strncpy((char *) publ_prop->topic, str, strlen(str) + 1);
+    strncpy((char *)publ_prop->topic, (const char*)str, strlen(str) + 1);
     #ifdef TEST_STAGE
       printf(":c: topic = %s, publ_prop->topic = %s \n",
              str, publ_prop->topic);
@@ -126,7 +118,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     str = (*env)->GetStringUTFChars(env,obj_str,0);
     // set structure's field
-    strncpy((char *) publ_prop->typeName, str, strlen(str) + 1);
+    strncpy((char *)publ_prop->typeName, (const char*)str, strlen(str) + 1);
     #ifdef TEST_STAGE
       printf(":c: typeName = %s, publ_prop->typeName = %s \n",
              str, publ_prop->typeName);
@@ -145,7 +137,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->typeChecksum = (TypeChecksum) (*env)->GetIntField(env, obj_pp, fid);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->typeChecksum = %d\n",
+      printf(":c: check: publ_prop->typeChecksum = %"PRId32"\n",
              publ_prop->typeChecksum);
     #endif
     /////////////////////////////////////////////////
@@ -162,7 +154,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     if (jbool == 0) publ_prop->expectsAck = ORTE_FALSE;
       else publ_prop->expectsAck = ORTE_TRUE;
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->expectsAck = %d\n", publ_prop->expectsAck);
+      printf(":c: check: publ_prop->expectsAck = %"PRId8"\n", publ_prop->expectsAck);
     #endif
     /////////////////////////////////////////////////
     // set persistence
@@ -187,7 +179,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->persistence = getNtpTime(env, obj_ntpT);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->persistence: sec = %d, fract = %d  \n",
+      printf(":c: check: publ_prop->persistence: sec = %"PRId32", fract = %"PRIu32"  \n",
              publ_prop->persistence.seconds, publ_prop->persistence.fraction);
     #endif
     /////////////////////////////////////////////////
@@ -205,7 +197,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->reliabilityOffered = (uint32_t) (*env)->GetLongField(env, obj_pp, fid);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->reliabilityOffered = %d \n",
+      printf(":c: check: publ_prop->reliabilityOffered = %"PRIu32" \n",
              publ_prop->reliabilityOffered);
     #endif
     /////////////////////////////////////////////////
@@ -223,7 +215,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->sendQueueSize = (uint32_t) (*env)->GetLongField(env,obj_pp,fid);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->sendQueueSize = %d \n",
+      printf(":c: check: publ_prop->sendQueueSize = %"PRIu32" \n",
              publ_prop->sendQueueSize);
     #endif
     /////////////////////////////////////////////////
@@ -241,7 +233,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->strength = (int32_t) (*env)->GetIntField(env,obj_pp,fid);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->strength = %d \n",
+      printf(":c: check: publ_prop->strength = %"PRId32" \n",
              publ_prop->strength);
     #endif
     /////////////////////////////////////////////////
@@ -259,7 +251,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->criticalQueueLevel = (uint32_t) (*env)->GetLongField(env, obj_pp, fid);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->criticalQueueLevel = %d \n",
+      printf(":c: check: publ_prop->criticalQueueLevel = %"PRIu32" \n",
              publ_prop->criticalQueueLevel);
     #endif
     /////////////////////////////////////////////////
@@ -278,7 +270,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     obj_ntpT = (*env)->GetObjectField(env, obj_pp, fid);
     publ_prop->HBNornalRate = getNtpTime(env, obj_ntpT);
     #ifdef TEST_STAGE
-    printf(":c: check: publ_prop->HBNornalRate: sec = %d, fract = %d  \n",
+    printf(":c: check: publ_prop->HBNornalRate: sec = %"PRId32", fract = %"PRIu32"  \n",
            publ_prop->HBNornalRate.seconds, publ_prop->HBNornalRate.fraction);
     #endif
     /////////////////////////////////////////////////
@@ -304,7 +296,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->HBCQLRate = getNtpTime(env, obj_ntpT);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->HBCQLRate: sec = %d, fract = %d  \n",
+      printf(":c: check: publ_prop->HBCQLRate: sec = %"PRId32", fract = %"PRIu32"  \n",
              publ_prop->HBCQLRate.seconds, publ_prop->HBCQLRate.fraction);
     #endif
     /////////////////////////////////////////////////
@@ -322,7 +314,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->HBMaxRetries = (unsigned int) (*env)->GetLongField(env, obj_pp, fid);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->HBMaxRetries = %d \n",
+      printf(":c: check: publ_prop->HBMaxRetries = %u \n",
              publ_prop->HBMaxRetries);
     #endif
     /////////////////////////////////////////////////
@@ -348,7 +340,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
     }
     publ_prop->maxBlockTime = getNtpTime(env, obj_ntpT);
     #ifdef TEST_STAGE
-      printf(":c: check: publ_prop->maxBlockTime: sec = %d, fract = %d  \n",
+      printf(":c: check: publ_prop->maxBlockTime: sec = %"PRId32", fract = %"PRIu32"  \n",
              publ_prop->maxBlockTime.seconds, publ_prop->maxBlockTime.fraction);
     #endif
     /////////////////////////////////////////////////