From b2297d1dd698b444fc74b42a2af1b62d1838db18 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Fri, 27 Nov 2015 16:57:18 -0500 Subject: [PATCH 1/5] silence warnings on OSX clang3.0 (issue #480) --- 3rdparty/sqlite3/sqlite3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/3rdparty/sqlite3/sqlite3.c b/3rdparty/sqlite3/sqlite3.c index 04ab891c633..5dcd842b533 100644 --- a/3rdparty/sqlite3/sqlite3.c +++ b/3rdparty/sqlite3/sqlite3.c @@ -66815,7 +66815,7 @@ static int vdbeRecordCompareWithSkip( /* RHS is a string */ else if( pRhs->flags & MEM_Str ){ - getVarint32(&aKey1[idx1], serial_type); + (void) getVarint32(&aKey1[idx1], serial_type); testcase( serial_type==12 ); if( serial_type<12 ){ rc = -1; @@ -66846,7 +66846,7 @@ static int vdbeRecordCompareWithSkip( /* RHS is a blob */ else if( pRhs->flags & MEM_Blob ){ - getVarint32(&aKey1[idx1], serial_type); + (void) getVarint32(&aKey1[idx1], serial_type); testcase( serial_type==12 ); if( serial_type<12 || (serial_type & 0x01) ){ rc = -1; @@ -67016,7 +67016,7 @@ static int vdbeRecordCompareString( int serial_type; int res; - getVarint32(&aKey1[1], serial_type); + (void) getVarint32(&aKey1[1], serial_type); if( serial_type<12 ){ res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ }else if( !(serial_type & 0x01) ){ From d035640605acb99c37e4eee49896403880796a65 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Fri, 27 Nov 2015 17:12:21 -0500 Subject: [PATCH 2/5] add casts from emu_file to core_file (issue #482) --- src/devices/sound/samples.cpp | 2 +- src/emu/emuopts.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/sound/samples.cpp b/src/devices/sound/samples.cpp index 6da7dd48f16..4c209ec72ae 100644 --- a/src/devices/sound/samples.cpp +++ b/src/devices/sound/samples.cpp @@ -571,7 +571,7 @@ bool samples_device::read_flac_sample(emu_file &file, sample_t &sample) file.seek(0, SEEK_SET); // create the FLAC decoder and fill in the sample data - flac_decoder decoder(file); + flac_decoder decoder((core_file&) file); sample.frequency = decoder.sample_rate(); // error if more than 1 channel or not 16bpp diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index d891aae1d73..7fb6d51ef9e 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -557,7 +557,7 @@ bool emu_options::parse_one_ini(const char *basename, int priority, std::string // parse the file osd_printf_verbose("Parsing %s.ini\n", basename); std::string error; - bool result = parse_ini_file(file, priority, OPTION_PRIORITY_DRIVER_INI, error); + bool result = parse_ini_file((core_file&)file, priority, OPTION_PRIORITY_DRIVER_INI, error); // append errors if requested if (!error.empty() && error_string != NULL) From 842874f030b2f1edec0902e3078597d0ba45c3d1 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Fri, 27 Nov 2015 17:22:53 -0500 Subject: [PATCH 3/5] Fix "use of constant operatand with &&" on osx --- scripts/toolchain.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index e6e2e0e773b..d200ab0f2d5 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -858,6 +858,7 @@ function toolchain(_buildDir, _subDir) objdir (_buildDir .. "osx_clang" .. "/obj") buildoptions { "-m64", + "-Wno-constant-logical-operand", } configuration { "osx*", "x64", "Release" } From 74db76d146fac9082c4c1e671edc18b9cce3edae Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Sat, 28 Nov 2015 09:06:30 -0500 Subject: [PATCH 4/5] revert sqlite3 changes, update version detection to silence warnings on OSX clang++ 3.0 (issue #480) --- 3rdparty/sqlite3/sqlite3.c | 6 +++--- scripts/genie.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3rdparty/sqlite3/sqlite3.c b/3rdparty/sqlite3/sqlite3.c index 5dcd842b533..04ab891c633 100644 --- a/3rdparty/sqlite3/sqlite3.c +++ b/3rdparty/sqlite3/sqlite3.c @@ -66815,7 +66815,7 @@ static int vdbeRecordCompareWithSkip( /* RHS is a string */ else if( pRhs->flags & MEM_Str ){ - (void) getVarint32(&aKey1[idx1], serial_type); + getVarint32(&aKey1[idx1], serial_type); testcase( serial_type==12 ); if( serial_type<12 ){ rc = -1; @@ -66846,7 +66846,7 @@ static int vdbeRecordCompareWithSkip( /* RHS is a blob */ else if( pRhs->flags & MEM_Blob ){ - (void) getVarint32(&aKey1[idx1], serial_type); + getVarint32(&aKey1[idx1], serial_type); testcase( serial_type==12 ); if( serial_type<12 || (serial_type & 0x01) ){ rc = -1; @@ -67016,7 +67016,7 @@ static int vdbeRecordCompareString( int serial_type; int res; - (void) getVarint32(&aKey1[1], serial_type); + getVarint32(&aKey1[1], serial_type); if( serial_type<12 ){ res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ }else if( !(serial_type & 0x01) ){ diff --git a/scripts/genie.lua b/scripts/genie.lua index 7fd13787389..6ac6933c45f 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -998,7 +998,7 @@ end "-Wno-tautological-compare", "-Wno-dynamic-class-memaccess", } - if (version >= 30200) then + if (version >= 30000) then buildoptions { "-Wno-unused-value", } From d005322e2ba4131032eee6293ffdb79b923c876d Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Sat, 28 Nov 2015 09:12:34 -0500 Subject: [PATCH 5/5] Merge clang++ version 30000 and 30400 sections to enable -Wno-constant-logical-operand --- scripts/genie.lua | 4 ---- scripts/toolchain.lua | 1 - 2 files changed, 5 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 6ac6933c45f..f43f06b94b3 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1001,10 +1001,6 @@ end if (version >= 30000) then buildoptions { "-Wno-unused-value", - } - end - if (version >= 30400) then - buildoptions { "-Wno-inline-new-delete", "-Wno-constant-logical-operand", } diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index d200ab0f2d5..e6e2e0e773b 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -858,7 +858,6 @@ function toolchain(_buildDir, _subDir) objdir (_buildDir .. "osx_clang" .. "/obj") buildoptions { "-m64", - "-Wno-constant-logical-operand", } configuration { "osx*", "x64", "Release" }