freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] * src/*.*: Add const qualifier to


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] * src/*.*: Add const qualifier to the executable basename.
Date: Thu, 08 Sep 2022 20:55:22 +0000

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

Commits:

  • 254001a1
    by Alexei Podtelezhnikov at 2022-09-08T16:53:13-04:00
    * src/*.*: Add const qualifier to the executable basename.
    

11 changed files:

Changes:

  • src/common.c
    ... ... @@ -8,7 +8,7 @@
    8 8
     #include <string.h>
    
    9 9
     
    
    10 10
     
    
    11
    -  char*
    
    11
    +  const char*
    
    12 12
       ft_basename( const char*  name )
    
    13 13
       {
    
    14 14
         const char*  base;
    
    ... ... @@ -33,7 +33,7 @@
    33 33
           c = *current;
    
    34 34
         }
    
    35 35
     
    
    36
    -    return (char*)base;
    
    36
    +    return base;
    
    37 37
       }
    
    38 38
     
    
    39 39
     
    

  • src/common.h
    ... ... @@ -7,7 +7,7 @@
    7 7
     #endif
    
    8 8
     
    
    9 9
     
    
    10
    -  extern char*
    
    10
    +  extern const char*
    
    11 11
       ft_basename( const char*  name );
    
    12 12
     
    
    13 13
       /* print a message and exit */
    

  • src/ftdump.c
    ... ... @@ -96,8 +96,8 @@
    96 96
     
    
    97 97
     
    
    98 98
       static void
    
    99
    -  usage( FT_Library  library,
    
    100
    -         char*       execname )
    
    99
    +  usage( FT_Library   library,
    
    100
    +         const char*  execname )
    
    101 101
       {
    
    102 102
         FT_Done_FreeType( library );
    
    103 103
     
    
    ... ... @@ -1170,15 +1170,14 @@
    1170 1170
       {
    
    1171 1171
         int    i, file;
    
    1172 1172
         char   filename[1024];
    
    1173
    -    char*  execname;
    
    1174 1173
         int    num_faces;
    
    1175 1174
         int    option;
    
    1176 1175
     
    
    1177 1176
         FT_Library  library;      /* the FreeType library */
    
    1178 1177
         FT_Face     face;         /* the font face        */
    
    1179 1178
     
    
    1179
    +    const char*  execname = ft_basename( argv[0] );
    
    1180 1180
     
    
    1181
    -    execname = ft_basename( argv[0] );
    
    1182 1181
     
    
    1183 1182
         /* Initialize engine */
    
    1184 1183
         error = FT_Init_FreeType( &library );
    

  • src/ftgrid.c
    ... ... @@ -1660,7 +1660,7 @@
    1660 1660
     
    
    1661 1661
     
    
    1662 1662
       static void
    
    1663
    -  usage( char*  execname )
    
    1663
    +  usage( const char*  execname )
    
    1664 1664
       {
    
    1665 1665
         fprintf( stderr,
    
    1666 1666
           "\n"
    
    ... ... @@ -1708,14 +1708,12 @@
    1708 1708
       parse_cmdline( int*    argc,
    
    1709 1709
                      char**  argv[] )
    
    1710 1710
       {
    
    1711
    -    char*  execname;
    
    1712
    -    int    option;
    
    1713
    -    int    have_encoding = 0;
    
    1714
    -    int    have_index    = 0;
    
    1711
    +    int          option;
    
    1712
    +    int          have_encoding = 0;
    
    1713
    +    int          have_index    = 0;
    
    1714
    +    const char*  execname = ft_basename( (*argv)[0] );
    
    1715 1715
     
    
    1716 1716
     
    
    1717
    -    execname = ft_basename( (*argv)[0] );
    
    1718
    -
    
    1719 1717
         while ( 1 )
    
    1720 1718
         {
    
    1721 1719
           option = getopt( *argc, *argv, "a:d:e:f:k:nr:v" );
    

  • src/ftlint.c
    ... ... @@ -64,7 +64,7 @@
    64 64
     
    
    65 65
     
    
    66 66
       static void
    
    67
    -  Usage( char*  name )
    
    67
    +  Usage( const char*  name )
    
    68 68
       {
    
    69 69
         printf( "ftlint: simple font tester -- part of the FreeType project\n" );
    
    70 70
         printf( "----------------------------------------------------------\n" );
    
    ... ... @@ -158,7 +158,7 @@
    158 158
             char**  argv )
    
    159 159
       {
    
    160 160
         int           file_index, face_index;
    
    161
    -    char*         execname;
    
    161
    +    const char*   execname;
    
    162 162
         char*         fname;
    
    163 163
         int           opt;
    
    164 164
         unsigned int  first_index = 0;
    

  • src/ftmulti.c
    ... ... @@ -889,7 +889,7 @@
    889 889
     
    
    890 890
     
    
    891 891
       static void
    
    892
    -  usage( char*  execname )
    
    892
    +  usage( const char*  execname )
    
    893 893
       {
    
    894 894
         fprintf( stderr,
    
    895 895
           "\n"
    
    ... ... @@ -936,7 +936,6 @@
    936 936
         int    old_ptsize, orig_ptsize, file;
    
    937 937
         int    first_glyph = 0;
    
    938 938
         int    XisSetup = 0;
    
    939
    -    char*  execname;
    
    940 939
         int    option;
    
    941 940
         int    file_loaded;
    
    942 941
     
    
    ... ... @@ -946,10 +945,9 @@
    946 945
         unsigned int  versions[3] = { TT_INTERPRETER_VERSION_35,
    
    947 946
                                       TT_INTERPRETER_VERSION_38,
    
    948 947
                                       TT_INTERPRETER_VERSION_40 };
    
    948
    +    const char*   execname = ft_basename( argv[0] );
    
    949 949
     
    
    950 950
     
    
    951
    -    execname = ft_basename( argv[0] );
    
    952
    -
    
    953 951
         /* Initialize engine */
    
    954 952
         error = FT_Init_FreeType( &library );
    
    955 953
         if ( error )
    

  • src/ftsdf.c
    ... ... @@ -660,7 +660,7 @@
    660 660
     
    
    661 661
     
    
    662 662
       static void
    
    663
    -  usage( char*  exec_name )
    
    663
    +  usage( const char*  exec_name )
    
    664 664
       {
    
    665 665
         fprintf( stderr,
    
    666 666
           "\n"
    
    ... ... @@ -684,14 +684,12 @@
    684 684
       main( int     argc,
    
    685 685
             char**  argv )
    
    686 686
       {
    
    687
    -    FT_Error  err       = FT_Err_Ok;
    
    688
    -    char*     exec_name = NULL;
    
    687
    +    FT_Error     err       = FT_Err_Ok;
    
    688
    +    const char*  exec_name = ft_basename( argv[0] );
    
    689 689
     
    
    690 690
         int  flip_y = 1;
    
    691 691
     
    
    692 692
     
    
    693
    -    exec_name = ft_basename( argv[0] );
    
    694
    -
    
    695 693
         if ( argc != 3 )
    
    696 694
           usage( exec_name );
    
    697 695
     
    

  • src/ftstring.c
    ... ... @@ -656,7 +656,7 @@
    656 656
     
    
    657 657
     
    
    658 658
       static void
    
    659
    -  usage( char*  execname )
    
    659
    +  usage( const char*  execname )
    
    660 660
       {
    
    661 661
         fprintf( stderr,
    
    662 662
           "\n"
    
    ... ... @@ -700,12 +700,10 @@
    700 700
       parse_cmdline( int*     argc,
    
    701 701
                      char***  argv )
    
    702 702
       {
    
    703
    -    char*  execname;
    
    704
    -    int    option;
    
    703
    +    int          option;
    
    704
    +    const char*  execname = ft_basename( (*argv)[0] );
    
    705 705
     
    
    706 706
     
    
    707
    -    execname = ft_basename( (*argv)[0] );
    
    708
    -
    
    709 707
         while ( 1 )
    
    710 708
         {
    
    711 709
           option = getopt( *argc, *argv, "d:e:k:m:r:v" );
    

  • src/ftvalid.c
    ... ... @@ -38,7 +38,7 @@
    38 38
     #include <stdlib.h>
    
    39 39
     
    
    40 40
     
    
    41
    -  static char*  execname;
    
    41
    +  static const char*  execname;
    
    42 42
     
    
    43 43
       typedef enum
    
    44 44
       {
    

  • src/ftview.c
    ... ... @@ -1637,7 +1637,7 @@
    1637 1637
     
    
    1638 1638
     
    
    1639 1639
       static void
    
    1640
    -  usage( char*  execname )
    
    1640
    +  usage( const char*  execname )
    
    1641 1641
       {
    
    1642 1642
         fprintf( stderr,
    
    1643 1643
           "\n"
    
    ... ... @@ -1688,12 +1688,10 @@
    1688 1688
       parse_cmdline( int*    argc,
    
    1689 1689
                      char**  argv[] )
    
    1690 1690
       {
    
    1691
    -    char*  execname;
    
    1692
    -    int    option;
    
    1691
    +    int          option;
    
    1692
    +    const char*  execname = ft_basename( (*argv)[0] );
    
    1693 1693
     
    
    1694 1694
     
    
    1695
    -    execname = ft_basename( (*argv)[0] );
    
    1696
    -
    
    1697 1695
         while ( 1 )
    
    1698 1696
         {
    
    1699 1697
           option = getopt( *argc, *argv, "d:e:f:k:L:l:m:pr:v" );
    

  • src/ttdebug.c
    ... ... @@ -2854,7 +2854,7 @@
    2854 2854
     
    
    2855 2855
     
    
    2856 2856
       static void
    
    2857
    -  Usage( char*  execname )
    
    2857
    +  Usage( const char*  execname )
    
    2858 2858
       {
    
    2859 2859
         char  versions[32];
    
    2860 2860
     
    
    ... ... @@ -2911,11 +2911,11 @@
    2911 2911
       main( int     argc,
    
    2912 2912
             char**  argv )
    
    2913 2913
       {
    
    2914
    -    char*  execname;
    
    2915 2914
         int    option;
    
    2916 2915
         char   version_string[64];
    
    2917 2916
     
    
    2918 2917
         int           i;
    
    2918
    +    const char*   execname;
    
    2919 2919
         unsigned int  versions[3] = { TT_INTERPRETER_VERSION_35,
    
    2920 2920
                                       TT_INTERPRETER_VERSION_38,
    
    2921 2921
                                       TT_INTERPRETER_VERSION_40 };
    


  • reply via email to

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