aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Barbour <tony@LunarG.com>2015-07-13 15:06:12 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-07-17 10:05:22 -0600
commitea092618b1b6df81c09c6d3abb30516a7daa321e (patch)
tree71e59320a7a4c0524aed28031f481b2f9591cd8c
parent1e6c516d95f0fe3863fa77a93a3f2e61310fb914 (diff)
downloadusermoji-ea092618b1b6df81c09c6d3abb30516a7daa321e.tar.xz
Windows: more fixes for windows compile
-rw-r--r--layers/draw_state.cpp4
-rw-r--r--layers/mem_tracker.cpp1
-rw-r--r--layers/shader_checker.cpp1
-rw-r--r--layers/vk_layer_debug_marker_table.cpp5
-rw-r--r--loader/cJSON.c54
5 files changed, 29 insertions, 36 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 83ceb385..49e91f4b 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -716,7 +716,6 @@ static LAYOUT_NODE* getLayoutNode(const VkDescriptorSetLayout layout) {
// Return 1 if update struct is of valid type, 0 otherwise
static VkBool32 validUpdateStruct(const VkDevice device, const GENERIC_HEADER* pUpdateStruct)
{
- char str[1024];
switch (pUpdateStruct->sType)
{
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
@@ -731,7 +730,6 @@ static VkBool32 validUpdateStruct(const VkDevice device, const GENERIC_HEADER* p
// For given update struct, return binding
static uint32_t getUpdateBinding(const VkDevice device, const GENERIC_HEADER* pUpdateStruct)
{
- char str[1024];
switch (pUpdateStruct->sType)
{
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
@@ -747,7 +745,6 @@ static uint32_t getUpdateBinding(const VkDevice device, const GENERIC_HEADER* pU
// Return count for given update struct
static uint32_t getUpdateArrayIndex(const VkDevice device, const GENERIC_HEADER* pUpdateStruct)
{
- char str[1024];
switch (pUpdateStruct->sType)
{
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
@@ -764,7 +761,6 @@ static uint32_t getUpdateArrayIndex(const VkDevice device, const GENERIC_HEADER*
// Return count for given update struct
static uint32_t getUpdateCount(const VkDevice device, const GENERIC_HEADER* pUpdateStruct)
{
- char str[1024];
switch (pUpdateStruct->sType)
{
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index 39a48bf6..6033806c 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -1296,7 +1296,6 @@ VkResult VKAPI vkCreateInstance(
static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo, VkDevice device)
{
- uint32_t i;
layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
my_device_data->wsi_enabled = false;
for (uint32_t i = 0; i < pCreateInfo->extensionCount; i++) {
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp
index 25cd7ce6..2955f8d5 100644
--- a/layers/shader_checker.cpp
+++ b/layers/shader_checker.cpp
@@ -571,7 +571,6 @@ validate_interface_between_stages(VkDevice dev,
std::map<uint32_t, interface_var> builtin_outputs;
std::map<uint32_t, interface_var> builtin_inputs;
- char str[1024];
bool pass = true;
collect_interface_by_location(dev, producer, spv::StorageClassOutput, outputs, builtin_outputs);
diff --git a/layers/vk_layer_debug_marker_table.cpp b/layers/vk_layer_debug_marker_table.cpp
index 47c93b10..b3b54c19 100644
--- a/layers/vk_layer_debug_marker_table.cpp
+++ b/layers/vk_layer_debug_marker_table.cpp
@@ -35,7 +35,6 @@ std::unordered_map<void *, VkLayerDebugMarkerDispatchTable *> tableDebugMarkerMa
* and a new key inserted into map */
VkLayerDebugMarkerDispatchTable * initDebugMarkerTable(VkDevice device)
{
- VkLayerDebugMarkerDispatchTable *pTable;
VkLayerDebugMarkerDispatchTable *pDebugMarkerTable;
assert(device);
@@ -56,5 +55,5 @@ VkLayerDebugMarkerDispatchTable * initDebugMarkerTable(VkDevice device)
pDebugMarkerTable->DbgSetObjectTag = (PFN_vkDbgSetObjectTag) pDisp->GetDeviceProcAddr(device, "vkDbgSetObjectTag");
pDebugMarkerTable->DbgSetObjectName = (PFN_vkDbgSetObjectName) pDisp->GetDeviceProcAddr(device, "vkDbgSetObjectName");
- return pTable;
-} \ No newline at end of file
+ return pDebugMarkerTable;
+}
diff --git a/loader/cJSON.c b/loader/cJSON.c
index 2d55207b..2f56f850 100644
--- a/loader/cJSON.c
+++ b/loader/cJSON.c
@@ -114,13 +114,13 @@ static const char *parse_number(cJSON *item,const char *num)
return num;
}
-static int pow2gt (int x) { --x; x|=x>>1; x|=x>>2; x|=x>>4; x|=x>>8; x|=x>>16; return x+1; }
+static size_t pow2gt (size_t x) { --x; x|=x>>1; x|=x>>2; x|=x>>4; x|=x>>8; x|=x>>16; return x+1; }
-typedef struct {char *buffer; int length; int offset; } printbuffer;
+typedef struct {char *buffer; size_t length; size_t offset; } printbuffer;
-static char* ensure(printbuffer *p,int needed)
+static char* ensure(printbuffer *p,size_t needed)
{
- char *newbuffer;int newsize;
+ char *newbuffer;size_t newsize;
if (!p || !p->buffer) return 0;
needed+=p->offset;
if (needed<=p->length) return p->buffer+p->offset;
@@ -251,7 +251,7 @@ static const char *parse_string(cJSON *item,const char *str)
/* Render the cstring provided to an escaped version that can be printed. */
static char *print_string_ptr(const char *str,printbuffer *p)
{
- const char *ptr;char *ptr2,*out;size_t len=0,flag=0;unsigned char token;
+ const char *ptr; char *ptr2; char *out; size_t len = 0, flag = 0; unsigned char token;
for (ptr=str;*ptr;ptr++) flag|=((*ptr>0 && *ptr<32)||(*ptr=='\"')||(*ptr=='\\'))?1:0;
if (!flag)
@@ -434,10 +434,10 @@ static const char *parse_array(cJSON *item,const char *value)
static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p)
{
char **entries;
- char *out=0,*ptr,*ret;size_t len=5;
- cJSON *child=item->child;
- int numentries=0,i=0,fail=0;
- size_t tmplen=0;
+ char *out=0,*ptr,*ret;size_t len=5;
+ cJSON *child=item->child;
+ int numentries=0,fail=0, j=0;
+ size_t tmplen=0,i=0;
/* How many entries in the array? */
while (child) numentries++,child=child->next;
@@ -490,7 +490,7 @@ static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p)
/* Handle failure. */
if (fail)
{
- for (i=0;i<numentries;i++) if (entries[i]) cJSON_free(entries[i]);
+ for (j=0;j<numentries;j++) if (entries[j]) cJSON_free(entries[j]);
cJSON_free(entries);
return 0;
}
@@ -498,11 +498,11 @@ static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p)
/* Compose the output array. */
*out='[';
ptr=out+1;*ptr=0;
- for (i=0;i<numentries;i++)
+ for (j=0;j<numentries;j++)
{
- tmplen=strlen(entries[i]);memcpy(ptr,entries[i],tmplen);ptr+=tmplen;
- if (i!=numentries-1) {*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;}
- cJSON_free(entries[i]);
+ tmplen=strlen(entries[j]);memcpy(ptr,entries[j],tmplen);ptr+=tmplen;
+ if (j!=numentries-1) {*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;}
+ cJSON_free(entries[j]);
}
cJSON_free(entries);
*ptr++=']';*ptr++=0;
@@ -550,10 +550,10 @@ static const char *parse_object(cJSON *item,const char *value)
static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p)
{
char **entries=0,**names=0;
- char *out=0,*ptr,*ret,*str;int len=7,i=0,j;
+ char *out=0,*ptr,*ret,*str;int j;
cJSON *child=item->child;
- int numentries=0,fail=0;
- size_t tmplen=0;
+ int numentries=0,fail=0,k;
+ size_t tmplen=0,i=0,len=7;
/* Count the number of entries. */
while (child) numentries++,child=child->next;
/* Explicitly handle empty object case */
@@ -563,7 +563,7 @@ static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p)
else out=(char*)cJSON_malloc(fmt?depth+4:3);
if (!out) return 0;
ptr=out;*ptr++='{';
- if (fmt) {*ptr++='\n';for (i=0;i<depth-1;i++) *ptr++='\t';}
+ if (fmt) {*ptr++='\n';for (j=0;j<depth-1;j++) *ptr++='\t';}
*ptr++='}';*ptr++=0;
return out;
}
@@ -601,7 +601,7 @@ static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p)
child=child->next;
}
ptr=ensure(p,fmt?(depth+1):2); if (!ptr) return 0;
- if (fmt) for (i=0;i<depth-1;i++) *ptr++='\t';
+ if (fmt) for (j=0;j<depth-1;j++) *ptr++='\t';
*ptr++='}';*ptr=0;
out=(p->buffer)+i;
}
@@ -632,26 +632,26 @@ static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p)
/* Handle failure */
if (fail)
{
- for (i=0;i<numentries;i++) {if (names[i]) cJSON_free(names[i]);if (entries[i]) cJSON_free(entries[i]);}
+ for (j=0;j<numentries;j++) {if (names[i]) cJSON_free(names[j]);if (entries[j]) cJSON_free(entries[j]);}
cJSON_free(names);cJSON_free(entries);
return 0;
}
/* Compose the output: */
*out='{';ptr=out+1;if (fmt)*ptr++='\n';*ptr=0;
- for (i=0;i<numentries;i++)
+ for (j=0;j<numentries;j++)
{
- if (fmt) for (j=0;j<depth;j++) *ptr++='\t';
- tmplen=strlen(names[i]);memcpy(ptr,names[i],tmplen);ptr+=tmplen;
+ if (fmt) for (k=0;k<depth;k++) *ptr++='\t';
+ tmplen=strlen(names[j]);memcpy(ptr,names[j],tmplen);ptr+=tmplen;
*ptr++=':';if (fmt) *ptr++='\t';
- strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
- if (i!=numentries-1) *ptr++=',';
+ strcpy(ptr,entries[j]);ptr+=strlen(entries[j]);
+ if (j!=numentries-1) *ptr++=',';
if (fmt) *ptr++='\n';*ptr=0;
- cJSON_free(names[i]);cJSON_free(entries[i]);
+ cJSON_free(names[j]);cJSON_free(entries[j]);
}
cJSON_free(names);cJSON_free(entries);
- if (fmt) for (i=0;i<depth-1;i++) *ptr++='\t';
+ if (fmt) for (j=0;j<depth-1;j++) *ptr++='\t';
*ptr++='}';*ptr++=0;
}
return out;