comparison gui/util/bitmap.c @ 33710:fd498969e72d

Clean up some function prototypes. Use const where possible and plain "char" instead of "unsigned char" for filenames. Fixes some clang compiler warnings.
author reimar
date Sat, 02 Jul 2011 23:12:45 +0000
parents 76342ee379eb
children 2218c589f9ab
comparison
equal deleted inserted replaced
33709:d7d180520491 33710:fd498969e72d
28 #include "libavutil/common.h" 28 #include "libavutil/common.h"
29 #include "libavutil/intreadwrite.h" 29 #include "libavutil/intreadwrite.h"
30 #include "libvo/fastmemcpy.h" 30 #include "libvo/fastmemcpy.h"
31 #include "mp_msg.h" 31 #include "mp_msg.h"
32 32
33 static int pngRead(unsigned char *fname, guiImage *bf) 33 static int pngRead(const char *fname, guiImage *bf)
34 { 34 {
35 FILE *file; 35 FILE *file;
36 long len; 36 long len;
37 void *data; 37 void *data;
38 int decode_ok, bpl; 38 int decode_ok, bpl;
163 } 163 }
164 164
165 return 1; 165 return 1;
166 } 166 }
167 167
168 static unsigned char *fExist(unsigned char *fname) 168 static const char *fExist(const char *fname)
169 { 169 {
170 static const char ext[][4] = { "png", "PNG" }; 170 static const char ext[][4] = { "png", "PNG" };
171 static unsigned char buf[512]; 171 static char buf[512];
172 unsigned int i; 172 unsigned int i;
173 173
174 if (access(fname, R_OK) == 0) 174 if (access(fname, R_OK) == 0)
175 return fname; 175 return fname;
176 176
182 } 182 }
183 183
184 return NULL; 184 return NULL;
185 } 185 }
186 186
187 int bpRead(char *fname, guiImage *bf) 187 int bpRead(const char *fname, guiImage *bf)
188 { 188 {
189 int r; 189 int r;
190 190
191 fname = fExist(fname); 191 fname = fExist(fname);
192 192
215 { 215 {
216 free(bf->Image); 216 free(bf->Image);
217 memset(bf, 0, sizeof(*bf)); 217 memset(bf, 0, sizeof(*bf));
218 } 218 }
219 219
220 int bpRenderMask(guiImage *in, guiImage *out) 220 int bpRenderMask(const guiImage *in, guiImage *out)
221 { 221 {
222 uint32_t *buf; 222 uint32_t *buf;
223 unsigned long i; 223 unsigned long i;
224 int b = 0, c = 0; 224 int b = 0, c = 0;
225 unsigned char tmp = 0; 225 unsigned char tmp = 0;