libtool-patches
[Top][All Lists]
Advanced

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

Re: More NULL fixups for ltdl.c on branch1-4


From: Bob Friesenhahn
Subject: Re: More NULL fixups for ltdl.c on branch1-4
Date: Mon, 14 Oct 2002 12:59:21 -0500 (CDT)

On Mon, 14 Oct 2002, Albert Chin wrote:

> On Mon, Oct 14, 2002 at 12:15:06PM -0500, Bob Friesenhahn wrote:
> > I believe this is a bad patch.  Only 'char *' pointers may be assigned
> > to NULL (which is of type 'char *') without an explicit cast.
>
> Huh?
>   
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=e21413d0f4430dc2&seekm=1992May6.014929.21220%40leland.Stanford.EDU#link1
>
> I'm dealing only with C89 here. Maybe it's invalid K&R, dunno, but
> seems ok to me.

Many legacy systems were delivered with NULL defined as "(char*)0".
That makes it a portabily problem to assign NULL to anything but a
char* without an explicit cast.

Here is some verbage from K&R's ANSI C book which indicates that
changing from 0 to NULL should not necessary:

"Pointers and integers are not interchangeable.  Zero is the sole
exception: the constant zero may be assigned to a pointer, and a
pointer may be compared with the constant zero.  The symbolic constant
NULL is often used as a mnemonic to indicate more clearly that this is
a special value for a pointer".

Of course, this (and ANSI C) says that your updates are ok (but not
necessary either).  The original K&R says that it is valid to assign 0
to any pointer.

Why is it that you want to change the code from using '0' to 'NULL'?

Bob

>
> > Bob
> >
> > On Mon, 14 Oct 2002, Albert Chin wrote:
> >
> > > 2002-10-12  Albert Chin-A-Young  <address@hidden>
> > >
> > >   * libltdl/ltdl.c: Init char * to NULL, not 0. And, for
> > >     some char * values, set *[var] = 0 to *[var] = '\0'.
> > >
> > > Hopefully this covers all uses of [ptr] = 0.
> > >
> > > --
> > > albert chin (address@hidden)
> > >
> > > -- snip snip
> > > Index: libltdl/ltdl.c
> > > ===================================================================
> > > RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
> > > retrieving revision 1.134.2.14
> > > diff -u -3 -p -r1.134.2.14 ltdl.c
> > > --- libltdl/ltdl.c        23 Jun 2002 21:47:20 -0000      1.134.2.14
> > > +++ libltdl/ltdl.c        14 Oct 2002 16:25:13 -0000
> > > @@ -209,7 +209,7 @@ static char *
> > >  strdup(str)
> > >       const char *str;
> > >  {
> > > -  char *tmp = 0;
> > > +  char *tmp = NULL;
> > >
> > >    if (str)
> > >      {
> > > @@ -238,9 +238,9 @@ strcmp (str1, str2)
> > >  {
> > >    if (str1 == str2)
> > >      return 0;
> > > -  if (str1 == 0)
> > > +  if (str1 == NULL)
> > >      return -1;
> > > -  if (str2 == 0)
> > > +  if (str2 == NULL)
> > >      return 1;
> > >
> > >    for (;*str1 && *str2; ++str1, ++str2)
> > > @@ -294,7 +294,7 @@ strrchr(str, ch)
> > >       const char *str;
> > >       int ch;
> > >  {
> > > -  const char *p, *q = 0;
> > > +  const char *p, *q = NULL;
> > >
> > >    for (p = str; *p != LT_EOS_CHAR; ++p)
> > >      {
> > > @@ -390,14 +390,14 @@ realloc (ptr, size)
> > >    if (size == 0)
> > >      {
> > >        /* For zero or less bytes, free the original memory */
> > > -      if (ptr != 0)
> > > +      if (ptr != NULL)
> > >   {
> > >     lt_dlfree (ptr);
> > >   }
> > >
> > >        return (lt_ptr) 0;
> > >      }
> > > -  else if (ptr == 0)
> > > +  else if (ptr == NULL)
> > >      {
> > >        /* Allow reallocation of a NULL pointer.  */
> > >        return lt_dlmalloc (size);
> > > @@ -476,7 +476,7 @@ argz_create_sep (str, delim, pargz, parg
> > >       size_t *pargz_len;
> > >  {
> > >    size_t argz_len;
> > > -  char *argz = 0;
> > > +  char *argz = NULL;
> > >
> > >    assert (str);
> > >    assert (pargz);
> > > @@ -757,11 +757,11 @@ static      const char      sys_search_path[]       
> > > = LT
> > >
> > >  /* The mutex functions stored here are global, and are necessarily the
> > >     same for all threads that wish to share access to libltdl.  */
> > > -static   lt_dlmutex_lock     *lt_dlmutex_lock_func     = 0;
> > > -static   lt_dlmutex_unlock   *lt_dlmutex_unlock_func   = 0;
> > > -static   lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0;
> > > -static   lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0;
> > > -static   const char          *lt_dllast_error          = 0;
> > > +static   lt_dlmutex_lock     *lt_dlmutex_lock_func     = NULL;
> > > +static   lt_dlmutex_unlock   *lt_dlmutex_unlock_func   = NULL;
> > > +static   lt_dlmutex_seterror *lt_dlmutex_seterror_func = NULL;
> > > +static   lt_dlmutex_geterror *lt_dlmutex_geterror_func = NULL;
> > > +static   const char          *lt_dllast_error          = NULL;
> > >
> > >
> > >  /* Either set or reset the mutex functions.  Either all the arguments 
> > > must
> > > @@ -810,7 +810,7 @@ lt_dlmutex_register (lock, unlock, seter
> > >  /* --- ERROR HANDLING --- */
> > >
> > >
> > > -static   const char    **user_error_strings      = 0;
> > > +static   const char    **user_error_strings      = NULL;
> > >  static   int             errorcount              = LT_ERROR_MAX;
> > >
> > >  int
> > > @@ -819,7 +819,7 @@ lt_dladderror (diagnostic)
> > >  {
> > >    int            errindex = 0;
> > >    int            result   = -1;
> > > -  const char  **temp     = (const char **) 0;
> > > +  const char  **temp     = NULL;
> > >
> > >    assert (diagnostic);
> > >
> > > @@ -1131,7 +1131,7 @@ sys_shl_sym (loader_data, module, symbol
> > >       lt_module module;
> > >       const char *symbol;
> > >  {
> > > -  lt_ptr address = 0;
> > > +  lt_ptr address = NULL;
> > >
> > >    /* sys_shl_open should never return a NULL module handle */
> > >    if (module == (lt_module) 0)
> > > @@ -1175,16 +1175,16 @@ sys_wll_open (loader_data, filename)
> > >       const char *filename;
> > >  {
> > >    lt_dlhandle    cur;
> > > -  lt_module      module     = 0;
> > > -  const char   *errormsg   = 0;
> > > -  char          *searchname = 0;
> > > +  lt_module      module     = NULL;
> > > +  const char   *errormsg   = NULL;
> > > +  char          *searchname = NULL;
> > >    char          *ext;
> > >    char           self_name_buf[MAX_PATH];
> > >
> > >    if (!filename)
> > >      {
> > >        /* Get the name of main module */
> > > -      *self_name_buf = 0;
> > > +      *self_name_buf = '\0';
> > >        GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf));
> > >        filename = ext = self_name_buf;
> > >      }
> > > @@ -1234,7 +1234,7 @@ sys_wll_open (loader_data, filename)
> > >      {
> > >        if (!cur->module)
> > >   {
> > > -   cur = 0;
> > > +   cur = NULL;
> > >     break;
> > >   }
> > >
> > > @@ -1250,7 +1250,7 @@ sys_wll_open (loader_data, filename)
> > >    if (cur || !module)
> > >      {
> > >        LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
> > > -      module = 0;
> > > +      module = NULL;
> > >      }
> > >
> > >    return module;
> > > @@ -1356,13 +1356,13 @@ sys_bedl_sym (loader_data, module, symbo
> > >       lt_module module;
> > >       const char *symbol;
> > >  {
> > > -  lt_ptr address = 0;
> > > +  lt_ptr address = NULL;
> > >    image_id image = (image_id) module;
> > >
> > >    if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != 
> > > B_OK)
> > >      {
> > >        LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
> > > -      address = 0;
> > > +      address = NULL;
> > >      }
> > >
> > >    return address;
> > > @@ -1399,7 +1399,7 @@ sys_dld_open (loader_data, filename)
> > >      {
> > >        LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
> > >        LT_DLFREE (module);
> > > -      module = 0;
> > > +      module = NULL;
> > >      }
> > >
> > >    return module;
> > > @@ -1461,8 +1461,8 @@ typedef struct lt_dlsymlists_t
> > >    const lt_dlsymlist            *syms;
> > >  } lt_dlsymlists_t;
> > >
> > > -static   const lt_dlsymlist     *default_preloaded_symbols       = 0;
> > > -static   lt_dlsymlists_t        *preloaded_symbols               = 0;
> > > +static   const lt_dlsymlist     *default_preloaded_symbols       = NULL;
> > > +static   lt_dlsymlists_t        *preloaded_symbols               = NULL;
> > >
> > >  static int
> > >  presym_init (loader_data)
> > > @@ -1472,7 +1472,7 @@ presym_init (loader_data)
> > >
> > >    LT_DLMUTEX_LOCK ();
> > >
> > > -  preloaded_symbols = 0;
> > > +  preloaded_symbols = NULL;
> > >    if (default_preloaded_symbols)
> > >      {
> > >        errors = lt_dlpreload (default_preloaded_symbols);
> > > @@ -1498,7 +1498,7 @@ presym_free_symlists ()
> > >        lists = lists->next;
> > >        LT_DLFREE (tmp);
> > >      }
> > > -  preloaded_symbols = 0;
> > > +  preloaded_symbols = NULL;
> > >
> > >    LT_DLMUTEX_UNLOCK ();
> > >
> > > @@ -1607,7 +1607,7 @@ presym_close (loader_data, module)
> > >       lt_module module;
> > >  {
> > >    /* Just to silence gcc -Wall */
> > > -  module = 0;
> > > +  module = NULL;
> > >    return 0;
> > >  }
> > >
> > > @@ -1710,9 +1710,9 @@ static      int     list_files_by_dir     LT_PARA
> > >                                            size_t *pargz_len));
> > >  static   int     file_not_found        LT_PARAMS((void));
> > >
> > > -static   char           *user_search_path= 0;
> > > -static   lt_dlloader    *loaders         = 0;
> > > -static   lt_dlhandle     handles         = 0;
> > > +static   char           *user_search_path= NULL;
> > > +static   lt_dlloader    *loaders         = NULL;
> > > +static   lt_dlhandle     handles         = NULL;
> > >  static   int             initialized     = 0;
> > >
> > >  /* Initialize libltdl. */
> > > @@ -1726,8 +1726,8 @@ lt_dlinit ()
> > >    /* Initialize only at first call. */
> > >    if (++initialized == 1)
> > >      {
> > > -      handles = 0;
> > > -      user_search_path = 0; /* empty search path */
> > > +      handles = NULL;
> > > +      user_search_path = NULL; /* empty search path */
> > >
> > >  #if HAVE_LIBDL && !defined(__CYGWIN__)
> > >        errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, 
> > > "dlopen");
> > > @@ -1862,7 +1862,7 @@ lt_dlexit ()
> > >
> > >     LT_DLMEM_REASSIGN (loader, next);
> > >   }
> > > -      loaders = 0;
> > > +      loaders = NULL;
> > >      }
> > >
> > >   done:
> > > @@ -1923,7 +1923,7 @@ tryall_dlopen (handle, filename)
> > >      }
> > >    else
> > >      {
> > > -      cur->info.filename = 0;
> > > +      cur->info.filename = NULL;
> > >      }
> > >
> > >    while (loader)
> > > @@ -1932,7 +1932,7 @@ tryall_dlopen (handle, filename)
> > >
> > >        cur->module = loader->module_open (data, filename);
> > >
> > > -      if (cur->module != 0)
> > > +      if (cur->module != NULL)
> > >   {
> > >     break;
> > >   }
> > > @@ -1963,7 +1963,7 @@ tryall_dlopen_module (handle, prefix, di
> > >       const char *dlname;
> > >  {
> > >    int      error = 0;
> > > -  char     *filename     = 0;
> > > +  char     *filename     = NULL;
> > >    size_t   filename_len  = 0;
> > >    size_t   dirname_len   = LT_STRLEN (dirname);
> > >
> > > @@ -1973,7 +1973,7 @@ tryall_dlopen_module (handle, prefix, di
> > >  #ifdef LT_DIRSEP_CHAR
> > >    /* Only canonicalized names (i.e. with DIRSEP chars already converted)
> > >       should make it into this function:  */
> > > -  assert (strchr (dirname, LT_DIRSEP_CHAR) == 0);
> > > +  assert (strchr (dirname, LT_DIRSEP_CHAR) == NULL);
> > >  #endif
> > >
> > >    if (dirname[dirname_len -1] == '/')
> > > @@ -2057,7 +2057,7 @@ canonicalize_path (path, pcanonical)
> > >       const char *path;
> > >       char **pcanonical;
> > >  {
> > > -  char *canonical = 0;
> > > +  char *canonical = NULL;
> > >
> > >    assert (path && *path);
> > >    assert (pcanonical);
> > > @@ -2161,9 +2161,9 @@ foreach_dirinpath (search_path, base_nam
> > >    int     filenamesize   = 0;
> > >    size_t lenbase = LT_STRLEN (base_name);
> > >    size_t argz_len        = 0;
> > > -  char *argz             = 0;
> > > -  char *filename = 0;
> > > -  char *canonical        = 0;
> > > +  char *argz             = NULL;
> > > +  char *filename = NULL;
> > > +  char *canonical        = NULL;
> > >
> > >    LT_DLMUTEX_LOCK ();
> > >
> > > @@ -2180,7 +2180,7 @@ foreach_dirinpath (search_path, base_nam
> > >      goto cleanup;
> > >
> > >    {
> > > -    char *dir_name = 0;
> > > +    char *dir_name = NULL;
> > >      while ((dir_name = argz_next (argz, argz_len, dir_name)))
> > >        {
> > >   size_t lendir = LT_STRLEN (dir_name);
> > > @@ -2247,7 +2247,7 @@ find_file_callback (filename, data1, dat
> > >
> > >        LT_DLFREE (*pdir);
> > >        *pdir   = lt_estrdup (filename);
> > > -      is_done = (*pdir == 0) ? -1 : 1;
> > > +      is_done = (*pdir == NULL) ? -1 : 1;
> > >      }
> > >
> > >    return is_done;
> > > @@ -2259,7 +2259,7 @@ find_file (search_path, base_name, pdir)
> > >       const char *base_name;
> > >       char **pdir;
> > >  {
> > > -  FILE *file = 0;
> > > +  FILE *file = NULL;
> > >
> > >    foreach_dirinpath (search_path, base_name, find_file_callback, pdir, 
> > > &file);
> > >
> > > @@ -2282,7 +2282,7 @@ find_handle_callback (filename, data, ig
> > >    /* Try to dlopen the file, but do not continue searching in any
> > >       case.  */
> > >    if (tryall_dlopen (handle, filename) != 0)
> > > -    *handle = 0;
> > > +    *handle = NULL;
> > >
> > >    return 1;
> > >  }
> > > @@ -2311,10 +2311,10 @@ load_deplibs (handle, deplibs)
> > >       char *deplibs;
> > >  {
> > >  #if LTDL_DLOPEN_DEPLIBS
> > > -  char   *p, *save_search_path = 0;
> > > +  char   *p, *save_search_path = NULL;
> > >    int   depcount = 0;
> > >    int    i;
> > > -  char   **names = 0;
> > > +  char   **names = NULL;
> > >  #endif
> > >    int    errors = 0;
> > >
> > > @@ -2350,7 +2350,7 @@ load_deplibs (handle, deplibs)
> > >     if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0)
> > >       {
> > >         char save = *end;
> > > -       *end = 0; /* set a temporary string terminator */
> > > +       *end = '\0'; /* set a temporary string terminator */
> > >         if (lt_dladdsearchdir(p+2))
> > >           {
> > >             goto cleanup;
> > > @@ -2407,7 +2407,7 @@ load_deplibs (handle, deplibs)
> > >       {
> > >         char *name;
> > >         char save = *end;
> > > -       *end = 0; /* set a temporary string terminator */
> > > +       *end = '\0'; /* set a temporary string terminator */
> > >         if (strncmp(p, "-l", 2) == 0)
> > >           {
> > >             size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2);
> > > @@ -2513,7 +2513,7 @@ trim (dest, str)
> > >      }
> > >    else
> > >      {
> > > -      *dest = 0;
> > > +      *dest = NULL;
> > >      }
> > >
> > >    return 0;
> > > @@ -2539,17 +2539,17 @@ try_dlopen (phandle, filename)
> > >       lt_dlhandle *phandle;
> > >       const char *filename;
> > >  {
> > > -  const char *   ext             = 0;
> > > -  const char *   saved_error     = 0;
> > > -  char * canonical       = 0;
> > > -  char * base_name       = 0;
> > > -  char * dir             = 0;
> > > -  char * name            = 0;
> > > +  const char *   ext             = NULL;
> > > +  const char *   saved_error     = NULL;
> > > +  char * canonical       = NULL;
> > > +  char * base_name       = NULL;
> > > +  char * dir             = NULL;
> > > +  char * name            = NULL;
> > >    int            errors          = 0;
> > >    lt_dlhandle    newhandle;
> > >
> > >    assert (phandle);
> > > -  assert (*phandle == 0);
> > > +  assert (*phandle == NULL);
> > >
> > >    LT_DLMUTEX_GETERROR (saved_error);
> > >
> > > @@ -2557,7 +2557,7 @@ try_dlopen (phandle, filename)
> > >    if (!filename)
> > >      {
> > >        *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
> > > -      if (*phandle == 0)
> > > +      if (*phandle == NULL)
> > >   return 1;
> > >
> > >        memset (*phandle, 0, sizeof(struct lt_dlhandle_struct));
> > > @@ -2614,12 +2614,12 @@ try_dlopen (phandle, filename)
> > >    if (ext && strcmp (ext, archive_ext) == 0)
> > >      {
> > >        /* this seems to be a libtool module */
> > > -      FILE *     file     = 0;
> > > -      char *     dlname   = 0;
> > > -      char *     old_name = 0;
> > > -      char *     libdir   = 0;
> > > -      char *     deplibs  = 0;
> > > -      char *    line      = 0;
> > > +      FILE *     file     = NULL;
> > > +      char *     dlname   = NULL;
> > > +      char *     old_name = NULL;
> > > +      char *     libdir   = NULL;
> > > +      char *     deplibs  = NULL;
> > > +      char *    line      = NULL;
> > >        size_t     line_len;
> > >
> > >        /* if we can't find the installed flag, it is probably an
> > > @@ -2782,7 +2782,7 @@ try_dlopen (phandle, filename)
> > >         errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]);
> > >         if (!errors
> > >             && dlname
> > > -           && (last_libname = strrchr (dlname, ' ')) != 0)
> > > +           && (last_libname = strrchr (dlname, ' ')) != NULL)
> > >           {
> > >             last_libname = lt_estrdup (last_libname + 1);
> > >             if (!last_libname)
> > > @@ -2803,7 +2803,7 @@ try_dlopen (phandle, filename)
> > >
> > >        /* allocate the handle */
> > >        *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
> > > -      if (*phandle == 0)
> > > +      if (*phandle == NULL)
> > >   ++errors;
> > >
> > >        if (errors)
> > > @@ -2847,7 +2847,7 @@ try_dlopen (phandle, filename)
> > >      {
> > >        /* not a libtool module */
> > >        *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
> > > -      if (*phandle == 0)
> > > +      if (*phandle == NULL)
> > >   {
> > >     ++errors;
> > >     goto cleanup;
> > > @@ -2914,7 +2914,7 @@ lt_dlhandle
> > >  lt_dlopen (filename)
> > >       const char *filename;
> > >  {
> > > -  lt_dlhandle handle = 0;
> > > +  lt_dlhandle handle = NULL;
> > >
> > >    /* Just incase we missed a code path in try_dlopen() that reports
> > >       an error, but forgets to reset handle... */
> > > @@ -2929,7 +2929,7 @@ lt_dlopen (filename)
> > >  static int
> > >  file_not_found ()
> > >  {
> > > -  const char *error = 0;
> > > +  const char *error = NULL;
> > >
> > >    LT_DLMUTEX_GETERROR (error);
> > >    if (error == LT_DLSTRERROR (FILE_NOT_FOUND))
> > > @@ -2946,9 +2946,9 @@ lt_dlhandle
> > >  lt_dlopenext (filename)
> > >       const char *filename;
> > >  {
> > > -  lt_dlhandle    handle          = 0;
> > > -  char * tmp             = 0;
> > > -  char * ext             = 0;
> > > +  lt_dlhandle    handle          = NULL;
> > > +  char * tmp             = NULL;
> > > +  char * ext             = NULL;
> > >    size_t len;
> > >    int            errors          = 0;
> > >
> > > @@ -3061,7 +3061,7 @@ lt_argz_insertinorder (pargz, pargz_len,
> > >       size_t *pargz_len;
> > >       const char *entry;
> > >  {
> > > -  char *before = 0;
> > > +  char *before = NULL;
> > >
> > >    assert (pargz);
> > >    assert (pargz_len);
> > > @@ -3086,9 +3086,9 @@ lt_argz_insertdir (pargz, pargz_len, dir
> > >       const char *dirnam;
> > >       struct dirent *dp;
> > >  {
> > > -  char   *buf        = 0;
> > > +  char   *buf        = NULL;
> > >    size_t buf_len    = 0;
> > > -  char   *end        = 0;
> > > +  char   *end        = NULL;
> > >    size_t end_offset = 0;
> > >    size_t dir_len    = 0;
> > >    int    errors      = 0;
> > > @@ -3151,7 +3151,7 @@ list_files_by_dir (dirnam, pargz, pargz_
> > >       char **pargz;
> > >       size_t *pargz_len;
> > >  {
> > > -  DIR    *dirp     = 0;
> > > +  DIR    *dirp     = NULL;
> > >    int    errors    = 0;
> > >
> > >    assert (dirnam && *dirnam);
> > > @@ -3162,7 +3162,7 @@ list_files_by_dir (dirnam, pargz, pargz_
> > >    dirp = opendir (dirnam);
> > >    if (dirp)
> > >      {
> > > -      struct dirent *dp  = 0;
> > > +      struct dirent *dp  = NULL;
> > >
> > >        while ((dp = readdir (dirp)))
> > >   if (dp->d_name[0] != '.')
> > > @@ -3193,7 +3193,7 @@ foreachfile_callback (dirname, data1, da
> > >   = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1;
> > >
> > >    int      is_done  = 0;
> > > -  char   *argz     = 0;
> > > +  char   *argz     = NULL;
> > >    size_t  argz_len = 0;
> > >
> > >    if (list_files_by_dir (dirname, &argz, &argz_len) != 0)
> > > @@ -3202,7 +3202,7 @@ foreachfile_callback (dirname, data1, da
> > >      goto cleanup;
> > >
> > >    {
> > > -    char *filename = 0;
> > > +    char *filename = NULL;
> > >      while ((filename = argz_next (argz, argz_len, filename)))
> > >        if ((is_done = (*func) (filename, data2)))
> > >   break;
> > > @@ -3446,8 +3446,8 @@ lt_dlpath_insertdir (ppath, before, dir)
> > >       const char *dir;
> > >  {
> > >    int    errors          = 0;
> > > -  char  *canonical       = 0;
> > > -  char  *argz            = 0;
> > > +  char  *canonical       = NULL;
> > > +  char  *argz            = NULL;
> > >    size_t argz_len        = 0;
> > >
> > >    assert (ppath);
> > > @@ -3462,13 +3462,13 @@ lt_dlpath_insertdir (ppath, before, dir)
> > >    assert (canonical && *canonical);
> > >
> > >    /* If *PPATH is empty, set it to DIR.  */
> > > -  if (*ppath == 0)
> > > +  if (*ppath == NULL)
> > >      {
> > >        assert (!before);          /* BEFORE cannot be set without PPATH.  
> > > */
> > >        assert (dir);              /* Without DIR, don't call this 
> > > function!  */
> > >
> > >        *ppath = lt_estrdup (dir);
> > > -      if (*ppath == 0)
> > > +      if (*ppath == NULL)
> > >   ++errors;
> > >
> > >        return errors;
> > > @@ -3702,7 +3702,7 @@ lt_dlcaller_set_data (key, handle, data)
> > >       lt_ptr data;
> > >  {
> > >    int n_elements = 0;
> > > -  lt_ptr stale = (lt_ptr) 0;
> > > +  lt_ptr stale = NULL;
> > >    int i;
> > >
> > >    /* This needs to be locked so that the caller data can be updated
> > > @@ -3731,7 +3731,7 @@ lt_dlcaller_set_data (key, handle, data)
> > >
> > >        if (!temp)
> > >   {
> > > -   stale = 0;
> > > +   stale = NULL;
> > >     goto done;
> > >   }
> > >
> > > @@ -3791,12 +3791,12 @@ lt_dlloader_add (place, dlloader, loader
> > >       const char *loader_name;
> > >  {
> > >    int errors = 0;
> > > -  lt_dlloader *node = 0, *ptr = 0;
> > > +  lt_dlloader *node = NULL, *ptr = NULL;
> > >
> > > -  if ((dlloader == 0)    /* diagnose null parameters */
> > > -      || (dlloader->module_open == 0)
> > > -      || (dlloader->module_close == 0)
> > > -      || (dlloader->find_sym == 0))
> > > +  if ((dlloader == NULL) /* diagnose null parameters */
> > > +      || (dlloader->module_open == NULL)
> > > +      || (dlloader->module_close == NULL)
> > > +      || (dlloader->find_sym == NULL))
> > >      {
> > >        LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
> > >        return 1;
> > > @@ -3807,7 +3807,7 @@ lt_dlloader_add (place, dlloader, loader
> > >    if (!node)
> > >      return 1;
> > >
> > > -  node->next             = 0;
> > > +  node->next             = NULL;
> > >    node->loader_name      = loader_name;
> > >    node->sym_prefix       = dlloader->sym_prefix;
> > >    node->dlloader_exit    = dlloader->dlloader_exit;
> > > @@ -3943,7 +3943,7 @@ const char *
> > >  lt_dlloader_name (place)
> > >       lt_dlloader *place;
> > >  {
> > > -  const char *name = 0;
> > > +  const char *name = NULL;
> > >
> > >    if (place)
> > >      {
> > > @@ -3963,7 +3963,7 @@ lt_user_data *
> > >  lt_dlloader_data (place)
> > >       lt_dlloader *place;
> > >  {
> > > -  lt_user_data *data = 0;
> > > +  lt_user_data *data = NULL;
> > >
> > >    if (place)
> > >      {
> > > @@ -3983,7 +3983,7 @@ lt_dlloader *
> > >  lt_dlloader_find (loader_name)
> > >       const char *loader_name;
> > >  {
> > > -  lt_dlloader *place = 0;
> > > +  lt_dlloader *place = NULL;
> > >
> > >    LT_DLMUTEX_LOCK ();
> > >    for (place = loaders; place; place = place->next)
> > >
> > >
> > > _______________________________________________
> > > Libtool-patches mailing list
> > > address@hidden
> > > http://mail.gnu.org/mailman/listinfo/libtool-patches
> > >
> >
> > ======================================
> > Bob Friesenhahn
> > address@hidden
> > http://www.simplesystems.org/users/bfriesen
> >
> >
> >
> > _______________________________________________
> > Libtool-patches mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/libtool-patches
>
> --
> albert chin (address@hidden)
>
>
> _______________________________________________
> Libtool-patches mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/libtool-patches
>

======================================
Bob Friesenhahn
address@hidden
http://www.simplesystems.org/users/bfriesen





reply via email to

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