-Wall -Wextra from now, fix a bunch of warnings, -O1 to -O2

This commit is contained in:
Alberto Ortega 2015-03-20 16:12:07 +01:00
parent 8e5f18a482
commit 7a93148aaf
8 changed files with 12 additions and 8 deletions

View File

@ -9,7 +9,7 @@ LINKOBJ = $(OBJ)
LIBS = -lwsock32 -liphlpapi -lsetupapi -lmpr -s
INCS =
BIN = Output/MingW/pafish.exe
CFLAGS = $(INCS) -O1
CFLAGS = $(INCS) -Wall -Wextra -O2
all: $(BIN)

View File

@ -9,7 +9,7 @@ LINKOBJ = $(OBJ)
LIBS = -L"C:/MinGW32/lib" -lwsock32 -liphlpapi -lsetupapi -lmpr -s
INCS = -I"C:/MinGW32/include"
BIN = Output/MingW/pafish.exe
CFLAGS = $(INCS) -O1
CFLAGS = $(INCS) -Wall -Wextra -O2
all: $(BIN)

View File

@ -19,7 +19,7 @@ static inline int rdtsc_diff() {
}
static inline void cpuid_vendor_00(char * vendor) {
int eax, ebx, ecx, edx;
int ebx, ecx, edx;
__asm__ volatile("cpuid" \
: "=b"(ebx), \

View File

@ -4,6 +4,7 @@
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
#include "types.h"
#include "gensandbox.h"
@ -26,7 +27,7 @@ int gensandbox_mouse_act() {
int gensandbox_username() {
char username[200];
int i;
size_t i;
DWORD usersize = sizeof(username);
GetUserName(username, &usersize);
for (i = 0; i < strlen(username); i++) { /* case-insensitive */
@ -46,7 +47,7 @@ int gensandbox_username() {
int gensandbox_path() {
char path[500];
int i;
size_t i;
DWORD pathsize = sizeof(path);
GetModuleFileName(NULL, path, pathsize);
for (i = 0; i < strlen(path); i++) { /* case-insensitive */

View File

@ -35,7 +35,7 @@
*/
int main(int argc, char *argv[])
int main(void)
{
char winverstr[32], aux[1024];
char cpu_vendor[13];
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
winver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&winver);
snprintf(winverstr, sizeof(winverstr)-sizeof(winverstr[0]), "%d.%d build %d",
snprintf(winverstr, sizeof(winverstr)-sizeof(winverstr[0]), "%lu.%lu build %lu",
winver.dwMajorVersion, winver.dwMinorVersion, winver.dwBuildNumber);
/* Get CPU vendor */

View File

@ -4,6 +4,7 @@
#include "qemu.h"
#include "types.h"
#include "utils.h"
int qemu_reg_key1() {
return pafish_exists_regkey_value_str(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\Scsi\\Scsi Port 0\\Scsi Bus 0\\Target Id 0\\Logical Unit Id 0", "Identifier", "QEMU");

View File

@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <ctype.h>
#include "utils.h"
#include "types.h"
@ -31,7 +32,7 @@ inline int pafish_exists_regkey_value_str(HKEY hKey, char * regkey_s, char * val
ret = RegQueryValueEx(regkey, value_s, NULL, NULL, (BYTE*)value, &size);
RegCloseKey(regkey);
if (ret == ERROR_SUCCESS) {
int i;
size_t i;
for (i = 0; i < strlen(value); i++) { /* case-insensitive */
value[i] = toupper(value[i]);
}

View File

@ -10,6 +10,7 @@
#include "vbox.h"
#include "utils.h"
#include "types.h"
#include "common.h"
/**
* SCSI registry key check