mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
xmlconfig: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
(cherry picked from commit 2b69dd6809)
This commit is contained in:
parent
87b50c6f26
commit
46b9602c75
2 changed files with 5 additions and 5 deletions
|
|
@ -373,7 +373,7 @@
|
|||
"description": "xmlconfig: Fix MSVC warning C4334 (32bit shift cast to 64bit)",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -321,8 +321,8 @@ driParseOptionInfo(driOptionCache *info,
|
|||
* config options we've ever seen in a driver.
|
||||
*/
|
||||
info->tableSize = 6;
|
||||
info->info = calloc(1 << info->tableSize, sizeof(driOptionInfo));
|
||||
info->values = calloc(1 << info->tableSize, sizeof(driOptionValue));
|
||||
info->info = calloc((size_t)1 << info->tableSize, sizeof(driOptionInfo));
|
||||
info->values = calloc((size_t)1 << info->tableSize, sizeof(driOptionValue));
|
||||
if (info->info == NULL || info->values == NULL) {
|
||||
fprintf(stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
|
|
@ -1109,13 +1109,13 @@ initOptionCache(driOptionCache *cache, const driOptionCache *info)
|
|||
unsigned i, size = 1 << info->tableSize;
|
||||
cache->info = info->info;
|
||||
cache->tableSize = info->tableSize;
|
||||
cache->values = malloc((1<<info->tableSize) * sizeof(driOptionValue));
|
||||
cache->values = malloc(((size_t)1 << info->tableSize) * sizeof(driOptionValue));
|
||||
if (cache->values == NULL) {
|
||||
fprintf(stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
memcpy(cache->values, info->values,
|
||||
(1<<info->tableSize) * sizeof(driOptionValue));
|
||||
((size_t)1 << info->tableSize) * sizeof(driOptionValue));
|
||||
for (i = 0; i < size; ++i) {
|
||||
if (cache->info[i].type == DRI_STRING)
|
||||
XSTRDUP(cache->values[i]._string, info->values[i]._string);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue