fix bitops on 32bit ints
authorMike Baker <mbm@openwrt.org>
Sun, 12 Mar 2006 04:53:17 +0000 (04:53 +0000)
committerMike Baker <mbm@openwrt.org>
Sun, 12 Mar 2006 04:53:17 +0000 (04:53 +0000)
SVN-Revision: 3348

openwrt/package/busybox/patches/220-awk_bitops.patch

index 4eddb19b5630e9e427a509e7cabe843d2fd6c8d8..2b85729135e6861aed04f69635d8119afc460e6d 100644 (file)
 +              break;
 +              
 +       case B_an:
-+              setvar_i(res, (unsigned long)getvar_i(av[0]) & (unsigned long)getvar_i(av[1]));
++              setvar_i(res, (long)getvar_i(av[0]) & (long)getvar_i(av[1]));
 +              break;
 +              
 +       case B_co:
-+              setvar_i(res, ~(unsigned long)getvar_i(av[0]));
++              setvar_i(res, ~(long)getvar_i(av[0]));
 +              break;
 +
 +       case B_ls:
-+              setvar_i(res, (unsigned long)getvar_i(av[0]) << (unsigned long)getvar_i(av[1]));
++              setvar_i(res, (long)getvar_i(av[0]) << (long)getvar_i(av[1]));
 +              break;
 +
 +       case B_or:
-+              setvar_i(res, (unsigned long)getvar_i(av[0]) | (unsigned long)getvar_i(av[1]));
++              setvar_i(res, (long)getvar_i(av[0]) | (long)getvar_i(av[1]));
 +              break;
 +
 +       case B_rs:
-+              setvar_i(res, (unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1]));
++              setvar_i(res, (long)((unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1])));
 +              break;
 +
 +       case B_xo:
-+              setvar_i(res, (unsigned long)getvar_i(av[0]) ^ (unsigned long)getvar_i(av[1]));
++              setvar_i(res, (long)getvar_i(av[0]) ^ (long)getvar_i(av[1]));
                break;
  
          case B_lo: