Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Fixes for -Wcast-qual. Add some needed const around...
details: https://anonhg.NetBSD.org/src/rev/8ae8628eda0a
branches: trunk
changeset: 581902:8ae8628eda0a
user: jmc <jmc%NetBSD.org@localhost>
date: Thu Jun 09 17:46:19 2005 +0000
description:
Fixes for -Wcast-qual. Add some needed const around char *'s,
__UNVOLATILE in READ/WRITE_REG and convert the rtc functions to properaly
take a volatile timeval
diffstat:
sys/arch/mips/sibyte/dev/sbmac.c | 6 +++---
sys/arch/mips/sibyte/dev/sbscn.c | 14 +++++++-------
sys/arch/sbmips/sbmips/rtc.c | 20 ++++++++++----------
3 files changed, 20 insertions(+), 20 deletions(-)
diffs (152 lines):
diff -r 387da7570658 -r 8ae8628eda0a sys/arch/mips/sibyte/dev/sbmac.c
--- a/sys/arch/mips/sibyte/dev/sbmac.c Thu Jun 09 16:38:29 2005 +0000
+++ b/sys/arch/mips/sibyte/dev/sbmac.c Thu Jun 09 17:46:19 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbmac.c,v 1.19 2004/03/19 07:11:33 cgd Exp $ */
+/* $NetBSD: sbmac.c,v 1.20 2005/06/09 17:46:19 jmc Exp $ */
/*
* Copyright 2000, 2001, 2004
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.19 2004/03/19 07:11:33 cgd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.20 2005/06/09 17:46:19 jmc Exp $");
#include "bpfilter.h"
#include "opt_inet.h"
@@ -2244,7 +2244,7 @@
*/
static int
-sbmac_parse_hwaddr(char *str, u_char *hwaddr)
+sbmac_parse_hwaddr(const char *str, u_char *hwaddr)
{
int digit1, digit2;
int idx = 6;
diff -r 387da7570658 -r 8ae8628eda0a sys/arch/mips/sibyte/dev/sbscn.c
--- a/sys/arch/mips/sibyte/dev/sbscn.c Thu Jun 09 16:38:29 2005 +0000
+++ b/sys/arch/mips/sibyte/dev/sbscn.c Thu Jun 09 17:46:19 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbscn.c,v 1.12 2003/08/07 16:28:35 agc Exp $ */
+/* $NetBSD: sbscn.c,v 1.13 2005/06/09 17:46:19 jmc Exp $ */
/*
* Copyright 2000, 2001
@@ -116,7 +116,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.12 2003/08/07 16:28:35 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.13 2005/06/09 17:46:19 jmc Exp $");
#define SBSCN_DEBUG
@@ -240,8 +240,8 @@
CFATTACH_DECL(sbscn, sizeof(struct sbscn_softc),
sbscn_match, sbscn_attach, NULL, NULL);
-#define READ_REG(rp) (mips3_ld((uint64_t *)(rp)))
-#define WRITE_REG(rp, val) (mips3_sd((uint64_t *)(rp), (val)))
+#define READ_REG(rp) (mips3_ld((int64_t *)__UNVOLATILE(rp)))
+#define WRITE_REG(rp, val) (mips3_sd((uint64_t *)__UNVOLATILE(rp), (val)))
/*
* input and output signals are actually the _inverse_ of the bits in the
@@ -421,12 +421,12 @@
}
#ifdef SBSCN_DEBUG
-void sbscn_status(struct sbscn_channel *, char *);
+void sbscn_status(struct sbscn_channel *, const char *);
int sbscn_debug = 0 /* XXXCGD */;
void
-sbscn_status(struct sbscn_channel *ch, char *str)
+sbscn_status(struct sbscn_channel *ch, const char *str)
{
struct sbscn_softc *sc = ch->ch_sc;
struct tty *tp = ch->ch_tty;
@@ -1330,7 +1330,7 @@
integrate void
sbscn_rxsoft(struct sbscn_channel *ch, struct tty *tp)
{
- int (*rint)(int c, struct tty *tp) = tp->t_linesw->l_rint;
+ int (*rint)(int, struct tty *) = tp->t_linesw->l_rint;
u_char *get, *end;
u_int cc, scc;
u_char sr;
diff -r 387da7570658 -r 8ae8628eda0a sys/arch/sbmips/sbmips/rtc.c
--- a/sys/arch/sbmips/sbmips/rtc.c Thu Jun 09 16:38:29 2005 +0000
+++ b/sys/arch/sbmips/sbmips/rtc.c Thu Jun 09 17:46:19 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtc.c,v 1.10 2005/06/04 20:14:24 he Exp $ */
+/* $NetBSD: rtc.c,v 1.11 2005/06/09 17:46:19 jmc Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.10 2005/06/04 20:14:24 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.11 2005/06/09 17:46:19 jmc Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -68,13 +68,13 @@
static int xirtc_match(struct device *, struct cfdata *, void *);
static void xirtc_attach(struct device *, struct device *, void *);
-static int xirtc_gettime(todr_chip_handle_t, struct timeval *);
-static int xirtc_settime(todr_chip_handle_t, struct timeval *);
+static int xirtc_gettime(todr_chip_handle_t, volatile struct timeval *);
+static int xirtc_settime(todr_chip_handle_t, volatile struct timeval *);
static int strtc_match(struct device *, struct cfdata *, void *);
static void strtc_attach(struct device *, struct device *, void *);
-static int strtc_gettime(todr_chip_handle_t, struct timeval *);
-static int strtc_settime(todr_chip_handle_t, struct timeval *);
+static int strtc_gettime(todr_chip_handle_t, volatile struct timeval *);
+static int strtc_settime(todr_chip_handle_t, volatile struct timeval *);
static int rtc_getcal(todr_chip_handle_t, int *);
static int rtc_setcal(todr_chip_handle_t, int);
@@ -152,7 +152,7 @@
}
static int
-xirtc_settime(todr_chip_handle_t handle, struct timeval *tv)
+xirtc_settime(todr_chip_handle_t handle, volatile struct timeval *tv)
{
struct rtc_softc *sc = handle->cookie;
struct clock_ymdhms ymdhms;
@@ -187,7 +187,7 @@
}
static int
-xirtc_gettime(todr_chip_handle_t handle, struct timeval *tv)
+xirtc_gettime(todr_chip_handle_t handle, volatile struct timeval *tv)
{
struct rtc_softc *sc = handle->cookie;
struct clock_ymdhms ymdhms;
@@ -270,7 +270,7 @@
}
static int
-strtc_settime(todr_chip_handle_t handle, struct timeval *tv)
+strtc_settime(todr_chip_handle_t handle, volatile struct timeval *tv)
{
struct rtc_softc *sc = handle->cookie;
struct clock_ymdhms ymdhms;
@@ -298,7 +298,7 @@
}
static int
-strtc_gettime(todr_chip_handle_t handle, struct timeval *tv)
+strtc_gettime(todr_chip_handle_t handle, volatile struct timeval *tv)
{
struct rtc_softc *sc = handle->cookie;
struct clock_ymdhms ymdhms;
Home |
Main Index |
Thread Index |
Old Index