summaryrefslogtreecommitdiff
path: root/libgfortran/intrinsics/mvbits.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/intrinsics/mvbits.c')
-rw-r--r--libgfortran/intrinsics/mvbits.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/intrinsics/mvbits.c b/libgfortran/intrinsics/mvbits.c
index 6bfb5cad85b..a452fc98b3f 100644
--- a/libgfortran/intrinsics/mvbits.c
+++ b/libgfortran/intrinsics/mvbits.c
@@ -1,5 +1,5 @@
/* Implementation of the MVBITS intrinsic
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006 Free Software Foundation, Inc.
Contributed by Tobias Schlüter
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -48,7 +48,7 @@ SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos,
{
TYPE oldbits, newbits, lenmask;
- lenmask = (*len == sizeof (TYPE)*8) ? ~(TYPE)0 : (1 << *len) - 1;
+ lenmask = (*len == sizeof (TYPE)*8) ? ~(TYPE)0 : ((TYPE)1 << *len) - 1;
newbits = (((UTYPE)(*from) >> *frompos) & lenmask) << *topos;
oldbits = *to & (~(lenmask << *topos));