File plib-1.8.5-intptr_t.patch of Package plib

--- src/ssg/ssgLoadFLT.cxx
+++ src/ssg/ssgLoadFLT.cxx
@@ -1289,8 +1289,8 @@
             index = get16i(ptr + 28); /* texture index */
 	    t = 0;
 	    if (index != -1) {
-	       state->texs = t = splay(state->texs, (void *)index, ptrcmp);
-	       if (t == 0 || t->key != (void *)index) {
+	       state->texs = t = splay(state->texs, (void *)(intptr_t)index, ptrcmp);
+	       if (t == 0 || t->key != (void *)(intptr_t)index) {
 		  /*ulSetError(UL_DEBUG, "[flt] undefined texture %d", index);*/
 		  t = 0;
 	       }
@@ -1362,8 +1362,8 @@
 	       }
 	       else {
 		  index = get16i(ptr + 30); /* material index */
-		  state->mtls = t = splay(state->mtls, (void *)index, ptrcmp);
-		  if (t && t->key == (void *)index) {
+		  state->mtls = t = splay(state->mtls, (void *)(intptr_t)index, ptrcmp);
+		  if (t && t->key == (void *)(intptr_t)index) {
 		     info.mtl = (float *)t->data;
 		  }
 		  else {
@@ -1886,7 +1886,7 @@
    stack[1] = PostClean(stack[1], attr[1]);
    
    if (stack[1] && instance >= 0) {
-       state->refs = sinsert(state->refs, (void *)instance, 0, ptrcmp);
+       state->refs = sinsert(state->refs, (void *)(intptr_t)instance, 0, ptrcmp);
        if (state->refs->data != (void *)-1) {
 	   ulSetError(UL_WARNING, "[flt] Instance %d redefined.", instance);
 	   ssgDeRefDelete((ssgEntity *) state->refs->data);
@@ -2238,8 +2238,8 @@
 	     PostLink(stack + sp - 1, attr + sp - 1, instance[sp], state);
 	     instance[sp] = -1;
 	     if (state->refs) {
-		 state->refs = splay(state->refs, (void *)k, ptrcmp);
-		 if (state->refs->key == (void *)k) {
+		 state->refs = splay(state->refs, (void *)(intptr_t)k, ptrcmp);
+		 if (state->refs->key == (void *)(intptr_t)k) {
 		     stack[sp] = (ssgEntity *)state->refs->data;
 		 }
 	     }
@@ -2478,7 +2478,7 @@
 	       if ((p = strrchr(file, '/')))
 		  file = p + 1;
 	       index = get32i(ptr + len - 12);
-	       state->texs = sinsert(state->texs, (void *)index, 0, ptrcmp);
+	       state->texs = sinsert(state->texs, (void *)(intptr_t)index, 0, ptrcmp);
 	       if (state->texs->data == (void *)-1) {
 		  //fltTexture *tex = (fltTexture *)malloc(sizeof(fltTexture));
 		  fltTexture *tex = new fltTexture;
@@ -2505,7 +2505,7 @@
             int i, j, n = (len - 4) / 184;
             for (i = 0; i < n; ++i) {
 	       float *mtl;
-	       state->mtls = sinsert(state->mtls, (void *)i, 0, ptrcmp);
+	       state->mtls = sinsert(state->mtls, (void *)(intptr_t)i, 0, ptrcmp);
 	       //state->mtls->data = malloc(sizeof(float)*14);
 	       state->mtls->data = new float[14];
 	       mtl = (float *)state->mtls->data;
@@ -2541,7 +2541,7 @@
 
       case 113: /* Material */
 	 index = get32i(ptr + 4);
-	 state->mtls = sinsert(state->mtls, (void *)index, 0, ptrcmp);
+	 state->mtls = sinsert(state->mtls, (void *)(intptr_t)index, 0, ptrcmp);
 	 if (state->mtls->data == (void *)-1) {
 	    float *mtl;
 	    int i;