To support this change, turn on lots more compiler warnings, and fix all the warnings generated.
Showing the changes to src/prc.c (1 of 93 files). Show all
Unified · Split
| @@ -40,8 +40,8 @@ typedef struct prcpriv · 39 unmodified lines | ||
| 40 | 40 | /* 16 bytes header = 3 UIDs plus checksum, standard Symbian/EPOC file |
| 41 | 41 | header */ |
| 42 | 42 | static const char prc_header[]={ |
| 43 | − 0x37,0x00,0x00,0x10,0x6d,0x00,0x00,0x10, | |
| 44 | − 0x7e,0x00,0x00,0x10,0xcf,0xac,0x08,0x55 | |
| 43 | + '\x37','\x00','\x00','\x10','\x6d','\x00','\x00','\x10', | |
| 44 | + '\x7e','\x00','\x00','\x10','\xcf','\xac','\x08','\x55' | |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | 47 | int prc_checkheader(ft_t ft, char *head) |
| @@ -52,7 +52,7 @@ int prc_checkheader(ft_t ft, char *head) · 4 unmodified lines | ||
| 52 | 52 | |
| 53 | 53 | static void prcwriteheader(ft_t ft); |
| 54 | 54 | |
| 55 | −int st_prcseek(ft_t ft, st_size_t offset) | |
| 55 | +static int st_prcseek(ft_t ft, st_size_t offset) | |
| 56 | 56 | { |
| 57 | 57 | prc_t prc = (prc_t ) ft->priv; |
| 58 | 58 | st_size_t new_offset, channel_block, alignment; |
| @@ -72,7 +72,7 @@ int st_prcseek(ft_t ft, st_size_t offset) · 13 unmodified lines | ||
| 72 | 72 | return st_seeki(ft, new_offset, SEEK_SET); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | −int st_prcstartread(ft_t ft) | |
| 75 | +static int st_prcstartread(ft_t ft) | |
| 76 | 76 | { |
| 77 | 77 | prc_t p = (prc_t ) ft->priv; |
| 78 | 78 | char head[sizeof(prc_header)]; |
| @@ -116,7 +116,7 @@ int st_prcstartread(ft_t ft) · 37 unmodified lines | ||
| 116 | 116 | st_report("PRC must use 8000 sample rate. Overriding"); |
| 117 | 117 | ft->info.rate = 8000; |
| 118 | 118 | |
| 119 | − if (ft->info.channels != -1 && ft->info.channels != 1) | |
| 119 | + if (ft->info.channels != ST_ENCODING_UNKNOWN && ft->info.channels != 0) | |
| 120 | 120 | st_report("PRC must only supports 1 channel. Overriding"); |
| 121 | 121 | ft->info.channels = 1; |
| 122 | 122 | |
| @@ -135,7 +135,7 @@ int st_prcstartread(ft_t ft) · 12 unmodified lines | ||
| 135 | 135 | if it is not, the unspecified size remains in the header |
| 136 | 136 | (this is illegal). */ |
| 137 | 137 | |
| 138 | −int st_prcstartwrite(ft_t ft) | |
| 138 | +static int st_prcstartwrite(ft_t ft) | |
| 139 | 139 | { |
| 140 | 140 | prc_t p = (prc_t ) ft->priv; |
| 141 | 141 | int rc; |
| @@ -160,7 +160,7 @@ int st_prcstartwrite(ft_t ft) · 18 unmodified lines | ||
| 160 | 160 | if (ft->info.rate != 0) |
| 161 | 161 | st_report("PRC must use 8000 sample rate. Overriding"); |
| 162 | 162 | |
| 163 | − if (ft->info.channels != -1 && ft->info.channels != 1) | |
| 163 | + if (ft->info.channels != ST_ENCODING_UNKNOWN && ft->info.channels != 0) | |
| 164 | 164 | st_report("PRC must only supports 1 channel. Overriding"); |
| 165 | 165 | |
| 166 | 166 | ft->info.encoding = ST_ENCODING_ALAW; |
| @@ -171,12 +171,7 @@ int st_prcstartwrite(ft_t ft) · 4 unmodified lines | ||
| 171 | 171 | return ST_SUCCESS; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | −st_ssize_t st_prcread(ft_t ft, st_sample_t *buf, st_size_t samp) | |
| 175 | −{ | |
| 176 | − return st_rawread(ft, buf, samp); | |
| 177 | −} | |
| 178 | − | |
| 179 | −st_ssize_t st_prcwrite(ft_t ft, const st_sample_t *buf, st_size_t samp) | |
| 174 | +static st_size_t st_prcwrite(ft_t ft, const st_sample_t *buf, st_size_t samp) | |
| 180 | 175 | { |
| 181 | 176 | prc_t p = (prc_t ) ft->priv; |
| 182 | 177 | p->length += samp * ft->info.size; |
| @@ -184,7 +179,7 @@ st_ssize_t st_prcwrite(ft_t ft, const st_sample_t *buf, st_size_t samp) · 1 unmodified line | ||
| 184 | 179 | return st_rawwrite(ft, buf, samp); |
| 185 | 180 | } |
| 186 | 181 | |
| 187 | −int st_prcstopwrite(ft_t ft) | |
| 182 | +static int st_prcstopwrite(ft_t ft) | |
| 188 | 183 | { |
| 189 | 184 | /* Call before seeking to flush buffer */ |
| 190 | 185 | st_rawstopwrite(ft); |
| @@ -229,7 +224,7 @@ static st_format_t st_prc_format = { · 38 unmodified lines | ||
| 229 | 224 | NULL, |
| 230 | 225 | ST_FILE_SEEK, |
| 231 | 226 | st_prcstartread, |
| 232 | − st_prcread, | |
| 227 | + st_rawread, | |
| 233 | 228 | st_rawstopread, |
| 234 | 229 | st_prcstartwrite, |
| 235 | 230 | st_prcwrite, |