changeset 35:b9d679965320

Code cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 24 May 2010 01:22:33 +0300
parents 32ec3c0d1b6c
children d803c129c1e2
files pwplib/gb.c pwplib/gb.h pwplib/pwplib.h pwplib/setup.c pwplib/snd-oss.c pwplib/snd-sdl.c pwplib/snd-w32.c pwplib/tty.h
diffstat 8 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/pwplib/gb.c	Mon May 24 01:16:43 2010 +0300
+++ b/pwplib/gb.c	Mon May 24 01:22:33 2010 +0300
@@ -49,7 +49,7 @@
   {int i=0;for(;i<3;i++)gb_sound(i,0,0,0);}
 }
 
-void gb_gen1chan(char*d,int l,int freq)
+static void gb_gen1chan(char*d,int l,int freq)
 {
   int ph=128*256;
   while(l--){
@@ -60,7 +60,7 @@
 
 #define CH pwpgb.ch
 
-void gb_beepemu(char*d,int l)
+static void gb_beepemu(char*d,int l)
 {
   static int pf=0;
   int
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pwplib/gb.h	Mon May 24 01:22:33 2010 +0300
@@ -0,0 +1,10 @@
+#ifndef PWP_GB_H
+#define PWP_GB_H 1
+
+#include "config.h"
+
+void gb_sound(int chan,int freq,int volume,int ratio);
+void gb_init(int freq);
+void gb_genwave(char*d,int l);
+
+#endif /* PWP_GB_H */
--- a/pwplib/pwplib.h	Mon May 24 01:16:43 2010 +0300
+++ b/pwplib/pwplib.h	Mon May 24 01:22:33 2010 +0300
@@ -181,5 +181,6 @@
 char* pwp_get_locale();
 void pwplib_dump_rast_plain();
 int pwp_timer_nrt();
+void pwplib_getopts();
 
 #endif
--- a/pwplib/setup.c	Mon May 24 01:16:43 2010 +0300
+++ b/pwplib/setup.c	Mon May 24 01:22:33 2010 +0300
@@ -122,7 +122,7 @@
 
 #define ARGC pwplib.argc
 #define ARGV pwplib.argv
-int getopts(optab*argin)
+static int getopts(optab *argin)
 {
    int i=0;
    
@@ -219,7 +219,7 @@
 
 /************************************/
 
-optab main_init[]=
+static optab main_init[]=
 {
    /* stuph */
    "help",   OPT_ONE,(void*)0,(void*)&pwplib.setup[SETUP_WANTHELP],
--- a/pwplib/snd-oss.c	Mon May 24 01:16:43 2010 +0300
+++ b/pwplib/snd-oss.c	Mon May 24 01:22:33 2010 +0300
@@ -10,6 +10,7 @@
 #include <linux/soundcard.h>
 
 #include "pwplib.h"
+#include "gb.h"
 
 #define TIMERHZ 72
 
@@ -20,8 +21,6 @@
    int freq;
 }pwp_oss;
 
-extern void gb_sound(int,int,int,int);
-
 void oss_loopflush()
 {
   for(;;)
--- a/pwplib/snd-sdl.c	Mon May 24 01:16:43 2010 +0300
+++ b/pwplib/snd-sdl.c	Mon May 24 01:22:33 2010 +0300
@@ -16,14 +16,13 @@
 #include <SDL.h>
 
 #include "pwplib.h"
+#include "gb.h"
 
 #define TIMERHZ 72
 
 static int pwp_sdlaudio_run = 1;
 static int pwp_sdlaudio_frag = -1, pwp_sdlaudio_curr;
 
-extern void gb_sound(int, int, int, int);
-
 
 static void pwp_sdlaudio_fill(void * udata, Uint8 * buf, int len)
 {
--- a/pwplib/snd-w32.c	Mon May 24 01:16:43 2010 +0300
+++ b/pwplib/snd-w32.c	Mon May 24 01:22:33 2010 +0300
@@ -12,6 +12,7 @@
 #define TIMERHZ 72
 
 #include "pwplib.h"
+#include "gb.h"
 
 #define NUMBUFS 2
 
@@ -29,8 +30,6 @@
 }
 pwp_w32snd;
 
-extern void gb_sound(int,int,int,int);
-
 void win32snd_fill()
 {
    while(pwp_w32snd.bufferptr<(HARDBUFSIZE-pwp_w32snd.buffersize))
--- a/pwplib/tty.h	Mon May 24 01:16:43 2010 +0300
+++ b/pwplib/tty.h	Mon May 24 01:22:33 2010 +0300
@@ -41,5 +41,5 @@
   TTY_VT2XX          /* vtnnn where nnn>=200 */
 };
 
-void tty_write(u8*data,int lgt);
-
+int tty_init(void);
+void tty_write(u8 *data, int lgt);