46
46
/* Analyze all literal strings instead of print statements */
47
47
#define OPT_PARSE_STRINGS (0x00000040)
48
48
49
- #define FLOAT_TINY (0.0000001)
50
- #define FLOAT_CMP (a , b ) (fabs(a - b) < FLOAT_TINY)
51
-
52
49
#define PARSER_OK (0)
53
50
#define PARSER_COMMENT_FOUND (1)
54
51
#define PARSER_EOF (256)
@@ -446,17 +443,6 @@ static void check_words(token_t *token)
446
443
return ;
447
444
}
448
445
449
- /* Retrieve the current time as a double. */
450
- static double gettime_to_double (void )
451
- {
452
- struct timeval tv ;
453
-
454
- if (UNLIKELY (gettimeofday (& tv , NULL ) < 0 ))
455
- return 0.0 ;
456
-
457
- return (double ) tv .tv_sec + ((double ) tv .tv_usec / 1000000 );
458
- }
459
-
460
446
/* Set up a new parser instance. */
461
447
static inline void parser_new (parser_t * restrict p ,
462
448
unsigned char * restrict data ,
@@ -1603,7 +1589,6 @@ static void set_is_not_identifier(void)
1603
1589
int main (int argc , char * * argv )
1604
1590
{
1605
1591
token_t t , line , str ;
1606
- double t1 , t2 ;
1607
1592
static char buffer [65536 ];
1608
1593
1609
1594
token_cat = token_cat_normal ;
@@ -1641,7 +1626,6 @@ int main(int argc, char **argv)
1641
1626
fflush (stdout );
1642
1627
setvbuf (stdout , buffer , _IOFBF , sizeof (buffer ));
1643
1628
1644
- t1 = gettime_to_double ();
1645
1629
if (argc == optind ) {
1646
1630
parse_path ("." , & t , & line , & str );
1647
1631
optind ++ ;
@@ -1651,35 +1635,23 @@ int main(int argc, char **argv)
1651
1635
optind ++ ;
1652
1636
}
1653
1637
}
1654
- t2 = gettime_to_double ();
1655
1638
1656
1639
token_free (& str );
1657
1640
token_free (& line );
1658
1641
token_free (& t );
1659
1642
1660
1643
dump_bad_spellings ();
1661
1644
1662
- printf ("%" PRIu32 " files scanned\n" , files );
1663
1645
printf ("%" PRIu32
1664
1646
" lines scanned (%.3f"
1665
1647
"M bytes)\n" ,
1666
1648
lines , (float ) bytes_total / (float ) (1024 * 1024 ));
1667
- if (words ) {
1668
- size_t nodes = word_node_heap_next - word_node_heap ;
1669
- printf ("%" PRIu32 " words and %zd nodes in dictionary heap\n" , words ,
1670
- nodes );
1671
- printf ("%" PRIu32 " chars mapped to %zd bytes of heap, ratio=1:%.2f\n" ,
1672
- dict_size , nodes * sizeof (word_node_t ),
1673
- (float ) nodes * sizeof (word_node_t ) / dict_size );
1674
- }
1675
1649
printf ("%zu printf style statements being processed\n" ,
1676
1650
SIZEOF_ARRAY (printfs ));
1677
1651
if (bad_spellings )
1678
1652
printf ("%" PRIu32 " unique bad spellings found (%" PRIu32
1679
1653
" non-unique)\n" ,
1680
1654
bad_spellings , bad_spellings_total );
1681
- printf ("scanned %.2f lines per second\n" ,
1682
- FLOAT_CMP (t1 , t2 ) ? 0.0 : (double ) lines / (t2 - t1 ));
1683
1655
1684
1656
fflush (stdout );
1685
1657
0 commit comments