X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=nesc.git;a=blobdiff_plain;f=tools%2Fnesc_nx.h;h=d269bc5f570f525522434e9e3d63f1da44c11b49;hp=c13392c36ac3502cb2cbfb0af997a2bc4486af52;hb=627b462e8421954b5102d839ff203adb3400a8cc;hpb=7b54393e237ed8f23c0c74f0a6cbc8de26c5bf98 diff --git a/tools/nesc_nx.h b/tools/nesc_nx.h index c13392c..d269bc5 100644 --- a/tools/nesc_nx.h +++ b/tools/nesc_nx.h @@ -126,7 +126,7 @@ unsigned byte_offset = offset >> 3; \ unsigned bit_offset = offset & 7; \ \ - x = x & ((1 << length) - 1); \ + x = x & (((uint ## bits ## _t)1 << length) - 1); \ \ /* all in one byte case */ \ if (length + bit_offset <= 8) { \ @@ -201,7 +201,7 @@ \ while (count + 8 <= length) \ { \ - x |= (uint ## bits ## _t)(msg[byte_offset++] << count); \ + x |= (uint ## bits ## _t)msg[byte_offset++] << count; \ count += 8; \ } \ \ @@ -218,7 +218,7 @@ unsigned bit_offset = offset & 7; \ unsigned count = 0; \ \ - x = x & ((1 << length) - 1); \ + x = x & (((uint ## bits ## _t)1 << length) - 1); \ \ /* all in one byte case */ \ if (length + bit_offset <= 8) { \