[netperf-dev] netperf4 commit notice r153 - branches/glib_migration/src

raj at netperf.org raj at netperf.org
Wed Apr 12 16:49:16 PDT 2006


Author: raj
Date: 2006-04-12 16:49:15 -0700 (Wed, 12 Apr 2006)
New Revision: 153

Modified:
   branches/glib_migration/src/nettest_bsd.c
Log:
Use PRIx64 in the sscanf calls to get good numbers under Windows - other nettest's NOT fixed - we _really_ need a more general formatting mechanism

Modified: branches/glib_migration/src/nettest_bsd.c
===================================================================
--- branches/glib_migration/src/nettest_bsd.c	2006-04-12 22:51:42 UTC (rev 152)
+++ branches/glib_migration/src/nettest_bsd.c	2006-04-12 23:49:15 UTC (rev 153)
@@ -2398,6 +2398,7 @@
     rd->servdemand     = &(rd->utilization[max_count]);
     rd->run_time       = &(rd->servdemand[max_count]);
     /* we should initialize result_confidence here? */
+    rd->result_confidence = 0.0;
     rd->result_minimum = DBL_MAX;
     rd->result_maximum = DBL_MIN;
     rd->outfd          = outfd;
@@ -2487,7 +2488,9 @@
       test_cntr[i] = strtod(value_str,NULL);
       if (test_cntr[i] == 0.0) {
         uint64_t x;
-        sscanf(value_str,"%llx",&x);
+	/* MUST use the PRIx64 macro to get the proper format under
+           Windows or we get garbage.  raj 2006-04-12 */
+        sscanf(value_str,"%"PRIx64,&x);
         test_cntr[i] = (double)x;
       }
     } else {
@@ -2614,7 +2617,8 @@
       sys_cntr[i] = strtod(value_str,NULL);
       if (sys_cntr[i] == 0.0) {
         uint64_t x;
-        sscanf(value_str,"%llx",&x);
+	/* MUST use PRIx64 to get proper results under Windows */
+        sscanf(value_str,"%"PRIx64,&x);
         sys_cntr[i] = (double)x;
       }
     } else {
@@ -2693,7 +2697,6 @@
   bsd_results_t *rd;
   test_t        *test;
   tset_elt_t    *set_elt;
-  char          *proc_name;
   xmlNodePtr     stats;
   xmlNodePtr     prev_stats;
   int            count; 
@@ -2702,7 +2705,6 @@
   double         num_of_cpus;
  
   rd        = test_set->report_data;
-  proc_name = "process_stats_for_run";
   set_elt   = test_set->tests;
   count     = test_set->confidence.count;
   index     = count - 1;
@@ -2715,7 +2717,7 @@
   }
 
   if (test_set->debug) {
-    fprintf(test_set->where, "%s count = %d\n", proc_name, count);
+    fprintf(test_set->where, "%s count = %d\n", __func__, count);
     fflush(test_set->where);
   }
 
@@ -2777,7 +2779,7 @@
               stats_for_test);
       fprintf(test_set->where,
               "%s was not designed to deal with this.\n",
-              proc_name);
+              __func__);
       fprintf(test_set->where,
               "exiting netperf now!!\n");
       fflush(test_set->where);



More information about the netperf-dev mailing list