[PATCH rtems-examples 16/23] benchmarks/nbench: Fix warnings

Joel Sherrill joel at rtems.org
Wed Feb 23 22:21:44 UTC 2022


---
 benchmarks/nbench/main.c                       | 3 +--
 benchmarks/nbench/nbench-byte-2.2.3/emfloat.c  | 6 ++++++
 benchmarks/nbench/nbench-byte-2.2.3/hardware.c | 4 ++++
 benchmarks/nbench/nbench-byte-2.2.3/nbench0.c  | 1 +
 benchmarks/nbench/nbench-byte-2.2.3/nbench1.c  | 4 ++--
 5 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/benchmarks/nbench/main.c b/benchmarks/nbench/main.c
index 68f799e..eebd1f5 100644
--- a/benchmarks/nbench/main.c
+++ b/benchmarks/nbench/main.c
@@ -68,7 +68,6 @@ rtems_task Init(rtems_task_argument arg)
 {
   rtems_status_code   sc;
   rtems_id            task_id_nbench;
-  char               *args[1] = {"./nbench"};
   rtems_interval      tickspersec;
 
   /*
@@ -90,7 +89,7 @@ rtems_task Init(rtems_task_argument arg)
 
   tickspersec = rtems_clock_get_ticks_per_second();
 
-  printf("clocks per sec: %ld\n", tickspersec);
+  printf("clocks per sec: %u\n", tickspersec);
   printf("Starting Shell\n");
 
   rtems_shell_main_loop(NULL);
diff --git a/benchmarks/nbench/nbench-byte-2.2.3/emfloat.c b/benchmarks/nbench/nbench-byte-2.2.3/emfloat.c
index 5e73890..6e18b03 100644
--- a/benchmarks/nbench/nbench-byte-2.2.3/emfloat.c
+++ b/benchmarks/nbench/nbench-byte-2.2.3/emfloat.c
@@ -647,6 +647,7 @@ case NORMAL_NORMAL:
                 z->exp= locx.exp;
         }
         else
+        { 
                 if (exponent_difference > 0)
                 {
                         /*
@@ -715,11 +716,13 @@ case NORMAL_NORMAL:
                                 z->sign = 0; /* positive */
                         }
                         else
+                        {
                                 if (locx.type == IFPF_IS_NORMAL ||
                                          locy.type == IFPF_IS_NORMAL)
                                 {
                                         normalize(z);
                                 }
+                        }
                 }
                 else
                 {
@@ -742,8 +745,11 @@ case NORMAL_NORMAL:
                                 z->type = IFPF_IS_NORMAL;
                         }
                         else
+                        {
                                 if (z->mantissa[0] & 0x8000)
                                         z->type = IFPF_IS_NORMAL;
+                        }
+                }
         }
         break;
 
diff --git a/benchmarks/nbench/nbench-byte-2.2.3/hardware.c b/benchmarks/nbench/nbench-byte-2.2.3/hardware.c
index 53bbec9..e4fde25 100644
--- a/benchmarks/nbench/nbench-byte-2.2.3/hardware.c
+++ b/benchmarks/nbench/nbench-byte-2.2.3/hardware.c
@@ -28,11 +28,13 @@ static void output_string(const char *buffer, const int write_to_file,
 *******************
 ** Removes a trailing newline character if present
 */
+/*
 static void removeNewLine(char * s) {
   if(strlen(s)>0 && s[strlen(s)-1] == '\n') {
     s[strlen(s)-1] = '\0';
   }
 }
+*/
 
 
 /***************
@@ -180,7 +182,9 @@ void hardware(const int write_to_file, FILE *global_ofile) {
   char os[BUF_SIZ];
   char model[BUF_SIZ];
   char cache[BUF_SIZ];
+#ifndef NO_UNAME
   char os_command[] = "uname -s -r";
+#endif
 #ifdef NO_UNAME
   os[0] = '\0';
 #else
diff --git a/benchmarks/nbench/nbench-byte-2.2.3/nbench0.c b/benchmarks/nbench/nbench-byte-2.2.3/nbench0.c
index 13fd6d9..0e5d045 100644
--- a/benchmarks/nbench/nbench-byte-2.2.3/nbench0.c
+++ b/benchmarks/nbench/nbench-byte-2.2.3/nbench0.c
@@ -331,6 +331,7 @@ output_string("* Trademarks are property of their respective holder.\n");
 }
 
 //exit(0);
+return 0;
 }
 
 /**************
diff --git a/benchmarks/nbench/nbench-byte-2.2.3/nbench1.c b/benchmarks/nbench/nbench-byte-2.2.3/nbench1.c
index be081e6..3ac8dbb 100644
--- a/benchmarks/nbench/nbench-byte-2.2.3/nbench1.c
+++ b/benchmarks/nbench/nbench-byte-2.2.3/nbench1.c
@@ -3149,7 +3149,7 @@ return((1<<bitnumb) & comparray[byteoffset] );
 void DoNNET(void)
 {
 NNetStruct *locnnetstruct;      /* Local ptr to global data */
-char *errorcontext;
+/* char *errorcontext; */
 ulong accumtime;
 double iterations;
 
@@ -3161,7 +3161,7 @@ locnnetstruct=&global_nnetstruct;
 /*
 ** Set error context
 */
-errorcontext="CPU:NNET";
+/* errorcontext="CPU:NNET"; */
 
 /*
 ** Init random number generator.
-- 
1.8.3.1



More information about the devel mailing list