Browse code

ctl: use unsigned literals for left bit shifting

Daniel-Constantin Mierla authored on 10/11/2021 19:09:24
Showing 1 changed files
... ...
@@ -188,7 +188,7 @@ struct binrpc_val{
188 188
 inline static int binrpc_get_int_len(int i)
189 189
 {
190 190
 	int size;
191
-	for (size=4; size && ((i & (0xff<<24))==0); i<<=8, size--);
191
+	for (size=4; size && ((i & (0xffu<<24))==0); i<<=8, size--);
192 192
 	return size;
193 193
 }
194 194
 
... ...
@@ -216,7 +216,7 @@ inline static unsigned char* binrpc_write_int(	unsigned char* p,
216 216
 {
217 217
 	int size;
218 218
 
219
-	for (size=4; size && ((i & (0xff<<24))==0); i<<=8, size--);
219
+	for (size=4; size && ((i & (0xffu<<24))==0); i<<=8, size--);
220 220
 	*len=size;
221 221
 	for(; (p<end) && (size); p++, size--){
222 222
 		*p=(unsigned char)(i>>24);