Skip to content

Commit

Permalink
Fix printf format warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Jul 12, 2020
1 parent d7abe8b commit 2393aef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions src/drivers/fluid_opensles.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,39 +109,39 @@ new_fluid_opensles_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth

if(!dev->engine)
{
FLUID_LOG(FLUID_ERR, "Failed to create the OpenSL ES engine, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to create the OpenSL ES engine, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

result = (*dev->engine)->Realize(dev->engine, SL_BOOLEAN_FALSE);

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to realize the OpenSL ES engine, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to realize the OpenSL ES engine, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

result = (*dev->engine)->GetInterface(dev->engine, SL_IID_ENGINE, &engine_interface);

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to retrieve the OpenSL ES engine interface, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to retrieve the OpenSL ES engine interface, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

result = (*engine_interface)->CreateOutputMix(engine_interface, &dev->output_mix_object, 0, 0, 0);

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to create the OpenSL ES output mix object, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to create the OpenSL ES output mix object, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

result = (*dev->output_mix_object)->Realize(dev->output_mix_object, SL_BOOLEAN_FALSE);

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to realize the OpenSL ES output mix object, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to realize the OpenSL ES output mix object, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

Expand Down Expand Up @@ -183,15 +183,15 @@ new_fluid_opensles_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to create the OpenSL ES audio player object, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to create the OpenSL ES audio player object, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

result = (*dev->audio_player)->Realize(dev->audio_player, SL_BOOLEAN_FALSE);

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to realize the OpenSL ES audio player object, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to realize the OpenSL ES audio player object, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

Expand All @@ -200,7 +200,7 @@ new_fluid_opensles_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to retrieve the OpenSL ES audio player interface, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to retrieve the OpenSL ES audio player interface, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

Expand All @@ -209,7 +209,7 @@ new_fluid_opensles_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to retrieve the OpenSL ES buffer queue interface, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to retrieve the OpenSL ES buffer queue interface, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

Expand All @@ -232,7 +232,7 @@ new_fluid_opensles_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to register the opensles_callback, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to register the opensles_callback, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

Expand All @@ -247,23 +247,23 @@ new_fluid_opensles_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to add a buffer to the queue, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to add a buffer to the queue, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

result = (*dev->audio_player_interface)->SetCallbackEventsMask(dev->audio_player_interface, SL_PLAYEVENT_HEADATEND);

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to set OpenSL ES audio player callback events, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to set OpenSL ES audio player callback events, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

result = (*dev->audio_player_interface)->SetPlayState(dev->audio_player_interface, SL_PLAYSTATE_PLAYING);

if(result != SL_RESULT_SUCCESS)
{
FLUID_LOG(FLUID_ERR, "Failed to set OpenSL ES audio player play state to playing, error code 0x%lx", result);
FLUID_LOG(FLUID_ERR, "Failed to set OpenSL ES audio player play state to playing, error code 0x%lx", (unsigned long)result);
goto error_recovery;
}

Expand Down
6 changes: 3 additions & 3 deletions src/midi/fluid_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fluid_file_read_full(fluid_file fp, size_t *length)
return NULL;
}

FLUID_LOG(FLUID_DBG, "File load: Allocating %lu bytes", buflen);
FLUID_LOG(FLUID_DBG, "File load: Allocating %lu bytes", (unsigned long)buflen);
buffer = FLUID_MALLOC(buflen);

if(buffer == NULL)
Expand All @@ -187,8 +187,8 @@ fluid_file_read_full(fluid_file fp, size_t *length)

if(n != buflen)
{
FLUID_LOG(FLUID_ERR, "Only read %lu bytes; expected %lu", n,
buflen);
FLUID_LOG(FLUID_ERR, "Only read %lu bytes; expected %lu", (unsigned long)n,
(unsigned long)buflen);
FLUID_FREE(buffer);
return NULL;
};
Expand Down

0 comments on commit 2393aef

Please sign in to comment.