Correct the type of the `c' arg to pccnputc().

Move declarations of console functions to cons.h so that they can't be
defined inconsistently in several places.  They should be config(8)ed.
This commit is contained in:
bde 1995-04-23 10:15:42 +00:00
parent 222122e04d
commit c351f3cb48
6 changed files with 30 additions and 33 deletions

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.111 1995/04/04 20:06:26 sos Exp $
* $Id: syscons.c,v 1.112 1995/04/12 20:48:07 wollman Exp $
*/
#include "sc.h"
@ -1145,8 +1145,9 @@ pccninit(struct consdev *cp)
}
void
pccnputc(dev_t dev, char c)
pccnputc(dev_t dev, int c)
{
u_char buf[1];
scr_stat *scp = console[0];
term_stat save = scp->term;
@ -1156,8 +1157,10 @@ pccnputc(dev_t dev, char c)
draw_cursor(scp, FALSE);
if (c == '\n')
ansi_put(scp, "\r\n", 2);
else
ansi_put(scp, &c, 1);
else {
buf[0] = c;
ansi_put(scp, buf, 1);
}
kernel_console = scp->term;
current_default = &user_default;
scp->term = save;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.h,v 1.4 1995/03/03 08:37:08 sos Exp $
* $Id: syscons.h,v 1.7 1995/04/04 20:04:17 sos Exp $
*/
#ifndef SYSCONS_H
@ -38,7 +38,8 @@
#define pa_to_va(pa) (KERNBASE + (pa)) /* works if ISMAPPED(pa...) */
/* printable chars */
#define PRINTABLE(ch) ((ch)>0x1B || ((ch)>0x0d && (ch)<0x1b) || (ch)<0x07)
#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
|| (ch) < 0x07)
/* macros for "intelligent" screen update */
#define mark_for_update(scp, x) {\
@ -175,11 +176,6 @@ int scparam(struct tty *tp, struct termios *t);
int scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p);
void scxint(dev_t dev);
void scstart(struct tty *tp);
void pccnprobe(struct consdev *cp);
void pccninit(struct consdev *cp);
void pccnputc(dev_t dev, char c);
int pccngetc(dev_t dev);
int pccncheckc(dev_t dev);
void scintr(int unit);
int pcmmap(dev_t dev, int offset, int nprot);
static void scinit(void);

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.111 1995/04/04 20:06:26 sos Exp $
* $Id: syscons.c,v 1.112 1995/04/12 20:48:07 wollman Exp $
*/
#include "sc.h"
@ -1145,8 +1145,9 @@ pccninit(struct consdev *cp)
}
void
pccnputc(dev_t dev, char c)
pccnputc(dev_t dev, int c)
{
u_char buf[1];
scr_stat *scp = console[0];
term_stat save = scp->term;
@ -1156,8 +1157,10 @@ pccnputc(dev_t dev, char c)
draw_cursor(scp, FALSE);
if (c == '\n')
ansi_put(scp, "\r\n", 2);
else
ansi_put(scp, &c, 1);
else {
buf[0] = c;
ansi_put(scp, buf, 1);
}
kernel_console = scp->term;
current_default = &user_default;
scp->term = save;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.h,v 1.4 1995/03/03 08:37:08 sos Exp $
* $Id: syscons.h,v 1.7 1995/04/04 20:04:17 sos Exp $
*/
#ifndef SYSCONS_H
@ -38,7 +38,8 @@
#define pa_to_va(pa) (KERNBASE + (pa)) /* works if ISMAPPED(pa...) */
/* printable chars */
#define PRINTABLE(ch) ((ch)>0x1B || ((ch)>0x0d && (ch)<0x1b) || (ch)<0x07)
#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
|| (ch) < 0x07)
/* macros for "intelligent" screen update */
#define mark_for_update(scp, x) {\
@ -175,11 +176,6 @@ int scparam(struct tty *tp, struct termios *t);
int scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p);
void scxint(dev_t dev);
void scstart(struct tty *tp);
void pccnprobe(struct consdev *cp);
void pccninit(struct consdev *cp);
void pccnputc(dev_t dev, char c);
int pccngetc(dev_t dev);
int pccncheckc(dev_t dev);
void scintr(int unit);
int pcmmap(dev_t dev, int offset, int nprot);
static void scinit(void);

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.111 1995/04/04 20:06:26 sos Exp $
* $Id: syscons.c,v 1.112 1995/04/12 20:48:07 wollman Exp $
*/
#include "sc.h"
@ -1145,8 +1145,9 @@ pccninit(struct consdev *cp)
}
void
pccnputc(dev_t dev, char c)
pccnputc(dev_t dev, int c)
{
u_char buf[1];
scr_stat *scp = console[0];
term_stat save = scp->term;
@ -1156,8 +1157,10 @@ pccnputc(dev_t dev, char c)
draw_cursor(scp, FALSE);
if (c == '\n')
ansi_put(scp, "\r\n", 2);
else
ansi_put(scp, &c, 1);
else {
buf[0] = c;
ansi_put(scp, buf, 1);
}
kernel_console = scp->term;
current_default = &user_default;
scp->term = save;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.h,v 1.4 1995/03/03 08:37:08 sos Exp $
* $Id: syscons.h,v 1.7 1995/04/04 20:04:17 sos Exp $
*/
#ifndef SYSCONS_H
@ -38,7 +38,8 @@
#define pa_to_va(pa) (KERNBASE + (pa)) /* works if ISMAPPED(pa...) */
/* printable chars */
#define PRINTABLE(ch) ((ch)>0x1B || ((ch)>0x0d && (ch)<0x1b) || (ch)<0x07)
#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
|| (ch) < 0x07)
/* macros for "intelligent" screen update */
#define mark_for_update(scp, x) {\
@ -175,11 +176,6 @@ int scparam(struct tty *tp, struct termios *t);
int scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p);
void scxint(dev_t dev);
void scstart(struct tty *tp);
void pccnprobe(struct consdev *cp);
void pccninit(struct consdev *cp);
void pccnputc(dev_t dev, char c);
int pccngetc(dev_t dev);
int pccncheckc(dev_t dev);
void scintr(int unit);
int pcmmap(dev_t dev, int offset, int nprot);
static void scinit(void);