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 | /* 16 bytes header = 3 UIDs plus checksum, standard Symbian/EPOC file | 40 | /* 16 bytes header = 3 UIDs plus checksum, standard Symbian/EPOC file |
| 41 | header */ | 41 | header */ |
| 42 | static const char prc_header[]={ | 42 | static const char prc_header[]={ |
| 43 | 0x37,0x00,0x00,0x10,0x6d,0x00,0x00,0x10, | 43 | '\x37','\x00','\x00','\x10','\x6d','\x00','\x00','\x10', |
| 44 | 0x7e,0x00,0x00,0x10,0xcf,0xac,0x08,0x55 | 44 | '\x7e','\x00','\x00','\x10','\xcf','\xac','\x08','\x55' |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | int prc_checkheader(ft_t ft, char *head) | 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 | static void prcwriteheader(ft_t ft); | 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 | prc_t prc = (prc_t ) ft->priv; | 57 | prc_t prc = (prc_t ) ft->priv; |
| 58 | st_size_t new_offset, channel_block, alignment; | 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 | return st_seeki(ft, new_offset, SEEK_SET); | 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 | prc_t p = (prc_t ) ft->priv; | 77 | prc_t p = (prc_t ) ft->priv; |
| 78 | char head[sizeof(prc_header)]; | 78 | char head[sizeof(prc_header)]; |
| @@ -116,7 +116,7 @@ int st_prcstartread(ft_t ft) · 37 unmodified lines | |||
| 116 | st_report("PRC must use 8000 sample rate. Overriding"); | 116 | st_report("PRC must use 8000 sample rate. Overriding"); |
| 117 | ft->info.rate = 8000; | 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 | st_report("PRC must only supports 1 channel. Overriding"); | 120 | st_report("PRC must only supports 1 channel. Overriding"); |
| 121 | ft->info.channels = 1; | 121 | ft->info.channels = 1; |
| 122 | 122 | ||
| @@ -135,7 +135,7 @@ int st_prcstartread(ft_t ft) · 12 unmodified lines | |||
| 135 | if it is not, the unspecified size remains in the header | 135 | if it is not, the unspecified size remains in the header |
| 136 | (this is illegal). */ | 136 | (this is illegal). */ |
| 137 | 137 | ||
| 138 | int st_prcstartwrite(ft_t ft) | 138 | static int st_prcstartwrite(ft_t ft) |
| 139 | { | 139 | { |
| 140 | prc_t p = (prc_t ) ft->priv; | 140 | prc_t p = (prc_t ) ft->priv; |
| 141 | int rc; | 141 | int rc; |
| @@ -160,7 +160,7 @@ int st_prcstartwrite(ft_t ft) · 18 unmodified lines | |||
| 160 | if (ft->info.rate != 0) | 160 | if (ft->info.rate != 0) |
| 161 | st_report("PRC must use 8000 sample rate. Overriding"); | 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 | st_report("PRC must only supports 1 channel. Overriding"); | 164 | st_report("PRC must only supports 1 channel. Overriding"); |
| 165 | 165 | ||
| 166 | ft->info.encoding = ST_ENCODING_ALAW; | 166 | ft->info.encoding = ST_ENCODING_ALAW; |
| @@ -171,12 +171,7 @@ int st_prcstartwrite(ft_t ft) · 4 unmodified lines | |||
| 171 | return ST_SUCCESS; | 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) | 174 | static st_size_t st_prcwrite(ft_t ft, const 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) | ||
| 180 | { | 175 | { |
| 181 | prc_t p = (prc_t ) ft->priv; | 176 | prc_t p = (prc_t ) ft->priv; |
| 182 | p->length += samp * ft->info.size; | 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 | return st_rawwrite(ft, buf, samp); | 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 | /* Call before seeking to flush buffer */ | 184 | /* Call before seeking to flush buffer */ |
| 190 | st_rawstopwrite(ft); | 185 | st_rawstopwrite(ft); |
| @@ -229,7 +224,7 @@ static st_format_t st_prc_format = { · 38 unmodified lines | |||
| 229 | NULL, | 224 | NULL, |
| 230 | ST_FILE_SEEK, | 225 | ST_FILE_SEEK, |
| 231 | st_prcstartread, | 226 | st_prcstartread, |
| 232 | st_prcread, | 227 | st_rawread, |
| 233 | st_rawstopread, | 228 | st_rawstopread, |
| 234 | st_prcstartwrite, | 229 | st_prcstartwrite, |
| 235 | st_prcwrite, | 230 | st_prcwrite, |