* grub-core/loader/macho.c: Fix compilation on non-i386.

This commit is contained in:
Vladimir Serbinenko 2013-12-17 20:46:33 +01:00
parent fe7c20bf9e
commit ebda165f3a
2 changed files with 11 additions and 6 deletions

View file

@ -1,3 +1,7 @@
2013-12-17 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/loader/macho.c: Fix compilation on non-i386.
2013-12-17 Vladimir Serbinenko <phcoder@gmail.com>
Add missing format_arg attribute to check that printf with translated

View file

@ -23,7 +23,6 @@
#include <grub/err.h>
#include <grub/macho.h>
#include <grub/cpu/macho.h>
#include <grub/machoload.h>
#include <grub/file.h>
#include <grub/misc.h>
@ -85,7 +84,7 @@ grub_macho_file (grub_file_t file, const char *filename, int is_64bit)
}
/* Is it a fat file? */
if (filestart.fat.magic == grub_be_to_cpu32 (GRUB_MACHO_FAT_MAGIC))
if (filestart.fat.magic == grub_cpu_to_be32_compile_time (GRUB_MACHO_FAT_MAGIC))
{
struct grub_macho_fat_arch *archs;
int i, narchs;
@ -111,15 +110,17 @@ grub_macho_file (grub_file_t file, const char *filename, int is_64bit)
for (i = 0; i < narchs; i++)
{
if (GRUB_MACHO_CPUTYPE_IS_HOST32
(grub_be_to_cpu32 (archs[i].cputype)) && !is_64bit)
if ((archs[i].cputype
== grub_cpu_to_be32_compile_time (GRUB_MACHO_CPUTYPE_IA32))
&& !is_64bit)
{
macho->offset32 = grub_be_to_cpu32 (archs[i].offset);
macho->end32 = grub_be_to_cpu32 (archs[i].offset)
+ grub_be_to_cpu32 (archs[i].size);
}
if (GRUB_MACHO_CPUTYPE_IS_HOST64
(grub_be_to_cpu32 (archs[i].cputype)) && is_64bit)
if ((archs[i].cputype
== grub_cpu_to_be32_compile_time (GRUB_MACHO_CPUTYPE_AMD64))
&& is_64bit)
{
macho->offset64 = grub_be_to_cpu32 (archs[i].offset);
macho->end64 = grub_be_to_cpu32 (archs[i].offset)