Mercurial > mplayer.hg
comparison TOOLS/bmovl-test.c @ 30702:9fc9d1e788aa
Do not cast the results of malloc/calloc/realloc.
These functions return void*, which is compatible with any pointer,
so there is no need for casts.
author | diego |
---|---|
date | Fri, 26 Feb 2010 15:01:37 +0000 |
parents | b573c7c7173b |
children |
comparison
equal
deleted
inserted
replaced
30701:3c1f75f4affe | 30702:9fc9d1e788aa |
---|---|
102 // Display and move image | 102 // Display and move image |
103 for(i=0; (i < (width - image->w)) && (i < (height - image->h)); i += 5) | 103 for(i=0; (i < (width - image->w)) && (i < (height - image->h)); i += 5) |
104 blit(fifo, image->pixels, image->w, image->h, i, i, 0, 1); | 104 blit(fifo, image->pixels, image->w, image->h, i, i, 0, 1); |
105 | 105 |
106 // Create a 75x75 bitmap | 106 // Create a 75x75 bitmap |
107 bitmap = (unsigned char*)malloc(75*75*4); | 107 bitmap = malloc(75 * 75 * 4); |
108 | 108 |
109 // Paint bitmap red, 50% transparent and blit at position 50,50 | 109 // Paint bitmap red, 50% transparent and blit at position 50,50 |
110 paint(bitmap, (75*75*4), 255, 0, 0, 128); | 110 paint(bitmap, (75*75*4), 255, 0, 0, 128); |
111 blit(fifo, bitmap, 75, 75, 50, 50, 0, 0); | 111 blit(fifo, bitmap, 75, 75, 50, 50, 0, 0); |
112 | 112 |