1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 02:38:52 -05:00

Fixed various VC++ warnings.

This commit is contained in:
Camilla Berglund 2012-09-13 00:05:54 +02:00
parent 5bbbf8640e
commit 633839502c
5 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,4 @@
include_directories(${GLFW_SOURCE_DIR}/src include_directories(${GLFW_SOURCE_DIR}/src
${GLFW_BINARY_DIR}/src ${GLFW_BINARY_DIR}/src
${glfw_INCLUDE_DIRS}) ${glfw_INCLUDE_DIRS})
@ -38,6 +39,10 @@ elseif (_GLFW_X11_GLX)
endif() endif()
endif() endif()
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}") set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}")

View File

@ -67,8 +67,12 @@ GLFWAPI void glfwSetGamma(float gamma)
value = (float) i / (float) (size - 1); value = (float) i / (float) (size - 1);
// Apply gamma curve // Apply gamma curve
value = (float) pow(value, 1.f / gamma) * 65535.f + 0.5f; value = (float) pow(value, 1.f / gamma) * 65535.f + 0.5f;
// Clamp to value range // Clamp to value range
value = (float) fmax(fmin(value, 65535.f), 0.f); if (value < 0.f)
value = 0.f;
else if (value > 65535.f)
value = 65535.f;
ramp.red[i] = (unsigned short) value; ramp.red[i] = (unsigned short) value;
ramp.green[i] = (unsigned short) value; ramp.green[i] = (unsigned short) value;

View File

@ -34,6 +34,7 @@
#include <stdlib.h> #include <stdlib.h>
#if defined(_MSC_VER) #if defined(_MSC_VER)
#include <malloc.h> #include <malloc.h>
#define strdup _strdup
#endif #endif

View File

@ -271,7 +271,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
return NULL; return NULL;
} }
monitors[found]->Win32.name = wcsdup(adapter.DeviceName); monitors[found]->Win32.name = _wcsdup(adapter.DeviceName);
found++; found++;
} }

View File

@ -28,6 +28,8 @@
// //
//======================================================================== //========================================================================
#include "tinycthread.h"
#include <GL/glfw3.h> #include <GL/glfw3.h>
#include <stdio.h> #include <stdio.h>
@ -35,8 +37,6 @@
#include <math.h> #include <math.h>
#include <assert.h> #include <assert.h>
#include "tinycthread.h"
typedef struct typedef struct
{ {
GLFWwindow window; GLFWwindow window;