From: John Hodge Date: Sat, 14 Jul 2012 12:33:05 +0000 (+0800) Subject: Kernel - Silencing complaining compilers X-Git-Tag: rel0.15~611^2~29 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=94d1376ee39e709225c895eb22c71ff3240e3254;p=tpg%2Facess2.git Kernel - Silencing complaining compilers --- diff --git a/KernelLand/Kernel/vfs/mount.c b/KernelLand/Kernel/vfs/mount.c index 5ac67a58..1832ac16 100644 --- a/KernelLand/Kernel/vfs/mount.c +++ b/KernelLand/Kernel/vfs/mount.c @@ -63,7 +63,7 @@ int VFS_Mount(const char *Device, const char *MountPoint, const char *Filesystem } tVFS_Driver *bestfs = NULL; - int bestrank, rank; + int bestrank = 0, rank; for( fs = gVFS_Drivers; fs; fs = fs->Next ) { if(!fs->Detect) continue ; diff --git a/KernelLand/Modules/IPStack/adapters.c b/KernelLand/Modules/IPStack/adapters.c index 83741dfe..90c0b245 100644 --- a/KernelLand/Modules/IPStack/adapters.c +++ b/KernelLand/Modules/IPStack/adapters.c @@ -370,13 +370,13 @@ void IPStack_SendDebugText(const char *Text) memcpy(buffer, pkt_hdr, sizeof(pkt_hdr)); memcpy(buffer + sizeof(pkt_hdr), cache, cache_len); - *(Uint16*)&buffer[14+2] = BigEndian16( sizeof(pkt_hdr)-14 + cache_len ); // IP Size - *(Uint16*)&buffer[14+10] = BigEndian16( 0 ); // IP Header - *(Uint16*)&buffer[14+20+4] = BigEndian16( 8+cache_len ); // UDP Size - *(Uint16*)&buffer[14+20+6] = BigEndian16( 0 ); // UDP Checksum - *(Uint32*)&buffer[link_checksum_ofs] = BigEndian32( 0 ); // 802.3 checksum? + ((Uint16*)buffer)[(14+2)/2] = BigEndian16( sizeof(pkt_hdr)-14 + cache_len ); // IP Size + ((Uint16*)buffer)[(14+10)/2] = BigEndian16( 0 ); // IP Header + ((Uint16*)buffer)[(14+20+4)/2] = BigEndian16( 8+cache_len ); // UDP Size + ((Uint16*)buffer)[(14+20+6)/2] = BigEndian16( 0 ); // UDP Checksum +// *(Uint32*)&buffer[link_checksum_ofs] = BigEndian32( 0 ); // 802.3 checksum? // TODO: Calculate checksums - *(Uint16*)&buffer[14+10] = BigEndian16( IPv4_Checksum(buffer+14,20) ); // IP Header + ((Uint16*)buffer)[(14+10)/2] = BigEndian16( IPv4_Checksum(buffer+14,20) ); // IP Header // Create buffer tIPStackBuffer *buf = IPStack_Buffer_CreateBuffer(1);