home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pctech / hlsrc / hlfix.c < prev    next >
C/C++ Source or Header  |  1988-09-09  |  1KB  |  48 lines

  1. /*+
  2.     Name:    hlfix.c
  3.     Date:    25-Jun-1988
  4.     Author:    Kent J. Quirk
  5.         (c) Copyright 1988 Ziff Communications Co.
  6.     Abstract:    Fixes the graphics numbers from old versions of hlbench.
  7.     History:    09-Sep-88   kjq     Version 1.00
  8. -*/    
  9.  
  10. #include <stdio.h>
  11. #include "hltimes.h"
  12.  
  13. main(int argc, char *argv[])
  14. {
  15.     int i, j, k;
  16.     TIME_REC trec, *trecp;
  17.     
  18.     for (k=1; k<argc; k++)
  19.     {
  20.     if (opentime(argv[k]) == 0)
  21.     {
  22.         printf("%s: couldn't open\n", argv[k]);
  23.     }   
  24.     else
  25.     {
  26.         for (i=1; i<7; i++)
  27.         {
  28.         trecp = readtime(i, 0);
  29.         if (trecp->desc[7] == 'G')    /* if it's 'Graphics' */
  30.         {
  31.             trec = *trecp;
  32.             trec.ticks = 0;
  33.             for (j=1; j<8; j++)
  34.             {     
  35.             trecp = readtime(i, j);
  36.             if (trecp->ticks > 0)
  37.                 trec.ticks += trecp->ticks;
  38.             }
  39.             savetime(i, 0, &trec);
  40.             break;
  41.         }
  42.         }
  43.         printf("%s: Changed to %ld ticks\n", argv[k], trec.ticks);
  44.     }                    /* else... */ 
  45.     }                        /* for k... */ 
  46.     return(0);
  47. }
  48.