Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh-3.1.0 fix for the Alpha



This patch makes zsh-3.1.0 work on machines (such as the Alpha) where
sizeof(void*) != sizeof(int).

This patch can be applied to the plain unpatched zsh-3.1.0 release.

Zoltan


*** Src/utils.c	1996/12/29 01:53:45	3.1.1.5
--- Src/utils.c	1996/12/30 23:00:44
***************
*** 2038,2044 ****
      *nints = (type & ~NT_HEAP);
      if (useheap)
  	*nints |= NT_HEAP;
!     for (i = NT_NUM(type); i--; *++nints = *++oints);
      onodes = (void **) (oints + 1);
      nnodes = (void **) (nints + 1);
      heap = type & NT_HEAP;
--- 2038,2048 ----
      *nints = (type & ~NT_HEAP);
      if (useheap)
  	*nints |= NT_HEAP;
!     i = NT_NUM(type);
!     while ((i + 1) & (sizeof(void *)/sizeof(int) - 1))
! 	i++;
!     while (i--)
! 	*++nints = *++oints;
      onodes = (void **) (oints + 1);
      nnodes = (void **) (nints + 1);
      heap = type & NT_HEAP;
***************
*** 2103,2109 ****
  	return;
  
      type = * (int *) a;
!     nodes = (void **) ((int *) a + NT_NUM(type) + 1);
      size = sizetab[NT_TYPE(type)];
      for (type = (type & 0xffff00) >> 4; (type >>= 4);) {
  	if ((n = *nodes++)) {
--- 2107,2116 ----
  	return;
  
      type = * (int *) a;
!     size = NT_NUM(type);
!     while ((size + 1) & (sizeof(void *)/sizeof(int) - 1))
! 	size++;
!     nodes = (void **) ((int *) a + size + 1);
      size = sizetab[NT_TYPE(type)];
      for (type = (type & 0xffff00) >> 4; (type >>= 4);) {
  	if ((n = *nodes++)) {



Messages sorted by: Reverse Date, Date, Thread, Author