summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2006-02-02 14:09:48 +0000
committerpixel <pixel>2006-02-02 14:09:48 +0000
commit530453376c1cef29b7c099f4e9e8b4e4dbf99db7 (patch)
tree2ac064392f5961646987139297c27c0f0d1791c5
parent074b784bfd03f248aa13cb50ad45479db03ba5ca (diff)
Removing a lot of warnings, as well as a bunch of terrible bugs!
-rw-r--r--includes/cdabstract.h4
-rw-r--r--lib/binwriter.cpp8
-rw-r--r--lib/cdabstract.cpp3
-rw-r--r--lib/dvdabstract.cpp6
-rw-r--r--lib/luacd.cpp21
-rw-r--r--psxdev/xadecode.h2
6 files changed, 26 insertions, 18 deletions
diff --git a/includes/cdabstract.h b/includes/cdabstract.h
index 1a49c07..e1ee3b4 100644
--- a/includes/cdabstract.h
+++ b/includes/cdabstract.h
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: cdabstract.h,v 1.7 2004-11-27 21:47:53 pixel Exp $ */
+/* $Id: cdabstract.h,v 1.8 2006-02-02 14:09:48 pixel Exp $ */
#ifndef __CD_ABSTRACT_H__
#define __CD_ABSTRACT_H__
@@ -31,7 +31,9 @@
#define METHOD_OUT_DIRECT 2
#define FILE_ANY_ACCESS 0
+#ifndef FILE_READ_ACCESS
#define FILE_READ_ACCESS 0x0001
+#endif
#define CTL_CODE( DevType, Function, Method, Access ) ( \
((DevType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
diff --git a/lib/binwriter.cpp b/lib/binwriter.cpp
index 5896315..dd7c712 100644
--- a/lib/binwriter.cpp
+++ b/lib/binwriter.cpp
@@ -17,18 +17,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: binwriter.cpp,v 1.1 2005-12-02 11:28:27 pixel Exp $ */
+/* $Id: binwriter.cpp,v 1.2 2006-02-02 14:09:49 pixel Exp $ */
#include <binwriter.h>
#include <binary.h>
void BinWriter::merge(void) {
- Section * iter, * sub_iter;
+ Section * iter;
std::vector<Section *> merged;
std::vector<Section *> to_merge;
std::vector<Section *>::iterator i;
- bool is_in, did_merge, pure_bss, is_before_us;
- Uint32 base, real_size, whole_size, end_address, sub_size;
+ bool is_in, pure_bss;
+ Uint32 base, real_size, whole_size, end_address;
for (iter = Section::GetFirst(); iter; iter = iter->GetNext()) {
is_in = false;
diff --git a/lib/cdabstract.cpp b/lib/cdabstract.cpp
index 44663f6..060edee 100644
--- a/lib/cdabstract.cpp
+++ b/lib/cdabstract.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: cdabstract.cpp,v 1.9 2004-11-27 21:47:56 pixel Exp $ */
+/* $Id: cdabstract.cpp,v 1.10 2006-02-02 14:09:49 pixel Exp $ */
#include "cdabstract.h"
#include "Input.h"
@@ -174,7 +174,6 @@ bool cdabstract::subprobe(String & probed) {
#ifdef _WIN32
int iDA, iDT, iDL;
- char letter[4];
HANDLE h;
if (GetDriveType(probed.to_charp()) == DRIVE_CDROM) {
diff --git a/lib/dvdabstract.cpp b/lib/dvdabstract.cpp
index 9e2370f..12d33c4 100644
--- a/lib/dvdabstract.cpp
+++ b/lib/dvdabstract.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: dvdabstract.cpp,v 1.3 2005-11-13 13:43:22 pixel Exp $ */
+/* $Id: dvdabstract.cpp,v 1.4 2006-02-02 14:09:49 pixel Exp $ */
#include "dvdabstract.h"
@@ -34,7 +34,11 @@ off_t dvdabstract::seek(off_t offset, int wheel) throw (GeneralException) {
break;
case SEEK_END:
throw IOGeneral("Can't seek from the end of the dvdabstract...");
+ default:
+ throw IOGeneral("Invalid seek wheel.");
}
+
+ return v;
}
off_t dvdabstract::tell() const {
diff --git a/lib/luacd.cpp b/lib/luacd.cpp
index 56ffe73..b1838fb 100644
--- a/lib/luacd.cpp
+++ b/lib/luacd.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: luacd.cpp,v 1.20 2005-11-13 13:41:20 pixel Exp $ */
+/* $Id: luacd.cpp,v 1.21 2006-02-02 14:09:49 pixel Exp $ */
#include "luacd.h"
@@ -40,7 +40,7 @@ enum cdutils_methods_t {
CDUTILS_READdata,
CDUTILS_READFILE,
CDUTILS_WRITESECTOR,
- CDUTILS_WRITEdata,
+ CDUTILS_WRITEDATA,
CDUTILS_WRITEFILE,
CDUTILS_GETISOINFOS,
CDUTILS_GETPTINFOS,
@@ -72,7 +72,7 @@ struct lua_functypes_t cdutils_methods[] = {
{ CDUTILS_READdata, "readdata", 1, 3, {LUA_NUMBER, LUA_NUMBER, LUA_NUMBER} },
{ CDUTILS_READFILE, "readfile", 2, 4, {LUA_OBJECT, LUA_NUMBER, LUA_NUMBER, LUA_NUMBER} },
{ CDUTILS_WRITESECTOR, "writesector", 1, 3, {LUA_TABLE, LUA_NUMBER, LUA_NUMBER} },
- { CDUTILS_WRITEdata, "writedata", 2, 4, {LUA_TABLE, LUA_NUMBER, LUA_NUMBER, LUA_NUMBER} },
+ { CDUTILS_WRITEDATA, "writedata", 2, 4, {LUA_TABLE, LUA_NUMBER, LUA_NUMBER, LUA_NUMBER} },
{ CDUTILS_WRITEFILE, "writefile", 1, 4, {LUA_OBJECT, LUA_NUMBER, LUA_NUMBER, LUA_NUMBER} },
{ CDUTILS_GETISOINFOS, "getisoinfos", 0, 0, 0 },
{ CDUTILS_GETPTINFOS, "getptinfos", 0, 0, 0 },
@@ -107,7 +107,7 @@ class sLua_cdutils : public Base {
DECLARE_METHOD(cdutils, CDUTILS_READdata);
DECLARE_METHOD(cdutils, CDUTILS_READFILE);
DECLARE_METHOD(cdutils, CDUTILS_WRITESECTOR);
- DECLARE_METHOD(cdutils, CDUTILS_WRITEdata);
+ DECLARE_METHOD(cdutils, CDUTILS_WRITEDATA);
DECLARE_METHOD(cdutils, CDUTILS_WRITEFILE);
DECLARE_METHOD(cdutils, CDUTILS_GETISOINFOS);
DECLARE_METHOD(cdutils, CDUTILS_GETPTINFOS);
@@ -143,7 +143,7 @@ void Luacdutils::pushmembers(Lua * L) {
PUSH_METHOD(cdutils, CDUTILS_READdata);
PUSH_METHOD(cdutils, CDUTILS_READFILE);
PUSH_METHOD(cdutils, CDUTILS_WRITESECTOR);
- PUSH_METHOD(cdutils, CDUTILS_WRITEdata);
+ PUSH_METHOD(cdutils, CDUTILS_WRITEDATA);
PUSH_METHOD(cdutils, CDUTILS_WRITEFILE);
PUSH_METHOD(cdutils, CDUTILS_GETISOINFOS);
PUSH_METHOD(cdutils, CDUTILS_GETPTINFOS);
@@ -304,9 +304,9 @@ int sLua_cdutils::cdutils_proceed(Lua * L, int n, cdutils * cd, int caller) {
sdata[i] = L->tonumber();
L->pop();
}
- cd->write_sector(data, mode, sect);
+ cd->write_sector(sdata, mode, sect);
break;
- case CDUTILS_WRITEdata:
+ case CDUTILS_WRITEDATA:
size = L->tonumber(3);
if (n >= 3)
sect = L->tonumber(4);
@@ -317,7 +317,7 @@ int sLua_cdutils::cdutils_proceed(Lua * L, int n, cdutils * cd, int caller) {
for (i = 0; i < size; i++) {
L->push((lua_Number) i);
L->gettable(2);
- sdata[i] = L->tonumber();
+ data[i] = L->tonumber();
L->pop();
}
cd->write_data(data, size, mode, sect);
@@ -879,7 +879,7 @@ void LuaPVD::pushstatics(Lua * L) throw (GeneralException) {
}
int sLua_PVD::PVD_proceed(Lua * L, int n, PVD * pvd, int caller) {
- int r = 0, key_i = 0, value_i;
+ int r = 0, key_i = 0;
String key_s, value_s;
cddate * value_date;
bool invalid = false, keyisstring;
@@ -1311,13 +1311,14 @@ int sLua_DirTree::DirTree_proceed(Lua * L, int n, DirTree * dir, int caller) {
}
int sLua_DirTree::DirTree_proceed_statics(Lua * L, int n, int caller) {
- int r;
+ int r = 0;
DirTree * father;
bool dir = true;
switch (caller) {
case DIRTREE_NEWDIRTREE:
father = (DirTree *) LuaObject::getme(L, 1);
+ r = 1;
if (n == 2)
dir = L->toboolean(2);
{
diff --git a/psxdev/xadecode.h b/psxdev/xadecode.h
index b886285..560ae73 100644
--- a/psxdev/xadecode.h
+++ b/psxdev/xadecode.h
@@ -28,8 +28,10 @@
#define XANONE 0x200 /* for application use only! */
#define XAAV 0x400 /* for application use only! */
+#ifndef max
#define max(a,b) (a<b?b:a)
#define min(a,b) (a>b?b:a)
+#endif
#define FXD_FxdToPCM(dt) (max(min((short)((dt)>>16), 32767), -32768))
#define DblToPCM(dt) (short)(max(min((dt), 32767), -32768))