[MLton] crossMap

Matthew Fluet fluet@cs.cornell.edu
Wed, 27 Jul 2005 21:08:36 -0400 (EDT)

  Undid part of previous checkin that changed
  	uchar *crossMap
  	pointer crossMap
  This broke the pack.sml regression with an assertion failure
    gc.c:1612: assert(m[i] == s->crossMap[i]) failed.
  The problem was presumably confusion/coercions between signed and
  unsigned chars, possibly with CROSS_MAP_EMPTY (255).
  Anyways, I'd prefer to keep the type as uchar *crossMap to reflect
  that the entries are thought of as unsigned chars.

gcc version 4.0 gives the following warning when crossMap is declared as a 
uchar pointer.

gc.c: In function createCardMapAndCrossMap:
gc.c:1272: warning: pointer targets in assignment differ in signedness
gc.c: In function resizeCardMapAndCrossMap:
gc.c:2885: warning: pointer targets in assignment differ in signedness
gc.c:2889: warning: pointer targets in passing argument 2 of copy differ in signedness

The line 2885 warning should be fixed by declaring oldCrossMap as a uchar 
pointer, though that simply makes the oldCrossMap argument at line 2889 
give a warning about different signedness.