--- nono/lib/sjis.h 2026/04/29 17:04:54 1.1.1.2 +++ nono/lib/sjis.h 2026/04/29 17:05:47 1.1.1.4 @@ -4,11 +4,14 @@ // Licensed under nono-license.txt // +// +// Shift_JIS 関係 +// + #pragma once #include "header.h" -// SJIS 処理用 class SJIS { public: @@ -22,7 +25,7 @@ class SJIS static bool IsKana(uint8 c) { // 半角カナの上位ニブルは a,b,c,d - return (1 << (c >> 4)) & 0b00111100'00000000; + return (1U << (c >> 4)) & 0b00111100'00000000; } // 全角文字の 1 バイト目なら true を返す @@ -34,7 +37,7 @@ class SJIS // bit 8, 9, e を立てた値と and すればよい。 // なお ubuntu amd64 gcc9.3 はビットテスト命令にコンパイルしてくれる。 - return (1 << (c >> 4)) & 0b01000011'00000000; + return (1U << (c >> 4)) & 0b01000011'00000000; } // 半角文字なら true を返す