"Fossies" - the Fresh Open Source Software Archive  

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

bitfields.cc  (bed-3.0.3.src.tar.xz):bitfields.cc  (bed-3.1.0.src.tar.xz)
skipping to change at line 120 skipping to change at line 120
Bitfield::Bitfield(Bitfield const &rev): Filter(rev),maxlen(0),number(rev .number),filebits(rev.filebits) , Bitfield::Bitfield(Bitfield const &rev): Filter(rev),maxlen(0),number(rev .number),filebits(rev.filebits) ,
bitnr(new Bitnr[number]), bitnr(new Bitnr[number]),
bytenr(new Bytenr[number]), bytenr(new Bytenr[number]),
wantsaway(rev.wantsaway) wantsaway(rev.wantsaway)
{ {
part=NULL; part=NULL;
memcpy(bitnr,rev.bitnr,sizeof(Bitnr)*number); memcpy(bitnr,rev.bitnr,sizeof(Bitnr)*number);
memcpy(bytenr,rev.bytenr,sizeof(Bytenr)*number); memcpy(bytenr,rev.bytenr,sizeof(Bytenr)*number);
} }
char *Bitfield::convstr(void) { char *Bitfield::convstr(void) const {
//Format: want:fbits:number:b;by,b;by, //Format: want:fbits:number:b;by,b;by,
// space bitnr and bytenr times number, space number, space filebits, space spec times count + space zero; // space bitnr and bytenr times number, space number, space filebits, space spec times count + space zero;
int newlen= 2*(((sizeof(Bitnr)+sizeof(Bytenr))*number)+sizeof(number)+sizeof(fil ebits))+ number*2+4+1+1; int newlen= 2*(((sizeof(Bitnr)+sizeof(Bytenr))*number)+sizeof(number)+sizeof(fil ebits))+ number*2+4+1+1;
if(newlen>maxlen) { if(newlen>maxlen) {
if(maxlen) { if(maxlen) {
delete[] convstring; delete[] convstring;
} }
maxlen=newlen; maxlen=newlen;
convstring=new char[maxlen]; convstring=new char[maxlen];
} }
skipping to change at line 288 skipping to change at line 288
bytesscreen=0; bytesscreen=0;
filebits=0; filebits=0;
for(int i=0;i<number;i++) { for(int i=0;i<number;i++) {
filebits+=bitnr[i]; filebits+=bitnr[i];
bytesscreen+=bytenr[i]; bytesscreen+=bytenr[i];
} }
bytesfile=(filebits+7)/8; bytesfile=(filebits+7)/8;
return 0; return 0;
} }
int Bitfield::equal(Filter *fil) { int Bitfield::equal(const Filter *fil) const {
if(!Filter::equal(fil)) if(!Filter::equal(fil))
return 0; return 0;
Bitfield *bitf=(Bitfield *)fil; Bitfield *bitf=(Bitfield *)fil;
if(number!=bitf->number) if(number!=bitf->number)
return 0; return 0;
if(memcmp(bitnr,bitf->bitnr,number*sizeof(Bitnr))) if(memcmp(bitnr,bitf->bitnr,number*sizeof(Bitnr)))
return 0; return 0;
if(memcmp(bytenr,bitf->bytenr,number*sizeof(Bytenr))) if(memcmp(bytenr,bitf->bytenr,number*sizeof(Bytenr)))
return 0; return 0;
return 1; return 1;
 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)