X-Git-Url: http://git.smho.de/gw/?p=owTools.git;a=blobdiff_plain;f=src%2Fhexfile.cpp;fp=src%2Fhexfile.cpp;h=df45d464c73422db8fc3bba1d5e814fbeeaeb1c6;hp=32ce6791669b24f774e57e9c67ce48812d63bb90;hb=1a6465a924428af072a8eb5e75ee547c394f4d8e;hpb=039b202e5c68834801d23e22eecc7cae2879ea83 diff --git a/src/hexfile.cpp b/src/hexfile.cpp index 32ce679..df45d46 100755 --- a/src/hexfile.cpp +++ b/src/hexfile.cpp @@ -53,13 +53,13 @@ hexFile::hexFile(std::string fname) { if (line[0]==':') { //ss << std::hex << line.substr(1,2); //ss >> bc; - uint8_t bc=std::stoul( line.substr(1,2), nullptr, 16); + uint8_t bc=(uint8_t)std::stoul( line.substr(1,2), nullptr, 16); uint32_t fw=std::stoul(line.substr(3,4),nullptr, 16); - uint8_t ty=std::stoul(line.substr(7,2),nullptr,16); + uint8_t ty=(uint8_t)std::stoul(line.substr(7,2),nullptr,16); uint32_t chsm = bc + (fw >> 8) + (fw & 0xFF) + ty; for (int i = 0; i < bc; i++) { int p = 9 + i * 2; - uint8_t b = std::stoul(line.substr(p, 2),nullptr, 16); + uint8_t b = (uint8_t)std::stoul(line.substr(p, 2),nullptr, 16); chsm = chsm + b; prog.push_back(b); }