Avoid printf/puts

This commit is contained in:
twinaphex 2020-09-28 03:17:21 +02:00
parent 2e5bfd74ec
commit 783bcb7a61
3 changed files with 18 additions and 40 deletions

View File

@ -15,7 +15,6 @@
#include <stdint.h>
#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <kernel.h>
@ -45,12 +44,6 @@ static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
err = audsrv_set_format(&format);
if (err)
{
printf("set format returned %d\n", err);
printf("audsrv returned error string: %s\n", audsrv_get_error_string());
}
audsrv_set_volume(MAX_VOLUME);
}

View File

@ -1217,10 +1217,7 @@ static int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int fr
pcm_mmap_appl_forward(pcm, frames);
ret = pcm_sync_ptr(pcm, 0);
if (ret != 0)
{
printf("%d\n", ret);
return ret;
}
return frames;
}

View File

@ -20,7 +20,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <sys/types.h>
#ifdef _WIN32
#include <direct.h>
@ -506,39 +505,29 @@ int libretrodb_create_index(libretrodb_t *db,
while (libretrodb_cursor_read_item(&cur, &item) == 0)
{
/* Only map keys are supported */
if (item.type != RDT_MAP)
{
printf("Only map keys are supported\n");
goto clean;
}
field = rmsgpack_dom_value_map_value(&item, &key);
/* Field not found in item */
if (!field)
{
printf("field not found in item\n");
goto clean;
}
/* Field is not binary */
if (field->type != RDT_BINARY)
{
printf("field is not binary\n");
goto clean;
}
/* Field is empty */
if (field->val.binary.len == 0)
{
printf("field is empty\n");
goto clean;
}
if (field_size == 0)
field_size = field->val.binary.len;
/* Field is not of correct size */
else if (field->val.binary.len != field_size)
{
printf("field is not of correct size\n");
goto clean;
}
buff = malloc(field_size + sizeof(uint64_t));
if (!buff)
@ -550,11 +539,10 @@ int libretrodb_create_index(libretrodb_t *db,
memcpy(buff_u64, &item_loc, sizeof(uint64_t));
/* Value is not unique? */
if (bintree_insert(tree, buff) != 0)
{
printf("Value is not unique: ");
rmsgpack_dom_value_print(field);
printf("\n");
goto clean;
}
buff = NULL;