diff --git a/example/C++/.gitignore b/example/C++/.gitignore index 7b045ce6..6a353150 100644 --- a/example/C++/.gitignore +++ b/example/C++/.gitignore @@ -1,5 +1,13 @@ +/*.o +/*~ /.deps /Makefile /Makefile.in -/*~ -/*.o +/device +/eject +/isofile +/isofile2 +/isolist +/main +/mmc1 +/mmc2 diff --git a/example/C++/OO/.gitignore b/example/C++/OO/.gitignore index d5e1b48e..edbbe2ee 100644 --- a/example/C++/OO/.gitignore +++ b/example/C++/OO/.gitignore @@ -1,4 +1,14 @@ +/*.o /.deps /Makefile /Makefile.in -/*.o +/cdtext +/device +/drives +/eject +/iso4 +/isofile +/isolist +/mmc1 +/mmc2 +/tracks diff --git a/example/C++/OO/eject.cpp b/example/C++/OO/eject.cpp index 50246f86..668f25be 100644 --- a/example/C++/OO/eject.cpp +++ b/example/C++/OO/eject.cpp @@ -41,7 +41,6 @@ int main(int argc, const char *argv[]) { - driver_return_code_t ret; driver_id_t driver_id = DRIVER_DEVICE; char *psz_drive = NULL; CdioDevice device; @@ -61,7 +60,7 @@ main(int argc, const char *argv[]) printf("CD in CD-ROM drive %s ejected.\n", psz_drive); } catch ( DriverOpUninit e ) { - printf("Can't Eject CD from CD-ROM drive: driver is not initialized.\n", + printf("Can't Eject CD %s from CD-ROM drive: driver is not initialized.\n", psz_drive); } catch ( DriverOpException e ) { diff --git a/example/C++/OO/isofile.cpp b/example/C++/OO/isofile.cpp index 781ba303..280c018b 100644 --- a/example/C++/OO/isofile.cpp +++ b/example/C++/OO/isofile.cpp @@ -71,7 +71,7 @@ main(int argc, const char *argv[]) { ISO9660::Stat *p_stat; FILE *p_outfd; - int i; + unsigned int i; char const *psz_image; char const *psz_fname; ISO9660::IFS *p_iso = new ISO9660::IFS; diff --git a/example/C++/isofile.cpp b/example/C++/isofile.cpp index 1b541bfa..86118ebc 100644 --- a/example/C++/isofile.cpp +++ b/example/C++/isofile.cpp @@ -72,7 +72,7 @@ main(int argc, const char *argv[]) { iso9660_stat_t *p_statbuf; FILE *p_outfd; - int i; + unsigned int i; char const *psz_image; char const *psz_fname; iso9660_t *p_iso; diff --git a/example/C++/isofile2.cpp b/example/C++/isofile2.cpp index 28835cab..6166f4e0 100644 --- a/example/C++/isofile2.cpp +++ b/example/C++/isofile2.cpp @@ -72,7 +72,7 @@ main(int argc, const char *argv[]) { iso9660_stat_t *p_statbuf; FILE *p_outfd; - int i; + unsigned int i; char const *psz_image; char const *psz_fname; iso9660_t *p_iso; diff --git a/example/paranoia.c b/example/paranoia.c index 045d1b70..38e201a2 100644 --- a/example/paranoia.c +++ b/example/paranoia.c @@ -61,22 +61,25 @@ put_num(long int num, int f, int bytes) } } +#define writestr(fd, s) \ + write(fd, s, sizeof(s)-1) /* Subtract 1 for trailing '\0'. */ + /* Write a the header for a WAV file. */ static void -write_WAV_header(int fd, long int i_bytecount){ +write_WAV_header(int fd, int32_t i_bytecount){ /* quick and dirty */ - write(fd, "RIFF", 4); /* 0-3 */ - put_num(i_bytecount+44-8, fd, 4); /* 4-7 */ - write(fd, "WAVEfmt ", 8); /* 8-15 */ - put_num(16, fd, 4); /* 16-19 */ - put_num(1, fd, 2); /* 20-21 */ - put_num(2, fd, 2); /* 22-23 */ - put_num(44100, fd, 4); /* 24-27 */ - put_num(44100*2*2, fd, 4); /* 28-31 */ - put_num(4, fd, 2); /* 32-33 */ - put_num(16, fd, 2); /* 34-35 */ - write(fd, "data", 4); /* 36-39 */ - put_num(i_bytecount, fd, 4); /* 40-43 */ + writestr(fd, "RIFF"); /* 0-3 */ + put_num(i_bytecount+44-8, fd, 4); /* 4-7 */ + writestr(fd, "WAVEfmt "); /* 8-15 */ + put_num(16, fd, 4); /* 16-19 */ + put_num(1, fd, 2); /* 20-21 */ + put_num(2, fd, 2); /* 22-23 */ + put_num(44100, fd, 4); /* 24-27 */ + put_num(44100*2*2, fd, 4); /* 28-31 */ + put_num(4, fd, 2); /* 32-33 */ + put_num(16, fd, 2); /* 34-35 */ + writestr(fd, "data"); /* 36-39 */ + put_num(i_bytecount, fd, 4); /* 40-43 */ } int