* grub-core/commands/i386/pc/sendkey.c (keysym): Add missing const.
* grub-core/commands/lspci.c (grub_pci_classname): Likewise.
* grub-core/commands/menuentry.c (hotkey_aliases): Likewise.
* grub-core/disk/lvm.c (grub_lvm_getvalue): Likewise.
(grub_lvm_check_flag): Likewise.
* grub-core/efiemu/i386/coredetect.c
(grub_efiemu_get_default_core_name): Likewise
* grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise.
* grub-core/fs/hfsplus.c (grub_hfsplus_catkey_internal): Likewise.
* grub-core/fs/ntfs.c (fixup): Likewise.
* grub-core/fs/xfs.c (grub_xfs_iterate_dir): Likewise.
* grub-core/fs/zfs/zfs.c (decomp_entry): Likewise.
(fzap_lookup): Likewise.
(zap_lookup): Likewise.
* grub-core/gnulib/regcomp.c (init_dfa): Likewise.
* grub-core/lib/legacy_parse.c (check_option): Likewise.
* grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Likewise.
* grub-core/loader/i386/bsd.c (grub_bsd_add_meta): Likewise.
(grub_freebsd_add_meta_module): Likewise.
(grub_cmd_freebsd_module): Likewise.
* grub-core/loader/i386/xnu.c (tbl_alias): Likewise.
* grub-core/loader/xnu.c (grub_xnu_register_memory): Likewise.
(grub_xnu_writetree_get_size): Likewise.
(grub_xnu_writetree_toheap_real): Likewise.
(grub_xnu_find_key): Likewise.
(grub_xnu_create_key): Likewise.
(grub_xnu_create_value): Likewise.
(grub_xnu_register_memory): Likewise.
(grub_xnu_check_os_bundle_required): Likewise.
(grub_xnu_scan_dir_for_kexts): Likewise.
(grub_xnu_load_kext_from_dir): Likewise.
* grub-core/normal/color.c (color_list): Likewise.
* grub-core/normal/completion.c (current_word): Likewise.
* grub-core/normal/menu_entry.c (insert_string): Likewise.
* grub-core/term/serial.c (grub_serial_find): Likewise.
* grub-core/term/tparm.c (grub_terminfo_tparm): Likewise.
* include/grub/efiemu/efiemu.h (grub_efiemu_get_default_core_name):
Likewise.
* include/grub/i386/bsd.h (grub_bsd_add_meta): Likewise.
(grub_freebsd_add_meta_module): Likewise.
* include/grub/lib/arg.h (grub_arg_option): Likewise.
* include/grub/net.h (grub_net_card_driver): Likewise.
(grub_net_card): Likewise.
(grub_net_app_protocol): Likewise.
* include/grub/parttool.h (grub_parttool_argdesc): Likewise.
* include/grub/serial.h (grub_serial_find): Likewise.
* include/grub/tparm.h (grub_terminfo_tparm): Likewise.
* include/grub/xnu.h (grub_xnu_create_key): Likewise.
(grub_xnu_create_value): Likewise.
(grub_xnu_find_key): Likewise.
(grub_xnu_scan_dir_for_kexts): Likewise.
(grub_xnu_load_kext_from_dir): Likewise.
* include/grub/zfs/zio_checksum.h (zio_checksum_t): Moved from here ...
* grub-core/fs/zfs/zfs.c (zio_checksum_t): ...here.
* include/grub/zfs/zio_checksum.h (zio_checksum_info):
Moved from here ...
* grub-core/fs/zfs/zfs.c (zio_checksum_info): ... here. Added missing const.
+2011-11-30 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Add missing const qualifiers.
+
+ * grub-core/commands/i386/pc/sendkey.c (keysym): Add missing const.
+ * grub-core/commands/lspci.c (grub_pci_classname): Likewise.
+ * grub-core/commands/menuentry.c (hotkey_aliases): Likewise.
+ * grub-core/disk/lvm.c (grub_lvm_getvalue): Likewise.
+ (grub_lvm_check_flag): Likewise.
+ * grub-core/efiemu/i386/coredetect.c
+ (grub_efiemu_get_default_core_name): Likewise
+ * grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise.
+ * grub-core/fs/hfsplus.c (grub_hfsplus_catkey_internal): Likewise.
+ * grub-core/fs/ntfs.c (fixup): Likewise.
+ * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Likewise.
+ * grub-core/fs/zfs/zfs.c (decomp_entry): Likewise.
+ (fzap_lookup): Likewise.
+ (zap_lookup): Likewise.
+ * grub-core/gnulib/regcomp.c (init_dfa): Likewise.
+ * grub-core/lib/legacy_parse.c (check_option): Likewise.
+ * grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Likewise.
+ * grub-core/loader/i386/bsd.c (grub_bsd_add_meta): Likewise.
+ (grub_freebsd_add_meta_module): Likewise.
+ (grub_cmd_freebsd_module): Likewise.
+ * grub-core/loader/i386/xnu.c (tbl_alias): Likewise.
+ * grub-core/loader/xnu.c (grub_xnu_register_memory): Likewise.
+ (grub_xnu_writetree_get_size): Likewise.
+ (grub_xnu_writetree_toheap_real): Likewise.
+ (grub_xnu_find_key): Likewise.
+ (grub_xnu_create_key): Likewise.
+ (grub_xnu_create_value): Likewise.
+ (grub_xnu_register_memory): Likewise.
+ (grub_xnu_check_os_bundle_required): Likewise.
+ (grub_xnu_scan_dir_for_kexts): Likewise.
+ (grub_xnu_load_kext_from_dir): Likewise.
+ * grub-core/normal/color.c (color_list): Likewise.
+ * grub-core/normal/completion.c (current_word): Likewise.
+ * grub-core/normal/menu_entry.c (insert_string): Likewise.
+ * grub-core/term/serial.c (grub_serial_find): Likewise.
+ * grub-core/term/tparm.c (grub_terminfo_tparm): Likewise.
+ * include/grub/efiemu/efiemu.h (grub_efiemu_get_default_core_name):
+ Likewise.
+ * include/grub/i386/bsd.h (grub_bsd_add_meta): Likewise.
+ (grub_freebsd_add_meta_module): Likewise.
+ * include/grub/lib/arg.h (grub_arg_option): Likewise.
+ * include/grub/net.h (grub_net_card_driver): Likewise.
+ (grub_net_card): Likewise.
+ (grub_net_app_protocol): Likewise.
+ * include/grub/parttool.h (grub_parttool_argdesc): Likewise.
+ * include/grub/serial.h (grub_serial_find): Likewise.
+ * include/grub/tparm.h (grub_terminfo_tparm): Likewise.
+ * include/grub/xnu.h (grub_xnu_create_key): Likewise.
+ (grub_xnu_create_value): Likewise.
+ (grub_xnu_find_key): Likewise.
+ (grub_xnu_scan_dir_for_kexts): Likewise.
+ (grub_xnu_load_kext_from_dir): Likewise.
+
+ * include/grub/zfs/zio_checksum.h (zio_checksum_t): Moved from here ...
+ * grub-core/fs/zfs/zfs.c (zio_checksum_t): ...here.
+ * include/grub/zfs/zio_checksum.h (zio_checksum_info):
+ Moved from here ...
+ * grub-core/fs/zfs/zfs.c (zio_checksum_info): ... here. Added missing const.
+
2011-11-28 Colin Watson <cjwatson@ubuntu.com>
* util/getroot.c (find_root_device_from_libzfs): Use xasprintf.
struct
keysym
{
- char *unshifted_name; /* the name in unshifted state */
- char *shifted_name; /* the name in shifted state */
+ const char *unshifted_name; /* the name in unshifted state */
+ const char *shifted_name; /* the name in shifted state */
unsigned char unshifted_ascii; /* the ascii code in unshifted state */
unsigned char shifted_ascii; /* the ascii code in shifted state */
unsigned char keycode; /* keyboard scancode */
{
int class;
int subclass;
- char *desc;
+ const char *desc;
};
static const struct grub_pci_classname grub_pci_classes[] =
static struct
{
- char *name;
+ const char *name;
int key;
} hotkey_aliases[] =
{
at the number. In case STR is not found, *P will be NULL and the
return value will be 0. */
static int
-grub_lvm_getvalue (char **p, char *str)
+grub_lvm_getvalue (char **p, const char *str)
{
*p = grub_strstr (*p, str);
if (! *p)
#endif
static int
-grub_lvm_check_flag (char *p, char *str, char *flag)
+grub_lvm_check_flag (char *p, const char *str, const char *flag)
{
int len_str = grub_strlen (str), len_flag = grub_strlen (flag);
while (1)
#define bit_LM (1 << 29)
-char *
+const char *
grub_efiemu_get_default_core_name (void)
{
{
const char *prefix;
char *filename;
- char *suffix;
+ const char *suffix;
grub_err_t err;
if (grub_efiemu_sizeof_uintn_t () != 0)
struct grub_hfsplus_catkey_internal
{
grub_uint32_t parent;
- char *name;
+ const char *name;
};
/* Internal representation of an extent overflow key. */
grub_ntfscomp_func_t grub_ntfscomp_func;
static grub_err_t
-fixup (struct grub_ntfs_data *data, char *buf, int len, char *magic)
+fixup (struct grub_ntfs_data *data, char *buf, int len, const char *magic)
{
int ss;
char *pu;
grub_fshelp_node_t node))
{
struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
- auto int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename);
+ auto int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, const char *filename);
- int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename)
+ int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, const char *filename)
{
struct grub_fshelp_node *fdiro;
grub_size_t s_len, grub_size_t d_len);
typedef struct decomp_entry
{
- char *name;
+ const char *name;
zfs_decomp_func_t *decomp_func;
} decomp_entry_t;
+/*
+ * Signature for checksum functions.
+ */
+typedef void zio_checksum_t(const void *data, grub_uint64_t size,
+ grub_zfs_endian_t endian, zio_cksum_t *zcp);
+
+/*
+ * Information about each checksum function.
+ */
+typedef struct zio_checksum_info {
+ zio_checksum_t *ci_func; /* checksum function for each byteorder */
+ int ci_correctable; /* number of correctable bits */
+ int ci_eck; /* uses zio embedded checksum? */
+ const char *ci_name; /* descriptive name */
+} zio_checksum_info_t;
+
typedef struct dnode_end
{
dnode_phys_t dn;
/* XXX */
static grub_err_t
fzap_lookup (dnode_end_t * zap_dnode, zap_phys_t * zap,
- char *name, grub_uint64_t * value, struct grub_zfs_data *data,
- int case_insensitive)
+ const char *name, grub_uint64_t * value,
+ struct grub_zfs_data *data, int case_insensitive)
{
void *l;
grub_uint64_t hash, idx, blkid;
*
*/
static grub_err_t
-zap_lookup (dnode_end_t * zap_dnode, char *name, grub_uint64_t * val,
+zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val,
struct grub_zfs_data *data, int case_insensitive)
{
grub_uint64_t block_type;
{
__re_size_t table_size;
#ifndef _LIBC
- char *codeset_name;
+ const char *codeset_name;
#endif
#ifdef RE_ENABLE_I18N
size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
}
static int
-check_option (const char *a, char *b, grub_size_t len)
+check_option (const char *a, const char *b, grub_size_t len)
{
if (grub_strlen (b) != len)
return 0;
typedef enum { CODESET } nl_item;
-static inline char *
+static inline const char *
nl_langinfo (nl_item item)
{
switch (item)
}
grub_err_t
-grub_bsd_add_meta (grub_uint32_t type, void *data, grub_uint32_t len)
+grub_bsd_add_meta (grub_uint32_t type, const void *data, grub_uint32_t len)
{
struct bsd_tag *newtag;
}
grub_err_t
-grub_freebsd_add_meta_module (char *filename, char *type, int argc, char **argv,
+grub_freebsd_add_meta_module (const char *filename, const char *type,
+ int argc, char **argv,
grub_addr_t addr, grub_uint32_t size)
{
- char *name;
+ const char *name;
name = grub_strrchr (filename, '/');
if (name)
name++;
grub_file_t file = 0;
int modargc;
char **modargv;
- char *type;
+ const char *type;
grub_err_t err;
void *src;
struct tbl_alias
{
grub_efi_guid_t guid;
- char *name;
+ const char *name;
};
static struct tbl_alias table_aliases[] =
struct grub_relocator *grub_xnu_relocator;
static grub_err_t
-grub_xnu_register_memory (char *prefix, int *suffix,
+grub_xnu_register_memory (const char *prefix, int *suffix,
grub_addr_t addr, grub_size_t size);
grub_err_t
grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target)
/* Compute the size of device tree in xnu format. */
static grub_size_t
-grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name)
+grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start,
+ const char *name)
{
grub_size_t ret;
struct grub_xnu_devtree_key *cur;
/* Write devtree in XNU format at curptr assuming the head is named NAME.*/
static void *
grub_xnu_writetree_toheap_real (void *curptr,
- struct grub_xnu_devtree_key *start, char *name)
+ struct grub_xnu_devtree_key *start,
+ const char *name)
{
struct grub_xnu_devtree_key *cur;
int nkeys = 0, nvals = 0;
/* Find a key or value in parent key. */
struct grub_xnu_devtree_key *
-grub_xnu_find_key (struct grub_xnu_devtree_key *parent, char *name)
+grub_xnu_find_key (struct grub_xnu_devtree_key *parent, const char *name)
{
struct grub_xnu_devtree_key *cur;
for (cur = parent; cur; cur = cur->next)
}
struct grub_xnu_devtree_key *
-grub_xnu_create_key (struct grub_xnu_devtree_key **parent, char *name)
+grub_xnu_create_key (struct grub_xnu_devtree_key **parent, const char *name)
{
struct grub_xnu_devtree_key *ret;
ret = grub_xnu_find_key (*parent, name);
}
struct grub_xnu_devtree_key *
-grub_xnu_create_value (struct grub_xnu_devtree_key **parent, char *name)
+grub_xnu_create_value (struct grub_xnu_devtree_key **parent, const char *name)
{
struct grub_xnu_devtree_key *ret;
ret = grub_xnu_find_key (*parent, name);
/* Register a memory in a memory map under name PREFIXSUFFIX
and increment SUFFIX. */
static grub_err_t
-grub_xnu_register_memory (char *prefix, int *suffix,
+grub_xnu_register_memory (const char *prefix, int *suffix,
grub_addr_t addr, grub_size_t size)
{
struct grub_xnu_devtree_key *chosen;
/* Returns true if the kext should be loaded according to plist
and osbundlereq. Also fill BINNAME. */
static int
-grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
+grub_xnu_check_os_bundle_required (char *plistname,
+ const char *osbundlereq,
char **binname)
{
grub_file_t file;
/* Load all loadable kexts placed under DIRNAME and matching OSBUNDLEREQUIRED */
grub_err_t
-grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
+grub_xnu_scan_dir_for_kexts (char *dirname, const char *osbundlerequired,
int maxrecursion)
{
grub_device_t dev;
/* Load extension DIRNAME. (extensions are directories in xnu) */
grub_err_t
-grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
+grub_xnu_load_kext_from_dir (char *dirname, const char *osbundlerequired,
int maxrecursion)
{
grub_device_t dev;
#include <grub/i18n.h>
/* Borrowed from GRUB Legacy */
-static char *color_list[16] =
+static const char *color_list[16] =
{
"black",
"blue",
#include <grub/extcmd.h>
/* The current word. */
-static char *current_word;
+static const char *current_word;
/* The matched string. */
static char *match;
}
static int
-insert_string (struct screen *screen, char *s, int update)
+insert_string (struct screen *screen, const char *s, int update)
{
int region_start = screen->num_lines;
int region_column = 0;
else
{
/* All but LF. */
- char *p;
+ const char *p;
struct line *current_linep;
int size;
int orig_num[screen->nterms], new_num[screen->nterms];
\f
struct grub_serial_port *
-grub_serial_find (char *name)
+grub_serial_find (const char *name)
{
struct grub_serial_port *port;
{
struct grub_arg_list *state = ctxt->state;
char pname[40];
- char *name = NULL;
+ const char *name = NULL;
struct grub_serial_port *port;
struct grub_serial_config config;
grub_err_t err;
return (out_buff);
}
-char *
+const char *
grub_terminfo_tparm (const char *string, ...)
{
va_list ap;
grub_err_t grub_efiemu_write_sym_markers (void);
grub_err_t grub_efiemu_pnvram (void);
grub_err_t grub_efiemu_prepare (void);
-char *grub_efiemu_get_default_core_name (void);
+const char *grub_efiemu_get_default_core_name (void);
void grub_efiemu_pnvram_cmd_unregister (void);
grub_err_t grub_efiemu_autocore (void);
grub_err_t grub_efiemu_crc32 (void);
grub_addr_t *kern_end);
grub_err_t grub_bsd_add_meta (grub_uint32_t type,
- void *data, grub_uint32_t len);
-grub_err_t grub_freebsd_add_meta_module (char *filename, char *type,
+ const void *data, grub_uint32_t len);
+grub_err_t grub_freebsd_add_meta_module (const char *filename, const char *type,
int argc, char **argv,
grub_addr_t addr, grub_uint32_t size);
const char *longarg;
int shortarg;
int flags;
- char *doc;
- char *arg;
+ const char *doc;
+ const char *arg;
grub_arg_type_t type;
};
struct grub_net_card_driver
{
struct grub_net_card_driver *next;
- char *name;
+ const char *name;
grub_err_t (*open) (const struct grub_net_card *dev);
void (*close) (const struct grub_net_card *dev);
grub_err_t (*send) (const struct grub_net_card *dev,
struct grub_net_card
{
struct grub_net_card *next;
- char *name;
+ const char *name;
struct grub_net_card_driver *driver;
grub_net_link_level_address_t default_address;
grub_net_card_flags_t flags;
struct grub_net_app_protocol
{
struct grub_net_app_protocol *next;
- char *name;
+ const char *name;
grub_err_t (*dir) (grub_device_t device, const char *path,
int (*hook) (const char *filename,
const struct grub_dirhook_info *info));
struct grub_parttool_argdesc
{
- char *name;
- char *desc;
+ const char *name;
+ const char *desc;
enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL}
type;
};
void grub_ns8250_init (void);
char *grub_serial_ns8250_add_port (grub_port_t port);
-struct grub_serial_port *grub_serial_find (char *name);
+struct grub_serial_port *grub_serial_find (const char *name);
extern struct grub_serial_driver grub_ns8250_driver;
void EXPORT_FUNC(grub_serial_unregister_driver) (struct grub_serial_driver *driver);
#define GRUB_TPARM_HEADER 1
/* Function prototypes. */
-char *grub_terminfo_tparm (const char *string, ...);
+const char *grub_terminfo_tparm (const char *string, ...);
#endif /* ! GRUB_TPARM_HEADER */
} __attribute__ ((packed));
struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent,
- char *name);
+ const char *name);
extern struct grub_xnu_devtree_key *grub_xnu_devtree_root;
grub_err_t grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size);
struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent,
- char *name);
+ const char *name);
void grub_xnu_lock (void);
void grub_xnu_unlock (void);
grub_err_t grub_xnu_resume (char *imagename);
grub_err_t grub_xnu_boot_resume (void);
struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent,
- char *name);
+ const char *name);
grub_err_t grub_xnu_align_heap (int align);
-grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
+grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname,
+ const char *osbundlerequired,
int maxrecursion);
-grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
+grub_err_t grub_xnu_load_kext_from_dir (char *dirname,
+ const char *osbundlerequired,
int maxrecursion);
grub_err_t grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target);
grub_err_t grub_xnu_fill_devicetree (void);
#ifndef _SYS_ZIO_CHECKSUM_H
#define _SYS_ZIO_CHECKSUM_H
-/*
- * Signature for checksum functions.
- */
-typedef void zio_checksum_t(const void *data, grub_uint64_t size,
- grub_zfs_endian_t endian, zio_cksum_t *zcp);
-
-/*
- * Information about each checksum function.
- */
-typedef struct zio_checksum_info {
- zio_checksum_t *ci_func; /* checksum function for each byteorder */
- int ci_correctable; /* number of correctable bits */
- int ci_eck; /* uses zio embedded checksum? */
- char *ci_name; /* descriptive name */
-} zio_checksum_info_t;
-
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
grub_zfs_endian_t endian, zio_cksum_t *);
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,