"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/marks.cpp" between
bed-3.0.2.src.tar.xz and bed-3.0.3.src.tar.xz

About: bed is an adjustable data format binary editor.

marks.cpp  (bed-3.0.2.src.tar.xz):marks.cpp  (bed-3.0.3.src.tar.xz)
skipping to change at line 52 skipping to change at line 52
} }
assert(i==total); assert(i==total);
qsort(pma,total,sizeof( struct mark *),markcmp); qsort(pma,total,sizeof( struct mark *),markcmp);
iter=head=&begin; iter=head=&begin;
for(i=0;i<total;i++) { for(i=0;i<total;i++) {
head->next=pma[i]; head->next=pma[i];
head->next->prev=head; head->next->prev=head;
head=head->next; head=head->next;
} }
} }
void keylookup::test(void) {}
/*
void keylookup::test(void) {
struct mark *el=iter;
fprintf(stderr,"head: %p\n",head);
while(el!=head) {
el=el->next;
if(el&&el->next==reinterpret_cast<struct mark *>(0x90000001e)) {
fprintf(stderr,"0x90000001e\n");
system("/bin/sh");
}
}
}
*/
int keylookup::putkeys(unsigned char *keys,int nr,OFFTYPE pos,Markgeg *des,uint3 2_t len) { int keylookup::putkeys(unsigned char *keys,int nr,OFFTYPE pos,Markgeg *des,uint3 2_t len) {
total++; total++;
head->next=myalloc (struct mark); head->next=myalloc (struct mark);
head->next->prev=head; head->next->prev=head;
head=head->next; head=head->next;
head->pos=pos; head->pos=pos;
head->len=len; head->len=len;
skipping to change at line 88 skipping to change at line 103
void keylookup::tobegin(void) {iter=&begin;}; void keylookup::tobegin(void) {iter=&begin;};
struct keylookup::mark *keylookup::prev(void) { struct keylookup::mark *keylookup::prev(void) {
struct mark *tmp; struct mark *tmp;
if(iter!=&begin) { if(iter!=&begin) {
tmp=iter; tmp=iter;
iter=iter->prev; iter=iter->prev;
return tmp; return tmp;
} }
return NULL; return NULL;
} }
struct keylookup::mark *keylookup::next(void) {
if(iter!=head) {
iter=iter->next;
return iter;
}
return NULL;
}
int keylookup::deleteall(void) { int keylookup::deleteall(void) {
int i; int i;
for(i=0;head!=&begin;i++) for(i=0;head!=&begin;i++)
rmmark(head); rmmark(head);
return i; return i;
} }
int keylookup::rmmark(struct keylookup::mark *mark) { int keylookup::rmmark(struct keylookup::mark *mark) {
if(mark==&begin) if(mark==&begin)
return -1; return -1;
intptr_t res =input.rmkeyseq(input.treebase,mark->keys,mark->nrkeys); intptr_t res =input.rmkeyseq(input.treebase,mark->keys,mark->nrkeys);
skipping to change at line 130 skipping to change at line 139
if(iter==mark) if(iter==mark)
iter=head; iter=head;
} }
myfree(mark->keys); myfree(mark->keys);
myfree(mark->des); myfree(mark->des);
myfree(mark); myfree(mark);
total--; total--;
return 0; return 0;
} }
/* /*
void keylookup::defaultmark(int pos,char des) { void keyleookup::defaultmark(int pos,char des) {
head->next=myalloc (struct mark); head->next=myalloc (struct mark);
head->next->prev=head; head->next->prev=head;
head=head->next; head=head->next;
head->pos=pos; head->pos=pos;
head->des=des; head->des=des;
head->keys=NULL; head->keys=NULL;
} }
*/ */
/* /*
skipping to change at line 153 skipping to change at line 162
}; };
*/ */
struct keylookup::mark *keylookup::getinput(unsigned char *str,int len) { struct keylookup::mark *keylookup::getinput(unsigned char *str,int len) {
struct mark *mark=NULL; struct mark *mark=NULL;
for(int i=0;(i<len)&&(!(mark=lookup(str[i])));i++) for(int i=0;(i<len)&&(!(mark=lookup(str[i])));i++)
if(isstart()) if(isstart())
return NULL; return NULL;
return mark; return mark;
}; };
struct keylookup::mark *keylookup::next(void) {
if(iter!=head) {
iter=iter->next;
return iter;
}
return NULL;
}
 End of changes. 4 change blocks. 
8 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)