{
//header for testing if it is a png
png_byte header[8];
- int is_png, bit_depth, color_type,rowbytes, retval;
+ int is_png, bit_depth, color_type, rowbytes;
+ size_t retval;
png_uint_32 i, twidth, theight;
png_structp png_ptr;
png_infop info_ptr, end_info;
err = vkCreateShader(demo->device, &createInfo, &shader);
if (err) {
free((void *) createInfo.pCode);
- return NULL;
+ return (VkShader) VK_NULL_HANDLE;
}
#endif
char *demo_read_spv(const char *filename, size_t *psize)
{
long int size;
- int U_ASSERT_ONLY retval;
+ size_t U_ASSERT_ONLY retval;
void *shader_code;
FILE *fp = fopen(filename, "rb");
WPARAM wParam,
LPARAM lParam)
{
- PAINTSTRUCT paint_struct;
- HDC hDC; // Device context
char tmp_str[] = "Test Vulkan Cube Program";
switch(uMsg)
/* main message loop*/
while(!done)
{
- PeekMessage(&msg,NULL,NULL,NULL,PM_REMOVE);
+ PeekMessage(&msg,0,0,0,PM_REMOVE);
if (msg.message == WM_QUIT) //check for a quit message
{
done = true; //if found, quit app
demo_cleanup(&demo);
- return msg.wParam;
+ return (int) msg.wParam;
}
#else // _WIN32
int main(int argc, char **argv)
WPARAM wParam,
LPARAM lParam)
{
- PAINTSTRUCT paint_struct;
- HDC hDC; // Device context
char tmp_str[] = "Test Vulkan Triangle Program";
switch(uMsg)
/* main message loop*/
while(!done)
{
- PeekMessage(&msg,NULL,NULL,NULL,PM_REMOVE);
+ PeekMessage(&msg,0,0,0,PM_REMOVE);
if (msg.message == WM_QUIT) //check for a quit message
{
done = true; //if found, quit app
demo_cleanup(&demo);
- return msg.wParam;
+ return (int) msg.wParam;
}
#else // _WIN32
int main(const int argc, const char *argv[])
size_t* pDataSize,
void* pData)
{
- VkResult result;
-
/* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
VkExtensionProperties *ext_props;
uint32_t *count;
#include "loader_platform.h"
#include "vk_dispatch_table_helper.h"
#include "vk_struct_string_helper_cpp.h"
+#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wwrite-strings"
+#endif
#include "vk_struct_graphviz_helper.h"
+#if defined(__GNUC__)
#pragma GCC diagnostic warning "-Wwrite-strings"
+#endif
#include "vk_struct_size_helper.h"
#include "draw_state.h"
#include "layers_config.h"
size_t* pDataSize,
void* pData)
{
- VkResult result;
-
/* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
VkExtensionProperties *ext_props;
uint32_t *count;
// For given MemObjInfo, report Obj & CB bindings
static void reportMemReferencesAndCleanUp(MT_MEM_OBJ_INFO* pMemObjInfo)
{
- uint32_t cmdBufRefCount = pMemObjInfo->pCmdBufferBindings.size();
- uint32_t objRefCount = pMemObjInfo->pObjBindings.size();
+ size_t cmdBufRefCount = pMemObjInfo->pCmdBufferBindings.size();
+ size_t objRefCount = pMemObjInfo->pObjBindings.size();
if ((pMemObjInfo->pCmdBufferBindings.size() + pMemObjInfo->pObjBindings.size()) != 0) {
char str[1024];
- sprintf(str, "Attempting to free memory object %p which still contains %d references", pMemObjInfo->mem, (cmdBufRefCount + objRefCount));
+ sprintf(str, "Attempting to free memory object %p which still contains %lu references", pMemObjInfo->mem, (cmdBufRefCount + objRefCount));
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, pMemObjInfo->mem, 0, MEMTRACK_INTERNAL_ERROR, "MEM", str);
}
size_t* pDataSize,
void* pData)
{
- VkResult result;
-
/* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
VkExtensionProperties *ext_props;
uint32_t *count;
sprintf(str, "Unknown Queue %p", queue);
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, queue, 0, MEMTRACK_INVALID_QUEUE, "MEM", str);
} else {
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
if (checkMemRef(queue, pMems[i]) == VK_TRUE) {
// Alread in list, just warn
char str[1024];
sprintf(str, "Unknown Queue %p", queue);
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, queue, 0, MEMTRACK_INVALID_QUEUE, "MEM", str);
} else {
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
for (list<VkDeviceMemory>::iterator it = pQueueInfo->pMemRefList.begin(); it != pQueueInfo->pMemRefList.end(); ++it) {
if ((*it) == pMems[i]) {
it = pQueueInfo->pMemRefList.erase(it);
size_t* pDataSize,
void* pData)
{
- VkResult result;
-
/* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
VkExtensionProperties *ext_props;
uint32_t *count;
size_t* pDataSize,
void* pData)
{
- VkResult result;
-
/* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
VkExtensionProperties *ext_props;
uint32_t *count;
HKEY key;
LONG rtn_value;
char *rtn_str = NULL;
- size_t rtn_len = 0;
+ DWORD rtn_len = 0;
size_t allocated_len = 0;
rtn_value = RegOpenKeyEx(hive, sub_key, 0, access_flags, &key);
char *env_str = getenv(env_var);
size_t env_len = (env_str == NULL) ? 0 : strlen(env_str);
char *registry_str = NULL;
- DWORD registry_len = 0;
+ size_t registry_len = 0;
char *rtn_str = NULL;
size_t rtn_len;
return false;
}
-static void loader_coalesce_extensions()
+static void loader_coalesce_extensions(void)
{
uint32_t i;
struct loader_scanned_icds *icd_list = loader.scanned_icd_list;
cond = ("%s == VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI && "
"%s && %s" % (ptype, pdata, cond))
setup.append("VkDisplayPropertiesWSI *info = %s;" % pdata)
- setup.append("uint32_t count = *%s / sizeof(*info), i;" % psize)
+ setup.append("size_t count = *%s / sizeof(*info), i;" % psize)
setup.append("for (i = 0; i < count; i++) {")
setup.append(" %s(info[i].display, disp);" % method)
setup.append("}")
cond = ("%s == VK_SWAP_CHAIN_INFO_TYPE_PERSISTENT_IMAGES_WSI && "
"%s && %s" % (ptype, pdata, cond))
setup.append("VkSwapChainImageInfoWSI *info = %s;" % pdata)
- setup.append("uint32_t count = *%s / sizeof(*info), i;" % psize)
+ setup.append("size_t count = *%s / sizeof(*info), i;" % psize)
setup.append("for (i = 0; i < count; i++) {")
setup.append(" %s(info[i].image, disp);" % method)
setup.append(" %s(info[i].memory, disp);" % method)
if proto.name == "EnumerateLayers":
funcs.append('%s%s\n'
'{\n'
- ' char str[1024];\n'
' if (gpu != NULL) {\n'
' pCurObj = (VkBaseLayerObject *) %s;\n'
' loader_platform_thread_once(&tabOnce, init%s);\n'