aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2018-07-23 15:11:55 +0200
committerAndre Weissflog <floooh@gmail.com>2018-07-23 15:11:55 +0200
commit1f028a7ad76e3c1957ce5cadfa4e599e5128b085 (patch)
treecd37c38352660150a33717419bde79879c0424b4
parentef752937404d927fbf83be87df8b97a300e1c383 (diff)
More VS warning management
-rw-r--r--sokol_app.h29
-rw-r--r--sokol_audio.h11
-rw-r--r--sokol_gfx.h21
3 files changed, 35 insertions, 26 deletions
diff --git a/sokol_app.h b/sokol_app.h
index 7d4e2b37..6929b8eb 100644
--- a/sokol_app.h
+++ b/sokol_app.h
@@ -569,6 +569,15 @@ extern const void* sapp_d3d11_get_depth_stencil_view(void);
/*-- IMPLEMENTATION ----------------------------------------------------------*/
#ifdef SOKOL_IMPL
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */
+#pragma warning(disable:4115) /* named type definition in parentheses */
+#pragma warning(disable:4054) /* 'type cast': from function pointer */
+#pragma warning(disable:4055) /* 'type cast': from data pointer */
+#pragma warning(disable:4505) /* unreferenced local function has been removed */
+#endif
+
#include <string.h> /* memset */
/* check if the config defines are alright */
@@ -2146,16 +2155,8 @@ _SOKOL_PRIVATE const _sapp_gl_fbconfig* _sapp_gl_choose_fbconfig(const _sapp_gl_
#if defined(SOKOL_D3D11)
#define COBJMACROS
#include <windows.h>
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */
-#pragma warning(disable:4115) /* named type definition in parentheses */
-#endif
#include <d3d11.h>
#include <dxgi.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
#endif
#ifndef DPI_ENUMS_DECLARED
@@ -2279,11 +2280,6 @@ more, you'll need to use you own gl header-generator/loader
*/
#if !defined(SOKOL_WIN32_NO_GL_LOADER)
#if defined(SOKOL_GLCORE33)
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4054) /* 'type cast': from function pointer */
-#pragma warning(disable:4055) /* 'type cast': from data pointer */
-#endif
#define __gl_h_ 1
#define __gl32_h_ 1
#define __gl31_h_ 1
@@ -2846,9 +2842,6 @@ _SOKOL_PRIVATE void _sapp_win32_gl_loadfuncs(void) {
#define glFrontFace _sapp_glFrontFace
#define glCullFace _sapp_glCullFace
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
#endif /* SOKOL_WIN32_NO_GL_LOADER */
#endif /* SOKOL_GLCORE33 */
@@ -5532,4 +5525,8 @@ const void* sapp_d3d11_get_depth_stencil_view(void) {
} /* extern "C" */
#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif /* SOKOL_IMPL */
diff --git a/sokol_audio.h b/sokol_audio.h
index ca0c86f0..0d59257f 100644
--- a/sokol_audio.h
+++ b/sokol_audio.h
@@ -158,6 +158,11 @@ extern int saudio_push(const float* frames, int num_frames);
/*--- IMPLEMENTATION ---------------------------------------------------------*/
#ifdef SOKOL_IMPL
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4505) /* unreferenced local function has been removed */
+#endif
+
#ifndef SOKOL_DEBUG
#ifdef _DEBUG
#define SOKOL_DEBUG (1)
@@ -302,7 +307,7 @@ _SOKOL_PRIVATE void _saudio_fifo_init(_saudio_fifo* fifo, int packet_size, int n
SOKOL_ASSERT((packet_size > 0) && (num_packets > 0));
fifo->packet_size = packet_size;
fifo->num_packets = num_packets;
- fifo->base_ptr = SOKOL_MALLOC(packet_size * num_packets);
+ fifo->base_ptr = (uint8_t*) SOKOL_MALLOC(packet_size * num_packets);
SOKOL_ASSERT(fifo->base_ptr);
fifo->cur_packet = -1;
fifo->cur_offset = 0;
@@ -678,4 +683,8 @@ int saudio_push(const float* frames, int num_frames) {
} /* extern "C" */
#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif /* SOKOL_IMPL */
diff --git a/sokol_gfx.h b/sokol_gfx.h
index 4d73c069..28bd9d9b 100644
--- a/sokol_gfx.h
+++ b/sokol_gfx.h
@@ -1547,6 +1547,13 @@ extern void sg_discard_context(sg_context ctx_id);
/*--- IMPLEMENTATION ---------------------------------------------------------*/
#ifdef SOKOL_IMPL
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */
+#pragma warning(disable:4115) /* named type definition in parentheses */
+#pragma warning(disable:4505) /* unreferenced local function has been removed */
+#endif
+
#ifndef SOKOL_DEBUG
#ifdef _DEBUG
#define SOKOL_DEBUG (1)
@@ -3201,7 +3208,7 @@ _SOKOL_PRIVATE void _sg_gl_load_blend(const sg_blend_state* src, sg_blend_state*
dst->color_write_mask = 0;
}
else {
- dst->color_write_mask = _sg_def((sg_color_mask)src->color_write_mask, SG_COLORMASK_RGBA);
+ dst->color_write_mask = (uint8_t) _sg_def((sg_color_mask)src->color_write_mask, SG_COLORMASK_RGBA);
}
for (int i = 0; i < 4; i++) {
dst->blend_color[i] = src->blend_color[i];
@@ -4093,11 +4100,6 @@ _SOKOL_PRIVATE void _sg_update_image(_sg_image* img, const sg_image_content* dat
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */
-#pragma warning(disable:4115) /* named type definition in parentheses */
-#endif
#include <d3d11.h>
#if (defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
#pragma comment (lib, "WindowsApp.lib")
@@ -4113,9 +4115,6 @@ _SOKOL_PRIVATE void _sg_update_image(_sg_image* img, const sg_image_content* dat
#pragma comment (lib, "d3dcompiler.lib")
#endif
#endif
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
#ifdef __cplusplus
extern "C" {
@@ -9030,4 +9029,8 @@ void sg_update_image(sg_image img_id, const sg_image_content* data) {
} /* extern "C" */
#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif /* SOKOL_IMPL */