summaryrefslogtreecommitdiff
path: root/package/busybox/patches/530-unsigned_bitwise_ops.patch
blob: e56351622a3559be6eeee1b7a869ca31be37c8a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -2035,27 +2035,27 @@
 		break;
 
 	case B_an:
-		setvar_i(res, (long)getvar_i(av[0]) & (long)getvar_i(av[1]));
+		setvar_i(res, (unsigned long)getvar_i(av[0]) & (unsigned long)getvar_i(av[1]));
 		break;
 
 	case B_co:
-		setvar_i(res, ~(long)getvar_i(av[0]));
+		setvar_i(res, ~(unsigned long)getvar_i(av[0]));
 		break;
 
 	case B_ls:
-		setvar_i(res, (long)getvar_i(av[0]) << (long)getvar_i(av[1]));
+		setvar_i(res, (unsigned long)getvar_i(av[0]) << (unsigned long)getvar_i(av[1]));
 		break;
 
 	case B_or:
-		setvar_i(res, (long)getvar_i(av[0]) | (long)getvar_i(av[1]));
+		setvar_i(res, (unsigned long)getvar_i(av[0]) | (unsigned long)getvar_i(av[1]));
 		break;
 
 	case B_rs:
-		setvar_i(res, (long)((unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1])));
+		setvar_i(res, (unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1]));
 		break;
 
 	case B_xo:
-		setvar_i(res, (long)getvar_i(av[0]) ^ (long)getvar_i(av[1]));
+		setvar_i(res, (unsigned long)getvar_i(av[0]) ^ (unsigned long)getvar_i(av[1]));
 		break;
 
 	case B_lo: