X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Fstring-convert.cc;h=c372520c16f3acb26d53b8f2bbd983ca1f943379;hb=eaa41b4e4dc1d3b893c5a75711f26db6a7f5fa18;hp=03bb05b319c57b291c11d2146170c630569957fc;hpb=14c7123e678938b7cc858c9f087788fd6516c1a2;p=lilypond.git diff --git a/flower/string-convert.cc b/flower/string-convert.cc index 03bb05b319..c372520c16 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -37,7 +37,7 @@ string String_convert::bin2hex (Byte bin_char) { string str; - str += to_string ((char) nibble2hex_byte (bin_char >> 4)); + str += to_string ((char) nibble2hex_byte ((Byte)(bin_char >> 4))); str += to_string ((char) nibble2hex_byte (bin_char++)); return str; } @@ -49,7 +49,7 @@ String_convert::bin2hex (string bin_string) Byte const *byte = (Byte const*)bin_string.data (); for (ssize i = 0; i < bin_string.length (); i++) { - str += to_string ((char)nibble2hex_byte (*byte >> 4)); + str += to_string ((char)nibble2hex_byte ((Byte)(*byte >> 4))); str += to_string ((char)nibble2hex_byte (*byte++)); } return str; @@ -206,9 +206,9 @@ Byte String_convert::nibble2hex_byte (Byte byte) { if ((byte & 0x0f) <= 9) - return (byte & 0x0f) + '0'; + return (Byte)((byte & 0x0f) + '0'); else - return (byte & 0x0f) - 10 + 'a'; + return (Byte)((byte & 0x0f) - 10 + 'a'); } /** Convert an integer to a string