freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] [ftlint] Improve error reporting.


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] [ftlint] Improve error reporting.
Date: Wed, 23 Jun 2021 02:57:59 +0000

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

Commits:

2 changed files:

Changes:

  • ChangeLog
    1
    +2021-06-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2
    +
    
    3
    +	[ftlint] Improve error reporting.
    
    4
    +
    
    5
    +	* src/ftlint.c (main): Decorate error messages.
    
    6
    +	(Error): Take a prefix message argumemt.
    
    7
    +
    
    1 8
     2021-06-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2 9
     
    
    3 10
     	* src/ftlint.c (main): Use `ft_basename'.
    

  • src/ftlint.c
    ... ... @@ -51,7 +51,7 @@
    51 51
     
    
    52 52
     
    
    53 53
       static void
    
    54
    -  Error( void )
    
    54
    +  Error( const FT_String  *msg )
    
    55 55
       {
    
    56 56
         const FT_String  *str;
    
    57 57
     
    
    ... ... @@ -59,7 +59,7 @@
    59 59
         switch( error )
    
    60 60
         #include <freetype/fterrors.h>
    
    61 61
     
    
    62
    -    printf( "  error = 0x%04x, %s\n", error, str );
    
    62
    +    printf( "%serror = 0x%04x, %s\n", msg, error, str );
    
    63 63
       }
    
    64 64
     
    
    65 65
     
    
    ... ... @@ -226,7 +226,7 @@
    226 226
         error = FT_Init_FreeType( &library );
    
    227 227
         if ( error )
    
    228 228
         {
    
    229
    -      Error();
    
    229
    +      Error( "" );
    
    230 230
           exit( 1 );
    
    231 231
         }
    
    232 232
     
    
    ... ... @@ -244,7 +244,7 @@
    244 244
           error = FT_New_Face( library, fname, face_index, &face );
    
    245 245
           if ( error )
    
    246 246
           {
    
    247
    -        Error();
    
    247
    +        Error( "  " );
    
    248 248
             continue;
    
    249 249
           }
    
    250 250
     
    
    ... ... @@ -254,7 +254,7 @@
    254 254
           error = FT_Set_Char_Size( face, ptsize << 6, ptsize << 6, 72, 72 );
    
    255 255
           if ( error )
    
    256 256
           {
    
    257
    -        Error();
    
    257
    +        Error( "  " );
    
    258 258
             goto Finalize;
    
    259 259
           }
    
    260 260
     
    
    ... ... @@ -271,8 +271,11 @@
    271 271
             error = FT_Load_Glyph( face, id, load_flags );
    
    272 272
             if ( error )
    
    273 273
             {
    
    274
    -          printf( "%5u:", id );
    
    275
    -          Error();
    
    274
    +          if ( !quiet )
    
    275
    +          {
    
    276
    +            printf( "%5u: ", id );
    
    277
    +            Error( "loading " );
    
    278
    +          }
    
    276 279
               Fail++;
    
    277 280
               continue;
    
    278 281
             }
    
    ... ... @@ -280,12 +283,12 @@
    280 283
             if ( quiet )
    
    281 284
               continue;
    
    282 285
     
    
    283
    -        printf( "%5u:", id );
    
    286
    +        printf( "%5u: ", id );
    
    284 287
     
    
    285 288
             error = FT_Render_Glyph( face->glyph, render_mode );
    
    286 289
             if ( error && error != FT_Err_Cannot_Render_Glyph )
    
    287 290
             {
    
    288
    -          Error();
    
    291
    +          Error( "rendering " );
    
    289 292
               Fail++;
    
    290 293
               continue;
    
    291 294
             }
    
    ... ... @@ -296,11 +299,11 @@
    296 299
             error = FT_Bitmap_Convert( library, &face->glyph->bitmap, &bitmap, 1 );
    
    297 300
             if ( error )
    
    298 301
             {
    
    299
    -          Error();
    
    302
    +          Error( "converting " );
    
    300 303
               continue;
    
    301 304
             }
    
    302 305
             else
    
    303
    -          printf( " %3ux%-4u ", bitmap.width, bitmap.rows );
    
    306
    +          printf( "%3ux%-4u ", bitmap.width, bitmap.rows );
    
    304 307
     
    
    305 308
             Analyze( &bitmap );
    
    306 309
             Checksum( &bitmap );
    


  • reply via email to

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