]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Fix one gcc 4.4 warning
[stockfish] / src / misc.cpp
index e235475a5713603c2cbe4db81a2d54e9e8a19243..89a2f5ee2e21e183d8c2ff7a715b7e0208574465 100644 (file)
@@ -1,7 +1,7 @@
 /*
   Stockfish, a UCI chess playing engine derived from Glaurung 2.1
   Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
-  Copyright (C) 2008-2009 Marco Costalba
+  Copyright (C) 2008-2010 Marco Costalba, Joona Kiiski, Tord Romstad
 
   Stockfish is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -230,9 +230,9 @@ static bool HT_enabled() {
   nIds = CPUInfo[0];
 
   memset(CPUString, 0, sizeof(CPUString));
-  *((int*)(CPUString+0)) = CPUInfo[1];
-  *((int*)(CPUString+4)) = CPUInfo[3];
-  *((int*)(CPUString+8)) = CPUInfo[2];
+  memcpy(&CPUString[0], &CPUInfo[1], sizeof(int));
+  memcpy(&CPUString[4], &CPUInfo[3], sizeof(int));
+  memcpy(&CPUString[8], &CPUInfo[2], sizeof(int));
 
   // Not an Intel CPU or CPUID.4 not supported
   if (strcmp(CPUString, "GenuineIntel") || nIds < 4)