X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmisc.cpp;h=89a2f5ee2e21e183d8c2ff7a715b7e0208574465;hb=13224e1d9d980dd91b4a3fd26937f5a49425ac3b;hp=e235475a5713603c2cbe4db81a2d54e9e8a19243;hpb=c853b87c08fc103b13d8dab73b5b72e936a99e00;p=stockfish diff --git a/src/misc.cpp b/src/misc.cpp index e235475a..89a2f5ee 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -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)