summaryrefslogtreecommitdiff
path: root/lang/ucblogo/patches/patch-intern.c
blob: 377339cc8bb8b5c7861949c490adca2a877da300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$NetBSD: patch-intern.c,v 1.2 2015/12/29 23:34:56 dholland Exp $

Fix a number of cases of plainly invalid C and portability issues.

--- intern.c.orig	2015-11-06 16:15:17.000000000 +0000
+++ intern.c
@@ -39,11 +39,11 @@ FIXNUM hash(char *s, int len) {
     /* and Ullman's book, Compilers: Principles, Techniques, and */
     /* Tools; figure 7.35. */
 
-    unsigned FIXNUM h = 0, g;
+    unsigned long FIXNUM h = 0, g;
 
     while (--len >= 0) {
 	h = (h << 4) + (FIXNUM)(*s++);
-	g = h & (0xf << (WORDSIZE-4));
+	g = h & (0xfUL << (WORDSIZE-4));
 	if (g != 0) {
 	    h ^= g ^ (g >> (WORDSIZE-8));
 	}