diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-01-14 17:26:39 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-01-14 17:46:02 +1100 |
commit | c6318e9dd3f7a91f40340911bcf57bf36768910e (patch) | |
tree | 19c44a2ef48655e1c81b1779a4d02813b6d0aa78 /src/test_grabbag | |
parent | 55721556161e6ab209f940f5023bc44b4051524a (diff) | |
download | flac-c6318e9dd3f7a91f40340911bcf57bf36768910e.tar.gz |
Purge usage of `unsigned` type
As pointed out by Ozkan Sezer, on some platforms `int32_t` is actually
a typedef for `long` so `unsigned` cannot be used interchangably with
`FLAC__uint32`. Fix is to switch from `unsigned` to explicit sized ISO
C types defined in <stdint.h>.
Diffstat (limited to 'src/test_grabbag')
-rw-r--r-- | src/test_grabbag/cuesheet/main.c | 8 | ||||
-rw-r--r-- | src/test_grabbag/picture/main.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/test_grabbag/cuesheet/main.c b/src/test_grabbag/cuesheet/main.c index eb6f2712..433d11a6 100644 --- a/src/test_grabbag/cuesheet/main.c +++ b/src/test_grabbag/cuesheet/main.c @@ -29,12 +29,12 @@ #include "FLAC/metadata.h" #include "share/grabbag.h" -static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset) +static int do_cuesheet(const char *infilename, uint32_t sample_rate, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset) { FILE *fin, *fout; const char *error_message, *tmpfilenamebase; char tmpfilename[4096]; - unsigned last_line_read; + uint32_t last_line_read; FLAC__StreamMetadata *cuesheet; FLAC__ASSERT(strlen(infilename) + 2 < sizeof(tmpfilename)); @@ -116,7 +116,7 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool int main(int argc, char *argv[]) { FLAC__uint64 lead_out_offset; - unsigned sample_rate = 48000; + uint32_t sample_rate = 48000; FLAC__bool is_cdda = false; const char *usage = "usage: test_cuesheet cuesheet_file lead_out_offset [ [ sample_rate ] cdda ]\n"; @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) lead_out_offset = (FLAC__uint64)strtoul(argv[2], 0, 10); if(argc >= 4) { - sample_rate = (unsigned)atoi(argv[3]); + sample_rate = (uint32_t)atoi(argv[3]); if(argc >= 5) { if(0 == strcmp(argv[4], "cdda")) is_cdda = true; diff --git a/src/test_grabbag/picture/main.c b/src/test_grabbag/picture/main.c index 35cd45ea..df914098 100644 --- a/src/test_grabbag/picture/main.c +++ b/src/test_grabbag/picture/main.c @@ -73,9 +73,9 @@ static FLAC__bool test_one_picture(const char *prefix, const PictureFile *pf, co if(fn_only) flac_snprintf(s, sizeof(s), "pictures/%s", pf->path); else if (res == NULL) - flac_snprintf(s, sizeof(s), "%u|%s|%s||pictures/%s", (unsigned)pf->type, pf->mime_type, pf->description, pf->path); + flac_snprintf(s, sizeof(s), "%u|%s|%s||pictures/%s", (uint32_t)pf->type, pf->mime_type, pf->description, pf->path); else - flac_snprintf(s, sizeof(s), "%u|%s|%s|%dx%dx%d/%d|pictures/%s", (unsigned)pf->type, pf->mime_type, pf->description, res->width, res->height, res->depth, res->colors, pf->path); + flac_snprintf(s, sizeof(s), "%u|%s|%s|%dx%dx%d/%d|pictures/%s", (uint32_t)pf->type, pf->mime_type, pf->description, res->width, res->height, res->depth, res->colors, pf->path); printf("testing grabbag__picture_parse_specification(\"%s\")... ", s); |