summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2004-05-02 21:04:45 +0000
committerpixel <pixel>2004-05-02 21:04:45 +0000
commitfb6db18f7032c106ffa7c98a43370df0a7b125dc (patch)
tree08bca812d96c7fbc90e8fffbbcec5d740d14a880
parent423c6d73b2e4492cc3181b425a08499d45e3fe4f (diff)
Buuuuuuuuuuuuuuug
-rwxr-xr-xMakefile2
-rw-r--r--lib/cdutils.cpp6
-rw-r--r--lib/luacd.cpp26
3 files changed, 17 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 050208f..bd86bab 100755
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
CPPFLAGS=-Wall -g -O3 -mcpu=i686 -Iincludes `sdl-config --cflags` -DHAVE_ZLIB `baltisot-config --cflags` `lua-config --include` -DCHATTING
-LDFLAGS=-lz `sdl-config --libs` `baltisot-config --libs`
+LDFLAGS=-lz `sdl-config --libs` `baltisot-config --libs` -lefence
CDTOOL_LDFLAGS=`baltisot-config --libs` -lreadline
CXX=g++
diff --git a/lib/cdutils.cpp b/lib/cdutils.cpp
index 51e2e09..821d51a 100644
--- a/lib/cdutils.cpp
+++ b/lib/cdutils.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: cdutils.cpp,v 1.27 2004-05-01 11:48:58 pixel Exp $ */
+/* $Id: cdutils.cpp,v 1.28 2004-05-02 21:04:45 pixel Exp $ */
#include <stdio.h>
#include <string.h>
@@ -319,7 +319,7 @@ void cdutils::write_file(Handle * file, long size, int type, int number) {
if (type == GUESS) {
type = guess_type(number);
}
-
+
if (number >= 0) {
sector_seek(number);
}
@@ -334,7 +334,7 @@ void cdutils::write_file(Handle * file, long size, int type, int number) {
for (i = 0; i < nbsectors; i++) {
memset(buffer, 0, 2352);
- file->read(buffer, sec_sizes[type]);
+ size = file->read(buffer, sec_sizes[type]);
write_sector(buffer, type);
}
}
diff --git a/lib/luacd.cpp b/lib/luacd.cpp
index 453e980..2c10b3f 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.11 2004-05-02 00:41:39 pixel Exp $ */
+/* $Id: luacd.cpp,v 1.12 2004-05-02 21:04:45 pixel Exp $ */
#include "luacd.h"
@@ -239,9 +239,9 @@ int sLua_cdutils::cdutils_proceed(Lua * L, int n, cdutils * cd, int caller) {
break;
case CDUTILS_READSECTOR:
if (n >= 1)
- mode = L->tonumber(2);
+ sect = L->tonumber(2);
if (n == 2)
- sect = L->tonumber(3);
+ mode = L->tonumber(3);
size = cd->read_sector(sdatas, mode, sect);
L->newtable();
for (i = 0; i < size; i++) {
@@ -254,9 +254,9 @@ int sLua_cdutils::cdutils_proceed(Lua * L, int n, cdutils * cd, int caller) {
case CDUTILS_READDATAS:
size = L->tonumber(2);
if (n >= 2)
- mode = L->tonumber(3);
- if (n == 3)
sect = L->tonumber(3);
+ if (n == 3)
+ mode = L->tonumber(3);
datas = (Byte *) malloc(size);
cd->read_datas(datas, size, mode, sect);
L->newtable();
@@ -272,16 +272,16 @@ int sLua_cdutils::cdutils_proceed(Lua * L, int n, cdutils * cd, int caller) {
h = (Handle *) LuaObject::getme(L, 2);
size = L->tonumber(5);
if (n >= 3)
- mode = L->tonumber(4);
+ sect = L->tonumber(4);
if (n == 4)
- sect = L->tonumber(5);
+ mode = L->tonumber(5);
cd->read_file(h, size, mode, sect);
break;
case CDUTILS_WRITESECTOR:
if (n >= 2)
- mode = L->tonumber(3);
+ sect = L->tonumber(3);
if (n == 3)
- sect = L->tonumber(4);
+ mode = L->tonumber(4);
for (i = 0; i < 2352; i++) {
L->push((lua_Number) i);
L->gettable(2);
@@ -293,9 +293,9 @@ int sLua_cdutils::cdutils_proceed(Lua * L, int n, cdutils * cd, int caller) {
case CDUTILS_WRITEDATAS:
size = L->tonumber(3);
if (n >= 3)
- mode = L->tonumber(4);
+ sect = L->tonumber(4);
if (n == 4)
- sect = L->tonumber(5);
+ mode = L->tonumber(5);
datas = (Byte *) malloc(size);
for (i = 0; i < size; i++) {
@@ -312,9 +312,9 @@ int sLua_cdutils::cdutils_proceed(Lua * L, int n, cdutils * cd, int caller) {
if (n >= 2)
size = L->tonumber(3);
if (n >= 3)
- mode = L->tonumber(4);
+ sect = L->tonumber(4);
if (n == 4)
- sect = L->tonumber(5);
+ mode = L->tonumber(5);
cd->write_file(h, size, mode, sect);
break;
case CDUTILS_GETISOINFOS: