From: John Hodge Date: Wed, 20 Jun 2012 14:58:03 +0000 (+0800) Subject: Kernel - Cleaning up some ARMv7 warnings due to alignment X-Git-Tag: rel0.15~611^2~48 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b54bfbc2571229d3477f2b48c7b84dd63307768b;p=tpg%2Facess2.git Kernel - Cleaning up some ARMv7 warnings due to alignment --- diff --git a/KernelLand/Kernel/bin/elf.c b/KernelLand/Kernel/bin/elf.c index 41e09820..83dfa8ac 100644 --- a/KernelLand/Kernel/bin/elf.c +++ b/KernelLand/Kernel/bin/elf.c @@ -50,7 +50,7 @@ tBinary *Elf_Load(int fp) switch(hdr.e_ident[4]) // EI_CLASS { case ELFCLASS32: - return Elf_Load32(fp, (Elf32_Ehdr*)&hdr); + return Elf_Load32(fp, (void*)&hdr); case ELFCLASS64: return Elf_Load64(fp, &hdr); default: diff --git a/KernelLand/Kernel/drvutil.c b/KernelLand/Kernel/drvutil.c index d2c86bfb..df4fac91 100644 --- a/KernelLand/Kernel/drvutil.c +++ b/KernelLand/Kernel/drvutil.c @@ -59,6 +59,9 @@ int DrvUtil_Video_2DStream(void *Ent, const void *Buffer, int Length, const Uint8 *stream = Buffer; int rem = Length; int op; + + Uint16 tmp[6]; + while( rem ) { rem --; @@ -84,7 +87,8 @@ int DrvUtil_Video_2DStream(void *Ent, const void *Buffer, int Length, case VIDEO_2DOP_NOP: break; case VIDEO_2DOP_FILL: - if(rem < 10) return Length-rem; + if(rem < 12) return Length-rem; + memcpy(tmp, stream, 6*2); if(!Handlers->Fill) { Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Driver" @@ -93,10 +97,9 @@ int DrvUtil_Video_2DStream(void *Ent, const void *Buffer, int Length, } Handlers->Fill( - Ent, - ((const Uint16*)stream)[0], ((const Uint16*)stream)[1], - ((const Uint16*)stream)[2], ((const Uint16*)stream)[3], - ((const Uint32*)stream)[4] + Ent, + tmp[0], tmp[1], tmp[2], tmp[3], + tmp[4] | ((Uint32)tmp[5] << 16) ); rem -= 10; @@ -114,9 +117,8 @@ int DrvUtil_Video_2DStream(void *Ent, const void *Buffer, int Length, Handlers->Blit( Ent, - ((const Uint16*)stream)[0], ((const Uint16*)stream)[1], - ((const Uint16*)stream)[2], ((const Uint16*)stream)[3], - ((const Uint16*)stream)[4], ((const Uint16*)stream)[5] + tmp[0], tmp[1], tmp[2], tmp[3], + tmp[4], tmp[5] ); rem -= 12;