VirtualBox

Changeset 104485 in vbox


Ignore:
Timestamp:
May 2, 2024 4:28:55 PM (9 months ago)
Author:
vboxsync
Message:

libs/xpcom/typelib: Some cleanups, bugref:3409

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

Legend:

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

    r103977 r104485  
    253253    fputs(" {\n"
    254254          " public: \n\n", state->file);
    255     if (iid) {
    256         fputs("  NS_DEFINE_STATIC_IID_ACCESSOR(", state->file);
    257         write_classname_iid_define(state->file, className);
    258         fputs(")\n\n", state->file);
    259     }
     255
     256    fputs("  NS_DEFINE_STATIC_IID_ACCESSOR(", state->file);
     257    write_classname_iid_define(state->file, className);
     258    fputs(")\n\n", state->file);
    260259
    261260    orig = state->tree; /* It would be nice to remove this state-twiddling. */
     
    11371136    const char *desc = IDL_CODEFRAG(state->tree).desc;
    11381137    GSList *lines = IDL_CODEFRAG(state->tree).lines;
    1139     guint fragment_length;
    1140    
     1138
    11411139    if (strcmp(desc, "C++") && /* libIDL bug? */ strcmp(desc, "C++\r")) {
    11421140        XPIDL_WARNING((state->tree, IDL_WARNING1,
     
    11551153     * we backtrack to get the proper line for the beginning of the block.
    11561154     */
    1157     /*
    1158      * Looks like getting this right means maintaining an accurate line
    1159      * count of everything generated, so we can set the file back to the
    1160      * correct line in the generated file afterwards.  Skipping for now...
    1161      */
    1162 
    1163     fragment_length = g_slist_length(lines);
    1164 /*      fprintf(state->file, "#line %d \"%s\"\n", */
    1165 /*              state->tree->_line - fragment_length - 1, */
    1166 /*              state->tree->_file); */
    1167 
    11681155    g_slist_foreach(lines, write_codefrag_line, (gpointer)state);
    11691156
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_typelib.c

    r103505 r104485  
    130130{
    131131    TreeState *state = user_data;
    132     IDL_tree up;
    133132    if (IDL_NODE_TYPE(tfd->tree) == IDLN_IDENT) {
    134         IDL_tree_type node_type = IDL_NODE_TYPE((up = IDL_NODE_UP(tfd->tree)));
     133        IDL_tree_type node_type = IDL_NODE_TYPE(IDL_NODE_UP(tfd->tree));
    135134        if (node_type == IDLN_INTERFACE || node_type == IDLN_FORWARD_DCL) {
    136135
     
    168167#endif
    169168            }
    170         } else {
    171 #ifdef DEBUG_shaver_ifaces
    172             fprintf(stderr, "ident %s isn't an interface (%s)\n",
    173                     IDL_IDENT(tfd->tree).str, IDL_NODE_TYPE_NAME(up));
    174 #endif
    175169        }
    176170    }
     
    278272    const XPTInterfaceDirectoryEntry *a = ap, *b = bp;
    279273    const nsID *aid = &a->iid, *bid = &b->iid;
    280     const char *ans, *bns;
    281274
    282275    int i;
     
    289282        COMPARE(m3[i]);
    290283    }
    291 
    292     /* defend against NULL name_space by using empty string. */
    293     ans = a->name_space ? a->name_space : "";
    294     bns = b->name_space ? b->name_space : "";
    295284
    296285    if (a->name_space && b->name_space) {
     
    848837                break;
    849838              }
    850               case IDLN_NATIVE: {
    851                   char *ident;
     839              case IDLN_NATIVE:
     840              {
    852841
    853842                  /* jband - adding goto for iid_is when type is native */
     
    857846                      goto handle_iid_is;
    858847
    859                   ident = IDL_IDENT(type).str;
    860848                  if (IDL_tree_property_get(type, "nsid")) {
    861849                      td->prefix.flags = TD_PNSIID;
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_struct.c

    r103505 r104485  
    280280     * the stack on large xpt files.
    281281     */
    282     ann = next = header->annotations;
     282    next = header->annotations;
    283283    annp = &header->annotations;
    284284    do {
     
    937937
    938938static XPT_TYPELIB_VERSIONS_STRUCT versions[] = XPT_TYPELIB_VERSIONS;
    939 #define XPT_TYPELIB_VERSIONS_COUNT (sizeof(versions) / sizeof(versions[0]))
    940939
    941940XPT_PUBLIC_API(PRUint16)
    942941XPT_ParseVersionString(const char* str, PRUint8* major, PRUint8* minor)
    943942{
    944     int i;
    945     for (i = 0; i < XPT_TYPELIB_VERSIONS_COUNT; i++) {
     943    for (uint32_t i = 0; i < RT_ELEMENTS(versions); i++) {
    946944        if (!strcmp(versions[i].str, str)) {
    947945            *major = versions[i].major;
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_xdr.c

    r49491 r104485  
    214214    XPT_DELETE(arena, state);
    215215 err_free_arena:
    216     if (arena)
    217         XPT_DestroyArena(arena);
     216    XPT_DestroyArena(arena);
    218217    return NULL;
    219218}
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_link.c

    r103114 r104485  
    240240           
    241241            state = XPT_NewXDRState(XPT_DECODE, whole, flen);
     242            if (!state)
     243            {
     244                fprintf(stdout, "XPT_NewXDRState failed for %s\n", name);
     245                return 1;
     246            }
    242247            if (!XPT_MakeCursor(state, XPT_HEADER, 0, cursor)) {
    243248                fprintf(stdout, "XPT_MakeCursor failed for %s\n", name);
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