VirtualBox

Changeset 62449 in vbox for trunk/src/libs/xpcom18a4/xpcom


Ignore:
Timestamp:
Jul 22, 2016 2:54:18 PM (8 years ago)
Author:
vboxsync
Message:

src/libs/xpcom: drop using the deprecated g_basename() function and use g_path_get_basename() instead

Location:
trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.h

    r29118 r62449  
    165165
    166166/*
    167  * Return a pointer to the start of the base filename of path
    168  */
    169 const char *
     167 * Return a newly allocated string to the start of the base filename of path.
     168 * Free with g_free().
     169 */
     170char *
    170171xpidl_basename(const char * path);
    171172
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_header.c

    r1 r62449  
    6161header_prolog(TreeState *state)
    6262{
    63     const char *define = xpidl_basename(state->basename);
     63    char *define = xpidl_basename(state->basename);
    6464    fprintf(state->file, "/*\n * DO NOT EDIT.  THIS FILE IS GENERATED FROM"
    6565            " %s.idl\n */\n", state->basename);
     
    6868            "#define __gen_%s_h__\n",
    6969            define, define);
     70    g_free(define);
    7071    if (state->base_includes != NULL) {
    7172        guint len = g_slist_length(state->base_includes);
     
    117118header_epilog(TreeState *state)
    118119{
    119     const char *define = xpidl_basename(state->basename);
     120    char *define = xpidl_basename(state->basename);
    120121    fprintf(state->file, "\n#endif /* __gen_%s_h__ */\n", define);
     122    g_free(define);
    121123    return TRUE;
    122124}
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_idl.c

    r62265 r62449  
    733733    if (strcmp(outname, "-")) {
    734734        const char *fopen_mode;
    735         const char *out_basename;
     735        char *out_basename;
    736736
    737737        /* explicit_output_filename can't be true without a filename */
     
    753753#endif
    754754            real_outname = g_strdup_printf("%s.%s", out_basename, mode->suffix);
     755            if (out_basename != outname)
     756                g_free(out_basename);
    755757        }
    756758
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_java.c

    r29724 r62449  
    9898            "\n"
    9999            , ext - basename >= 19 ? 19 : (int)(ext - basename), basename);
     100    g_free(basename);
    100101#else
    101102    fputs("/*\n * ************* DO NOT EDIT THIS FILE ***********\n",
     
    358359            java_prolog(state);
    359360        }
     361        g_free(basename);
    360362    }
    361363
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c

    r40504 r62449  
    833833 * Return a pointer to the start of the base filename of path
    834834 */
    835 const char *
     835char *
    836836xpidl_basename(const char * path)
    837837{
    838     const char * result = g_basename(path);
     838    char * result = g_path_get_basename(path);
    839839    /*
    840840     *If this is windows then we'll handle either / or \ as a separator
     
    842842     */
    843843#if defined(XP_WIN32)
     844# error adapt regarding g_basename() vs. g_path_get_basename()!
    844845    const char * slash = strrchr(path, '/');
    845846    /* If we found a slash and its after the current default OS separator */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette