summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-08-31 16:52:44 +0000
committerbde <bde@FreeBSD.org>1996-08-31 16:52:44 +0000
commit070eb30ca675029e79f93333b60287527efc0906 (patch)
treed0ca99d3f53a0fe4ea60e83d05baa8825fdd8cc4 /sys/kern
parentdb0af2c4dc8e05c93d178bf31653024d244398bb (diff)
downloadFreeBSD-src-070eb30ca675029e79f93333b60287527efc0906.zip
FreeBSD-src-070eb30ca675029e79f93333b60287527efc0906.tar.gz
Fixed the easy cases of const poisoning in the kernel. Cosmetic.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_aout.c4
-rw-r--r--sys/kern/imgact_elf.c14
-rw-r--r--sys/kern/imgact_gzip.c4
-rw-r--r--sys/kern/imgact_shell.c4
-rw-r--r--sys/kern/subr_prf.c6
-rw-r--r--sys/kern/tty.c6
6 files changed, 19 insertions, 19 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 0455da5..3c9d9a8 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_aout.c,v 1.27 1996/05/01 02:42:41 bde Exp $
+ * $Id: imgact_aout.c,v 1.28 1996/05/02 10:43:16 phk Exp $
*/
#include <sys/param.h>
@@ -52,7 +52,7 @@ static int
exec_aout_imgact(imgp)
struct image_params *imgp;
{
- struct exec *a_out = (struct exec *) imgp->image_header;
+ const struct exec *a_out = (const struct exec *) imgp->image_header;
struct vmspace *vmspace = imgp->proc->p_vmspace;
vm_offset_t vmaddr;
unsigned long virtual_offset;
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index b44792d..0b96037 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,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: imgact_elf.c,v 1.6 1996/06/12 05:07:25 gpalmer Exp $
+ * $Id: imgact_elf.c,v 1.7 1996/06/18 05:15:46 dyson Exp $
*/
#include <sys/param.h>
@@ -67,7 +67,7 @@
static int map_pages __P((struct vnode *vp, vm_offset_t offset, vm_offset_t *buf, vm_size_t size));
static void unmap_pages __P((struct vnode *vp, vm_offset_t buf, vm_size_t size));
static int elf_check_permissions __P((struct proc *p, struct vnode *vp));
-static int elf_check_header __P((Elf32_Ehdr *hdr, int type));
+static int elf_check_header __P((const Elf32_Ehdr *hdr, int type));
static int elf_load_section __P((struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot));
static int elf_load_file __P((struct proc *p, char *file, u_long *addr, u_long *entry));
static int elf_freebsd_fixup __P((int **stack_base, struct image_params *imgp));
@@ -237,7 +237,7 @@ elf_check_permissions(struct proc *p, struct vnode *vp)
}
static int
-elf_check_header(Elf32_Ehdr *hdr, int type)
+elf_check_header(const Elf32_Ehdr *hdr, int type)
{
if (!(hdr->e_ident[EI_MAG0] == ELFMAG0 &&
hdr->e_ident[EI_MAG1] == ELFMAG1 &&
@@ -468,8 +468,8 @@ fail:
int
exec_elf_imgact(struct image_params *imgp)
{
- Elf32_Ehdr *hdr = (Elf32_Ehdr *) imgp->image_header;
- Elf32_Phdr *phdr, *mapped_phdr = NULL;
+ const Elf32_Ehdr *hdr = (const Elf32_Ehdr *) imgp->image_header;
+ const Elf32_Phdr *phdr, *mapped_phdr = NULL;
Elf32_Auxargs *elf_auxargs = NULL;
struct vmspace *vmspace = imgp->proc->p_vmspace;
vm_prot_t prot = 0;
@@ -514,8 +514,8 @@ exec_elf_imgact(struct image_params *imgp)
*/
phdr = mapped_phdr;
} else {
- phdr = (Elf32_Phdr*)
- ((char*)(imgp->image_header)+hdr->e_phoff);
+ phdr = (const Elf32_Phdr*)
+ ((const char *)imgp->image_header + hdr->e_phoff);
}
/*
diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c
index fd981fcb..32498ae 100644
--- a/sys/kern/imgact_gzip.c
+++ b/sys/kern/imgact_gzip.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: imgact_gzip.c,v 1.22 1996/05/02 10:43:16 phk Exp $
+ * $Id: imgact_gzip.c,v 1.23 1996/08/01 22:00:14 phk Exp $
*
* This module handles execution of a.out files which have been run through
* "gzip". This saves diskspace, but wastes cpu-cycles and VM.
@@ -66,7 +66,7 @@ exec_gzip_imgact(imgp)
struct image_params *imgp;
{
int error, error2 = 0;
- u_char *p = (u_char *) imgp->image_header;
+ const u_char *p = (const u_char *) imgp->image_header;
struct imgact_gzip igz;
struct inflate infl;
struct vmspace *vmspace;
diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c
index 3d2e8ff..b00c652 100644
--- a/sys/kern/imgact_shell.c
+++ b/sys/kern/imgact_shell.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_shell.c,v 1.10 1995/12/02 16:32:03 bde Exp $
+ * $Id: imgact_shell.c,v 1.11 1996/04/08 01:21:58 davidg Exp $
*/
#include <sys/param.h>
@@ -58,7 +58,7 @@ exec_shell_imgact(imgp)
char *interp;
/* a shell script? */
- if (((short *) image_header)[0] != SHELLMAGIC)
+ if (((const short *) image_header)[0] != SHELLMAGIC)
return(-1);
/*
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index bd6ff58..10c5770 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
- * $Id: subr_prf.c,v 1.37 1996/05/09 18:58:06 gpalmer Exp $
+ * $Id: subr_prf.c,v 1.38 1996/08/19 20:07:07 julian Exp $
*/
#include "opt_ddb.h"
@@ -390,14 +390,14 @@ kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_lis
for (;;) {
padc = ' ';
width = 0;
- while ((ch = *(u_char *)fmt++) != '%') {
+ while ((ch = (u_char)*fmt++) != '%') {
if (ch == '\0')
return retval;
PCHAR(ch);
}
lflag = 0; ladjust = 0; sharpflag = 0; neg = 0;
sign = 0; dot = 0; dwidth = 0;
-reswitch: switch (ch = *(u_char *)fmt++) {
+reswitch: switch (ch = (u_char)*fmt++) {
case '.':
dot = 1;
goto reswitch;
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 4d3c983..bdae27a 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
- * $Id: tty.c,v 1.82 1996/06/12 05:07:33 gpalmer Exp $
+ * $Id: tty.c,v 1.83 1996/08/28 18:45:09 bde Exp $
*/
/*-
@@ -135,7 +135,7 @@ static int ttywflush __P((struct tty *tp));
#define TB TAB
#define VT VTAB
-static char const char_type[] = {
+static u_char const char_type[] = {
E|CC, O|CC, O|CC, E|CC, O|CC, E|CC, E|CC, O|CC, /* nul - bel */
O|BS, E|TB, E|NL, O|CC, E|VT, O|CR, O|CC, E|CC, /* bs - si */
O|CC, E|CC, E|CC, O|CC, E|CC, O|CC, O|CC, E|CC, /* dle - etb */
@@ -1816,7 +1816,7 @@ loop:
ce = cc;
else {
ce = cc - scanc((u_int)cc, (u_char *)cp,
- (u_char *)char_type, CCLASSMASK);
+ char_type, CCLASSMASK);
/*
* If ce is zero, then we're processing
* a special character through ttyoutput.
OpenPOWER on IntegriCloud