2009-12-19 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/types.h (UNUSED): Removed since it conflicts with NetBSD headers. All users changed to direct __attribute__ ((unused)). Reported by Grégoire Sutre.
This commit is contained in:
parent
b99518d1ce
commit
e0a6ca52f2
12 changed files with 54 additions and 32 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2009-12-19 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* include/grub/types.h (UNUSED): Removed since it conflicts with
|
||||||
|
NetBSD headers. All users changed to direct __attribute__ ((unused)).
|
||||||
|
Reported by Grégoire Sutre.
|
||||||
|
|
||||||
2009-12-19 Carles Pina i Estany <carles@pina.cat>
|
2009-12-19 Carles Pina i Estany <carles@pina.cat>
|
||||||
|
|
||||||
* include/grub/normal.h (grub_utf8_to_ucs4): New declaration.
|
* include/grub/normal.h (grub_utf8_to_ucs4): New declaration.
|
||||||
|
|
|
@ -62,7 +62,7 @@ grub_getline (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_cmd_read (grub_command_t cmd UNUSED, int argc, char **args)
|
grub_cmd_read (grub_command_t cmd __attribute__ ((unused)), int argc, char **args)
|
||||||
{
|
{
|
||||||
char *line = grub_getline ();
|
char *line = grub_getline ();
|
||||||
if (! line)
|
if (! line)
|
||||||
|
|
|
@ -107,9 +107,11 @@ static struct grub_disk_dev grub_pxe_dev =
|
||||||
};
|
};
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_pxefs_dir (grub_device_t device UNUSED, const char *path UNUSED,
|
grub_pxefs_dir (grub_device_t device __attribute__ ((unused)),
|
||||||
|
const char *path __attribute__ ((unused)),
|
||||||
int (*hook) (const char *filename,
|
int (*hook) (const char *filename,
|
||||||
const struct grub_dirhook_info *info) UNUSED)
|
const struct grub_dirhook_info *info)
|
||||||
|
__attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <grub/cpu/types.h>
|
#include <grub/cpu/types.h>
|
||||||
|
|
||||||
#define UNUSED __attribute__ ((unused))
|
|
||||||
|
|
||||||
#ifdef GRUB_UTIL
|
#ifdef GRUB_UTIL
|
||||||
# define GRUB_CPU_SIZEOF_VOID_P SIZEOF_VOID_P
|
# define GRUB_CPU_SIZEOF_VOID_P SIZEOF_VOID_P
|
||||||
# define GRUB_CPU_SIZEOF_LONG SIZEOF_LONG
|
# define GRUB_CPU_SIZEOF_LONG SIZEOF_LONG
|
||||||
|
|
|
@ -181,7 +181,9 @@ grub_elf32_size (grub_elf_t elf)
|
||||||
/* Run through the program headers to calculate the total memory size we
|
/* Run through the program headers to calculate the total memory size we
|
||||||
* should claim. */
|
* should claim. */
|
||||||
auto int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf, Elf32_Phdr *phdr, void *_arg);
|
auto int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf, Elf32_Phdr *phdr, void *_arg);
|
||||||
int NESTED_FUNC_ATTR calcsize (grub_elf_t UNUSED _elf, Elf32_Phdr *phdr, void UNUSED *_arg)
|
int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf __attribute__ ((unused)),
|
||||||
|
Elf32_Phdr *phdr,
|
||||||
|
void *_arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
/* Only consider loadable segments. */
|
/* Only consider loadable segments. */
|
||||||
if (phdr->p_type != PT_LOAD)
|
if (phdr->p_type != PT_LOAD)
|
||||||
|
@ -360,7 +362,9 @@ grub_elf64_size (grub_elf_t elf)
|
||||||
/* Run through the program headers to calculate the total memory size we
|
/* Run through the program headers to calculate the total memory size we
|
||||||
* should claim. */
|
* should claim. */
|
||||||
auto int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf, Elf64_Phdr *phdr, void *_arg);
|
auto int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf, Elf64_Phdr *phdr, void *_arg);
|
||||||
int NESTED_FUNC_ATTR calcsize (grub_elf_t UNUSED _elf, Elf64_Phdr *phdr, void UNUSED *_arg)
|
int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf __attribute__ ((unused)),
|
||||||
|
Elf64_Phdr *phdr,
|
||||||
|
void *_arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
/* Only consider loadable segments. */
|
/* Only consider loadable segments. */
|
||||||
if (phdr->p_type != PT_LOAD)
|
if (phdr->p_type != PT_LOAD)
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
#include <grub/cpu/multiboot.h>
|
#include <grub/cpu/multiboot.h>
|
||||||
|
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr,
|
grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr,
|
||||||
|
grub_addr_t *addr __attribute__ ((unused)),
|
||||||
int *do_load)
|
int *do_load)
|
||||||
{
|
{
|
||||||
Elf32_Addr paddr = phdr->p_paddr;
|
Elf32_Addr paddr = phdr->p_paddr;
|
||||||
|
@ -48,7 +49,8 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr,
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, UNUSED grub_addr_t *addr,
|
grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr,
|
||||||
|
grub_addr_t *addr __attribute__ ((unused)),
|
||||||
int *do_load)
|
int *do_load)
|
||||||
{
|
{
|
||||||
Elf64_Addr paddr = phdr->p_paddr;
|
Elf64_Addr paddr = phdr->p_paddr;
|
||||||
|
@ -82,7 +84,8 @@ grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_mb2_arch_module_free (grub_addr_t addr, UNUSED grub_size_t size)
|
grub_mb2_arch_module_free (grub_addr_t addr,
|
||||||
|
grub_size_t size __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
grub_free((void *) addr);
|
grub_free((void *) addr);
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
|
@ -36,7 +36,8 @@ typedef void (*kernel_entry_t) (unsigned long, void *, int (void *),
|
||||||
|
|
||||||
/* Claim the memory occupied by the multiboot kernel. */
|
/* Claim the memory occupied by the multiboot kernel. */
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr,
|
grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr,
|
||||||
|
grub_addr_t *addr __attribute__((unused)),
|
||||||
int *do_load)
|
int *do_load)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -61,7 +62,8 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr,
|
||||||
|
|
||||||
/* Claim the memory occupied by the multiboot kernel. */
|
/* Claim the memory occupied by the multiboot kernel. */
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, UNUSED grub_addr_t *addr,
|
grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr,
|
||||||
|
grub_addr_t *addr __attribute__((unused)),
|
||||||
int *do_load)
|
int *do_load)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
|
@ -123,8 +123,9 @@ SUFFIX (grub_macho_size) (grub_macho_t macho, grub_macho_addr_t *segments_start,
|
||||||
should claim. */
|
should claim. */
|
||||||
auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho,
|
auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho,
|
||||||
struct grub_macho_cmd *phdr, void *_arg);
|
struct grub_macho_cmd *phdr, void *_arg);
|
||||||
int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho,
|
int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho __attribute__ ((unused)),
|
||||||
struct grub_macho_cmd *hdr0, void UNUSED *_arg)
|
struct grub_macho_cmd *hdr0,
|
||||||
|
void *_arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0;
|
grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0;
|
||||||
if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT)
|
if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT)
|
||||||
|
@ -166,10 +167,10 @@ SUFFIX (grub_macho_load) (grub_macho_t macho, char *offset, int flags)
|
||||||
grub_err_t err = 0;
|
grub_err_t err = 0;
|
||||||
auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho,
|
auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho,
|
||||||
struct grub_macho_cmd *hdr0,
|
struct grub_macho_cmd *hdr0,
|
||||||
void UNUSED *_arg);
|
void *_arg __attribute__ ((unused)));
|
||||||
int NESTED_FUNC_ATTR do_load(grub_macho_t _macho,
|
int NESTED_FUNC_ATTR do_load(grub_macho_t _macho,
|
||||||
struct grub_macho_cmd *hdr0,
|
struct grub_macho_cmd *hdr0,
|
||||||
void UNUSED *_arg)
|
void *_arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0;
|
grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0;
|
||||||
|
|
||||||
|
@ -223,11 +224,11 @@ SUFFIX (grub_macho_get_entry_point) (grub_macho_t macho)
|
||||||
{
|
{
|
||||||
grub_macho_addr_t entry_point = 0;
|
grub_macho_addr_t entry_point = 0;
|
||||||
auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho,
|
auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho,
|
||||||
struct grub_macho_cmd *hdr,
|
struct grub_macho_cmd *hdr,
|
||||||
void UNUSED *_arg);
|
void *_arg __attribute__ ((unused)));
|
||||||
int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho,
|
int NESTED_FUNC_ATTR hook(grub_macho_t _macho __attribute__ ((unused)),
|
||||||
struct grub_macho_cmd *hdr,
|
struct grub_macho_cmd *hdr,
|
||||||
void UNUSED *_arg)
|
void *_arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
if (hdr->cmd == GRUB_MACHO_CMD_THREAD)
|
if (hdr->cmd == GRUB_MACHO_CMD_THREAD)
|
||||||
entry_point = ((grub_macho_thread_t *) hdr)->entry_point;
|
entry_point = ((grub_macho_thread_t *) hdr)->entry_point;
|
||||||
|
|
|
@ -222,7 +222,8 @@ grub_mb2_unload (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_mb2_load_other (UNUSED grub_file_t file, UNUSED void *buffer)
|
grub_mb2_load_other (grub_file_t file __attribute__ ((unused)),
|
||||||
|
void *buffer __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
/* XXX Create module tag here. */
|
/* XXX Create module tag here. */
|
||||||
return grub_error (GRUB_ERR_UNKNOWN_OS, "currently only ELF is supported");
|
return grub_error (GRUB_ERR_UNKNOWN_OS, "currently only ELF is supported");
|
||||||
|
|
|
@ -488,7 +488,7 @@ grub_util_is_dmraid (const char *os_dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_util_get_dev_abstraction (const char *os_dev UNUSED)
|
grub_util_get_dev_abstraction (const char *os_dev __attribute__((unused)))
|
||||||
{
|
{
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
/* Check for LVM. */
|
/* Check for LVM. */
|
||||||
|
|
|
@ -35,8 +35,10 @@ escape_of_path (const char *orig_path)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy UNUSED,
|
grub_util_emit_devicemap_entry (FILE *fp, char *name,
|
||||||
int *num_fd UNUSED, int *num_hd UNUSED)
|
int is_floppy __attribute__((unused)),
|
||||||
|
int *num_fd __attribute__((unused)),
|
||||||
|
int *num_hd __attribute__((unused)))
|
||||||
{
|
{
|
||||||
const char *orig_path = grub_util_devname_to_ofpath (name);
|
const char *orig_path = grub_util_devname_to_ofpath (name);
|
||||||
char *ofpath = escape_of_path (orig_path);
|
char *ofpath = escape_of_path (orig_path);
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef OFPATH_STANDALONE
|
#ifdef OFPATH_STANDALONE
|
||||||
#define UNUSED __attribute__((unused))
|
|
||||||
#define xmalloc malloc
|
#define xmalloc malloc
|
||||||
void
|
void
|
||||||
grub_util_error (const char *fmt, ...)
|
grub_util_error (const char *fmt, ...)
|
||||||
|
@ -199,8 +198,10 @@ get_basename(char *p)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
of_path_of_vdisk(char *of_path,
|
of_path_of_vdisk(char *of_path,
|
||||||
const char *devname UNUSED, const char *device,
|
const char *devname __attribute__((unused)),
|
||||||
const char *devnode UNUSED, const char *devicenode)
|
const char *device,
|
||||||
|
const char *devnode __attribute__((unused)),
|
||||||
|
const char *devicenode)
|
||||||
{
|
{
|
||||||
char *sysfs_path, *p;
|
char *sysfs_path, *p;
|
||||||
int devno, junk;
|
int devno, junk;
|
||||||
|
@ -217,8 +218,9 @@ of_path_of_vdisk(char *of_path,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
of_path_of_ide(char *of_path,
|
of_path_of_ide(char *of_path,
|
||||||
const char *devname UNUSED, const char *device,
|
const char *devname __attribute__((unused)), const char *device,
|
||||||
const char *devnode UNUSED, const char *devicenode)
|
const char *devnode __attribute__((unused)),
|
||||||
|
const char *devicenode)
|
||||||
{
|
{
|
||||||
char *sysfs_path, *p;
|
char *sysfs_path, *p;
|
||||||
int chan, devno;
|
int chan, devno;
|
||||||
|
@ -299,8 +301,9 @@ check_sas (char *sysfs_path, int *tgt)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
of_path_of_scsi(char *of_path,
|
of_path_of_scsi(char *of_path,
|
||||||
const char *devname UNUSED, const char *device,
|
const char *devname __attribute__((unused)), const char *device,
|
||||||
const char *devnode UNUSED, const char *devicenode)
|
const char *devnode __attribute__((unused)),
|
||||||
|
const char *devicenode)
|
||||||
{
|
{
|
||||||
const char *p, *digit_string, *disk_name;
|
const char *p, *digit_string, *disk_name;
|
||||||
int host, bus, tgt, lun;
|
int host, bus, tgt, lun;
|
||||||
|
|
Loading…
Reference in a new issue