X-Git-Url: https://git.llucax.com/software/druntime.git/blobdiff_plain/5a07183e26b7ca151959629420a83f59af5339f3..HEAD:/src/compiler/dmd/util/cpuid.d?ds=sidebyside diff --git a/src/compiler/dmd/util/cpuid.d b/src/compiler/dmd/util/cpuid.d index b4d9cba..da11f9e 100644 --- a/src/compiler/dmd/util/cpuid.d +++ b/src/compiler/dmd/util/cpuid.d @@ -40,14 +40,14 @@ COPYRIGHT: Public Domain module rt.util.cpuid; -private import stdc.string; +private import core.stdc.string; version(D_InlineAsm_X86) { /// Returns vendor string char[] vendor() {return vendorStr;} /// Returns processor string - char[] processor() {return processorStr;} + string processor() {return processorStr;} /// Is MMX supported? bool mmx() {return (flags&MMX_BIT)!=0;} @@ -186,8 +186,8 @@ private: uint flags, misc, exflags, apic, signature; uint _stepping, _model, _family; - char[12] vendorStr = ""; - char[] processorStr = ""; + char[12] vendorStr = 0; + string processorStr = ""; uint maxThreads=1; uint maxCores=1; @@ -250,7 +250,7 @@ private: return; // seems many intel processors prepend whitespace - processorStr = strip(toString(dst)).dup; + processorStr = cast(string)strip(toString(dst)).dup; } private void getFeatureFlags() @@ -421,9 +421,14 @@ private: return stripr(stripl(s)); } - string toString(char *s) + char[] toString(char* s) { - return s ? s[0 .. strlen(s)] : cast(char[])null; + return s ? s[0 .. strlen(s)] : null; + } + + string toString(invariant(char)* s) + { + return s ? s[0 .. strlen(s)] : null; } } }