freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] [ftbench,ftgrid,ftmulti,ftview] A


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] [ftbench,ftgrid,ftmulti,ftview] Accept hexadecimal glyph indices.
Date: Sun, 22 Jan 2023 03:50:18 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

  • d0d57891
    by Alexei Podtelezhnikov at 2023-01-21T22:35:35-05:00
    [ftbench,ftgrid,ftmulti,ftview] Accept hexadecimal glyph indices.
    
    This helps to use charcodes on the command line.
    
    * src/ftbench.c (main): Use sscanf with "%i".
    * src/ftgrid.c (parse_cmdline): Ditto.
    * src/ftmulti.c (main): Ditto.
    * src/ftview.c (parse_cmdline): Ditto.
    

4 changed files:

Changes:

  • src/ftbench.c
    ... ... @@ -1217,7 +1217,7 @@
    1217 1217
             {
    
    1218 1218
               int  fi, li;
    
    1219 1219
     
    
    1220
    -          if ( sscanf( optarg, "%d%*[,:-]%d", &fi, &li ) == 2 )
    
    1220
    +          if ( sscanf( optarg, "%i%*[,:-]%i", &fi, &li ) == 2 )
    
    1221 1221
               {
    
    1222 1222
                 first_index = fi < 0 ? 0 : fi;
    
    1223 1223
                 last_index  = li < 0 ? 0 : li;
    

  • src/ftgrid.c
    ... ... @@ -1752,8 +1752,7 @@
    1752 1752
             break;
    
    1753 1753
     
    
    1754 1754
           case 'f':
    
    1755
    -        status.Num = atoi( optarg );
    
    1756
    -        have_index = 1;
    
    1755
    +        have_index = sscanf( optarg, "%i", &status.Num );
    
    1757 1756
             break;
    
    1758 1757
     
    
    1759 1758
           case 'k':
    

  • src/ftmulti.c
    ... ... @@ -1002,7 +1002,7 @@
    1002 1002
             break;
    
    1003 1003
     
    
    1004 1004
           case 'f':
    
    1005
    -        first_glyph = atoi( optarg );
    
    1005
    +        sscanf( optarg, "%i", &first_glyph );
    
    1006 1006
             break;
    
    1007 1007
     
    
    1008 1008
           case 'h':
    

  • src/ftview.c
    ... ... @@ -1689,7 +1689,7 @@
    1689 1689
             break;
    
    1690 1690
     
    
    1691 1691
           case 'f':
    
    1692
    -        status.offset = atoi( optarg );
    
    1692
    +        sscanf( optarg, "%i", &status.offset );
    
    1693 1693
             break;
    
    1694 1694
     
    
    1695 1695
           case 'k':
    


  • reply via email to

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