mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-03 21:24:06 +02:00
[busybox] Use unsigned longs for bitwise operations in awk, thanks benoar.
- Resolves the ipcalc.sh bug on some arches, closes #3012, #3946 - Submitted upstream as busybox bug #4774 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12427 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
977d04101f
commit
e56a83b19e
36
package/busybox/patches/530-unsigned_bitwise_ops.patch
Normal file
36
package/busybox/patches/530-unsigned_bitwise_ops.patch
Normal file
@ -0,0 +1,36 @@
|
||||
--- a/editors/awk.c
|
||||
+++ b/editors/awk.c
|
||||
@@ -2046,27 +2046,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:
|
Loading…
Reference in New Issue
Block a user