freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 4441f7b: Replace `foo == NULL' and `foo != NULL' with


From: Werner LEMBERG
Subject: [freetype2] master 4441f7b: Replace `foo == NULL' and `foo != NULL' with `!foo' and `foo', resp.
Date: Mon, 26 Dec 2016 16:10:06 +0000 (UTC)

branch: master
commit 4441f7b24675fbd7d91f794f5d54e6c1ff168439
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    Replace `foo == NULL' and `foo != NULL' with `!foo' and `foo', resp.
    
    Other minor formatting.
---
 src/autofit/afglobal.c        |    4 ++--
 src/autofit/afhints.c         |   12 ++++++------
 src/autofit/aflatin.c         |    2 +-
 src/autofit/aflatin2.c        |    2 +-
 src/autofit/afloader.c        |    2 +-
 src/base/ftadvanc.c           |    2 +-
 src/base/ftbitmap.c           |    2 +-
 src/base/ftdbgmem.c           |   22 ++++++++++-----------
 src/base/ftmac.c              |    8 ++++----
 src/base/ftobjs.c             |   28 +++++++++++++--------------
 src/base/ftsnames.c           |    2 +-
 src/base/ftutil.c             |    6 +++---
 src/bdf/bdfdrivr.c            |    2 +-
 src/bdf/bdflib.c              |    2 +-
 src/bzip2/ftbzip2.c           |    2 +-
 src/cache/ftccache.c          |   14 +++++++-------
 src/cache/ftccache.h          |    6 +++---
 src/cache/ftcmanag.c          |    4 ++--
 src/cache/ftcmru.c            |   10 +++++-----
 src/cache/ftcsbits.c          |    2 +-
 src/cff/cf2arrst.c            |   20 ++++++++++----------
 src/cff/cf2ft.c               |    2 +-
 src/cff/cffdrivr.c            |   12 ++++++------
 src/cff/cffload.c             |    6 +++---
 src/cff/cffobjs.c             |    2 +-
 src/gxvalid/gxvcommn.c        |   14 +++++++-------
 src/gxvalid/gxvmort.c         |    2 +-
 src/gxvalid/gxvmorx.c         |    2 +-
 src/gzip/ftgzip.c             |    2 +-
 src/pcf/pcfdrivr.c            |    2 +-
 src/pcf/pcfread.c             |    2 +-
 src/pfr/pfrload.c             |    4 ++--
 src/pfr/pfrobjs.c             |    2 +-
 src/psaux/psobjs.c            |   12 ++++++------
 src/psaux/t1cmap.c            |    4 ++--
 src/psaux/t1decode.c          |    6 +++---
 src/pshinter/pshalgo.c        |    2 +-
 src/sfnt/sfobjs.c             |   18 +++++++++---------
 src/sfnt/ttbdf.c              |    6 ++++--
 src/sfnt/ttcmap.c             |    4 ++--
 src/smooth/ftgrays.c          |    2 +-
 src/tools/apinames.c          |   14 +++++++-------
 src/tools/ftrandom/ftrandom.c |   42 ++++++++++++++++++++---------------------
 src/truetype/ttdriver.c       |    2 +-
 src/truetype/ttgload.c        |    2 +-
 src/truetype/ttgxvar.c        |   34 ++++++++++++++++-----------------
 src/truetype/ttinterp.c       |    4 ++--
 src/type1/t1afm.c             |    6 +++---
 src/type42/t42objs.c          |    2 +-
 49 files changed, 184 insertions(+), 182 deletions(-)

diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index db070e7..11ed0df 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -168,7 +168,7 @@
       AF_Script_UniRange  range;
 
 
-      if ( script_class->script_uni_ranges == NULL )
+      if ( !script_class->script_uni_ranges )
         continue;
 
       /*
@@ -456,7 +456,7 @@
                              [style_class->writing_system];
 
     metrics = globals->metrics[style];
-    if ( metrics == NULL )
+    if ( !metrics )
     {
       /* create the global metrics object if necessary */
       FT_Memory  memory = globals->face->memory;
diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c
index 0f7f6e5..8ad3e1c 100644
--- a/src/autofit/afhints.c
+++ b/src/autofit/afhints.c
@@ -45,7 +45,7 @@
 
     if ( axis->num_segments < AF_SEGMENTS_EMBEDDED )
     {
-      if ( axis->segments == NULL )
+      if ( !axis->segments )
       {
         axis->segments     = axis->embedded.segments;
         axis->max_segments = AF_SEGMENTS_EMBEDDED;
@@ -110,7 +110,7 @@
 
     if ( axis->num_edges < AF_EDGES_EMBEDDED )
     {
-      if ( axis->edges == NULL )
+      if ( !axis->edges )
       {
         axis->edges     = axis->embedded.edges;
         axis->max_edges = AF_EDGES_EMBEDDED;
@@ -743,7 +743,7 @@
 
     if ( new_max <= AF_CONTOURS_EMBEDDED )
     {
-      if ( hints->contours == NULL )
+      if ( !hints->contours )
       {
         hints->contours     = hints->embedded.contours;
         hints->max_contours = AF_CONTOURS_EMBEDDED;
@@ -772,7 +772,7 @@
 
     if ( new_max <= AF_POINTS_EMBEDDED )
     {
-      if ( hints->points == NULL )
+      if ( !hints->points )
       {
         hints->points     = hints->embedded.points;
         hints->max_points = AF_POINTS_EMBEDDED;
@@ -1182,7 +1182,7 @@
         AF_Point  point, first, last;
 
 
-        if ( edge == NULL )
+        if ( !edge )
           continue;
 
         first = seg->first;
@@ -1208,7 +1208,7 @@
         AF_Point  point, first, last;
 
 
-        if ( edge == NULL )
+        if ( !edge )
           continue;
 
         first = seg->first;
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 141e659..8f6e51d 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -2211,7 +2211,7 @@
                                 seg->serif->edge         &&
                                 seg->serif->edge != edge );
 
-          if ( ( seg->link && seg->link->edge != NULL ) || is_serif )
+          if ( ( seg->link && seg->link->edge ) || is_serif )
           {
             AF_Edge     edge2;
             AF_Segment  seg2;
diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c
index 5cc5eb7..e1cc1f5 100644
--- a/src/autofit/aflatin2.c
+++ b/src/autofit/aflatin2.c
@@ -1303,7 +1303,7 @@
                                 seg->serif->edge         &&
                                 seg->serif->edge != edge );
 
-          if ( ( seg->link && seg->link->edge != NULL ) || is_serif )
+          if ( ( seg->link && seg->link->edge ) || is_serif )
           {
             AF_Edge     edge2;
             AF_Segment  seg2;
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index b9e1f5f..7f75fc3 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -51,7 +51,7 @@
     loader->face    = face;
     loader->globals = (AF_FaceGlobals)face->autohint.data;
 
-    if ( loader->globals == NULL )
+    if ( !loader->globals )
     {
       error = af_face_globals_new( face, &loader->globals, module );
       if ( !error )
diff --git a/src/base/ftadvanc.c b/src/base/ftadvanc.c
index 31a2c04..59c7450 100644
--- a/src/base/ftadvanc.c
+++ b/src/base/ftadvanc.c
@@ -36,7 +36,7 @@
     if ( flags & FT_LOAD_NO_SCALE )
       return FT_Err_Ok;
 
-    if ( face->size == NULL )
+    if ( !face->size )
       return FT_THROW( Invalid_Size_Handle );
 
     if ( flags & FT_LOAD_VERTICAL_LAYOUT )
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 24fead3..533e57a 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -76,7 +76,7 @@
     source_pitch_sign = source->pitch < 0 ? -1 : 1;
     target_pitch_sign = target->pitch < 0 ? -1 : 1;
 
-    if ( source->buffer == NULL )
+    if ( !source->buffer )
     {
       *target = *source;
       if ( source_pitch_sign != target_pitch_sign )
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index 38d1a80..fcdceef 100644
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -268,7 +268,7 @@
                       ft_mem_table_alloc(
                         table,
                         new_size * (FT_Long)sizeof ( FT_MemNode ) );
-      if ( new_buckets == NULL )
+      if ( !new_buckets )
         return;
 
       FT_ARRAY_ZERO( new_buckets, new_size );
@@ -309,7 +309,7 @@
 
 
     table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );
-    if ( table == NULL )
+    if ( !table )
       goto Exit;
 
     FT_ZERO( table );
@@ -466,7 +466,7 @@
     for (;;)
     {
       node = *pnode;
-      if ( node == NULL )
+      if ( !node )
         break;
 
       if ( node->file_name == _ft_debug_file   &&
@@ -477,7 +477,7 @@
     }
 
     node = (FT_MemSource)ft_mem_table_alloc( table, sizeof ( *node ) );
-    if ( node == NULL )
+    if ( !node )
       ft_mem_debug_panic(
         "not enough memory to perform memory debugging\n" );
 
@@ -545,7 +545,7 @@
 
       /* we need to create a new node in this table */
       node = (FT_MemNode)ft_mem_table_alloc( table, sizeof ( *node ) );
-      if ( node == NULL )
+      if ( !node )
         ft_mem_debug_panic( "not enough memory to run memory tests" );
 
       node->address = address;
@@ -717,7 +717,7 @@
     FT_MemTable  table = (FT_MemTable)memory->user;
 
 
-    if ( block == NULL )
+    if ( !block )
       ft_mem_debug_panic( "trying to free NULL in (%s:%ld)",
                           FT_FILENAME( _ft_debug_file ),
                           _ft_debug_lineno );
@@ -755,7 +755,7 @@
 
     /* the following is valid according to ANSI C */
 #if 0
-    if ( block == NULL || cur_size == 0 )
+    if ( !block || !cur_size )
       ft_mem_debug_panic( "trying to reallocate NULL in (%s:%ld)",
                           file_name, line_no );
 #endif
@@ -799,7 +799,7 @@
       return NULL;
 
     new_block = (FT_Pointer)ft_mem_table_alloc( table, new_size );
-    if ( new_block == NULL )
+    if ( !new_block )
       return NULL;
 
     ft_mem_table_set( table, (FT_Byte*)new_block, new_size, delta );
@@ -840,7 +840,7 @@
         memory->free    = ft_mem_debug_free;
 
         p = getenv( "FT2_ALLOC_TOTAL_MAX" );
-        if ( p != NULL )
+        if ( p )
         {
           FT_Long  total_max = ft_strtol( p, NULL, 10 );
 
@@ -853,7 +853,7 @@
         }
 
         p = getenv( "FT2_ALLOC_COUNT_MAX" );
-        if ( p != NULL )
+        if ( p )
         {
           FT_Long  total_count = ft_strtol( p, NULL, 10 );
 
@@ -866,7 +866,7 @@
         }
 
         p = getenv( "FT2_KEEP_ALIVE" );
-        if ( p != NULL )
+        if ( p )
         {
           FT_Long  keep_alive = ft_strtol( p, NULL, 10 );
 
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 55cdea6..a7115c4 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -605,7 +605,7 @@
     for (;;)
     {
       post_data = Get1Resource( TTAG_POST, res_id++ );
-      if ( post_data == NULL )
+      if ( !post_data )
         break;  /* we are done */
 
       code = (*post_data)[0];
@@ -644,7 +644,7 @@
     for (;;)
     {
       post_data = Get1Resource( TTAG_POST, res_id++ );
-      if ( post_data == NULL )
+      if ( !post_data )
         break;  /* we are done */
 
       post_size = (FT_ULong)GetHandleSize( post_data ) - 2;
@@ -655,7 +655,7 @@
         if ( last_code != -1 )
         {
           /* we are done adding a chunk, fill in the size field */
-          if ( size_p != NULL )
+          if ( size_p )
           {
             *size_p++ = (FT_Byte)(   pfb_chunk_size         & 0xFF );
             *size_p++ = (FT_Byte)( ( pfb_chunk_size >> 8  ) & 0xFF );
@@ -743,7 +743,7 @@
 
 
     sfnt = GetResource( TTAG_sfnt, sfnt_id );
-    if ( sfnt == NULL )
+    if ( !sfnt )
       return FT_THROW( Invalid_Handle );
 
     sfnt_size = (FT_ULong)GetHandleSize( sfnt );
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 09cfe7a..64791e6 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1957,7 +1957,7 @@
     FT_Long        dlen, offset;
 
 
-    if ( NULL == stream )
+    if ( !stream )
       return FT_THROW( Invalid_Stream_Operation );
 
     error = FT_Stream_Seek( stream, 0 );
@@ -3457,7 +3457,7 @@
     FT_CMap    cmap = NULL;
 
 
-    if ( clazz == NULL || charmap == NULL || charmap->face == NULL )
+    if ( !clazz || !charmap || !charmap->face )
       return FT_THROW( Invalid_Argument );
 
     face   = charmap->face;
@@ -3602,7 +3602,7 @@
       FT_CMap     ucmap = FT_CMAP( face->charmap );
 
 
-      if ( charmap != NULL )
+      if ( charmap )
       {
         FT_CMap  vcmap = FT_CMAP( charmap );
 
@@ -3643,7 +3643,7 @@
       FT_CharMap  charmap = find_variant_selector_charmap( face );
 
 
-      if ( charmap != NULL )
+      if ( charmap )
       {
         FT_CMap  vcmap = FT_CMAP( charmap );
 
@@ -3682,7 +3682,7 @@
       FT_CharMap  charmap = find_variant_selector_charmap( face );
 
 
-      if ( charmap != NULL )
+      if ( charmap )
       {
         FT_CMap    vcmap  = FT_CMAP( charmap );
         FT_Memory  memory = FT_FACE_MEMORY( face );
@@ -3710,7 +3710,7 @@
       FT_CharMap  charmap = find_variant_selector_charmap( face );
 
 
-      if ( charmap != NULL )
+      if ( charmap )
       {
         FT_CMap    vcmap  = FT_CMAP( charmap );
         FT_Memory  memory = FT_FACE_MEMORY( face );
@@ -3744,7 +3744,7 @@
       FT_CharMap  charmap = find_variant_selector_charmap( face );
 
 
-      if ( charmap != NULL )
+      if ( charmap )
       {
         FT_CMap    vcmap  = FT_CMAP( charmap );
         FT_Memory  memory = FT_FACE_MEMORY( face );
@@ -3872,7 +3872,7 @@
     if ( face && FT_IS_SFNT( face ) )
     {
       FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
-      if ( service != NULL )
+      if ( service )
         table = service->get_table( face, tag );
     }
 
@@ -3896,7 +3896,7 @@
       return FT_THROW( Invalid_Face_Handle );
 
     FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
-    if ( service == NULL )
+    if ( !service )
       return FT_THROW( Unimplemented_Feature );
 
     return service->load_table( face, tag, offset, buffer, length );
@@ -3921,7 +3921,7 @@
       return FT_THROW( Invalid_Face_Handle );
 
     FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
-    if ( service == NULL )
+    if ( !service )
       return FT_THROW( Unimplemented_Feature );
 
     return service->table_info( face, table_index, tag, &offset, length );
@@ -3943,7 +3943,7 @@
 
     face = charmap->face;
     FT_FACE_FIND_SERVICE( face, service, TT_CMAP );
-    if ( service == NULL )
+    if ( !service )
       return 0;
     if ( service->get_cmap_info( charmap, &cmap_info ))
       return 0;
@@ -3967,7 +3967,7 @@
 
     face = charmap->face;
     FT_FACE_FIND_SERVICE( face, service, TT_CMAP );
-    if ( service == NULL )
+    if ( !service )
       return -1;
     if ( service->get_cmap_info( charmap, &cmap_info ))
       return -1;
@@ -4590,7 +4590,7 @@
       if ( module->clazz->get_interface )
         result = module->clazz->get_interface( module, service_id );
 
-      if ( global && result == NULL )
+      if ( global && !result )
       {
         /* we didn't find it, look in all other modules then */
         FT_Library  library = module->library;
@@ -4607,7 +4607,7 @@
             if ( cur[0]->clazz->get_interface )
             {
               result = cur[0]->clazz->get_interface( cur[0], service_id );
-              if ( result != NULL )
+              if ( result )
                 break;
             }
           }
diff --git a/src/base/ftsnames.c b/src/base/ftsnames.c
index ce79641..e0d5f82 100644
--- a/src/base/ftsnames.c
+++ b/src/base/ftsnames.c
@@ -58,7 +58,7 @@
 
 
         /* load name on demand */
-        if ( entry->stringLength > 0 && entry->string == NULL )
+        if ( entry->stringLength > 0 && !entry->string )
         {
           FT_Memory  memory = face->memory;
           FT_Stream  stream = face->stream;
diff --git a/src/base/ftutil.c b/src/base/ftutil.c
index fad7d1a..36d2dd7 100644
--- a/src/base/ftutil.c
+++ b/src/base/ftutil.c
@@ -74,7 +74,7 @@
     if ( size > 0 )
     {
       block = memory->alloc( memory, size );
-      if ( block == NULL )
+      if ( !block )
         error = FT_THROW( Out_Of_Memory );
     }
     else if ( size < 0 )
@@ -141,7 +141,7 @@
     }
     else if ( cur_count == 0 )
     {
-      FT_ASSERT( block == NULL );
+      FT_ASSERT( !block );
 
       block = ft_mem_alloc( memory, new_count*item_size, &error );
     }
@@ -153,7 +153,7 @@
 
 
       block2 = memory->realloc( memory, cur_size, new_size, block );
-      if ( block2 == NULL )
+      if ( !block2 )
         error = FT_THROW( Out_Of_Memory );
       else
         block = block2;
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 02e7f84..a2242be 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -276,7 +276,7 @@ THE SOFTWARE.
 
         len = lengths[nn];
 
-        if ( src == NULL )
+        if ( !src )
           continue;
 
         /* separate elements with a space */
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index f54df22..7fd95a7 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -1119,7 +1119,7 @@
     /* See whether this property type exists yet or not. */
     /* If not, create it.                                */
     propid = ft_hash_str_lookup( name, &(font->proptbl) );
-    if ( propid == NULL )
+    if ( !propid )
     {
       error = bdf_create_property( name, BDF_ATOM, font );
       if ( error )
diff --git a/src/bzip2/ftbzip2.c b/src/bzip2/ftbzip2.c
index 4577a83..4d0b388 100644
--- a/src/bzip2/ftbzip2.c
+++ b/src/bzip2/ftbzip2.c
@@ -180,7 +180,7 @@
     bzstream->next_in  = (char*)zip->buffer;
 
     if ( BZ2_bzDecompressInit( bzstream, 0, 0 ) != BZ_OK ||
-         bzstream->next_in == NULL                       )
+         !bzstream->next_in                              )
       error = FT_THROW( Invalid_File_Format );
 
   Exit:
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index 3b1a4bc..de20255 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -147,7 +147,7 @@
         for (;;)
         {
           node = *pnode;
-          if ( node == NULL )
+          if ( !node )
             break;
 
           if ( node->hash & ( mask + 1 ) )
@@ -232,7 +232,7 @@
       FTC_Node  node = *pnode;
 
 
-      if ( node == NULL )
+      if ( !node )
       {
         FT_TRACE0(( "ftc_node_hash_unlink: unknown node\n" ));
         return;
@@ -288,7 +288,7 @@
     cache = manager->caches[node->cache_index];
 
 #ifdef FT_DEBUG_ERROR
-    if ( cache == NULL )
+    if ( !cache )
     {
       FT_TRACE0(( "ftc_node_destroy: invalid node handle\n" ));
       return;
@@ -494,7 +494,7 @@
     FTC_Node_CompareFunc  compare = cache->clazz.node_compare;
 
 
-    if ( cache == NULL || anode == NULL )
+    if ( !cache || !anode )
       return FT_THROW( Invalid_Argument );
 
     /* Go to the `top' node of the list sharing same masked hash */
@@ -505,7 +505,7 @@
     for (;;)
     {
       node = *pnode;
-      if ( node == NULL )
+      if ( !node )
         goto NewNode;
 
       if ( node->hash == hash                           &&
@@ -523,7 +523,7 @@
       /* Update pnode by modified linked list */
       while ( *pnode != node )
       {
-        if ( *pnode == NULL )
+        if ( !*pnode )
         {
           FT_ERROR(( "FTC_Cache_Lookup: oops!!!  node missing\n" ));
           goto NewNode;
@@ -582,7 +582,7 @@
         FT_Bool   list_changed = FALSE;
 
 
-        if ( node == NULL )
+        if ( !node )
           break;
 
         if ( cache->clazz.node_remove_faceid( node, face_id,
diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index 1b12959..ab4ea51 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -227,7 +227,7 @@ FT_BEGIN_HEADER
     for (;;)                                                             \
     {                                                                    \
       _node = *_pnode;                                                   \
-      if ( _node == NULL )                                               \
+      if ( !_node )                                                      \
         goto NewNode_;                                                   \
                                                                          \
       if ( _node->hash == _hash                             &&           \
@@ -245,7 +245,7 @@ FT_BEGIN_HEADER
       /* Update _pnode by possibly modified linked list */               \
       while ( *_pnode != _node )                                         \
       {                                                                  \
-        if ( *_pnode == NULL )                                           \
+        if ( !*_pnode )                                                  \
         {                                                                \
           FT_ERROR(( "FTC_CACHE_LOOKUP_CMP: oops!!! node missing\n" ));  \
           goto NewNode_;                                                 \
@@ -325,7 +325,7 @@ FT_BEGIN_HEADER
         break;                                                    \
                                                                   \
       _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
-      if ( _try_done > 0 && ( list_changed != NULL ) )            \
+      if ( _try_done > 0 && list_changed != NULL )                \
         *(FT_Bool*)( list_changed ) = TRUE;                       \
                                                                   \
       if ( _try_done == 0 )                                       \
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index 507c605..9a25b97 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -553,7 +553,7 @@
                 manager->num_nodes ));
 #endif
 
-    if ( manager->cur_weight < manager->max_weight || first == NULL )
+    if ( manager->cur_weight < manager->max_weight || !first )
       return;
 
     /* go to last node -- it's a circular list */
@@ -638,7 +638,7 @@
 
 
     /* try to remove `count' nodes from the list */
-    if ( first == NULL )  /* empty list! */
+    if ( !first )  /* empty list! */
       return 0;
 
     /* go to last node - it's a circular list */
diff --git a/src/cache/ftcmru.c b/src/cache/ftcmru.c
index d107584..7c460b9 100644
--- a/src/cache/ftcmru.c
+++ b/src/cache/ftcmru.c
@@ -76,7 +76,7 @@
     FTC_MruNode  first = *plist;
 
 
-    FT_ASSERT( first != NULL );
+    FT_ASSERT( first );
 
     if ( first != node )
     {
@@ -126,7 +126,7 @@
     FTC_MruNode  prev, next;
 
 
-    FT_ASSERT( first != NULL );
+    FT_ASSERT( first );
 
 #ifdef FT_DEBUG_ERROR
       {
@@ -238,7 +238,7 @@
                    FTC_MruNode  *anode )
   {
     FT_Error     error;
-    FTC_MruNode  node = NULL;
+    FTC_MruNode  node   = NULL;
     FT_Memory    memory = list->memory;
 
 
@@ -296,7 +296,7 @@
 
 
     node = FTC_MruList_Find( list, key );
-    if ( node == NULL )
+    if ( !node )
       return FTC_MruList_New( list, key, anode );
 
     *anode = node;
@@ -332,7 +332,7 @@
 
 
     first = list->nodes;
-    while ( first && ( selection == NULL || selection( first, key ) ) )
+    while ( first && ( !selection || selection( first, key ) ) )
     {
       FTC_MruList_Remove( list, first );
       first = list->nodes;
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index d6f1ddc..78cd8de 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -378,7 +378,7 @@
        *
        */
 
-      if ( sbit->buffer == NULL && sbit->width == 255 )
+      if ( !sbit->buffer && sbit->width == 255 )
       {
         FT_ULong  size;
         FT_Error  error;
diff --git a/src/cff/cf2arrst.c b/src/cff/cf2arrst.c
index 89f3e9f..6796450 100644
--- a/src/cff/cf2arrst.c
+++ b/src/cff/cf2arrst.c
@@ -58,7 +58,7 @@
                      FT_Error*     error,
                      size_t        sizeItem )
   {
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     /* initialize the structure */
     arrstack->memory    = memory;
@@ -78,7 +78,7 @@
     FT_Memory  memory = arrstack->memory;     /* for FT_FREE */
 
 
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     arrstack->allocated = 0;
     arrstack->count     = 0;
@@ -95,7 +95,7 @@
   cf2_arrstack_setNumElements( CF2_ArrStack  arrstack,
                                size_t        numElements )
   {
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     {
       FT_Error   error  = FT_Err_Ok;        /* for FT_REALLOC */
@@ -140,7 +140,7 @@
   cf2_arrstack_setCount( CF2_ArrStack  arrstack,
                          size_t        numElements )
   {
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     if ( numElements > arrstack->allocated )
     {
@@ -157,7 +157,7 @@
   FT_LOCAL_DEF( void )
   cf2_arrstack_clear( CF2_ArrStack  arrstack )
   {
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     arrstack->count = 0;
   }
@@ -167,7 +167,7 @@
   FT_LOCAL_DEF( size_t )
   cf2_arrstack_size( const CF2_ArrStack  arrstack )
   {
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     return arrstack->count;
   }
@@ -176,7 +176,7 @@
   FT_LOCAL_DEF( void* )
   cf2_arrstack_getBuffer( const CF2_ArrStack  arrstack )
   {
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     return arrstack->ptr;
   }
@@ -190,7 +190,7 @@
     void*  newPtr;
 
 
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     if ( idx >= arrstack->count )
     {
@@ -212,7 +212,7 @@
   cf2_arrstack_push( CF2_ArrStack  arrstack,
                      const void*   ptr )
   {
-    FT_ASSERT( arrstack != NULL );
+    FT_ASSERT( arrstack );
 
     if ( arrstack->count == arrstack->allocated )
     {
@@ -225,7 +225,7 @@
       }
     }
 
-    FT_ASSERT( ptr != NULL );
+    FT_ASSERT( ptr );
 
     {
       size_t  offset = arrstack->count * arrstack->sizeItem;
diff --git a/src/cff/cf2ft.c b/src/cff/cf2ft.c
index a7fb5aa..c0d067e 100644
--- a/src/cff/cf2ft.c
+++ b/src/cff/cf2ft.c
@@ -312,7 +312,7 @@
     font = (CF2_Font)decoder->cff->cf2_instance.data;
 
     /* on first glyph, allocate instance structure */
-    if ( decoder->cff->cf2_instance.data == NULL )
+    if ( !decoder->cff->cf2_instance.data )
     {
       decoder->cff->cf2_instance.finalizer =
         (FT_Generic_Finalizer)cf2_free_instance;
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 05d5fb8..3182528 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -456,11 +456,11 @@
     FT_Error  error = FT_Err_Ok;
 
 
-    if ( cff && cff->font_info == NULL )
+    if ( cff && !cff->font_info )
     {
-      CFF_FontRecDict  dict   = &cff->top_font.font_dict;
+      CFF_FontRecDict  dict      = &cff->top_font.font_dict;
       PS_FontInfoRec  *font_info = NULL;
-      FT_Memory        memory = face->root.memory;
+      FT_Memory        memory    = face->root.memory;
 
 
       if ( FT_ALLOC( font_info, sizeof ( *font_info ) ) )
@@ -621,7 +621,7 @@
 
       if ( registry )
       {
-        if ( cff->registry == NULL )
+        if ( !cff->registry )
           cff->registry = cff_index_get_sid_string( cff,
                                                     dict->cid_registry );
         *registry = cff->registry;
@@ -629,7 +629,7 @@
 
       if ( ordering )
       {
-        if ( cff->ordering == NULL )
+        if ( !cff->ordering )
           cff->ordering = cff_index_get_sid_string( cff,
                                                     dict->cid_ordering );
         *ordering = cff->ordering;
@@ -1104,7 +1104,7 @@
 #endif
 
     result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );
-    if ( result != NULL )
+    if ( result )
       return result;
 
     /* `driver' is not yet evaluated in non-PIC mode */
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 09ae6f2..c1e6b14 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -345,7 +345,7 @@
     FT_Memory  memory = stream->memory;
 
 
-    if ( idx->count > 0 && idx->offsets == NULL )
+    if ( idx->count > 0 && !idx->offsets )
     {
       FT_Byte    offsize = idx->off_size;
       FT_ULong   data_size;
@@ -417,7 +417,7 @@
 
     *table = NULL;
 
-    if ( idx->offsets == NULL )
+    if ( !idx->offsets )
     {
       error = cff_index_load_offsets( idx );
       if ( error )
@@ -754,7 +754,7 @@
 
     /* if there is no FDSelect, return zero               */
     /* Note: CFF2 with just one Font Dict has no FDSelect */
-    if ( fdselect->data == NULL )
+    if ( !fdselect->data )
       goto Exit;
 
     switch ( fdselect->format )
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 03ed5a5..1c0a12d 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -1083,7 +1083,7 @@
         error = FT_Err_Ok;
 
         /* if no Unicode charmap was previously selected, select this one */
-        if ( cffface->charmap == NULL && nn != (FT_UInt)cffface->num_charmaps )
+        if ( !cffface->charmap && nn != (FT_UInt)cffface->num_charmaps )
           cffface->charmap = cffface->charmaps[nn];
 
       Skip_Unicode:
diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c
index 65f793c..b324bc6 100644
--- a/src/gxvalid/gxvcommn.c
+++ b/src/gxvalid/gxvcommn.c
@@ -789,7 +789,7 @@
       FT_INVALID_FORMAT;
 
     func = fmt_funcs_table[format];
-    if ( func == NULL )
+    if ( !func )
       FT_INVALID_FORMAT;
 
     func( p, limit, gxvalid );
@@ -1161,7 +1161,7 @@
         break;
       }
 
-      if ( NULL != gxvalid->statetable.entry_validate_func )
+      if ( gxvalid->statetable.entry_validate_func )
         gxvalid->statetable.entry_validate_func( state,
                                                  flags,
                                                  &glyphOffset,
@@ -1244,10 +1244,10 @@
     if ( stateSize > 0xFF )
       FT_INVALID_DATA;
 
-    if ( gxvalid->statetable.optdata_load_func != NULL )
+    if ( gxvalid->statetable.optdata_load_func )
       gxvalid->statetable.optdata_load_func( p, limit, gxvalid );
 
-    if ( gxvalid->statetable.subtable_setup_func != NULL)
+    if ( gxvalid->statetable.subtable_setup_func )
       setup_func = gxvalid->statetable.subtable_setup_func;
     else
       setup_func = gxv_StateTable_subtable_setup;
@@ -1534,7 +1534,7 @@
         goto Exit;
       }
 
-      if ( NULL != gxvalid->xstatetable.entry_validate_func )
+      if ( gxvalid->xstatetable.entry_validate_func )
         gxvalid->xstatetable.entry_validate_func( state,
                                                   flags,
                                                   &glyphOffset,
@@ -1591,10 +1591,10 @@
 
     GXV_TRACE(( "StateTable Subtables\n" ));
 
-    if ( gxvalid->xstatetable.optdata_load_func != NULL )
+    if ( gxvalid->xstatetable.optdata_load_func )
       gxvalid->xstatetable.optdata_load_func( p, limit, gxvalid );
 
-    if ( gxvalid->xstatetable.subtable_setup_func != NULL )
+    if ( gxvalid->xstatetable.subtable_setup_func )
       setup_func = gxvalid->xstatetable.subtable_setup_func;
     else
       setup_func = gxv_XStateTable_subtable_setup;
diff --git a/src/gxvalid/gxvmort.c b/src/gxvalid/gxvmort.c
index b83a2b2..1209392 100644
--- a/src/gxvalid/gxvmort.c
+++ b/src/gxvalid/gxvmort.c
@@ -205,7 +205,7 @@
         FT_INVALID_FORMAT;
 
       func = fmt_funcs_table[type];
-      if ( func == NULL )
+      if ( !func )
         GXV_TRACE(( "morx type %d is reserved\n", type ));
 
       func( p, p + rest, gxvalid );
diff --git a/src/gxvalid/gxvmorx.c b/src/gxvalid/gxvmorx.c
index a3abe43..b626993 100644
--- a/src/gxvalid/gxvmorx.c
+++ b/src/gxvalid/gxvmorx.c
@@ -98,7 +98,7 @@
         FT_INVALID_FORMAT;
 
       func = fmt_funcs_table[type];
-      if ( func == NULL )
+      if ( !func )
         GXV_TRACE(( "morx type %d is reserved\n", type ));
 
       func( p, p + rest, gxvalid );
diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c
index 0e1792d..74b467f 100644
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -317,7 +317,7 @@
     zstream->next_in  = zip->buffer;
 
     if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK ||
-         zstream->next_in == NULL                     )
+         !zstream->next_in                           )
       error = FT_THROW( Invalid_File_Format );
 
   Exit:
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index 476882f..d60cc3e 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -618,7 +618,7 @@ THE SOFTWARE.
 
 
     prop = pcf_find_property( face, prop_name );
-    if ( prop != NULL )
+    if ( prop )
     {
       if ( prop->isString )
       {
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index 6b2e82c..04f84f8 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -1156,7 +1156,7 @@ THE SOFTWARE.
 
         len = lengths[nn];
 
-        if ( src == NULL )
+        if ( !src )
           continue;
 
         /* separate elements with a space */
diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c
index e509e70..aad759a 100644
--- a/src/pfr/pfrload.c
+++ b/src/pfr/pfrload.c
@@ -562,7 +562,7 @@
     FT_UInt    len    = (FT_UInt)( limit - p );
 
 
-    if ( phy_font->font_id != NULL )
+    if ( phy_font->font_id )
       goto Exit;
 
     if ( FT_ALLOC( phy_font->font_id, len + 1 ) )
@@ -589,7 +589,7 @@
     FT_Memory  memory = phy_font->memory;
 
 
-    if ( phy_font->vertical.stem_snaps != NULL )
+    if ( phy_font->vertical.stem_snaps )
       goto Exit;
 
     PFR_CHECK( 1 );
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 10a3d2b..0491d13 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -185,7 +185,7 @@
        * nothing.
        */
       pfrface->family_name = phy_font->family_name;
-      if ( pfrface->family_name == NULL )
+      if ( !pfrface->family_name )
         pfrface->family_name = phy_font->font_id;
 
       /* note that the style name can be NULL in certain PFR fonts,
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index dc19e8a..262e9bd 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -750,7 +750,7 @@
         if ( !token.type )
           break;
 
-        if ( tokens != NULL && cur < limit )
+        if ( tokens && cur < limit )
           *cur = token;
 
         cur++;
@@ -815,12 +815,12 @@
 
       old_cur = cur;
 
-      if ( coords != NULL && count >= max_coords )
+      if ( coords && count >= max_coords )
         break;
 
       /* call PS_Conv_ToFixed() even if coords == NULL */
       /* to properly parse number at `cur'             */
-      *( coords != NULL ? &coords[count] : &dummy ) =
+      *( coords ? &coords[count] : &dummy ) =
         (FT_Short)( PS_Conv_ToFixed( &cur, limit, 0 ) >> 16 );
 
       if ( old_cur == cur )
@@ -895,12 +895,12 @@
 
       old_cur = cur;
 
-      if ( values != NULL && count >= max_values )
+      if ( values && count >= max_values )
         break;
 
       /* call PS_Conv_ToFixed() even if coords == NULL */
       /* to properly parse number at `cur'             */
-      *( values != NULL ? &values[count] : &dummy ) =
+      *( values ? &values[count] : &dummy ) =
         PS_Conv_ToFixed( &cur, limit, power_ten );
 
       if ( old_cur == cur )
@@ -1172,7 +1172,7 @@
 
           /* for this to work (FT_String**)q must have been */
           /* initialized to NULL                            */
-          if ( *(FT_String**)q != NULL )
+          if ( *(FT_String**)q )
           {
             FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n",
                         field->ident ));
diff --git a/src/psaux/t1cmap.c b/src/psaux/t1cmap.c
index d352435..7709c13 100644
--- a/src/psaux/t1cmap.c
+++ b/src/psaux/t1cmap.c
@@ -45,7 +45,7 @@
     cmap->code_to_sid   = is_expert ? psnames->adobe_expert_encoding
                                     : psnames->adobe_std_encoding;
 
-    FT_ASSERT( cmap->code_to_sid != NULL );
+    FT_ASSERT( cmap->code_to_sid );
   }
 
 
@@ -201,7 +201,7 @@
     cmap->count   = (FT_UInt)encoding->code_last - cmap->first;
     cmap->indices = encoding->char_index;
 
-    FT_ASSERT( cmap->indices != NULL );
+    FT_ASSERT( cmap->indices );
     FT_ASSERT( encoding->code_first <= encoding->code_last );
 
     return 0;
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index f755678..c80ca3f 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -873,7 +873,7 @@
             PS_Blend  blend = decoder->blend;
 
 
-            if ( arg_cnt != 1 || blend == NULL )
+            if ( arg_cnt != 1 || !blend )
               goto Unexpected_OtherSubr;
 
             idx = Fix2Int( top[0] );
@@ -941,7 +941,7 @@
             PS_Blend  blend = decoder->blend;
 
 
-            if ( arg_cnt != 2 || blend == NULL )
+            if ( arg_cnt != 2 || !blend )
               goto Unexpected_OtherSubr;
 
             idx = Fix2Int( top[1] );
@@ -962,7 +962,7 @@
             PS_Blend  blend = decoder->blend;
 
 
-            if ( arg_cnt != 1 || blend == NULL )
+            if ( arg_cnt != 1 || !blend )
               goto Unexpected_OtherSubr;
 
             idx = Fix2Int( top[0] );
diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c
index e4d8299..5688a33 100644
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -1531,7 +1531,7 @@
           }
         }
 
-        if ( point->hint == NULL )
+        if ( !point->hint )
         {
           for ( nn = 0; nn < num_hints; nn++ )
           {
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 12b7078..818009e 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -260,7 +260,7 @@
 
     if ( rec && convert )
     {
-      if ( rec->string == NULL )
+      if ( !rec->string )
       {
         FT_Stream  stream = face->name_table.stream;
 
@@ -1119,14 +1119,14 @@
 
     /* do we have outlines in there? */
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
-    has_outline = FT_BOOL( face->root.internal->incremental_interface      ||
-                           tt_face_lookup_table( face, TTAG_glyf ) != NULL ||
-                           tt_face_lookup_table( face, TTAG_CFF ) != NULL  ||
-                           tt_face_lookup_table( face, TTAG_CFF2 ) != NULL );
+    has_outline = FT_BOOL( face->root.internal->incremental_interface ||
+                           tt_face_lookup_table( face, TTAG_glyf )    ||
+                           tt_face_lookup_table( face, TTAG_CFF )     ||
+                           tt_face_lookup_table( face, TTAG_CFF2 )    );
 #else
-    has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != NULL ||
-                           tt_face_lookup_table( face, TTAG_CFF ) != NULL  ||
-                           tt_face_lookup_table( face, TTAG_CFF2 ) != NULL );
+    has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) ||
+                           tt_face_lookup_table( face, TTAG_CFF )  ||
+                           tt_face_lookup_table( face, TTAG_CFF2 ) );
 #endif
 
     is_apple_sbit = 0;
@@ -1435,7 +1435,7 @@
                                                   charmap->encoding_id );
 
 #if 0
-          if ( root->charmap     == NULL &&
+          if ( !root->charmap                           &&
                charmap->encoding == FT_ENCODING_UNICODE )
           {
             /* set 'root->charmap' to the first Unicode encoding we find */
diff --git a/src/sfnt/ttbdf.c b/src/sfnt/ttbdf.c
index f891691..62acf09 100644
--- a/src/sfnt/ttbdf.c
+++ b/src/sfnt/ttbdf.c
@@ -48,7 +48,7 @@
       FT_Stream  stream = FT_FACE(face)->stream;
 
 
-      if ( bdf->table != NULL )
+      if ( bdf->table )
         FT_FRAME_RELEASE( bdf->table );
 
       bdf->table_end    = NULL;
@@ -165,7 +165,7 @@
 
     error = FT_ERR( Invalid_Argument );
 
-    if ( size == NULL || property_name == NULL )
+    if ( !size || !property_name )
       goto Exit;
 
     property_len = ft_strlen( property_name );
@@ -177,6 +177,7 @@
       FT_UInt  _ppem  = FT_NEXT_USHORT( p );
       FT_UInt  _count = FT_NEXT_USHORT( p );
 
+
       if ( _ppem == size->metrics.y_ppem )
       {
         count = _count;
@@ -193,6 +194,7 @@
     {
       FT_UInt  type = FT_PEEK_USHORT( p + 4 );
 
+
       if ( ( type & 0x10 ) != 0 )
       {
         FT_UInt32  name_offset = FT_PEEK_ULONG( p     );
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 2dda36d..d383b3d 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -2946,7 +2946,7 @@
 
 
     cmap->max_results = 0;
-    if ( memory != NULL && cmap->results != NULL )
+    if ( memory && cmap->results )
       FT_FREE( cmap->results );
   }
 
@@ -3782,7 +3782,7 @@
           }
         }
 
-        if ( *pclazz == NULL )
+        if ( !*pclazz )
         {
           FT_TRACE0(( "tt_face_build_cmaps:"
                       " unsupported cmap sub-table ignored\n" ));
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 97d88f1..ba42c9c 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -519,7 +519,7 @@ typedef ptrdiff_t  FT_PtrDist;
     for (;;)
     {
       cell = *pcell;
-      if ( cell == NULL || cell->x > x )
+      if ( !cell || cell->x > x )
         break;
 
       if ( cell->x == x )
diff --git a/src/tools/apinames.c b/src/tools/apinames.c
index 9f81b1a..73bc99d 100644
--- a/src/tools/apinames.c
+++ b/src/tools/apinames.c
@@ -90,14 +90,14 @@ names_add( const char*  name,
     max_names += (max_names >> 1) + 4;
     the_names  = (NameRec*)realloc( the_names,
                                     sizeof ( the_names[0] ) * max_names );
-    if ( the_names == NULL )
+    if ( !the_names )
       panic( "not enough memory" );
   }
   nm = &the_names[num_names++];
 
   nm->hash = h;
   nm->name = (char*)malloc( len+1 );
-  if ( nm->name == NULL )
+  if ( !nm->name )
     panic( "not enough memory" );
 
   memcpy( nm->name, name, len );
@@ -159,7 +159,7 @@ names_dump( FILE*         out,
         char         temp[512];
 
 
-        if ( dll_name == NULL )
+        if ( !dll_name )
         {
           fprintf( stderr,
                    "you must provide a DLL name with the -d option!\n" );
@@ -168,7 +168,7 @@ names_dump( FILE*         out,
 
         /* we must omit the .dll suffix from the library name */
         dot = strchr( dll_name, '.' );
-        if ( dot != NULL )
+        if ( dot )
         {
           int  len = dot - dll_name;
 
@@ -190,7 +190,7 @@ names_dump( FILE*         out,
 
     case OUTPUT_NETWARE_IMP:
       {
-        if ( dll_name != NULL )
+        if ( dll_name )
           fprintf( out, "  (%s)\n", dll_name );
         for ( nn = 0; nn < num_names - 1; nn++ )
           fprintf( out, "  %s,\n", the_names[nn].name );
@@ -371,7 +371,7 @@ int  main( int argc, const char* const*  argv )
           arg += 2;
 
         out = fopen( arg, "wt" );
-        if ( out == NULL )
+        if ( !out )
         {
           fprintf( stderr, "could not open '%s' for writing\n", argv[2] );
           exit(3);
@@ -440,7 +440,7 @@ int  main( int argc, const char* const*  argv )
     {
       FILE*  file = fopen( argv[0], "rb" );
 
-      if ( file == NULL )
+      if ( !file )
         fprintf( stderr, "unable to open '%s'\n", argv[0] );
       else
       {
diff --git a/src/tools/ftrandom/ftrandom.c b/src/tools/ftrandom/ftrandom.c
index ff31169..6b50a3f 100644
--- a/src/tools/ftrandom/ftrandom.c
+++ b/src/tools/ftrandom/ftrandom.c
@@ -246,11 +246,11 @@
     char*  pt;
 
 
-    if ( extensions == NULL )
+    if ( !extensions )
       return true;
 
     pt = strrchr( filename, '.' );
-    if ( pt == NULL )
+    if ( !pt )
       return false;
     if ( pt < strrchr( filename, '/' ) )
       return false;
@@ -273,7 +273,7 @@
     item->isbinary = item->isascii = item->ishex = false;
 
     foo = fopen( item->name, "rb" );
-    if ( foo != NULL )
+    if ( foo )
     {
       /* Try to guess the file type from the first few characters... */
       int  ch1 = getc( foo );
@@ -300,8 +300,8 @@
       else if ( ch1 == '%' && ch2 == '!' )
       {
         /* Random PostScript */
-        if ( strstr( item->name, ".pfa" ) != NULL ||
-             strstr( item->name, ".PFA" ) != NULL )
+        if ( strstr( item->name, ".pfa" ) ||
+             strstr( item->name, ".PFA" ) )
           item->ishex = true;
         else
           item->isascii = true;
@@ -364,7 +364,7 @@
 
 
       examples = opendir( fontdirs[i] );
-      if ( examples == NULL )
+      if ( !examples )
       {
         fprintf( stderr,
                  "Can't open example font directory `%s'\n",
@@ -378,13 +378,13 @@
                   "%s/%s", fontdirs[i], ent->d_name );
         if ( stat( buffer, &statb ) == -1 || S_ISDIR( statb.st_mode ) )
           continue;
-        if ( extensions == NULL || extmatch( buffer, extensions ) )
+        if ( !extensions || extmatch( buffer, extensions ) )
         {
           if ( fcnt >= max )
           {
             max += 100;
             fontlist = realloc( fontlist, max * sizeof ( struct fontlist ) );
-            if ( fontlist == NULL )
+            if ( !fontlist )
             {
               fprintf( stderr, "Can't allocate memory\n" );
               exit( 1 );
@@ -438,20 +438,20 @@
             char*             newfont )
   {
     static char   buffer[8096];
-    FILE          *good, *new;
+    FILE          *good, *newf;
     size_t        len;
     unsigned int  i, err_cnt;
 
 
     good = fopen( item->name, "r" );
-    if ( good == NULL )
+    if ( !good )
     {
       fprintf( stderr, "Can't open `%s'\n", item->name );
       return false;
     }
 
-    new = fopen( newfont, "w+" );
-    if ( new == NULL )
+    newf = fopen( newfont, "w+" );
+    if ( !newf )
     {
       fprintf( stderr, "Can't create temporary output file `%s'\n",
                newfont );
@@ -459,19 +459,19 @@
     }
 
     while ( ( len = fread( buffer, 1, sizeof ( buffer ), good ) ) > 0 )
-      fwrite( buffer, 1, len, new );
+      fwrite( buffer, 1, len, newf );
 
     fclose( good );
 
     err_cnt = getErrorCnt( item );
     for ( i = 0; i < err_cnt; ++i )
     {
-      fseek( new, getRandom( 0, (int)( item->len - 1 ) ), SEEK_SET );
+      fseek( newf, getRandom( 0, (int)( item->len - 1 ) ), SEEK_SET );
 
       if ( item->isbinary )
-        putc( getRandom( 0, 0xFF ), new );
+        putc( getRandom( 0, 0xFF ), newf );
       else if ( item->isascii )
-        putc( getRandom( 0x20, 0x7E ), new );
+        putc( getRandom( 0x20, 0x7E ), newf );
       else
       {
         int  hex = getRandom( 0, 15 );
@@ -482,18 +482,18 @@
         else
           hex += 'A' - 10;
 
-        putc( hex, new );
+        putc( hex, newf );
       }
     }
 
-    if ( ferror( new ) )
+    if ( ferror( newf ) )
     {
-      fclose( new );
+      fclose( newf );
       unlink( newfont );
       return false;
     }
 
-    fclose( new );
+    fclose( newf );
 
     return true;
   }
@@ -701,7 +701,7 @@
       dirs = default_dir_list;
     }
 
-    if ( testfile != NULL )
+    if ( testfile )
       ExecuteTest( testfile );         /* This should never return */
 
     time( &now );
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index e7f3c0e..af8b205 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -575,7 +575,7 @@
 #endif
 
     result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );
-    if ( result != NULL )
+    if ( result )
       return result;
 
 #ifndef FT_CONFIG_OPTION_PIC
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index ce53983..a0cdfc8 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -441,7 +441,7 @@
     flag       = (FT_Byte*)outline->tags;
     flag_limit = flag + n_points;
 
-    FT_ASSERT( flag != NULL );
+    FT_ASSERT( flag );
 
     while ( flag < flag_limit )
     {
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 59387da..a9a1a94 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -1325,7 +1325,7 @@
     /* read the font data and set up the internal representation */
     /* if not already done                                       */
 
-    if ( face->blend == NULL )
+    if ( !face->blend )
     {
       FT_TRACE2(( "FVAR " ));
 
@@ -1469,7 +1469,7 @@
 
     /* fill the output array if requested */
 
-    if ( master != NULL )
+    if ( master )
     {
       FT_UInt  n;
 
@@ -1567,7 +1567,7 @@
 
     face->doblend = FALSE;
 
-    if ( face->blend == NULL )
+    if ( !face->blend )
     {
       if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
         goto Exit;
@@ -1603,11 +1603,11 @@
 
     FT_TRACE5(( "\n" ));
 
-    if ( !face->isCFF2 && blend->glyphoffsets == NULL )
+    if ( !face->isCFF2 && !blend->glyphoffsets )
       if ( FT_SET_ERROR( ft_var_load_gvar( face ) ) )
         goto Exit;
 
-    if ( blend->normalizedcoords == NULL )
+    if ( !blend->normalizedcoords )
     {
       if ( FT_NEW_ARRAY( blend->normalizedcoords, mmvar->num_axis ) )
         goto Exit;
@@ -1653,7 +1653,7 @@
 
     face->doblend = TRUE;
 
-    if ( face->cvt != NULL )
+    if ( face->cvt )
     {
       switch ( manageCvt )
       {
@@ -1718,7 +1718,7 @@
     FT_UInt   i, nc;
 
 
-    if ( face->blend == NULL )
+    if ( !face->blend )
     {
       if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
         return error;
@@ -1783,7 +1783,7 @@
     FT_Memory       memory = face->root.memory;
 
 
-    if ( face->blend == NULL )
+    if ( !face->blend )
     {
       if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
         goto Exit;
@@ -1849,7 +1849,7 @@
     if ( !blend->avar_checked )
       ft_var_load_avar( face );
 
-    if ( blend->avar_segment != NULL )
+    if ( blend->avar_segment )
     {
       FT_TRACE5(( "normalized design coordinates"
                   " before applying `avar' data:\n" ));
@@ -1950,7 +1950,7 @@
 
     FT_TRACE2(( "CVAR " ));
 
-    if ( blend == NULL )
+    if ( !blend )
     {
       FT_TRACE2(( "\n"
                   "tt_face_vary_cvt: no blend specified\n" ));
@@ -1958,7 +1958,7 @@
       goto Exit;
     }
 
-    if ( face->cvt == NULL )
+    if ( !face->cvt )
     {
       FT_TRACE2(( "\n"
                   "tt_face_vary_cvt: no `cvt ' table\n" ));
@@ -2086,7 +2086,7 @@
                                              table_len,
                                              point_count == 0 ? face->cvt_size
                                                               : point_count );
-      if ( localpoints == NULL || deltas == NULL )
+      if ( !localpoints || !deltas )
         ; /* failure, ignore it */
 
       else if ( localpoints == ALL_POINTS )
@@ -2451,7 +2451,7 @@
     FT_Short    *deltas_x, *deltas_y;
 
 
-    if ( !face->doblend || blend == NULL )
+    if ( !face->doblend || !blend )
       return FT_THROW( Invalid_Argument );
 
     if ( glyph_index >= blend->gv_glyphcnt      ||
@@ -2597,7 +2597,7 @@
                                           point_count == 0 ? n_points
                                                            : point_count );
 
-      if ( points == NULL || deltas_y == NULL || deltas_x == NULL )
+      if ( !points || !deltas_y || !deltas_x )
         ; /* failure, ignore it */
 
       else if ( points == ALL_POINTS )
@@ -2818,7 +2818,7 @@
     GX_Blend   blend  = face->blend;
 
 
-    if ( blend != NULL )
+    if ( blend )
     {
       FT_UInt  i, num_axes;
 
@@ -2829,14 +2829,14 @@
       FT_FREE( blend->normalizedcoords );
       FT_FREE( blend->mmvar );
 
-      if ( blend->avar_segment != NULL )
+      if ( blend->avar_segment )
       {
         for ( i = 0; i < num_axes; i++ )
           FT_FREE( blend->avar_segment[i].correspondence );
         FT_FREE( blend->avar_segment );
       }
 
-      if ( blend->hvar_table != NULL )
+      if ( blend->hvar_table )
       {
         if ( blend->hvar_table->itemStore.varData )
         {
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 834784c..657598c 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -129,7 +129,7 @@
 
     coderange = &exec->codeRangeTable[range - 1];
 
-    FT_ASSERT( coderange->base != NULL );
+    FT_ASSERT( coderange->base );
 
     /* NOTE: Because the last instruction of a program may be a CALL */
     /*       which will return to the first byte *after* the code    */
@@ -1613,7 +1613,7 @@
 
     range = &exc->codeRangeTable[aRange - 1];
 
-    if ( range->base == NULL )     /* invalid coderange */
+    if ( !range->base )     /* invalid coderange */
     {
       exc->error = FT_THROW( Invalid_CodeRange );
       return FAILURE;
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index bbd843c..5c7f389 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -208,7 +208,7 @@
       kp++;
     }
 
-    if ( oldcharmap != NULL )
+    if ( oldcharmap )
       error = FT_Set_Charmap( t1_face, oldcharmap );
     if ( error )
       goto Exit;
@@ -309,14 +309,14 @@
       {
         t1_face->face_flags |= FT_FACE_FLAG_KERNING;
         face->afm_data       = fi;
-        fi = NULL;
+        fi                   = NULL;
       }
     }
 
     FT_FRAME_EXIT();
 
   Exit:
-    if ( fi != NULL )
+    if ( fi )
       T1_Done_Metrics( memory, fi );
 
     return error;
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 089ae0f..1e4907b 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -590,7 +590,7 @@
     FT_Error       error   = FT_Err_Ok;
 
 
-    if ( face->glyph == NULL )
+    if ( !face->glyph )
     {
       /* First glyph slot for this face */
       slot->ttslot = t42face->ttf_face->glyph;



reply via email to

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