Skip to content

Commit

Permalink
Test compilation with gnu++20 std
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed Jan 11, 2024
1 parent 8d30297 commit 19cbf4e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ if test "x$GCC" = "xyes"; then
CXXFLAGS="$CXXFLAGS -ffast-math -Wall -pipe"
# use C++17 if possible (Qt 6 requires it)
AUD_CHECK_CXXFLAGS(-std=gnu++17)
if test "${CXXFLAGS%gnu++17}" = "$CXXFLAGS" ; then
AUD_CHECK_CXXFLAGS(-std=gnu++20)
if test "${CXXFLAGS%gnu++20}" = "$CXXFLAGS" ; then
CXXFLAGS="$CXXFLAGS -std=gnu++11"
fi
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project('audacious-plugins', 'c', 'cpp',
meson_version: '>= 0.51',
default_options: [
'c_std=gnu99',
'cpp_std=gnu++17',
'cpp_std=gnu++20',
'warning_level=1'
])

Expand Down
6 changes: 3 additions & 3 deletions src/aosd/aosd_trigger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ aosd_trigger_func_pb_titlechange_cb ( void * plentry_gp , void * prevs_gp )

/* same filename but title changed, useful to detect http stream song changes */

if ( ( prevs->title != nullptr ) && ( prevs->filename != nullptr ) )
if (prevs->title && prevs->filename)
{
if ( ( pl_entry_filename != nullptr ) && ( !strcmp(pl_entry_filename,prevs->filename) ) )
if (pl_entry_filename && ! strcmp (pl_entry_filename, prevs->filename))
{
if ( ( pl_entry_title != nullptr ) && ( strcmp(pl_entry_title,prevs->title) ) )
if (pl_entry_title && strcmp (pl_entry_title, prevs->title))
{
/* string formatting is done here a.t.m. - TODO - improve this area */
char * markup = g_markup_printf_escaped
Expand Down
4 changes: 2 additions & 2 deletions src/oss4/oss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ static int open_device()
flags |= O_EXCL;
}

if (aud_get_bool("oss4", "use_alt_device") && alt_device != nullptr)
if (aud_get_bool("oss4", "use_alt_device") && alt_device)
res = open(alt_device, flags);
else if (device != nullptr)
else if (device)
res = open(device, flags);
else
res = open(DEFAULT_DSP, flags);
Expand Down
6 changes: 3 additions & 3 deletions src/scrobbler2/scrobbler_communication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static gboolean scrobbler_request_token ()

if (read_token(error_code, error_detail) == false) {
success = false;
if (error_code != nullptr && g_strcmp0(error_code, "8")) {
if (error_code && g_strcmp0(error_code, "8")) {
//error code 8: There was an error granting the request token. Please try again later
request_token = String();
}
Expand All @@ -162,7 +162,7 @@ static gboolean update_session_key() {
String error_detail;

if (read_session_key(error_code, error_detail) == false) {
if (error_code != nullptr && (
if (error_code && (
g_strcmp0(error_code, "4") == 0 || //invalid token
g_strcmp0(error_code, "14") == 0 || //token not authorized
g_strcmp0(error_code, "15") == 0 //token expired
Expand Down Expand Up @@ -230,7 +230,7 @@ static gboolean scrobbler_test_connection() {
if (read_authentication_test_result(error_code, error_detail) == false) {
AUDINFO("Error code: %s. Detail: %s.\n", (const char *)error_code,
(const char *)error_detail);
if (error_code != nullptr && (
if (error_code && (
g_strcmp0(error_code, "4") == 0 || //error code 4: Authentication Failed - You do not have permissions to access the service
g_strcmp0(error_code, "9") == 0 //error code 9: Invalid session key - Please re-authenticate
)) {
Expand Down
2 changes: 1 addition & 1 deletion src/xspf/xspf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void xspf_add_file (xmlNode * track, const char * filename,
}
}

if (location != nullptr)
if (location)
{
if (tuple.valid ())
tuple.set_filename (location);
Expand Down

0 comments on commit 19cbf4e

Please sign in to comment.