* linker now sorts based on IIDs
* xpt_dump no longer complains about md->result if it is of the correct retval type
This commit is contained in:
coop%netscape.com 1999-03-08 21:13:58 +00:00
Родитель df77619c4a
Коммит 244b59ee4f
4 изменённых файлов: 82 добавлений и 40 удалений

Просмотреть файл

@ -74,7 +74,8 @@ XPT_DumpXPTString(XPTString *str);
PRBool
XPT_DumpParamDescriptor(XPTHeader *header, XPTParamDescriptor *pd,
const int indent, PRBool verbose_mode);
const int indent, PRBool verbose_mode,
PRBool is_result);
PRBool
XPT_DumpTypeDescriptor(XPTTypeDescriptor *td, int indent,
@ -174,8 +175,8 @@ main(int argc, char **argv)
if (param_problems) {
fprintf(stdout, "\nWARNING: ParamDescriptors are present with "
"no in/out flag information.\nThese have been marked "
"with 'XXX'.\n");
"bad in/out/retval flag information.\nThese have been marked "
"with 'XXX'.\nRemember, retval params should always be marked as out!\n");
}
XPT_DestroyXDRState(state);
@ -471,13 +472,13 @@ XPT_DumpMethodDescriptor(XPTHeader *header, XPTMethodDescriptor *md,
fprintf(stdout, "%*sParameter #%d:\n", new_indent, " ", i);
if (!XPT_DumpParamDescriptor(header, &md->params[i], more_indent,
verbose_mode))
verbose_mode, PR_FALSE))
return PR_FALSE;
}
fprintf(stdout, "%*sResult:\n", indent, " ");
if (!XPT_DumpParamDescriptor(header, md->result, new_indent,
verbose_mode)) {
verbose_mode, PR_TRUE)) {
return PR_FALSE;
}
} else {
@ -565,13 +566,29 @@ XPT_DumpXPTString(XPTString *str)
PRBool
XPT_DumpParamDescriptor(XPTHeader *header, XPTParamDescriptor *pd,
const int indent, PRBool verbose_mode)
const int indent, PRBool verbose_mode,
PRBool is_result)
{
int new_indent = indent + BASE_INDENT;
if (!XPT_PD_IS_IN(pd->flags) && !XPT_PD_IS_OUT(pd->flags)) {
if (!XPT_PD_IS_IN(pd->flags) &&
!XPT_PD_IS_OUT(pd->flags) &&
XPT_PD_IS_RETVAL(pd->flags)) {
param_problems = PR_TRUE;
fprintf(stdout, "XXX\n");
} else {
if (!XPT_PD_IS_IN(pd->flags) && !XPT_PD_IS_OUT(pd->flags)) {
if (is_result) {
if (XPT_TDP_TAG(pd->type.prefix) != TD_UINT32 &&
XPT_TDP_TAG(pd->type.prefix) != TD_VOID) {
param_problems = PR_TRUE;
fprintf(stdout, "XXX\n");
}
} else {
param_problems = PR_TRUE;
fprintf(stdout, "XXX\n");
}
}
}
fprintf(stdout, "%*sIn Param? ", indent, " ");

Просмотреть файл

@ -32,10 +32,8 @@
#endif
/* Forward declarations. */
int compare_IDEs_by_IID(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2);
int compare_IDEs_by_name(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2);
static int compare_IDEs_by_IID(const void *ap, const void *bp);
static int compare_IDEs_by_name(const void *ap, const void *bp);
static int compare_IIDs(const void *ap, const void *bp);
PRBool copy_IDE(XPTInterfaceDirectoryEntry *from,
XPTInterfaceDirectoryEntry *to);
@ -143,6 +141,11 @@ main(int argc, char **argv)
}
}
qsort(IDE_array,
numberOfInterfaces,
sizeof(XPTInterfaceDirectoryEntry),
compare_IDEs_by_IID);
header = XPT_NewHeader(numberOfInterfaces);
ann = XPT_NewAnnotation(XPT_ANN_LAST, NULL, NULL);
header->annotations = ann;
@ -195,20 +198,21 @@ main(int argc, char **argv)
return 0;
}
int
compare_IDEs_by_IID(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2)
static int
compare_IDEs_by_IID(const void *ap,
const void *bp)
{
nsID *one = &ide1->iid;
nsID *two = &ide2->iid;
const XPTInterfaceDirectoryEntry *ide1 = ap, *ide2 = bp;
return compare_IIDs(one, two);
return compare_IIDs(&ide1->iid, &ide2->iid);
}
int
compare_IDEs_by_name(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2)
static int
compare_IDEs_by_name(const void *ap,
const void *bp)
{
const XPTInterfaceDirectoryEntry *ide1 = ap, *ide2 = bp;
return strcmp(ide1->name, ide2->name);
}

