Unverified Commit 5540790f authored by Edênis Freindorfer Azevedo's avatar Edênis Freindorfer Azevedo Committed by Rafael Kitover
Browse files

fix some compilation warnings


Signed-off-by: default avatarRafael Kitover <rkitover@gmail.com>
Merged #396
parent d9197281
......@@ -20,6 +20,7 @@ int g_allocCountTemp = 0;
void* SzAlloc(void* p, size_t size)
{
(void)p; // unused param
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
......@@ -31,6 +32,7 @@ void* SzAlloc(void* p, size_t size)
void SzFree(void* p, void* address)
{
(void)p; // unused param
#ifdef _SZ_ALLOC_DEBUG
if (address != 0) {
g_allocCount--;
......@@ -42,6 +44,7 @@ void SzFree(void* p, void* address)
void* SzAllocTemp(void* p, size_t size)
{
(void)p; // unused param
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
......@@ -56,6 +59,7 @@ void* SzAllocTemp(void* p, size_t size)
void SzFreeTemp(void* p, void* address)
{
(void)p; // unused param
#ifdef _SZ_ALLOC_DEBUG
if (address != 0) {
g_allocCountTemp--;
......
......@@ -325,24 +325,30 @@ size_t utf8_encode_char( unsigned wide, char * target )
target[5] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x4000000;
break;
case 5:
target[4] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x200000;
break;
case 4:
target[3] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x10000;
break;
case 3:
target[2] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x800;
break;
case 2:
target[1] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0xC0;
case 1:
break;
case 1:
target[0] = wide;
break;
}
return count;
......
This diff is collapsed.
......@@ -66,7 +66,7 @@ bool FileExists(const char *filename)
// Get user-specific config dir manually.
// apple: ~/Library/Application Support/
// windows: %APPDATA%\
// windows: %APPDATA%/
// unix: ${XDG_CONFIG_HOME:-~/.config}/
std::string get_xdg_user_config_home()
{
......@@ -94,7 +94,7 @@ std::string get_xdg_user_config_home()
// Get user-specific data dir manually.
// apple: ~/Library/Application Support/
// windows: %APPDATA%\
// windows: %APPDATA%/
// unix: ${XDG_DATA_HOME:-~/.local/share}/
std::string get_xdg_user_data_home()
{
......
......@@ -10,6 +10,8 @@
#define FILE_SEP '/'
#endif
#define FREAD_UNCHECKED(A,B,C,D) (void)(fread(A,B,C,D) + 1)
enum IMAGE_TYPE { IMAGE_UNKNOWN = -1, IMAGE_GBA = 0, IMAGE_GB = 1 };
// save game
......
This diff is collapsed.
#ifndef _CONFIGMANAGER_H
#define _CONFIGMANAGER_H
#pragma once
#include "../sdl/filters.h"
#include <stdio.h>
#ifndef __GNUC__
#define HAVE_DECL_GETOPT 0
#define __STDC__ 1
#ifndef __LIBRETRO__
#include "getopt.h"
#endif
#else // ! __GNUC__
#define HAVE_DECL_GETOPT 1
#ifndef __LIBRETRO__
#include <getopt.h>
#endif
#endif // ! __GNUC__
#define MAX_CHEATS 16384
extern bool cpuIsMultiBoot;
extern bool mirroringEnable;
extern bool parseDebug;
extern bool speedHack;
extern bool speedup;
extern char *rewindMemory;
extern const char *aviRecordDir;
extern const char *biosFileNameGB;
extern const char *biosFileNameGBA;
extern const char *biosFileNameGBC;
extern const char *loadDotCodeFile;
extern const char *saveDotCodeFile;
extern const char *linkHostAddr;
extern const char *movieRecordDir;
extern const char *romDirGB;
extern const char *romDirGBA;
extern const char *romDirGBC;
extern const char *soundRecordDir;
extern int *rewindSerials;
extern int active;
extern int agbPrint;
extern int autoFire;
extern int autoFireMaxCount;
extern int autoFireToggle;
extern int autoFrameSkip;
extern int autoLoadMostRecent;
extern int autoPatch;
extern int autoSaveLoadCheatList;
extern int aviRecording;
extern int captureFormat;
extern int cheatsEnabled;
extern int cpuDisableSfx;
extern int cpuSaveType;
extern int dinputKeyFocus;
extern int disableMMX;
extern int disableStatusMessages;
extern int dsoundDisableHardwareAcceleration;
extern int filterHeight;
extern int filterMagnification;
extern int filterMT; // enable multi-threading for pixel filters
extern int filter;
extern int filterWidth;
extern int frameSkip;
extern int frameskipadjust;
extern int fsAdapter;
extern int fsColorDepth;
extern int fsForceChange;
extern int fsFrequency;
extern int fsHeight;
extern int fsWidth;
extern int fullScreen;
extern int fullScreenStretch;
extern int gdbBreakOnLoad;
extern int gdbPort;
extern int glFilter;
extern int ifbType;
extern int joypadDefault;
extern int languageOption;
extern int layerEnable;
extern int layerSettings;
extern int linkAuto;
extern int linkHacks;
extern int linkMode;
extern int linkNumPlayers;
extern int linkTimeout;
extern int maxScale;
extern int movieFrame;
extern int moviePlayFrame;
extern int moviePlaying;
extern int movieRecording;
extern int openGL;
extern int autoPatch;
extern int optFlashSize;
extern int optPrintUsage;
extern int paused;
extern int pauseWhenInactive;
extern int recentFreeze;
extern int renderedFrames;
extern int rewindCount;
extern int rewindCounter;
extern int rewindPos;
extern int rewindSaveNeeded;
extern int rewindTimer;
extern int rewindTopPos;
// extern int romSize;
extern int rtcEnabled;
extern int saveType;
extern int screenMessage;
extern int sensorX;
extern int sensorY;
extern int showRenderedFrames;
extern int showSpeed;
extern int showSpeedTransparent;
extern int sizeX;
extern int sizeY;
extern int skipBios;
extern int skipSaveGameBattery;
extern int skipSaveGameCheats;
extern int soundRecording;
extern int speedupToggle;
extern int sunBars;
extern int surfaceSizeX;
extern int surfaceSizeY;
extern int threadPriority;
extern int tripleBuffering;
extern int useBios;
extern int useBiosFileGB;
extern int useBiosFileGBA;
extern int useBiosFileGBC;
extern int videoOption;
extern int vsync;
extern int wasPaused;
extern uint32_t windowHeight;
extern int windowPositionX;
extern int windowPositionY;
extern uint32_t windowWidth;
extern int winFlashSize;
extern int winGbBorderOn;
extern int winGbPrinterEnabled;
extern int winPauseNextFrame;
extern uint32_t autoFrameSkipLastTime;
extern uint32_t movieLastJoypad;
extern uint32_t movieNextJoypad;
extern uint32_t throttle;
extern uint32_t speedup_throttle;
extern uint32_t speedup_frame_skip;
extern int preparedCheats;
extern const char *preparedCheatCodes[MAX_CHEATS];
// allow up to 100 IPS/UPS/PPF patches given on commandline
#define PATCH_MAX_NUM 100
extern int patchNum;
extern char *patchNames[PATCH_MAX_NUM]; // and so on
extern int mouseCounter;
extern FilterFunc filterFunction;
extern IFBFilterFunc ifbFunction;
extern char *homeDir;
extern const char *screenShotDir;
extern const char *saveDir;
extern const char *batteryDir;
// Directory within homedir to use for default save location.
#define DOT_DIR "visualboyadvance-m"
void SetHome(char *_arg0);
void SaveConfigFile();
void CloseConfig();
uint32_t ReadPrefHex(const char *pref_key, int default_value);
uint32_t ReadPrefHex(const char *pref_key);
uint32_t ReadPref(const char *pref_key, int default_value);
uint32_t ReadPref(const char *pref_key);
const char *ReadPrefString(const char *pref_key, const char *default_value);
const char *ReadPrefString(const char *pref_key);
void LoadConfigFile(int argc, char **argv);
void LoadConfig();
int ReadOpts(int argc, char **argv);
#endif
#ifndef _CONFIGMANAGER_H
#define _CONFIGMANAGER_H
#pragma once
#include "../sdl/filters.h"
#include <stdio.h>
#ifndef __GNUC__
#define HAVE_DECL_GETOPT 0
#define __STDC__ 1
#ifndef __LIBRETRO__
#include "getopt.h"
#endif
#else // ! __GNUC__
#define HAVE_DECL_GETOPT 1
#ifndef __LIBRETRO__
#include <getopt.h>
#endif
#endif // ! __GNUC__
#define MAX_CHEATS 16384
extern bool cpuIsMultiBoot;
extern bool mirroringEnable;
extern bool parseDebug;
extern bool speedHack;
extern bool speedup;
extern char *rewindMemory;
extern const char *aviRecordDir;
extern const char *biosFileNameGB;
extern const char *biosFileNameGBA;
extern const char *biosFileNameGBC;
extern const char *loadDotCodeFile;
extern const char *saveDotCodeFile;
extern const char *linkHostAddr;
extern const char *movieRecordDir;
extern const char *romDirGB;
extern const char *romDirGBA;
extern const char *romDirGBC;
extern const char *soundRecordDir;
extern int *rewindSerials;
extern int active;
extern int agbPrint;
extern int autoFire;
extern int autoFireMaxCount;
extern int autoFireToggle;
extern int autoFrameSkip;
extern int autoLoadMostRecent;
extern int autoPatch;
extern int autoSaveLoadCheatList;
extern int aviRecording;
extern int captureFormat;
extern int cheatsEnabled;
extern int cpuDisableSfx;
extern int cpuSaveType;
extern int dinputKeyFocus;
extern int disableMMX;
extern int disableStatusMessages;
extern int dsoundDisableHardwareAcceleration;
extern int filterHeight;
extern int filterMagnification;
extern int filterMT; // enable multi-threading for pixel filters
extern int filter;
extern int filterWidth;
extern int frameSkip;
extern int frameskipadjust;
extern int fsAdapter;
extern int fsColorDepth;
extern int fsForceChange;
extern int fsFrequency;
extern int fsHeight;
extern int fsWidth;
extern int fullScreen;
extern int fullScreenStretch;
extern int gdbBreakOnLoad;
extern int gdbPort;
extern int glFilter;
extern int ifbType;
extern int joypadDefault;
extern int languageOption;
extern int layerEnable;
extern int layerSettings;
extern int linkAuto;
extern int linkHacks;
extern int linkMode;
extern int linkNumPlayers;
extern int linkTimeout;
extern int maxScale;
extern int movieFrame;
extern int moviePlayFrame;
extern int moviePlaying;
extern int movieRecording;
extern int openGL;
extern int autoPatch;
extern int optFlashSize;
extern int optPrintUsage;
extern int paused;
extern int pauseWhenInactive;
extern int recentFreeze;
extern int renderedFrames;
extern int rewindCount;
extern int rewindCounter;
extern int rewindPos;
extern int rewindSaveNeeded;
extern int rewindTimer;
extern int rewindTopPos;
// extern int romSize;
extern int rtcEnabled;
extern int saveType;
extern int screenMessage;
extern int sensorX;
extern int sensorY;
extern int showRenderedFrames;
extern int showSpeed;
extern int showSpeedTransparent;
extern int sizeX;
extern int sizeY;
extern int skipBios;
extern int skipSaveGameBattery;
extern int skipSaveGameCheats;
extern int soundRecording;
extern int speedupToggle;
extern int sunBars;
extern int surfaceSizeX;
extern int surfaceSizeY;
extern int threadPriority;
extern int tripleBuffering;
extern int useBios;
extern int useBiosFileGB;
extern int useBiosFileGBA;
extern int useBiosFileGBC;
extern int videoOption;
extern int vsync;
extern int wasPaused;
extern uint32_t windowHeight;
extern int windowPositionX;
extern int windowPositionY;
extern uint32_t windowWidth;
extern int winFlashSize;
extern int winGbBorderOn;
extern int winGbPrinterEnabled;
extern int winPauseNextFrame;
extern uint32_t autoFrameSkipLastTime;
extern uint32_t movieLastJoypad;
extern uint32_t movieNextJoypad;
extern uint32_t throttle;
extern uint32_t speedup_throttle;
extern uint32_t speedup_frame_skip;
extern int preparedCheats;
extern const char *preparedCheatCodes[MAX_CHEATS];
// allow up to 100 IPS/UPS/PPF patches given on commandline
#define PATCH_MAX_NUM 100
extern int patchNum;
extern char *patchNames[PATCH_MAX_NUM]; // and so on
extern int mouseCounter;
extern FilterFunc filterFunction;
extern IFBFilterFunc ifbFunction;
extern char *homeDir;
extern const char *screenShotDir;
extern const char *saveDir;
extern const char *batteryDir;
// Directory within homedir to use for default save location.
#define DOT_DIR "visualboyadvance-m"
void SetHome(char *_arg0);
void SaveConfigFile();
void CloseConfig();
uint32_t ReadPrefHex(const char *pref_key, int default_value);
uint32_t ReadPrefHex(const char *pref_key);
uint32_t ReadPref(const char *pref_key, int default_value);
uint32_t ReadPref(const char *pref_key);
const char *ReadPrefString(const char *pref_key, const char *default_value);
const char *ReadPrefString(const char *pref_key);
void LoadConfigFile(int argc, char **argv);
void LoadConfig();
int ReadOpts(int argc, char **argv);
#endif
......@@ -58,7 +58,7 @@ class SoundDriver
*/
virtual void write(uint16_t *finalWave, int length) = 0;
virtual void setThrottle(unsigned short throttle){};
virtual void setThrottle(unsigned short throttle) = 0;
};
#endif // __VBA_SOUND_DRIVER_H__
......@@ -137,7 +137,7 @@ bool SoundSDL::init(long sampleRate) {
sound_device = SDL_OpenAudioDevice(NULL, 0, &audio, &audio_spec, SDL_AUDIO_ALLOW_ANY_CHANGE);
if(sound_device < 0) {
if(sound_device == 0) {
std::cerr << "Failed to open audio: " << SDL_GetError() << std::endl;
return false;
}
......
......@@ -45,7 +45,7 @@ protected:
private:
RingBuffer<uint16_t> samples_buf;
SDL_AudioDeviceID sound_device = -1;
SDL_AudioDeviceID sound_device = 0;
SDL_mutex* mutex;
SDL_sem* data_available;
......
......@@ -643,7 +643,7 @@ dictionary *iniparser_load(const char *ininame)
char line[ASCIILINESZ + 1];
char section[ASCIILINESZ + 1];
char key[ASCIILINESZ + 1];
char tmp[ASCIILINESZ + 1];
char tmp[2 * ASCIILINESZ + 3];
char val[ASCIILINESZ + 1];
int last = 0;
......
......@@ -20,7 +20,7 @@ static uint8_t *frm3 = NULL;
extern uint32_t qRGB_COLOR_MASK[2];
static void Init()
void InterframeFilterInit()
{
frm1 = (uint8_t *)calloc(322*242,4);
// 1 frame ago
......@@ -163,8 +163,9 @@ static void SmartIB_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, int start
void SmartIB(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
if(cpu_mmx) {
......@@ -329,8 +330,9 @@ static void SmartIB32_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, int sta
void SmartIB32(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
if(cpu_mmx) {
......@@ -445,8 +447,9 @@ static void MotionBlurIB_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, int
void MotionBlurIB(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
......@@ -550,8 +553,9 @@ static void MotionBlurIB32_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, in
void MotionBlurIB32(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
......@@ -569,7 +573,7 @@ void MotionBlurIB32(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, i
int sPitch = srcPitch >> 2;
int pos = 0;
for (int j = 0; j < height; j++)
for (int j = 0; j < height; j++)
for (int i = 0; i < sPitch; i++) {
uint32_t color = src0[pos];
src0[pos] = (((color & colorMask) >> 1) +
......
......@@ -5,7 +5,7 @@
extern int RGB_LOW_BITS_MASK;
static void Init();
void InterframeFilterInit();
// call ifc to ignore previous frame / when starting new
void InterframeCleanup();
......
// ****************************************************************************
// * This file is part of the HqMAME project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// * *
// * Additionally and as a special exception, the author gives permission *
// * to link the code of this program with the MAME library (or with modified *
// * versions of MAME that use the same license as MAME), and distribute *
// * linked combinations including the two. You must obey the GNU General *
// * Public License in all respects for all of the code used other than MAME. *
// * If you modify this file, you may extend this exception to your version *
// * of the file, but you are not obligated to do so. If you do not wish to *
// * do so, delete this exception statement from your version. *
// ****************************************************************************
#ifndef XBRZ_CONFIG_HEADER_284578425345
#define XBRZ_CONFIG_HEADER_284578425345
// do NOT include any headers here! used by xBRZ_dll!!!
namespace xbrz
{
struct ScalerCfg {
ScalerCfg()
: luminanceWeight(1), equalColorTolerance(30), dominantDirectionThreshold(3.6),
steepDirectionThreshold(2.2), newTestAttribute(0)
{
}
double luminanceWeight;
double equalColorTolerance;
double dominantDirectionThreshold;
double steepDirectionThreshold;
double newTestAttribute; // unused; test new parameters
};
}
// ****************************************************************************
// * This file is part of the HqMAME project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// * *
// * Additionally and as a special exception, the author gives permission *