"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/reverse.h" 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.

reverse.h  (bed-3.0.3.src.tar.xz):reverse.h  (bed-3.1.0.src.tar.xz)
skipping to change at line 48 skipping to change at line 48
} }
~Reverse() { ~Reverse() {
delete[] label; delete[] label;
} }
Reverse(int fb,int sb,const char *conv):Filter(fb,fb,Reversename) { Reverse(int fb,int sb,const char *conv):Filter(fb,fb,Reversename) {
sscanf(conv,"%d",&unit); sscanf(conv,"%d",&unit);
char *tmp=new char[10]; char *tmp=new char[10];
snprintf(tmp,10,"r%d",unit); snprintf(tmp,10,"r%d",unit);
label=tmp; label=tmp;
} }
virtual char *convstr(void) override { virtual char *convstr(void) const override {
return label+1; return label+1;
} }
virtual Filter *newone(void) const override{ virtual Filter *newone(void) const override{
return new Reverse(*this); return new Reverse(*this);
} }
virtual int chbytes(int bytes) override{ virtual int chbytes(int bytes) override{
bytesscreen=bytesfile=bytes; bytesscreen=bytesfile=bytes;
return bytes; return bytes;
} }
virtual int chbytesback(int bytes) override{ virtual int chbytesback(int bytes) override{
return chbytes(bytes); return chbytes(bytes);
} }
virtual int fromfile(const unsigned char *const input,unsigned char *cons t output) const override { virtual int fromfile(const unsigned char *const input,unsigned char *cons t output) const override {
reverse((char *)input,(char *)output,bytesscreen,unit); reverse((char *)input,(char *)output,bytesscreen,unit);
return bytesscreen; return bytesscreen;
} }
virtual int tofile(const unsigned char * const input,unsigned char *const output) override { virtual int tofile(const unsigned char * const input,unsigned char *const output) override {
reverse((char *)input,(char *)output,bytesscreen,unit); reverse((char *)input,(char *)output,bytesscreen,unit);
return bytesscreen; return bytesscreen;
} }
virtual int equal(Filter *fil) override { virtual int equal(const Filter *fil) const override {
if(!Filter::equal(fil)) if(!Filter::equal(fil))
return 0; return 0;
if(((Reverse *)fil)->unit!=unit) if(((Reverse *)fil)->unit!=unit)
return 0; return 0;
return 1; return 1;
}; };
virtual int screen2filepos(int pos) override{ virtual int screen2filepos(int pos) override{
int units=bytesscreen/unit; int units=bytesscreen/unit;
int theunit=pos/unit; int theunit=pos/unit;
 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)