Differences From Artifact [51a35125035c1bf8]:
- File
jim.c
-
2011-06-01 02:05:19
- part of checkin
[8de627108c]
on branch trunk
- Add [upcall] command
Allows previous command definitions to be invoked when otherwise hidden via [local]
Signed-off-by: Steve Bennett <steveb@workware.net.au> (user: steveb@workware.net.au
-
2011-06-01 02:05:19
- part of checkin
[8de627108c]
on branch trunk
- Add [upcall] command
To Artifact [fecb0c2e8955ff36]:
- File
jim.c
-
2011-06-03 01:34:00
- part of checkin
[f739b7974e]
on branch trunk
- Fix some clang warnings
And also a potentially undefined integer left shift
Signed-off-by: Steve Bennett <steveb@workware.net.au> (user: steveb@workware.net.au
-
2011-06-03 01:34:00
- part of checkin
[f739b7974e]
on branch trunk
- Fix some clang warnings
7043 7043 }
7044 7044 break;
7045 7045 case JIM_EXPROP_ROTL:{
7046 7046 /* uint32_t would be better. But not everyone has inttypes.h? */
7047 7047 unsigned long uA = (unsigned long)wA;
7048 7048 const unsigned int S = sizeof(unsigned long) * 8;
7049 7049
7050 - wC = (unsigned long)((uA << wB) | (uA >> (S - wB)));
7050 + /* Shift left by the word size or more is undefined. */
7051 + wB %= S;
7052 +
7053 + wC = (unsigned long)(uA << wB) | (uA >> (S - wB));
7051 7054 break;
7052 7055 }
7053 7056 case JIM_EXPROP_ROTR:{
7054 7057 unsigned long uA = (unsigned long)wA;
7055 7058 const unsigned int S = sizeof(unsigned long) * 8;
7059 +
7060 + wB %= S;
7056 7061
7057 7062 wC = (unsigned long)((uA >> wB) | (uA << (S - wB)));
7058 7063 break;
7059 7064 }
7060 7065 default:
7061 7066 abort();
7062 7067 }