mirror of
https://github.com/anrieff/libcpuid
synced 2024-12-16 16:35:45 +00:00
Define constant for CPU codename string
This commit is contained in:
parent
3dd6974b52
commit
df7e310e2f
4 changed files with 4 additions and 3 deletions
|
@ -469,7 +469,7 @@ struct cpu_id_t {
|
|||
* +--------+--------+-------+-------+-------+---------------------------------------+-----------------------+
|
||||
* @endcode
|
||||
*/
|
||||
char cpu_codename[64];
|
||||
char cpu_codename[CODENAME_STR_MAX];
|
||||
|
||||
/** SSE execution unit size (64 or 128; -1 if N/A) */
|
||||
int32_t sse_size;
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
#define VENDOR_STR_MAX 16
|
||||
#define BRAND_STR_MAX 64
|
||||
#define CODENAME_STR_MAX 64
|
||||
#define CPU_FLAGS_MAX 128
|
||||
#define MAX_CPUID_LEVEL 32
|
||||
#define MAX_EXT_CPUID_LEVEL 32
|
||||
|
|
|
@ -142,7 +142,7 @@ int match_cpu_codename(const struct match_entry_t* matchtable, int count,
|
|||
bestindex = i;
|
||||
}
|
||||
}
|
||||
strcpy(data->cpu_codename, matchtable[bestindex].name);
|
||||
strncpy(data->cpu_codename, matchtable[bestindex].name, CODENAME_STR_MAX);
|
||||
return bestscore;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ struct match_entry_t {
|
|||
int ncores, l2cache, l3cache, brand_code;
|
||||
uint64_t model_bits;
|
||||
int model_code;
|
||||
char name[36];
|
||||
char name[CODENAME_STR_MAX];
|
||||
};
|
||||
|
||||
// returns the match score:
|
||||
|
|
Loading…
Reference in a new issue