various fixes
This commit is contained in:
parent
d288f34470
commit
9f70f9735c
@ -12,6 +12,17 @@ ______________________________________________________________________
|
|||||||
Notes for GoldED+ 1.1.5, February xx 2001
|
Notes for GoldED+ 1.1.5, February xx 2001
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
|
! Window size in Win32 version now calculated from different
|
||||||
|
parameters, you may need to adjust screen properties before running
|
||||||
|
GoldED+ (especially in Win2k with it's defaults 300 rows :)). Though
|
||||||
|
most users shouldn't noticed this change.
|
||||||
|
|
||||||
|
+ Status line update speed improved.
|
||||||
|
|
||||||
|
- Fixed character stripping on the clipboard block boundary.
|
||||||
|
|
||||||
|
! Default value for DispTabSize changed to 8.
|
||||||
|
|
||||||
! If @pseudo token created from address it now stops not only on space
|
! If @pseudo token created from address it now stops not only on space
|
||||||
but at @ as well, so no more "Hello bigfoot@shoes.com!" :-)
|
but at @ as well, so no more "Hello bigfoot@shoes.com!" :-)
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ CfgGed::CfgGed() {
|
|||||||
displistcursor = NO;
|
displistcursor = NO;
|
||||||
dispmargin = NO;
|
dispmargin = NO;
|
||||||
dispmsgsize = DISPMSGSIZE_BYTES;
|
dispmsgsize = DISPMSGSIZE_BYTES;
|
||||||
disptabsize = 4;
|
disptabsize = 8;
|
||||||
encodeemailheaders = true;
|
encodeemailheaders = true;
|
||||||
externoptions = EXTUTIL_CLS | EXTUTIL_SWAP | EXTUTIL_CURSOR | EXTUTIL_RELOAD | EXTUTIL_PAUSEONERROR | EXTUTIL_KEEPCTRL;
|
externoptions = EXTUTIL_CLS | EXTUTIL_SWAP | EXTUTIL_CURSOR | EXTUTIL_RELOAD | EXTUTIL_PAUSEONERROR | EXTUTIL_KEEPCTRL;
|
||||||
ezycomuserno = 0;
|
ezycomuserno = 0;
|
||||||
|
@ -1077,6 +1077,7 @@ void IEclass::editimport(Line* __line, char* __filename, bool imptxt) {
|
|||||||
memset(spaces, ' ', tabsz);
|
memset(spaces, ' ', tabsz);
|
||||||
spaces[tabsz] = NUL;
|
spaces[tabsz] = NUL;
|
||||||
int level = LoadCharset(AA->Xlatimport(), CFG->xlatlocalset);
|
int level = LoadCharset(AA->Xlatimport(), CFG->xlatlocalset);
|
||||||
|
size_t buf_len = EDIT_PARABUFLEN;
|
||||||
char* buf = (char*) throw_malloc(EDIT_PARABUFLEN);
|
char* buf = (char*) throw_malloc(EDIT_PARABUFLEN);
|
||||||
Line* saveline = __line->next;
|
Line* saveline = __line->next;
|
||||||
__line->next = NULL;
|
__line->next = NULL;
|
||||||
@ -1115,14 +1116,21 @@ void IEclass::editimport(Line* __line, char* __filename, bool imptxt) {
|
|||||||
doinvalidate(buf, CFG->invalidate.xp.first.c_str(), CFG->invalidate.xp.second.c_str());
|
doinvalidate(buf, CFG->invalidate.xp.first.c_str(), CFG->invalidate.xp.second.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t read_len = strlen(buf);
|
||||||
|
|
||||||
// Replace tabs
|
// Replace tabs
|
||||||
char *ht = buf;
|
char *ht = buf;
|
||||||
while((ht = strchr(ht, '\t')) != NULL) {
|
while((ht = strchr(ht, '\t')) != NULL) {
|
||||||
int rposn = ht-buf;
|
int rposn = ht-buf;
|
||||||
int rstart = rposn%tabsz+1;
|
int rstart = rposn%tabsz+1;
|
||||||
*ht = ' ';
|
*ht = ' ';
|
||||||
if(tabsz > rstart)
|
if(tabsz > rstart) {
|
||||||
|
if((read_len + tabsz - rstart) >= (buf_len - 7)) {
|
||||||
|
buf_len += tabsz;
|
||||||
|
buf = (char*)throw_realloc(buf, buf_len);
|
||||||
|
}
|
||||||
strins(spaces+rstart, buf, rposn);
|
strins(spaces+rstart, buf, rposn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the paragraph to the new line and retype it
|
// Copy the paragraph to the new line and retype it
|
||||||
|
@ -41,6 +41,7 @@ void IEclass::Clip2Buf() {
|
|||||||
spaces[tabsz] = NUL;
|
spaces[tabsz] = NUL;
|
||||||
|
|
||||||
// Allocate paragraph read buffer
|
// Allocate paragraph read buffer
|
||||||
|
size_t buf_len = EDIT_PARABUFLEN;
|
||||||
char *buf = (char *)throw_malloc(EDIT_PARABUFLEN);
|
char *buf = (char *)throw_malloc(EDIT_PARABUFLEN);
|
||||||
Line *__line = NULL;
|
Line *__line = NULL;
|
||||||
|
|
||||||
@ -49,14 +50,21 @@ void IEclass::Clip2Buf() {
|
|||||||
// Read paragraphs
|
// Read paragraphs
|
||||||
while(clipbrd.read(buf, EDIT_PARABUFLEN-6)) {
|
while(clipbrd.read(buf, EDIT_PARABUFLEN-6)) {
|
||||||
|
|
||||||
|
size_t read_len = strlen(buf);
|
||||||
|
|
||||||
// Replace tabs
|
// Replace tabs
|
||||||
char *ht = buf;
|
char *ht = buf;
|
||||||
while((ht = strchr(ht, '\t')) != NULL) {
|
while((ht = strchr(ht, '\t')) != NULL) {
|
||||||
int rposn = ht-buf;
|
int rposn = ht-buf;
|
||||||
int rstart = rposn%tabsz+1;
|
int rstart = rposn%tabsz+1;
|
||||||
*ht = ' ';
|
*ht = ' ';
|
||||||
if(tabsz > rstart)
|
if(tabsz > rstart) {
|
||||||
|
if((read_len + tabsz - rstart) >= (buf_len - 6)) {
|
||||||
|
buf_len += tabsz;
|
||||||
|
buf = (char*)throw_realloc(buf, buf_len);
|
||||||
|
}
|
||||||
strins(spaces+rstart, buf, rposn);
|
strins(spaces+rstart, buf, rposn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the paragraph to the new line and retype it
|
// Copy the paragraph to the new line and retype it
|
||||||
|
@ -2978,7 +2978,7 @@ char* ParseInternetAddr(char* __string, char* __name, char* __addr) {
|
|||||||
|
|
||||||
StripQuotes(__name);
|
StripQuotes(__name);
|
||||||
|
|
||||||
strxmimecpy(__name, __name, 0, strlen(__name), true);
|
strxmimecpy(__name, __name, 0, strlen(__name)+1, true);
|
||||||
|
|
||||||
return __name;
|
return __name;
|
||||||
}
|
}
|
||||||
|
@ -398,20 +398,25 @@ void LoadText(GMsg* msg, const char* textfile) {
|
|||||||
char* ptr;
|
char* ptr;
|
||||||
char* txtptr;
|
char* txtptr;
|
||||||
int hardcr = NO, hardlen;
|
int hardcr = NO, hardlen;
|
||||||
char hardline[20], tabspaces[9];
|
char hardline[20];
|
||||||
|
|
||||||
strcpy(tabspaces, " ");
|
|
||||||
#define PBUFSIZE 4096 // Allow a 4k long paragraph
|
|
||||||
|
|
||||||
buf = (char*)throw_malloc(PBUFSIZE);
|
|
||||||
|
|
||||||
fp = fsopen(textfile, "rt", CFG->sharemode);
|
fp = fsopen(textfile, "rt", CFG->sharemode);
|
||||||
if(fp) {
|
if(fp) {
|
||||||
|
|
||||||
|
#define PBUFSIZE 4096 // Allow a 4k long paragraph
|
||||||
|
|
||||||
|
size_t buf_len = PBUFSIZE;
|
||||||
|
buf = (char*)throw_malloc(PBUFSIZE);
|
||||||
|
|
||||||
|
int tabsz = CFG->disptabsize ? CFG->disptabsize : 1;
|
||||||
|
__extension__ char spaces[tabsz+1];
|
||||||
|
memset(spaces, ' ', tabsz);
|
||||||
|
spaces[tabsz] = NUL;
|
||||||
|
|
||||||
uint tlen = (uint)(fsize(fp)+512);
|
uint tlen = (uint)(fsize(fp)+512);
|
||||||
msg->txt = txtptr = (char*)throw_realloc(msg->txt, tlen);
|
msg->txt = txtptr = (char*)throw_realloc(msg->txt, tlen);
|
||||||
memset(msg->txt, NUL, tlen);
|
memset(msg->txt, NUL, tlen);
|
||||||
|
|
||||||
tabspaces[CFG->disptabsize] = NUL;
|
|
||||||
if(EDIT->HardLines())
|
if(EDIT->HardLines())
|
||||||
strcpy(hardline, EDIT->HardLine());
|
strcpy(hardline, EDIT->HardLine());
|
||||||
else
|
else
|
||||||
@ -420,8 +425,8 @@ void LoadText(GMsg* msg, const char* textfile) {
|
|||||||
hardlen = strlen(hardline);
|
hardlen = strlen(hardline);
|
||||||
*txtptr = NUL;
|
*txtptr = NUL;
|
||||||
|
|
||||||
while(fgets(buf, PBUFSIZE, fp)) {
|
while(fgets(buf, PBUFSIZE-1, fp)) {
|
||||||
strsrep(buf, "\t", tabspaces); // Expand tabs
|
|
||||||
if(EDIT->HardLines() and strneql(buf, hardline, hardlen)) {
|
if(EDIT->HardLines() and strneql(buf, hardline, hardlen)) {
|
||||||
hardcr = not hardcr;
|
hardcr = not hardcr;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
@ -431,43 +436,74 @@ void LoadText(GMsg* msg, const char* textfile) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
size_t read_len = strlen(buf);
|
||||||
|
|
||||||
|
char *ht = buf;
|
||||||
|
while((ht = strchr(ht, '\t')) != NULL) {
|
||||||
|
int rposn = ht-buf;
|
||||||
|
int rstart = rposn%tabsz+1;
|
||||||
|
*ht = ' ';
|
||||||
|
if(tabsz > rstart) {
|
||||||
|
if((read_len + tabsz - rstart) >= (buf_len-1)) {
|
||||||
|
buf_len += tabsz;
|
||||||
|
buf = (char*)throw_realloc(buf, buf_len);
|
||||||
|
}
|
||||||
|
strins(spaces+rstart, buf, rposn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
while(*ptr == ' ') // Skip leading spaces
|
while(*ptr == ' ') // Skip leading spaces
|
||||||
ptr++;
|
ptr++;
|
||||||
if(*ptr != LF) {
|
if(*ptr != LF) {
|
||||||
strsrep(buf, hardline, "\r");
|
strsrep(buf, hardline, "\r");
|
||||||
|
read_len = strlen(buf);
|
||||||
if(hardcr or *buf == CTRL_A) {
|
if(hardcr or *buf == CTRL_A) {
|
||||||
buf[strlen(buf)-1] = CR;
|
if(not isspace(buf[read_len-1])) read_len += 1;
|
||||||
|
buf[read_len-1] = CR;
|
||||||
|
buf[read_len] = NUL;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
*txtptr = CR;
|
*txtptr = CR;
|
||||||
}
|
}
|
||||||
else if(is_quote(buf)) {
|
else if(is_quote(buf)) {
|
||||||
buf[strlen(buf)-1] = CR;
|
if(not isspace(buf[read_len-1])) read_len += 1;
|
||||||
|
buf[read_len-1] = CR;
|
||||||
|
buf[read_len] = NUL;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
*txtptr = CR;
|
*txtptr = CR;
|
||||||
}
|
}
|
||||||
else if((buf[0] == buf[1]) and (buf[0] == buf[2])) {
|
else if((buf[0] == buf[1]) and (buf[0] == buf[2])) {
|
||||||
buf[strlen(buf)-1] = CR;
|
if(not isspace(buf[read_len-1])) read_len += 1;
|
||||||
|
buf[read_len-1] = CR;
|
||||||
|
buf[read_len] = NUL;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
*txtptr = CR;
|
*txtptr = CR;
|
||||||
}
|
}
|
||||||
else if(strnieql(buf, " * Origin: ", 11)) {
|
else if(strnieql(buf, " * Origin: ", 11)) {
|
||||||
buf[strlen(buf)-1] = CR;
|
if(not isspace(buf[read_len-1])) read_len += 1;
|
||||||
|
buf[read_len-1] = CR;
|
||||||
|
buf[read_len] = NUL;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
*txtptr = CR;
|
*txtptr = CR;
|
||||||
}
|
}
|
||||||
else if(strnieql(ptr, "CC:", 3)) {
|
else if(strnieql(ptr, "CC:", 3)) {
|
||||||
buf[strlen(buf)-1] = CR;
|
if(not isspace(buf[read_len-1])) read_len += 1;
|
||||||
|
buf[read_len-1] = CR;
|
||||||
|
buf[read_len] = NUL;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
*txtptr = CR;
|
*txtptr = CR;
|
||||||
}
|
}
|
||||||
else if(strnieql(ptr, "XC:", 3)) {
|
else if(strnieql(ptr, "XC:", 3)) {
|
||||||
buf[strlen(buf)-1] = CR;
|
if(not isspace(buf[read_len-1])) read_len += 1;
|
||||||
|
buf[read_len-1] = CR;
|
||||||
|
buf[read_len] = NUL;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
*txtptr = CR;
|
*txtptr = CR;
|
||||||
}
|
}
|
||||||
else if(strnieql(buf, "SEEN-BY: ", 9)) {
|
else if(strnieql(buf, "SEEN-BY: ", 9)) {
|
||||||
buf[strlen(buf)-1] = CR;
|
if(not isspace(buf[read_len-1])) read_len += 1;
|
||||||
|
buf[read_len-1] = CR;
|
||||||
|
buf[read_len] = NUL;
|
||||||
if(*txtptr == LF)
|
if(*txtptr == LF)
|
||||||
*txtptr = CR;
|
*txtptr = CR;
|
||||||
}
|
}
|
||||||
@ -486,10 +522,9 @@ void LoadText(GMsg* msg, const char* textfile) {
|
|||||||
strcpy(buf, "\r");
|
strcpy(buf, "\r");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(*(txtptr-1) == CR or *txtptr == NUL) {
|
if((*(txtptr-1) == CR) or (*txtptr == NUL)) {
|
||||||
ptr = buf;
|
size = strlen(buf);
|
||||||
size = strlen(ptr);
|
memcpy(txtptr, buf, size);
|
||||||
memcpy(txtptr, ptr, size);
|
|
||||||
txtptr += size-1;
|
txtptr += size-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -497,8 +532,8 @@ void LoadText(GMsg* msg, const char* textfile) {
|
|||||||
*(++txtptr) = CR;
|
*(++txtptr) = CR;
|
||||||
*(++txtptr) = NUL;
|
*(++txtptr) = NUL;
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
throw_free(buf);
|
||||||
}
|
}
|
||||||
throw_free(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -516,9 +516,9 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
|||||||
ifp = fsopen(indexfile, "rb", CFG->sharemode);
|
ifp = fsopen(indexfile, "rb", CFG->sharemode);
|
||||||
if(ifp) {
|
if(ifp) {
|
||||||
fseek(ifp, 0L, SEEK_END);
|
fseek(ifp, 0L, SEEK_END);
|
||||||
int idxs = (int)(ftell(ifp)/4L);
|
int idxs = (int)(ftell(ifp)/sizeof(long));
|
||||||
if(idxs) {
|
if(idxs) {
|
||||||
fseek(ifp, (long)(rand()%idxs)*4L, SEEK_SET);
|
fseek(ifp, (long)(rand()%idxs)*sizeof(long), SEEK_SET);
|
||||||
fread(&fpos, sizeof(long), 1, ifp);
|
fread(&fpos, sizeof(long), 1, ifp);
|
||||||
fseek(tfp, fpos, SEEK_SET);
|
fseek(tfp, fpos, SEEK_SET);
|
||||||
while(fgets(buf, 255, tfp)) {
|
while(fgets(buf, 255, tfp)) {
|
||||||
|
@ -49,9 +49,8 @@ void update_statuslines() {
|
|||||||
called = YES;
|
called = YES;
|
||||||
|
|
||||||
vchar sep = _box_table(W_BSTAT, 3);
|
vchar sep = _box_table(W_BSTAT, 3);
|
||||||
char help[200], meminfo[200], clkinfo[200];
|
char help[200], clkinfo[200];
|
||||||
*clkinfo = NUL;
|
*clkinfo = NUL;
|
||||||
*meminfo = NUL;
|
|
||||||
*help = NUL;
|
*help = NUL;
|
||||||
|
|
||||||
if(CFG->switches.get(statuslineclock)) {
|
if(CFG->switches.get(statuslineclock)) {
|
||||||
@ -77,12 +76,29 @@ void update_statuslines() {
|
|||||||
__gver_postversion__
|
__gver_postversion__
|
||||||
);
|
);
|
||||||
|
|
||||||
int len = MAXCOL-strlen(help)-strlen(meminfo)-strlen(clkinfo)-2;
|
int help_len = strlen(help);
|
||||||
sprintf(buf, " %s%-*.*s%s%s ", help, len, len, information, meminfo, clkinfo);
|
int clk_len = strlen(clkinfo);
|
||||||
|
int len = MAXCOL-help_len-clk_len-2;
|
||||||
|
sprintf(buf, " %s%-*.*s%s ", help, len, len, information, clkinfo);
|
||||||
|
|
||||||
if(streql(old_status_line, buf))
|
char *begin = buf;
|
||||||
|
char *obegin = old_status_line;
|
||||||
|
char *end = buf + MAXCOL;
|
||||||
|
char *oend = old_status_line + MAXCOL;
|
||||||
|
while((*begin != NUL) and (*begin == *obegin)) {
|
||||||
|
++begin;
|
||||||
|
++obegin;
|
||||||
|
}
|
||||||
|
if(begin == end)
|
||||||
return;
|
return;
|
||||||
strcpy(old_status_line, buf);
|
// we have at least one mismatch
|
||||||
|
if(*obegin) {
|
||||||
|
while(*end == *oend) {
|
||||||
|
--end;
|
||||||
|
--oend;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
memcpy(obegin, begin, end-begin+1);
|
||||||
|
|
||||||
#ifdef GOLD_MOUSE
|
#ifdef GOLD_MOUSE
|
||||||
gmou.GetStatus();
|
gmou.GetStatus();
|
||||||
@ -91,10 +107,12 @@ void update_statuslines() {
|
|||||||
#endif
|
#endif
|
||||||
int row, col;
|
int row, col;
|
||||||
vposget(&row, &col);
|
vposget(&row, &col);
|
||||||
wwprintstr(W_STAT, 0,0, C_STATW, buf);
|
*(++end) = NUL;
|
||||||
if(*help)
|
wwprintstr(W_STAT, 0,begin-buf, C_STATW, begin);
|
||||||
wwprintc(W_STAT, 0,strlen(help)-1, C_STATW, sep);
|
if(*help and ((begin - buf) < (help_len-1)) and ((end - buf) > (help_len-1)))
|
||||||
wwprintc(W_STAT, 0,MAXCOL-strlen(clkinfo), C_STATW, sep);
|
wwprintc(W_STAT, 0,help_len-1, C_STATW, sep);
|
||||||
|
if(((begin - buf) < (MAXCOL-clk_len)) and ((end - buf) > (MAXCOL-clk_len)))
|
||||||
|
wwprintc(W_STAT, 0,MAXCOL-clk_len, C_STATW, sep);
|
||||||
vposset(row, col);
|
vposset(row, col);
|
||||||
#ifdef GOLD_MOUSE
|
#ifdef GOLD_MOUSE
|
||||||
if(gmou.Row() == MAXROW-1)
|
if(gmou.Row() == MAXROW-1)
|
||||||
|
@ -125,7 +125,7 @@ char* gclipbrd::read(char* buffer, int maxlen) {
|
|||||||
if(len > i and strchr("\r\n", *(p+1)) and (*p != *(p+1)))
|
if(len > i and strchr("\r\n", *(p+1)) and (*p != *(p+1)))
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
strxcpy(buffer, clipdata, ++i);
|
strxcpy(buffer, clipdata, i+1);
|
||||||
char* p2 = strpbrk(buffer, "\r\n");
|
char* p2 = strpbrk(buffer, "\r\n");
|
||||||
if(p2) *p2 = 0;
|
if(p2) *p2 = 0;
|
||||||
if(p) strcat(buffer, "\n");
|
if(p) strcat(buffer, "\n");
|
||||||
|
@ -575,12 +575,12 @@ void GVid::detectinfo(GVidInfo* _info) {
|
|||||||
assert(GetConsoleScreenBufferInfo(gvid_hout, &csbi) != 0);
|
assert(GetConsoleScreenBufferInfo(gvid_hout, &csbi) != 0);
|
||||||
|
|
||||||
_info->screen.mode = 0;
|
_info->screen.mode = 0;
|
||||||
_info->screen.rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
_info->screen.rows = csbi.dwSize.Y;
|
||||||
_info->screen.columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
_info->screen.columns = csbi.dwSize.X;
|
||||||
|
|
||||||
// Get cursor position and character attribute under the cursor
|
// Get cursor position and character attribute under the cursor
|
||||||
_info->cursor.row = csbi.dwCursorPosition.Y - csbi.srWindow.Top;
|
_info->cursor.row = csbi.dwCursorPosition.Y;
|
||||||
_info->cursor.column = csbi.dwCursorPosition.X - csbi.srWindow.Left;
|
_info->cursor.column = csbi.dwCursorPosition.X;
|
||||||
_info->color.textattr = csbi.wAttributes;
|
_info->color.textattr = csbi.wAttributes;
|
||||||
|
|
||||||
// Get cursor form
|
// Get cursor form
|
||||||
|
@ -63,20 +63,18 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::update_netecho
|
|||||||
// Delete or add the header index
|
// Delete or add the header index
|
||||||
if(__delete) {
|
if(__delete) {
|
||||||
if(_pos < _total) {
|
if(_pos < _total) {
|
||||||
memmove(_scanidx+_pos, _scanidx+_pos+1, (_total-_pos-1)*sizeof(msgn_t));
|
--_total;
|
||||||
_total--;
|
if(_total != _pos)
|
||||||
|
memmove(_scanidx+_pos, _scanidx+_pos+1, (_total-_pos)*sizeof(msgn_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(_scanidx[_closest] != __hdridx) {
|
if(_scanidx[_closest] != __hdridx) {
|
||||||
_scanidx[_total++] = __hdridx;
|
++_closest;
|
||||||
for(uint k=_total >> 1; k; k >>= 1)
|
if(_closest != _total)
|
||||||
for(uint i=k; i < _total; i++)
|
memmove(_scanidx+_closest+1, _scanidx+_closest, (_total-_closest+1)*sizeof(msgn_t));
|
||||||
for(uint j=i-k; (j >= 0) and CmpV(_scanidx[j], _scanidx[j+k]) > 0; j-=k) {
|
_scanidx[_closest] = __hdridx;
|
||||||
msgn_t e = _scanidx[j];
|
++_total;
|
||||||
_scanidx[j] = _scanidx[j+k];
|
|
||||||
_scanidx[j+k] = e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user