kaffeh patch

Bernie Solomon bernard at UG.EDS.COM
Mon Mar 10 09:58:33 PST 1997


Having seen the availability of the BISS AWT I tried to build it on HP
and have discovered a problem with kaffeh. HP insists that doubles
really are 8 byte aligned and the constant pool can have them just 4
byte aligned. My patch to support.c in kaffeh is below. I wonder if this
problem is elsewhere too (I haven't looked myself yet).
-- 
Bernie Solomon (bernard at edsug.com or Bernard.Solomon at acm.org)
Unigraphics Architecture, EDS-Unigraphics, Cambridge, UK
-------------- next part --------------
*** support.c   Mon Mar 10 17:51:44 1997
--- /users/bernard/orig-kaffe-0.8.2/kaffe/kaffeh/support.c      Tue Mar  4 09:56:55 1997
***************
*** 142,148 ****
        u2 idx;
        u4 len;
        char cval[1000];
-       union { jint i[2]; jdouble d; } u;
  
        readu2(&f.access_flags, fp);
        readu2(&f.name_index, fp);
--- 142,147 ----
***************
*** 176,184 ****
  #endif
                                break;
                        case CONSTANT_Double:
!                               u.i[0] = cpool->data[idx];
!                               u.i[1] = cpool->data[idx + 1];
!                               sprintf(cval, "%g", u.d);
                                break;
                        case CONSTANT_String:
                                sprintf(cval, "\"%s\"", (char*)cpool->data[cpool->data[idx]]);
--- 175,181 ----
  #endif
                                break;
                        case CONSTANT_Double:
!                               sprintf(cval, "%g", *(double*)&cpool->data[idx]);
                                break;
                        case CONSTANT_String:
                                sprintf(cval, "\"%s\"", (char*)cpool->data[cpool->data[idx]]);



More information about the kaffe mailing list