freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Re: trace_gloader is registered in fttrace.h


From: mpsuzuki
Subject: [ft-devel] Re: trace_gloader is registered in fttrace.h
Date: Thu, 9 Jul 2009 14:19:34 +0900

Hi,

I attached a preliminary one written by Perl.
When I rewrite it and cleanup by Python, I will
propose to include it in src/tools officially.

By running the attached script, the results are:

# Trace component used in the implementations but not defined in fttrace.h
Trace component t1afm (used in src/type1/t1afm.c:33) is not defined.
Trace component ttbdf (used in src/sfnt/ttbdf.c:37) is not defined.
# Trace component defined in fttrace.h but not used in the implementations
Trace component any (defined in fttrace.h:22) is not used.
Trace component cidafm (defined in fttrace.h:89) is not used.
Trace component pshalgo1 (defined in fttrace.h:75) is not used.
Trace component t1hint (defined in fttrace.h:64) is not used.

I will add t1afm & ttbdf definitions soon.

Regards,
mpsuzuki


#!/usr/bin/env perl

open( SRC_FILE_LIST, 'find src -name "*.[ch]" -exec egrep -l 
"#define.*FT_COMPONENT.*trace" \{\} \; |' );
while( <SRC_FILE_LIST> )
{  
   s/[\r\n]*//g;
   $src_pathname = $_;
   open( SRC_FILE, "cat $src_pathname|" ) || die;
   $line_num = 0;
   while( <SRC_FILE> )
   {
     $line_num ++;
     s/[\r\n]*//g;
     if ( /^[ \t]*#define[ \t]+FT_COMPONENT[ \t]+trace_/ )
     {
       s/^[ \t]*#define[ \t]+FT_COMPONENT[ \t]+trace_//;
       $component_symbol = $_;
       @trace_part = split( ",", $TRACE_COMPONENT{ $component_symbol } );
       push( @trace_part, sprintf( "%s:%d", $src_pathname, $line_num ) );
       $TRACE_COMPONENT{ $component_symbol } = join( ",", sort( @trace_part ) );
     }
   }
   close( SRC_FILE );
}
close( SRC_FILE_LIST );

open( FTTRACE_H, 'cat include/freetype/internal/fttrace.h |' ) || die;
$line_num = 0;
while( <FTTRACE_H> )
{
  s/[\r\n]*//g;
  $line_num ++;
  if ( /FT_TRACE_DEF/ )
  {
    s/^.*FT_TRACE_DEF[ \t]*\([ \t]*//;
    s/[ \t\)].*$//;
    $component_symbol = $_;
    if ( !defined( $KNOWN_COMPONENT{ $component_symbol } ) )
    {
      $KNOWN_COMPONENT{ $component_symbol } = sprintf( "fttrace.h:%d", 
$line_num );
    }
    else
    {
      printf( "trace component %s is defined twice, see %s and fttrace.h:%d\n",
              $KNOWN_COMPONENT{ $component_symbol }, $line_num );
    }
  }
}
close( FTTRACE_H );

printf( "# Trace component used in the implementations but not defined in 
fttrace.h\n" );
foreach $sym ( sort( keys( %TRACE_COMPONENT ) ) )
{
  if ( !defined( $KNOWN_COMPONENT{ $sym } ) )
  {
    printf( "Trace component %s (used in %s) is not defined.\n", $sym, 
$TRACE_COMPONENT{ $sym } );
  }
}

printf( "# Trace component defined in fttrace.h but not used in the 
implementations\n" );
foreach $sym ( sort( keys( %KNOWN_COMPONENT ) ) )
{
  if ( !defined( $TRACE_COMPONENT{ $sym } ) )
  {
    printf( "Trace component %s (defined in %s) is not used.\n", $sym, 
$KNOWN_COMPONENT{ $sym } );
  }
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]