Commit 734bb8e3 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

Merge branch 'xmlandcompression' of github.com:ASTRO-BO/PacketLib into xmlandcompression

parents bd27f860 c0e5fac1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -104,8 +104,9 @@
           but it could also be referenced using idrefs. -->
      <xs:attribute name="id" type="xs:ID" />
      <xs:attribute name="numberofblocksoffset" type="xs:integer" default="0" />
      <xs:attribute name="default" />
      <xs:attribute name="description" />
      <!-- Use constvalue to defined the field as a constant -->
      <xs:attribute name="constvalue" />
    </xs:complexType>
  </xs:element>

+3 −3
Original line number Diff line number Diff line
@@ -148,12 +148,12 @@ void XmlConfig::_writeFields(xml_node parent, fstream& fs)
		int nbits = atoi(typeStr.substr(spos, epos+1).c_str());
		fs << nbits << endl;

		xml_attribute defaultt = it->attribute("default");
		if(!defaultt)
		xml_attribute constvalue = it->attribute("constvalue");
		if(!constvalue)
			fs << "none" << endl;
		else
		{
			bitset<64> x(atoi(defaultt.value()));
			bitset<64> x(atoi(constvalue.value()));
			fs << "0b" << x.to_string().substr(64-nbits, 64) << endl;
		}
		index++;