From 61025621155f79d4085dc7b6bc3d36817b5a01f8 Mon Sep 17 00:00:00 2001
From: ebensza <bence.janos.szabo@ericsson.com>
Date: Thu, 12 May 2016 13:19:26 +0200
Subject: [PATCH] clang warning elimination2

Signed-off-by: ebensza <bence.janos.szabo@ericsson.com>
---
 compiler2/Type_codegen.cc  | 2 +-
 compiler2/ttcn3/compiler.y | 4 ++--
 core/ProfilerTools.cc      | 6 +++---
 core/Runtime.cc            | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/compiler2/Type_codegen.cc b/compiler2/Type_codegen.cc
index 170ec49df..f6225b893 100644
--- a/compiler2/Type_codegen.cc
+++ b/compiler2/Type_codegen.cc
@@ -3037,7 +3037,7 @@ void Type::generate_json_schema_array(JSON_Tokenizer& json)
       "\"record of\"" : "\"set of\"");
   } else {
     // set the number of elements for arrays
-    char* size_str = mprintf("%zu", get_nof_comps());
+    char* size_str = mprintf("%lu", (unsigned long)(get_nof_comps()));
     json.put_next_token(JSON_TOKEN_NAME, "minItems");
     json.put_next_token(JSON_TOKEN_NUMBER, size_str);
     json.put_next_token(JSON_TOKEN_NAME, "maxItems");
diff --git a/compiler2/ttcn3/compiler.y b/compiler2/ttcn3/compiler.y
index 1f56362b5..baf1a8e33 100644
--- a/compiler2/ttcn3/compiler.y
+++ b/compiler2/ttcn3/compiler.y
@@ -8746,8 +8746,8 @@ PredefinedOps:
   {
     if ($3->get_nof_logargs() != 1) {
       Location loc(infile, @1);
-      loc.error("The any2unistr function takes exactly one argument, not %zu.",
-        $3->get_nof_logargs());
+      loc.error("The any2unistr function takes exactly one argument, not %lu.",
+        (unsigned long)($3->get_nof_logargs()));
         delete $3;
         $$ = new Value(Value::OPTYPE_ANY2UNISTR, new LogArguments());
         $$->set_location(infile, @$);
diff --git a/core/ProfilerTools.cc b/core/ProfilerTools.cc
index a8cd12dd6..b5c9db6de 100644
--- a/core/ProfilerTools.cc
+++ b/core/ProfilerTools.cc
@@ -896,8 +896,8 @@ namespace Profiler_Tools {
 
       // number of lines and functions
       if (p_flags & STATS_NUMBER_OF_LINES) {
-        line_func_count_str = mputprintf(line_func_count_str, "%s:\t%zu lines,\t%zu functions\n",
-           p_db[i].filename, p_db[i].lines.size(), p_db[i].functions.size());
+        line_func_count_str = mputprintf(line_func_count_str, "%s:\t%lu lines,\t%lu functions\n",
+           p_db[i].filename, (unsigned long)(p_db[i].lines.size()), (unsigned long)(p_db[i].functions.size()));
       }
       total_code_lines += p_db[i].lines.size();
       total_functions += p_db[i].functions.size();
@@ -905,7 +905,7 @@ namespace Profiler_Tools {
     if (p_flags & STATS_NUMBER_OF_LINES) {
       line_func_count_str = mputprintf(line_func_count_str,
         "--------------------------------------\n"
-        "Total:\t%zu lines,\t%zu functions\n", total_code_lines, total_functions);
+        "Total:\t%lu lines,\t%lu functions\n", (unsigned long)total_code_lines, (unsigned long)total_functions);
     }
 
     if (p_flags & (STATS_TOP10_ALL_DATA | STATS_ALL_DATA_SORTED)) {
diff --git a/core/Runtime.cc b/core/Runtime.cc
index 44c4ce178..fd4423e6a 100644
--- a/core/Runtime.cc
+++ b/core/Runtime.cc
@@ -2895,7 +2895,7 @@ void TTCN_Runtime::wait_terminated_processes()
   errno = 0;
   for ( ; ; ) {
     int statuscode;
-    struct rusage r_usage = {{0,0},{0,0},0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+    struct rusage r_usage = {{0,0},{0,0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}};
 #ifdef INTERIX
     pid_t child_pid = waitpid(-1, &statuscode, WNOHANG);
     getrusage(RUSAGE_CHILDREN, &r_usage);
-- 
GitLab