Просмотреть файл

@ -74,7 +74,8 @@ XPT_DumpXPTString(XPTString *str);
PRBool
XPT_DumpParamDescriptor(XPTHeader *header, XPTParamDescriptor *pd,
const int indent, PRBool verbose_mode);
const int indent, PRBool verbose_mode,
PRBool is_result);
PRBool
XPT_DumpTypeDescriptor(XPTTypeDescriptor *td, int indent,
@ -174,8 +175,8 @@ main(int argc, char **argv)
if (param_problems) {
fprintf(stdout, "\nWARNING: ParamDescriptors are present with "
"no in/out flag information.\nThese have been marked "
"with 'XXX'.\n");
"bad in/out/retval flag information.\nThese have been marked "
"with 'XXX'.\nRemember, retval params should always be marked as out!\n");
}
XPT_DestroyXDRState(state);
@ -471,13 +472,13 @@ XPT_DumpMethodDescriptor(XPTHeader *header, XPTMethodDescriptor *md,
fprintf(stdout, "%*sParameter #%d:\n", new_indent, " ", i);
if (!XPT_DumpParamDescriptor(header, &md->params[i], more_indent,
verbose_mode))
verbose_mode, PR_FALSE))
return PR_FALSE;
}
fprintf(stdout, "%*sResult:\n", indent, " ");
if (!XPT_DumpParamDescriptor(header, md->result, new_indent,
verbose_mode)) {
verbose_mode, PR_TRUE)) {
return PR_FALSE;
}
} else {
@ -565,13 +566,29 @@ XPT_DumpXPTString(XPTString *str)
PRBool
XPT_DumpParamDescriptor(XPTHeader *header, XPTParamDescriptor *pd,
const int indent, PRBool verbose_mode)
const int indent, PRBool verbose_mode,
PRBool is_result)
{
int new_indent = indent + BASE_INDENT;
if (!XPT_PD_IS_IN(pd->flags) && !XPT_PD_IS_OUT(pd->flags)) {
if (!XPT_PD_IS_IN(pd->flags) &&
!XPT_PD_IS_OUT(pd->flags) &&
XPT_PD_IS_RETVAL(pd->flags)) {
param_problems = PR_TRUE;
fprintf(stdout, "XXX\n");
} else {
if (!XPT_PD_IS_IN(pd->flags) && !XPT_PD_IS_OUT(pd->flags)) {
if (is_result) {
if (XPT_TDP_TAG(pd->type.prefix) != TD_UINT32 &&
XPT_TDP_TAG(pd->type.prefix) != TD_VOID) {
param_problems = PR_TRUE;
fprintf(stdout, "XXX\n");
}
} else {
param_problems = PR_TRUE;
fprintf(stdout, "XXX\n");
}
}
}
fprintf(stdout, "%*sIn Param? ", indent, " ");

Просмотреть файл

@ -32,10 +32,8 @@
#endif
/* Forward declarations. */
int compare_IDEs_by_IID(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2);
int compare_IDEs_by_name(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2);
static int compare_IDEs_by_IID(const void *ap, const void *bp);
static int compare_IDEs_by_name(const void *ap, const void *bp);
static int compare_IIDs(const void *ap, const void *bp);
PRBool copy_IDE(XPTInterfaceDirectoryEntry *from,
XPTInterfaceDirectoryEntry *to);
@ -143,6 +141,11 @@ main(int argc, char **argv)
}
}
qsort(IDE_array,
numberOfInterfaces,
sizeof(XPTInterfaceDirectoryEntry),
compare_IDEs_by_IID);
header = XPT_NewHeader(numberOfInterfaces);
ann = XPT_NewAnnotation(XPT_ANN_LAST, NULL, NULL);
header->annotations = ann;
@ -195,20 +198,21 @@ main(int argc, char **argv)
return 0;
}
int
compare_IDEs_by_IID(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2)
static int
compare_IDEs_by_IID(const void *ap,
const void *bp)
{
nsID *one = &ide1->iid;
nsID *two = &ide2->iid;
const XPTInterfaceDirectoryEntry *ide1 = ap, *ide2 = bp;
return compare_IIDs(one, two);
return compare_IIDs(&ide1->iid, &ide2->iid);
}
int
compare_IDEs_by_name(XPTInterfaceDirectoryEntry *ide1,
XPTInterfaceDirectoryEntry *ide2)
static int
compare_IDEs_by_name(const void *ap,
const void *bp)
{
const XPTInterfaceDirectoryEntry *ide1 = ap, *ide2 = bp;
return strcmp(ide1->name, ide2->name);
}