mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-04 22:47:44 -04:00
minor refactoring (lprintf)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@900 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
6fb01dd380
commit
2b9f9c51e6
5 changed files with 24 additions and 42 deletions
|
@ -275,8 +275,6 @@ void sharedmem940_finish(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern char **g_argv;
|
|
||||||
|
|
||||||
void YM2612Init_940(int baseclock, int rate)
|
void YM2612Init_940(int baseclock, int rate)
|
||||||
{
|
{
|
||||||
printf("YM2612Init_940()\n");
|
printf("YM2612Init_940()\n");
|
||||||
|
|
10
gp2x/plat.c
10
gp2x/plat.c
|
@ -1,7 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include "plat_gp2x.h"
|
#include "plat_gp2x.h"
|
||||||
#include "soc.h"
|
#include "soc.h"
|
||||||
|
@ -209,12 +208,3 @@ void plat_finish(void)
|
||||||
sndout_oss_exit();
|
sndout_oss_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void lprintf(const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list vl;
|
|
||||||
|
|
||||||
va_start(vl, fmt);
|
|
||||||
vprintf(fmt, vl);
|
|
||||||
va_end(vl);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
11
linux/io.c
11
linux/io.c
|
@ -1,7 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include "../common/emu.h"
|
#include "../common/emu.h"
|
||||||
#include "../common/menu.h"
|
#include "../common/menu.h"
|
||||||
|
@ -364,13 +363,3 @@ void mp3_update(int *buffer, int length, int stereo)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lprintf */
|
|
||||||
void lprintf(const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list vl;
|
|
||||||
|
|
||||||
va_start(vl, fmt);
|
|
||||||
vprintf(fmt, vl);
|
|
||||||
va_end(vl);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
32
linux/plat.c
32
linux/plat.c
|
@ -1,6 +1,7 @@
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -22,17 +23,22 @@ int plat_is_dir(const char *path)
|
||||||
|
|
||||||
int plat_get_root_dir(char *dst, int len)
|
int plat_get_root_dir(char *dst, int len)
|
||||||
{
|
{
|
||||||
extern char **g_argv;
|
int j, ret;
|
||||||
int j;
|
|
||||||
|
ret = readlink("/proc/self/exe", dst, len - 1);
|
||||||
|
if (ret < 0) {
|
||||||
|
perror("readlink");
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
dst[ret] = 0;
|
||||||
|
|
||||||
strncpy(dst, g_argv[0], len);
|
|
||||||
len -= 32; // reserve
|
|
||||||
if (len < 0) len = 0;
|
|
||||||
dst[len] = 0;
|
|
||||||
for (j = strlen(dst); j > 0; j--)
|
for (j = strlen(dst); j > 0; j--)
|
||||||
if (dst[j] == '/') { dst[j+1] = 0; break; }
|
if (dst[j] == '/') {
|
||||||
|
dst[++j] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return j + 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __GP2X__
|
#ifdef __GP2X__
|
||||||
|
@ -142,3 +148,13 @@ void plat_munmap(void *ptr, size_t size)
|
||||||
munmap(ptr, size);
|
munmap(ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* lprintf */
|
||||||
|
void lprintf(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list vl;
|
||||||
|
|
||||||
|
va_start(vl, fmt);
|
||||||
|
vprintf(fmt, vl);
|
||||||
|
va_end(vl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdarg.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -627,13 +626,3 @@ void plat_finish(void)
|
||||||
printf("all done\n");
|
printf("all done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lprintf */
|
|
||||||
void lprintf(const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list vl;
|
|
||||||
|
|
||||||
va_start(vl, fmt);
|
|
||||||
vprintf(fmt, vl);
|
|
||||||
va_end(vl);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue