Sprinkle some const -- gets things out of the .data segment, which

is important in the i386 boot blocks (grmumble).
This commit is contained in:
thorpej 2000-11-02 00:34:51 +00:00
parent bc7363329c
commit abf350ddcf
1 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dosfs.c,v 1.1 2000/11/02 00:25:05 thorpej Exp $ */ /* $NetBSD: dosfs.c,v 1.2 2000/11/02 00:34:51 thorpej Exp $ */
/* /*
* Copyright (c) 1996, 1998 Robert Nordier * Copyright (c) 1996, 1998 Robert Nordier
@ -98,7 +98,7 @@ typedef struct {
/* Supply missing "." and ".." root directory entries */ /* Supply missing "." and ".." root directory entries */
static const char *const dotstr[2] = {".", ".."}; static const char *const dotstr[2] = {".", ".."};
static struct direntry dot[2] = { static const struct direntry dot[2] = {
{". ", " ", ATTR_DIRECTORY, {". ", " ", ATTR_DIRECTORY,
0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0}, 0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0},
{0, 0}, {0x21, 0}, {0, 0}, {0, 0, 0, 0}}, {0, 0}, {0x21, 0}, {0, 0}, {0, 0, 0, 0}},
@ -138,8 +138,8 @@ static struct direntry dot[2] = {
static int dosunmount(DOS_FS *); static int dosunmount(DOS_FS *);
static int parsebs(DOS_FS *, DOS_BS *); static int parsebs(DOS_FS *, DOS_BS *);
static int namede(DOS_FS *, const char *, struct direntry **); static int namede(DOS_FS *, const char *, const struct direntry **);
static int lookup(DOS_FS *, u_int, const char *, struct direntry **); static int lookup(DOS_FS *, u_int, const char *, const struct direntry **);
static void cp_xdnm(u_char *, struct winentry *); static void cp_xdnm(u_char *, struct winentry *);
static void cp_sfn(u_char *, struct direntry *); static void cp_sfn(u_char *, struct direntry *);
static off_t fsize(DOS_FS *, struct direntry *); static off_t fsize(DOS_FS *, struct direntry *);
@ -202,7 +202,7 @@ dosunmount(DOS_FS * fs)
int int
dosfs_open(char *path, struct open_file *fd) dosfs_open(char *path, struct open_file *fd)
{ {
struct direntry *de; const struct direntry *de;
DOS_FILE *f; DOS_FILE *f;
DOS_FS *fs; DOS_FS *fs;
u_int size, clus; u_int size, clus;
@ -427,10 +427,10 @@ parsebs(DOS_FS * fs, DOS_BS * bs)
* Return directory entry from path * Return directory entry from path
*/ */
static int static int
namede(DOS_FS * fs, const char *path, struct direntry ** dep) namede(DOS_FS * fs, const char *path, const struct direntry ** dep)
{ {
char name[256]; char name[256];
struct direntry *de; const struct direntry *de;
char *s; char *s;
size_t n; size_t n;
int err; int err;
@ -462,7 +462,7 @@ namede(DOS_FS * fs, const char *path, struct direntry ** dep)
* Lookup path segment * Lookup path segment
*/ */
static int static int
lookup(DOS_FS * fs, u_int clus, const char *name, struct direntry ** dep) lookup(DOS_FS * fs, u_int clus, const char *name, const struct direntry ** dep)
{ {
DOS_DIR *dir; DOS_DIR *dir;
u_char lfn[261]; u_char lfn[261];