"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/examples/duplicate.cpp" between
bed-3.0.3.src.tar.xz and bed-3.1.0.src.tar.xz

About: bed is an adjustable data format binary editor.

duplicate.cpp  (bed-3.0.3.src.tar.xz):duplicate.cpp  (bed-3.1.0.src.tar.xz)
skipping to change at line 70 skipping to change at line 70
sscanf(conv,"%d",&number); sscanf(conv,"%d",&number);
label=new char[10]; label=new char[10];
sprintf(label,"dup %d",number); sprintf(label,"dup %d",number);
chbytesback(sb); chbytesback(sb);
} }
Duplicate(Duplicate const &rev): Filter(rev),number(rev.number) { Duplicate(Duplicate const &rev): Filter(rev),number(rev.number) {
label=new char[10]; label=new char[10];
sprintf(label,"dup %d",number); sprintf(label,"dup %d",number);
chbytesback(bytesscreen); chbytesback(bytesscreen);
} }
char *convstr(void) override { char *convstr(void) const override {
return label+4; return label+4;
} }
~Duplicate() { ~Duplicate() {
delete[] label; delete[] label;
} }
virtual Filter *newone(void)const override { virtual Filter *newone(void)const override {
return new Duplicate(*this); return new Duplicate(*this);
} }
virtual int chbytes(int b) override { virtual int chbytes(int b) override {
bytesfile=b; bytesfile=b;
skipping to change at line 111 skipping to change at line 111
int i; int i;
for(i=0;i<(number-1);i++) { for(i=0;i<(number-1);i++) {
if(memcmp(input+bytesfile*i,output,bytesfile)) { if(memcmp(input+bytesfile*i,output,bytesfile)) {
memmove(output,input+bytesfile*i,bytesfile); memmove(output,input+bytesfile*i,bytesfile);
return bytesfile; return bytesfile;
} }
} }
memmove(output,input+bytesfile*i,bytesfile); memmove(output,input+bytesfile*i,bytesfile);
return bytesfile; return bytesfile;
} }
int equal(Filter *fil) override { int equal(const Filter *fil) const override {
if(!Filter::equal(fil)) if(!Filter::equal(fil))
return 0; return 0;
if(number!=((Duplicate *)fil)->number) if(number!=((Duplicate *)fil)->number)
return 0; return 0;
return 1; return 1;
} }
virtual int screen2filepos(int pos) override { virtual int screen2filepos(int pos) override {
return pos%bytesfile; return pos%bytesfile;
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

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