我收到此错误并且无法修复,我还是菜鸟,如果有人可以帮助我,我会感谢您此代码来自 libxenon 的 xmplayer(用于 jtag xbox)
(我尝试搜索类似的错误,但我找不到问题所在)
int FileSortCallback(const void *f1, const void *f2) {
/* Special case for implicit directories */
if (((BROWSERENTRY *) f1)->filename[0] == '.' || ((BROWSERENTRY *) f2)->filename[0] == '.') {
if (strcmp(((BROWSERENTRY *) f1)->filename, ".") == 0) {
return -1;
}
if (strcmp(((BROWSERENTRY *) f2)->filename, ".") == 0) {
return 1;
}
if (strcmp(((BROWSERENTRY *) f1)->filename, "..") == 0) {
return -1;
}
if (strcmp(((BROWSERENTRY *) f2)->filename, "..") == 0) {
return 1;
}
}
/* If one is a file and one is a directory the directory is first. */
if (((BROWSERENTRY *) f1)->isdir && !(((BROWSERENTRY *) f2)->isdir)) return -1;
if (!(((BROWSERENTRY *) f1)->isdir) && ((BROWSERENTRY *) f2)->isdir) return 1;
//Ascending Name
if (XMPlayerCfg.sort_order == 0) {
return stricmp(((BROWSERENTRY *) f1)->filename, ((BROWSERENTRY *) f2)->filename);
}
//Descending Name
else if (XMPlayerCfg.sort_order == 1) {
return stricmp(((BROWSERENTRY *) f2)->filename, ((BROWSERENTRY *) f1)->filename);
}
//Date Ascending
else if (XMPlayerCfg.sort_order == 2) {
if ( ((BROWSERENTRY *) f2)->date == ((BROWSERENTRY *) f1)->date) { //if date is the same order by filename
return stricmp(((BROWSERENTRY *) f2)->filename, ((BROWSERENTRY *) f1)->filename);
} else {
return ((BROWSERENTRY *) f1)->date - ((BROWSERENTRY *) f2)->date;
}
}
//Date Descending
else if (XMPlayerCfg.sort_order == 3) {
if ( ((BROWSERENTRY *) f2)->date == ((BROWSERENTRY *) f1)->date) { //if date is the same order by filename
return stricmp(((BROWSERENTRY *) f1)->filename, ((BROWSERENTRY *) f2)->filename);
} else {
return ((BROWSERENTRY *) f2)->date - ((BROWSERENTRY *) f1)->date;
}
}
}