From ab0afb77b2a0bb9d5dd3eb27ea98c6f9f4e938c2 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 23 Jun 2002 15:47:03 +0000 Subject: fixed u_* types for Windows. --- Makefile | 4 ++-- psxdev/bs.c | 2 +- psxdev/bs.h | 11 ++++++----- psxdev/common.h | 4 +++- psxdev/vlc.c | 54 +++++++++++++++++++++++++++--------------------------- psxdev/xadecode.c | 1 + 6 files changed, 40 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index cd471e4..19ce4e8 100755 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ TARGET = lzss dlzss cd-tool str-tool all: subdirs ${TARGET} subdirs: - for d in ${SUBDIRS} ; do make -C $$d ; done + for d in ${SUBDIRS} ; do make -C $$d || exit -1 ; done lzss: lzss.o lzss.h generic.o generic.h fileutils.h fileutils.o lzss-main.o Makefile ${CXX} ${LDFLAGS} -DLZSS_MAIN lzss.o generic.o fileutils.o lzss-main.o -o lzss @@ -30,6 +30,6 @@ str-tool: str-util.o generic.h generic.o fileutils.o fileutils.h cdutils.o cduti ${CXX} ${LDFLAGS} str-util.o generic.o fileutils.o cdutils.o yazedc.o psxdev/bs.o psxdev/idctfst.o psxdev/jfdctint.o psxdev/vlc.o -o str-tool -lSDL clean: - for d in ${SUBDIRS} ; do make -C $$d clean ; done + for d in ${SUBDIRS} ; do make -C $$d clean || exit -1 ; done rm -f *.o ${TARGET} compil.c diff --git a/psxdev/bs.c b/psxdev/bs.c index 5823430..a79a877 100644 --- a/psxdev/bs.c +++ b/psxdev/bs.c @@ -264,7 +264,7 @@ static void blk2huff (bs_context_t *ctxt,BLOCK *blk,int q_scale) } } -u_char bs_roundtbl[256*3]; +Uint8 bs_roundtbl[256*3]; void bs_init (void) { diff --git a/psxdev/bs.h b/psxdev/bs.h index 47a3762..4d66e0c 100644 --- a/psxdev/bs.h +++ b/psxdev/bs.h @@ -1,4 +1,4 @@ -/* $Id: bs.h,v 1.2 2002-06-23 11:19:06 Pixel Exp $ */ +/* $Id: bs.h,v 1.3 2002-06-23 15:47:03 Pixel Exp $ */ /* libbs - library for the bitstream image format @@ -36,6 +36,7 @@ #include #include +#include "generic.h" typedef struct { int width,height; @@ -48,10 +49,10 @@ typedef struct { #define BS_TYPE 2 typedef struct { - u_short length; - u_short magic; - u_short q_scale; - u_short type; + Uint16 length; + Uint16 magic; + Uint16 q_scale; + Uint16 type; } bs_header_t; /* prototypes */ diff --git a/psxdev/common.h b/psxdev/common.h index ee6e3a1..3a3c9d1 100644 --- a/psxdev/common.h +++ b/psxdev/common.h @@ -1,4 +1,4 @@ -/* $Id: common.h,v 1.1 2002-06-21 23:45:51 Pixel Exp $ */ +/* $Id: common.h,v 1.2 2002-06-23 15:47:03 Pixel Exp $ */ /* common stuff @@ -28,6 +28,8 @@ #define _GNU_SOURCE #define _USE_GNU +#include "generic.h" + #include #if ENABLE_NLS diff --git a/psxdev/vlc.c b/psxdev/vlc.c index 780dcf1..196fa96 100644 --- a/psxdev/vlc.c +++ b/psxdev/vlc.c @@ -1,7 +1,7 @@ -#include "bs.h" #include #include #include +#include "bs.h" #define SOFT @@ -39,7 +39,7 @@ /* Table B-14, DCT coefficients table zero, * codes 0100 ... 1xxx (used for all other coefficients) */ -static const u_long VLCtabnext[12*2] = { +static const Uint32 VLCtabnext[12*2] = { CODE(0,2,4), CODE(2,1,4), CODE2(1,1,3), CODE2(1,-1,3), CODE0(63,512,2), CODE0(63,512,2), CODE0(63,512,2), CODE0(63,512,2), /*EOB*/ CODE2(0,1,2), CODE2(0,1,2), CODE2(0,-1,2), CODE2(0,-1,2) @@ -48,7 +48,7 @@ static const u_long VLCtabnext[12*2] = { /* Table B-14, DCT coefficients table zero, * codes 000001xx ... 00111xxx */ -static const u_long VLCtab0[60*2] = { +static const Uint32 VLCtab0[60*2] = { CODE0(63,0,6), CODE0(63,0,6),CODE0(63,0,6), CODE0(63,0,6), /* ESCAPE */ CODE2(2,2,7), CODE2(2,-2,7), CODE2(9,1,7), CODE2(9,-1,7), CODE2(0,4,7), CODE2(0,-4,7), CODE2(8,1,7), CODE2(8,-1,7), @@ -69,7 +69,7 @@ static const u_long VLCtab0[60*2] = { /* Table B-14, DCT coefficients table zero, * codes 0000001000 ... 0000001111 */ -static const u_long VLCtab1[8*2] = { +static const Uint32 VLCtab1[8*2] = { CODE(16,1,10), CODE(5,2,10), CODE(0,7,10), CODE(2,3,10), CODE(1,4,10), CODE(15,1,10), CODE(14,1,10), CODE(4,2,10) }; @@ -77,7 +77,7 @@ static const u_long VLCtab1[8*2] = { /* Table B-14/15, DCT coefficients table zero / one, * codes 000000010000 ... 000000011111 */ -static const u_long VLCtab2[16*2] = { +static const Uint32 VLCtab2[16*2] = { CODE(0,11,12), CODE(8,2,12), CODE(4,3,12), CODE(0,10,12), CODE(2,4,12), CODE(7,2,12), CODE(21,1,12), CODE(20,1,12), CODE(0,9,12), CODE(19,1,12), CODE(18,1,12), CODE(1,5,12), @@ -87,7 +87,7 @@ static const u_long VLCtab2[16*2] = { /* Table B-14/15, DCT coefficients table zero / one, * codes 0000000010000 ... 0000000011111 */ -static const u_long VLCtab3[16*2] = { +static const Uint32 VLCtab3[16*2] = { CODE(10,2,13), CODE(9,2,13), CODE(5,3,13), CODE(3,4,13), CODE(2,5,13), CODE(1,7,13), CODE(1,6,13), CODE(0,15,13), CODE(0,14,13), CODE(0,13,13), CODE(0,12,13), CODE(26,1,13), @@ -97,7 +97,7 @@ static const u_long VLCtab3[16*2] = { /* Table B-14/15, DCT coefficients table zero / one, * codes 00000000010000 ... 00000000011111 */ -static const u_long VLCtab4[16*2] = { +static const Uint32 VLCtab4[16*2] = { CODE(0,31,14), CODE(0,30,14), CODE(0,29,14), CODE(0,28,14), CODE(0,27,14), CODE(0,26,14), CODE(0,25,14), CODE(0,24,14), CODE(0,23,14), CODE(0,22,14), CODE(0,21,14), CODE(0,20,14), @@ -107,7 +107,7 @@ static const u_long VLCtab4[16*2] = { /* Table B-14/15, DCT coefficients table zero / one, * codes 000000000010000 ... 000000000011111 */ -static const u_long VLCtab5[16*2] = { +static const Uint32 VLCtab5[16*2] = { CODE(0,40,15), CODE(0,39,15), CODE(0,38,15), CODE(0,37,15), CODE(0,36,15), CODE(0,35,15), CODE(0,34,15), CODE(0,33,15), CODE(0,32,15), CODE(1,14,15), CODE(1,13,15), CODE(1,12,15), @@ -117,7 +117,7 @@ static const u_long VLCtab5[16*2] = { /* Table B-14/15, DCT coefficients table zero / one, * codes 0000000000010000 ... 0000000000011111 */ -static const u_long VLCtab6[16*2] = { +static const Uint32 VLCtab6[16*2] = { CODE(1,18,16), CODE(1,17,16), CODE(1,16,16), CODE(1,15,16), CODE(6,3,16), CODE(16,2,16), CODE(15,2,16), CODE(14,2,16), CODE(13,2,16), CODE(12,2,16), CODE(11,2,16), CODE(31,1,16), @@ -138,7 +138,7 @@ static const u_long VLCtab6[16*2] = { 8 1111110xxxxxxxx 11111110xxxxxxxx -255..-128,128..255 */ -static const u_long DC_Ytab0[48] = { +static const Uint32 DC_Ytab0[48] = { CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3), CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3), CODE1(0,1,3),CODE1(0,1,3),CODE1(0,1,3),CODE1(0,1,3), @@ -156,7 +156,7 @@ static const u_long DC_Ytab0[48] = { }; -static const u_long DC_UVtab0[56] = { +static const Uint32 DC_UVtab0[56] = { CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2), CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2), CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2), @@ -191,17 +191,17 @@ static const u_long DC_UVtab0[56] = { #define Printf printf -int DecDCTvlc(u_short *mdec_bs,u_short *mdec_rl) +int DecDCTvlc(Uint16 *mdec_bs,Uint16 *mdec_rl) { -/* u_short *mdec_bs = mdecbs,*mdec_rl = mdecrl */ - u_short *rl_end; - u_long bitbuf; +/* Uint16 *mdec_bs = mdecbs,*mdec_rl = mdecrl */ + Uint16 *rl_end; + Uint32 bitbuf; int incnt; /* 16-Lbit x86=char risc = long */ int q_code; int type,n; int last_dc[3]; -/* BS_HDR u_short rlsize,magic,ver,q_scale */ +/* BS_HDR Uint16 rlsize,magic,ver,q_scale */ /* printf("%04x,%04x,",mdec_bs[0],mdec_bs[1]); */ *(long*)mdec_rl=*(long*)mdec_bs; @@ -216,7 +216,7 @@ int DecDCTvlc(u_short *mdec_bs,u_short *mdec_rl) n = 0; last_dc[0]=last_dc[1]=last_dc[2] = 0; while(mdec_rlmdec_rl = mdecrl; @@ -494,7 +494,7 @@ static void DecDCTin(bs_context_t *ctxt, u_short *mdecrl,int mode) ctxt->mdec_mode = mode; } -static void DecDCTout(bs_context_t *ctxt, u_short *image,int size) +static void DecDCTout(bs_context_t *ctxt, Uint16 *image,int size) { BLOCK blk[DCTSIZE2*6]; int blocksize=16*16; @@ -540,7 +540,7 @@ void bs_decode_rgb24 ( for(x=0;x #include #include +#include "common.h" #include "xadecode.h" #if USE_FXD -- cgit v1.2.3