/* -- PRIVATE FUNCTION DECLARATIONS ---------------------------------------- */
/* Spaceball device functions, defined in fg_spaceball_mswin.c */
-//Added by Jinrong Xie (stonexjr @ gmail.com) 12/24/2014
+//Added by Jinrong Xie <stonexjr at gmail.com> 12/24/2014
int fgIsSpaceballWinEvent(HWND hwnd, WPARAM wParam, LPARAM lParam);
void fgSpaceballHandleWinEvent(HWND hwnd, WPARAM wParam, LPARAM lParam);
*/
#include <GL/freeglut.h>
+#include <stdlib.h>
#include "../fg_internal.h"
enum {
if (res == -1)
return;
- rawInputBuffer = (BYTE*)malloc(size);
+ rawInputBuffer = malloc(size * sizeof *rawInputBuffer);
pRawInput = (PRAWINPUT)rawInputBuffer;
res = GetRawInputData(hRawInput, RID_INPUT, pRawInput, &size, sizeof(RAWINPUTHEADER));