Commits

Anonymous committed 3cc4c03

visual studio doesn't like arithmetic on a void*

  • Participants
  • Parent commits 63dd871

Comments (0)

Files changed (2)

File src/bufferproxy.c

         return RAISE (PyExc_IndexError, "bytes to write exceed buffer size");
     }
 
-    memcpy (buffer->buffer + offset, buf, (size_t) length);
+    memcpy (((Uint8 *)buffer->buffer) + offset, buf, (size_t) length);
 
     Py_RETURN_NONE;
 }   

File src/pixelarray.c

 
                 *((Uint16 *) (pixels + y * padding) + offset) =
                     (Uint16)*((Uint16 *)
-                        (valsf->pixels + vy * val->padding) + val->start + vy);
+                        ((Uint8*)valsf->pixels + vy * val->padding) + val->start + vy);
             }
         }
         break;
                 vx += val->xstep;
 
                 px = (Uint8 *) (pixels + y * padding) + offset * 3;
-                vpx = (Uint8 *) (valsf->pixels + y * val->padding) +
+                vpx = (Uint8 *) ((Uint8*)valsf->pixels + y * val->padding) +
                     (val->start + vx) * 3;
 
 #if (SDL_BYTEORDER == SDL_LIL_ENDIAN)
 
                 *((Uint32 *) (pixels + y * padding) + offset) =
                     *((Uint32 *)
-                        (valsf->pixels + y * val->padding) + val->start + vx);
+                        ((Uint8*)valsf->pixels + y * val->padding) + val->start + vx);
             }
         }
         break;