Skip to content
Snippets Groups Projects
Commit 03aa4ef0 authored by deuce's avatar deuce
Browse files

Fix sorting of integer values on LE platforms.

parent 8d39c3db
No related branches found
No related tags found
No related merge requests found
...@@ -40,127 +40,127 @@ struct sort_order_info sort_order[] = { ...@@ -40,127 +40,127 @@ struct sort_order_info sort_order[] = {
"BBS Name" "BBS Name"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, name) ,offsetof(struct bbslist, name)
,LIST_NAME_MAX+1 ,sizeof((struct bbslist *)NULL->name)
} }
,{ ,{
"Date Added" "Date Added"
,SORT_ORDER_REVERSED ,SORT_ORDER_REVERSED
,offsetof(struct bbslist, added) ,offsetof(struct bbslist, added)
,sizeof(time_t) ,sizeof((struct bbslist *)NULL->added)
} }
,{ ,{
"Date Last Connected" "Date Last Connected"
,SORT_ORDER_REVERSED ,SORT_ORDER_REVERSED
,offsetof(struct bbslist, connected) ,offsetof(struct bbslist, connected)
,sizeof(time_t) ,sizeof((struct bbslist *)NULL->connected)
} }
,{ ,{
"Total Calls" "Total Calls"
,SORT_ORDER_REVERSED ,SORT_ORDER_REVERSED
,offsetof(struct bbslist, calls) ,offsetof(struct bbslist, calls)
,sizeof(unsigned int) ,sizeof((struct bbslist *)NULL->calls)
} }
,{ ,{
"Dialing List" "Dialing List"
,0 ,0
,offsetof(struct bbslist, type) ,offsetof(struct bbslist, type)
,sizeof(int) ,sizeof((struct bbslist *)NULL->type)
} }
,{ ,{
"Address" "Address"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, addr) ,offsetof(struct bbslist, addr)
,LIST_NAME_MAX+1 ,sizeof((struct bbslist *)NULL->addr)
} }
,{ ,{
"Port" "Port"
,0 ,0
,offsetof(struct bbslist, port) ,offsetof(struct bbslist, port)
,sizeof(short unsigned int) ,sizeof((struct bbslist *)NULL->port)
} }
,{ ,{
"Username" "Username"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, user) ,offsetof(struct bbslist, user)
,MAX_USER_LEN+1 ,sizeof((struct bbslist *)NULL->user)
} }
,{ ,{
"Password" "Password"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, password) ,offsetof(struct bbslist, password)
,MAX_PASSWD_LEN+1 ,sizeof((struct bbslist *)NULL->password)
} }
,{ ,{
"System Password" "System Password"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, syspass) ,offsetof(struct bbslist, syspass)
,MAX_SYSPASS_LEN+1 ,sizeof((struct bbslist *)NULL->syspass)
} }
,{ ,{
"Connection Type" "Connection Type"
,0 ,0
,offsetof(struct bbslist, conn_type) ,offsetof(struct bbslist, conn_type)
,sizeof(int) ,sizeof((struct bbslist *)NULL->conn_type)
} }
,{ ,{
"Reversed" "Reversed"
,0 ,0
,offsetof(struct bbslist, reversed) ,offsetof(struct bbslist, reversed)
,sizeof(int) ,sizeof((struct bbslist *)NULL->reversed)
} }
,{ ,{
"Screen Mode" "Screen Mode"
,0 ,0
,offsetof(struct bbslist, screen_mode) ,offsetof(struct bbslist, screen_mode)
,sizeof(int) ,sizeof((struct bbslist *)NULL->screen_mode)
} }
,{ ,{
"Status Line Visibility" "Status Line Visibility"
,0 ,0
,offsetof(struct bbslist, nostatus) ,offsetof(struct bbslist, nostatus)
,sizeof(int) ,sizeof((struct bbslist *)NULL->nostatus)
} }
,{ ,{
"Dowload Directory" "Download Directory"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, dldir) ,offsetof(struct bbslist, dldir)
,MAX_PATH+1 ,sizeof((struct bbslist *)NULL->dldir)
} }
,{ ,{
"Upload Directory" "Upload Directory"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, uldir) ,offsetof(struct bbslist, uldir)
,MAX_PATH+1 ,sizeof((struct bbslist *)NULL->uldir)
} }
,{ ,{
"Log File" "Log File"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, logfile) ,offsetof(struct bbslist, logfile)
,MAX_PATH+1 ,sizeof((struct bbslist *)NULL->logfile)
} }
,{ ,{
"Transfer Log Level" "Transfer Log Level"
,0 ,0
,offsetof(struct bbslist, xfer_loglevel) ,offsetof(struct bbslist, xfer_loglevel)
,sizeof(int) ,sizeof((struct bbslist *)NULL->xfer_loglevel)
} }
,{ ,{
"BPS Rate" "BPS Rate"
,0 ,0
,offsetof(struct bbslist, bpsrate) ,offsetof(struct bbslist, bpsrate)
,sizeof(int) ,sizeof((struct bbslist *)NULL->bpsrate)
} }
,{ ,{
"ANSI Music" "ANSI Music"
,0 ,0
,offsetof(struct bbslist, music) ,offsetof(struct bbslist, music)
,sizeof(int) ,sizeof((struct bbslist *)NULL->music)
} }
,{ ,{
"Font" "Font"
,SORT_ORDER_STRING ,SORT_ORDER_STRING
,offsetof(struct bbslist, font) ,offsetof(struct bbslist, font)
,80 ,sizeof((struct bbslist *)NULL->font)
} }
,{ ,{
NULL NULL
...@@ -313,6 +313,24 @@ int is_sorting(int chk) ...@@ -313,6 +313,24 @@ int is_sorting(int chk)
return(0); return(0);
} }
int intbufcmp(const void *a, const void *b, size_t size)
{
#ifdef __BIG_ENDIAN__
return(memcmp(a,b,size);
#else
int i;
int ret;
unsigned char *ac;
unsigned char *bc;
for(i=size-1; i>=0; i--) {
if(ac[i]!=bc[i])
return(ac[i]-bc[i]);
}
return(0);
#endif
}
int listcmp(const void *aptr, const void *bptr) int listcmp(const void *aptr, const void *bptr)
{ {
const char *a=*(void **)(aptr); const char *a=*(void **)(aptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment