Skip to content

Commit a1ed45f

Browse files
committed
Define SQUEAK_BUILTIN_PLUGIN in the right place so that Makefile.tools can be
included by plugin Makefiles. Reduce the number of implciit declarations and compiler warnings in the mpeg3 support source. Still a few more to be done, but this shows the way.
1 parent 478f654 commit a1ed45f

File tree

24 files changed

+208
-64
lines changed

24 files changed

+208
-64
lines changed

build.win32x86/common/Makefile.tools

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ CFLAGS:= -msse2 -ggdb2 -m32 \
5151
-mno-rtd -mms-bitfields $(OFLAGS) $(NOBUILTIN) $(WARNINGS)
5252

5353
TZ:=$(shell date +%Z)
54-
XDEFS:= -DSQUEAK_BUILTIN_PLUGIN
5554
DEFS:= $(COGDEFS) $(WINVER) -DWIN32=1 -DWIN32_FILE_SUPPORT -DNO_ISNAN \
5655
-DNO_SERVICE -D'TZ="$(TZ)"' \
5756
$(NDEBUG) -DLSB_FIRST -D'VM_NAME="$(VM_NAME)"' $(XDEFS) $(CROQUET)

build.win64x64/common/Makefile.tools

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ CFLAGS:= -fdeclspec -msse2 -ggdb2 -m64 \
5151
-mno-rtd -mms-bitfields $(OFLAGS) $(NOBUILTIN) $(WARNINGS)
5252

5353
TZ:=$(shell date +%Z)
54-
XDEFS:= -DSQUEAK_BUILTIN_PLUGIN
5554
DEFS:= $(COGDEFS) $(WINVER) -DWIN64=1 -DWIN32_FILE_SUPPORT -DNO_ISNAN \
5655
-DNO_SERVICE -D'TZ="$(TZ)"' \
5756
$(NDEBUG) -DLSB_FIRST -D'VM_NAME="$(VM_NAME)"' $(XDEFS) $(CROQUET)

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/audio/header.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232

3333
#include "mpeg3audio.h"
34+
#include "mpeg3protos.h"
3435
#include "tables.h"
3536

3637
#include <stdio.h>

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/audio/mpeg3audio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef MPEG3AUDIO_H
55
#define MPEG3AUDIO_H
66

7+
typedef struct mpeg3 mpeg3_t;
8+
79
#include "ac3.h"
810
#include "bitstream.h"
911
#ifndef M_PI

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/bitstream.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ typedef struct
2424

2525
unsigned int mpeg3demux_read_char_packet(mpeg3_demuxer_t *demuxer);
2626
unsigned int mpeg3demux_read_prev_char_packet(mpeg3_demuxer_t *demuxer);
27+
int mpeg3bits_seek_end(mpeg3_bits_t* stream);
28+
int mpeg3bits_seek_start(mpeg3_bits_t* stream);
29+
int mpeg3bits_seek_time(mpeg3_bits_t* stream, double time_position);
30+
int mpeg3bits_seek_byte(mpeg3_bits_t* stream, long position);
31+
int mpeg3bits_seek_percentage(mpeg3_bits_t* stream, double percentage);
32+
void mpeg3bits_start_reverse(mpeg3_bits_t* stream);
33+
void mpeg3bits_start_forward(mpeg3_bits_t* stream);
34+
2735

2836
/* ======================================================================== */
2937
/* Entry Points */

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <stdlib.h>
3737
#include <string.h>
3838
#include "mpeg3private.h"
39+
#include "mpeg3protos.h"
3940
#include "changesForSqueak.h"
4041

4142
#if defined(TARGET_OS_MAC) && !defined ( __APPLE__ ) && !defined ( __MACH__ )

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ typedef struct
1717
long total_samples;
1818
} mpeg3_atrack_t;
1919

