httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_status.c
Date Wed, 25 Jul 2001 21:15:54 GMT
wrowe       01/07/25 14:15:54

  Modified:    modules/generators mod_status.c
  Log:
    Some cast magic for intentional float/int transformations, but I have
    no idea what exactly this computation was trying to accomplish...
  
      req_time = (long)(((ws_record.stop_time - ws_record.start_time) * 1000)
  		    + ((ws_record.stop_time - ws_record.start_time) / 1000));
  
  Revision  Changes    Path
  1.42      +11 -9     httpd-2.0/modules/generators/mod_status.c
  
  Index: mod_status.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_status.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- mod_status.c	2001/07/12 03:20:45	1.41
  +++ mod_status.c	2001/07/25 21:15:54	1.42
  @@ -186,12 +186,12 @@
   {
       int days, hrs, mins, secs;
       
  -    secs = tsecs % 60;
  +    secs = (int)(tsecs % 60);
       tsecs /= 60;
  -    mins = tsecs % 60;
  +    mins = (int)(tsecs % 60);
       tsecs /= 60;
  -    hrs = tsecs % 24;
  -    days = tsecs / 24;
  +    hrs = (int)(tsecs % 24);
  +    days = (int)(tsecs / 24);
       if (days)
   	ap_rprintf(r, " %d day%s", days, days == 1 ? "" : "s");
       if (hrs)
  @@ -418,12 +418,14 @@
   			(float) count / (float) up_time);
   
   	    if (up_time > 0) {
  -		format_byte_out(r, KBYTE * (float) kbcount / (float) up_time);
  +		format_byte_out(r, (unsigned long)(KBYTE * (float) kbcount 
  +                                                         / (float) up_time));
   		ap_rputs("/second - ", r);
   	    }
   
   	    if (count > 0) {
  -		format_byte_out(r, KBYTE * (float) kbcount / (float) count);
  +		format_byte_out(r, (unsigned long)(KBYTE * (float) kbcount 
  +                                                         / (float) count));
   		ap_rputs("/request", r);
   	    }
   
  @@ -534,9 +536,9 @@
   		ws_record.start_time == 0L)
   		req_time = 0L;
   	    else
  -		req_time =
  -		    ((ws_record.stop_time - ws_record.start_time) * 1000) +
  -		    ((ws_record.stop_time - ws_record.start_time) / 1000);
  +		req_time = (long)
  +		     (((ws_record.stop_time - ws_record.start_time) * 1000)
  +		    + ((ws_record.stop_time - ws_record.start_time) / 1000));
   #endif
   	    if (req_time < 0L)
   		req_time = 0L;
  
  
  

Mime
View raw message