"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/examples/multiply.cc" 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.

multiply.cc  (bed-3.0.3.src.tar.xz):multiply.cc  (bed-3.1.0.src.tar.xz)
skipping to change at line 45 skipping to change at line 45
Multiply(double multiplier,int fb,int sb) : Filter(fb,sb,filtername(Multi ply)),multiplier(multiplier){ Multiply(double multiplier,int fb,int sb) : Filter(fb,sb,filtername(Multi ply)),multiplier(multiplier){
mklabel(multiplier); mklabel(multiplier);
} }
Multiply(int fb,int sb,const char *conv) : Filter(fb,sb,filtername(Multip ly)) { Multiply(int fb,int sb,const char *conv) : Filter(fb,sb,filtername(Multip ly)) {
sscanf(conv,"%" FLOATSTR,&multiplier); sscanf(conv,"%" FLOATSTR,&multiplier);
mklabel(multiplier); mklabel(multiplier);
} }
Multiply(Multiply const &rev): Multiply(rev.bytesfile,rev.bytesscreen,rev .multiplier) { Multiply(Multiply const &rev): Multiply(rev.bytesfile,rev.bytesscreen,rev .multiplier) {
} }
char *convstr(void) override { char *convstr(void) const override {
return label+mulsize; return label+mulsize;
} }
~Multiply() { ~Multiply() {
delete[] label; delete[] label;
} }
virtual Filter *newone(void)const override { virtual Filter *newone(void)const override {
return new Multiply(*this); return new Multiply(*this);
} }
virtual int chbytes(int b) override { virtual int chbytes(int b) override {
skipping to change at line 79 skipping to change at line 79
FT out=tus*multiplier; FT out=tus*multiplier;
memcpy(output,&out,bytesscreen); memcpy(output,&out,bytesscreen);
return bytesscreen; return bytesscreen;
} }
virtual int tofile(const unsigned char * const input,unsigned char * cons t output) override { virtual int tofile(const unsigned char * const input,unsigned char * cons t output) override {
const FT *in=reinterpret_cast<const FT *>(input); const FT *in=reinterpret_cast<const FT *>(input);
BT out=BT(roundf(*in/multiplier)); BT out=BT(roundf(*in/multiplier));
memcpy(output,&out,bytesfile); memcpy(output,&out,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(multiplier!=((Multiply *)fil)->multiplier) if(multiplier!=((Multiply *)fil)->multiplier)
return 0; return 0;
return 1; return 1;
} }
}; };
registerfilterclass(Multiply) registerfilterclass(Multiply)
 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)