20+
mpeg3_atrack_t* mpeg3_new_atrack(mpeg3_t *file, int stream_id, int is_ac3, mpeg3_demuxer_t *demuxer);
21+
int mpeg3_delete_atrack(mpeg3_t *file, mpeg3_atrack_t *atrack);
22+
mpeg3audio_t* mpeg3audio_new(mpeg3_t *file, mpeg3_atrack_t *track, int is_ac3);
23+
2024
#endif

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,15 @@
4040
4141
4242
*/
43+
#include "mpeg3io.h"
4344
#include "mpeg3private.h"
4445
#include "mpeg3protos.h"
4546

4647
#if defined(__linux__)
4748
#include <mntent.h>
4849
#endif
4950

50-
#if defined( TARGET_OS_MAC) && !defined ( __APPLE__ ) && !defined ( __MACH__ )
51-
#include <stat.h>
52-
#else
5351
#include <sys/stat.h>
54-
#endif
5552

5653
#include <stdlib.h>
5754
#include <string.h>
@@ -331,18 +328,3 @@ int mpeg3io_end_of_file(mpeg3_fs_t *fs ) {
331328

332329
return ( ! fs->fd ) || feof(fs->fd);
333330
}
334-
335-
inline int mpeg3io_fgetc(mpeg3_fs_t *fs) {
336-
if (fs->mpeg_is_in_buffer) {
337-
unsigned int value;
338-
fs->mpeg_is_in_buffer_file_position++;
339-
if (fs->mpeg_is_in_buffer_file_position >= fs->mpeg_buffer_size) {
340-
fs->mpeg_is_in_buffer_file_position = fs->mpeg_buffer_size;
341-
return 0;
342-
}
343-
value = (unsigned int) fs->mpeg_is_in_buffer[fs->mpeg_is_in_buffer_file_position-1];
344-
return value;
345-
}
346-
return (fs->fd ? fgetc(fs->fd) : 0);
347-
}
348-

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,25 @@ typedef struct
3535
#endif
3636

3737
#define mpeg3io_total_bytes(fs) (((mpeg3_fs_t *)(fs))->total_bytes)
38-
inline int mpeg3io_fgetc(mpeg3_fs_t *fs);
3938

40-
static inline unsigned int mpeg3io_read_int32(mpeg3_fs_t *fs)
39+
static inline int
40+
mpeg3io_fgetc(mpeg3_fs_t *fs) {
41+
if (fs->mpeg_is_in_buffer) {
42+
unsigned int value;
43+
fs->mpeg_is_in_buffer_file_position++;
44+
if (fs->mpeg_is_in_buffer_file_position >= fs->mpeg_buffer_size) {
45+
fs->mpeg_is_in_buffer_file_position = fs->mpeg_buffer_size;
46+
return 0;
47+
}
48+
value = (unsigned int) fs->mpeg_is_in_buffer[fs->mpeg_is_in_buffer_file_position-1];
49+
return value;
50+
}
51+
return (fs->fd ? fgetc(fs->fd) : 0);
52+
}
53+
54+
55+
static inline unsigned int
56+
mpeg3io_read_int32(mpeg3_fs_t *fs)
4157
{
4258
int a, b, c, d;
4359
unsigned int result;

platforms/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3private.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ void memoryFree(void *stuff);
3939
#endif
4040

4141

42+
typedef struct mpeg3 mpeg3_t;
43+
4244
#include "mpeg3atrack.h"
4345
#include "mpeg3css.h"
4446
#include "mpeg3io.h"
4547
#include "mpeg3private.inc"
4648
#include "mpeg3title.h"
4749
#include "mpeg3vtrack.h"
4850

49-
typedef struct
51+
struct mpeg3
5052
{
5153
mpeg3_fs_t *fs; /* Store entry path here */
5254
mpeg3_demuxer_t *demuxer; /* Master tables */
@@ -72,9 +74,6 @@ typedef struct
7274
int program; /* Number of program to play */
7375
int cpus;
7476
int have_mmx;
75-
} mpeg3_t;
76-
77-
78-
77+
};
7978

8079
#endif

0 commit comments

Comments
 (0)