mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-25 03:12:08 +01:00
1745 lines
67 KiB
Diff
1745 lines
67 KiB
Diff
commit c51ecefde798e81c64f66765d055e0d223001bb1
|
|
Author: Sertonix <sertonix@posteo.net>
|
|
Date: 2025-09-01T19:54:56+02:00
|
|
|
|
Fix compilation with modern toolchain
|
|
|
|
Patch-Source: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c79702286ddf799bb01d94dc64d54bee173e55aa
|
|
Patch-Source: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f9eb3d2efe58a331361cbc7c10b8bf12faa8e375
|
|
Patch-Source: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a1ed45f3102e99d94170fa2a25df5d7d3bba3d60
|
|
Patch-Source: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/535886f96ac5b117b55d0cbb6bdffab4643b6043
|
|
Patch-Source: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4e2add2d44380218f452c90b489afbb575162f14
|
|
|
|
And many more changes
|
|
|
|
diff --git a/Cross/plugins/AsynchFilePlugin/AsynchFilePlugin.h b/Cross/plugins/AsynchFilePlugin/AsynchFilePlugin.h
|
|
index 0622458..45814fd 100644
|
|
--- a/Cross/plugins/AsynchFilePlugin/AsynchFilePlugin.h
|
|
+++ b/Cross/plugins/AsynchFilePlugin/AsynchFilePlugin.h
|
|
@@ -10,9 +10,9 @@ typedef struct {
|
|
} AsyncFile;
|
|
|
|
int asyncFileClose(AsyncFile *f);
|
|
-int asyncFileOpen(AsyncFile *f, int fileNamePtr, int fileNameSize, int writeFlag, int semaIndex);
|
|
+int asyncFileOpen(AsyncFile *f, char *fileNamePtr, int fileNameSize, int writeFlag, int semaIndex);
|
|
int asyncFileRecordSize();
|
|
-int asyncFileReadResult(AsyncFile *f, int bufferPtr, int bufferSize);
|
|
+int asyncFileReadResult(AsyncFile *f, char *bufferPtr, int bufferSize);
|
|
int asyncFileReadStart(AsyncFile *f, int fPosition, int count);
|
|
int asyncFileWriteResult(AsyncFile *f);
|
|
-int asyncFileWriteStart(AsyncFile *f, int fPosition, int bufferPtr, int bufferSize);
|
|
+int asyncFileWriteStart(AsyncFile *f, int fPosition, char *bufferPtr, int bufferSize);
|
|
diff --git a/Cross/plugins/CroquetPlugin/CroquetPlugin.h b/Cross/plugins/CroquetPlugin/CroquetPlugin.h
|
|
index fa8fbe8..84dbc89 100644
|
|
--- a/Cross/plugins/CroquetPlugin/CroquetPlugin.h
|
|
+++ b/Cross/plugins/CroquetPlugin/CroquetPlugin.h
|
|
@@ -19,5 +19,6 @@
|
|
Non-zero if successful, zero otherwise.
|
|
*/
|
|
int ioGatherEntropy(char *bufPtr, int bufSize);
|
|
+int triBoxOverlap(float *a, float *b, float *c, float *d, float *e);
|
|
|
|
#endif /* CROQUET_PLUGIN_H */
|
|
diff --git a/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h b/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h
|
|
index fcbe0c8..05be47a 100644
|
|
--- a/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h
|
|
+++ b/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h
|
|
@@ -18,7 +18,7 @@ char * list, sqInt attributeListLength);
|
|
|
|
/* ioShowDisplayOnWindow: similar to ioShowDisplay but adds the sqInt windowIndex
|
|
* Return true if ok, false if not, but not currently checked */
|
|
-extern sqInt ioShowDisplayOnWindow( unsigned char* dispBitsIndex, sqInt width, sqInt
|
|
+extern sqInt ioShowDisplayOnWindow( unsigned* dispBitsIndex, sqInt width, sqInt
|
|
height, sqInt depth, sqInt affectedL, sqInt affectedR, sqInt affectedT, sqInt affectedB,
|
|
sqInt windowIndex);
|
|
|
|
diff --git a/Cross/plugins/MIDIPlugin/MIDIPlugin.h b/Cross/plugins/MIDIPlugin/MIDIPlugin.h
|
|
index 7d25ce1..0362553 100644
|
|
--- a/Cross/plugins/MIDIPlugin/MIDIPlugin.h
|
|
+++ b/Cross/plugins/MIDIPlugin/MIDIPlugin.h
|
|
@@ -7,7 +7,7 @@ int midiShutdown(void);
|
|
int sqMIDIGetClock(void);
|
|
int sqMIDIGetPortCount(void);
|
|
int sqMIDIGetPortDirectionality(int portNum);
|
|
-int sqMIDIGetPortName(int portNum, int namePtr, int length);
|
|
+int sqMIDIGetPortName(int portNum, char * namePtr, int length);
|
|
int sqMIDIClosePort(int portNum);
|
|
int sqMIDIOpenPort(int portNum, int readSemaIndex, int interfaceClockRate);
|
|
int sqMIDIParameterSet(int whichParameter, int newValue);
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/header.c b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/header.c
|
|
index dcb53b2..69c7da5 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/header.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/header.c
|
|
@@ -31,6 +31,7 @@
|
|
*/
|
|
|
|
#include "mpeg3audio.h"
|
|
+#include "mpeg3protos.h"
|
|
#include "tables.h"
|
|
|
|
#include <stdio.h>
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer1.c b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer1.c
|
|
index 8bdcba8..63ddd5f 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer1.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer1.c
|
|
@@ -32,5 +32,5 @@
|
|
|
|
int mpeg3audio_dolayer1(mpeg3audio_t *audio)
|
|
{
|
|
- ;
|
|
+ return 0;
|
|
}
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer3.c b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer3.c
|
|
index ac7e989..17f01bb 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer3.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/layer3.c
|
|
@@ -875,7 +875,7 @@ int mpeg3audio_III_hybrid(mpeg3audio_t *audio,
|
|
return 0;
|
|
}
|
|
|
|
-int mpeg3audio_III_antialias(mpeg3audio_t *audio,
|
|
+void mpeg3audio_III_antialias(mpeg3audio_t *audio,
|
|
float xr[SBLIMIT][SSLIMIT],
|
|
struct gr_info_s *gr_info)
|
|
{
|
|
@@ -919,13 +919,12 @@ int mpeg3audio_III_antialias(mpeg3audio_t *audio,
|
|
}
|
|
}
|
|
}
|
|
- return 0;
|
|
}
|
|
|
|
/*
|
|
* III_stereo: calculate float channel values for Joint-I-Stereo-mode
|
|
*/
|
|
-int mpeg3audio_III_i_stereo(mpeg3audio_t *audio,
|
|
+void mpeg3audio_III_i_stereo(mpeg3audio_t *audio,
|
|
float xr_buf[2][SBLIMIT][SSLIMIT],
|
|
int *scalefac,
|
|
struct gr_info_s *gr_info,
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/mpeg3audio.h b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/mpeg3audio.h
|
|
index c1d7c88..9f902b8 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/mpeg3audio.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/mpeg3audio.h
|
|
@@ -4,6 +4,8 @@
|
|
#ifndef MPEG3AUDIO_H
|
|
#define MPEG3AUDIO_H
|
|
|
|
+typedef struct mpeg3 mpeg3_t;
|
|
+
|
|
#include "ac3.h"
|
|
#include "bitstream.h"
|
|
#ifndef M_PI
|
|
@@ -124,5 +126,34 @@ typedef struct
|
|
} mpeg3audio_t;
|
|
|
|
|
|
-
|
|
-#endif
|
|
+/* dct.c */
|
|
+int mpeg3audio_dct64_1(float *out0, float *out1, float *b1, float *b2, float *samples);
|
|
+int mpeg3audio_dct64(float *a, float *b, float *c);
|
|
+int mpeg3audio_dct36(float *inbuf, float *o1, float *o2, float *wintab, float *tsbuf);
|
|
+int mpeg3audio_dct12(float *in, float *rawout1, float *rawout2, register float *wi, register float *ts);
|
|
+int mpeg3audio_imdct_init(mpeg3audio_t *audio);
|
|
+/* header.c */
|
|
+int mpeg3audio_prev_header(mpeg3audio_t *audio);
|
|
+int mpeg3audio_read_header(mpeg3audio_t *audio);
|
|
+/* layer2.c */
|
|
+int mpeg3audio_dolayer2(mpeg3audio_t *audio);
|
|
+/* layer3.c */
|
|
+int mpeg3audio_read_layer3_frame(mpeg3audio_t *audio);
|
|
+int mpeg3audio_dolayer3(mpeg3audio_t *audio);
|
|
+/* mpeg3audio.c */
|
|
+int mpeg3audio_replace_buffer(mpeg3audio_t *audio, long new_allocation);
|
|
+int mpeg3audio_seek_percentage(mpeg3audio_t *audio, double percentage);
|
|
+int mpeg3audio_seek_sample(mpeg3audio_t *audio, long sample);
|
|
+int mpeg3audio_read_raw(mpeg3audio_t *audio, unsigned char *output, long *size, long max_size);
|
|
+int mpeg3audio_decode_audio(mpeg3audio_t *audio, float *output_f, short *output_i, int channel, long start_position, long len);
|
|
+/* pcm.c */
|
|
+int mpeg3audio_read_pcm_header(mpeg3audio_t *audio);
|
|
+int mpeg3audio_do_pcm(mpeg3audio_t *audio);
|
|
+/* synthesizers.c */
|
|
+int mpeg3audio_synth_stereo(mpeg3audio_t *audio, float *bandPtr, int channel, float *out, int *pnt);
|
|
+int mpeg3audio_synth_mono(mpeg3audio_t *audio, float *bandPtr, float *samples, int *pnt);
|
|
+int mpeg3audio_reset_synths(mpeg3audio_t *audio);
|
|
+/* tables.c */
|
|
+int mpeg3audio_new_decode_tables(mpeg3audio_t *audio);
|
|
+
|
|
+#endif /* MPEG3AUDIO_H */
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/pcm.c b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/pcm.c
|
|
index 111db6a..a307c65 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/audio/pcm.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/audio/pcm.c
|
|
@@ -32,6 +32,7 @@
|
|
*/
|
|
|
|
#include "mpeg3audio.h"
|
|
+#include "mpeg3protos.h"
|
|
#include "mpeg3private.inc"
|
|
|
|
int mpeg3audio_read_pcm_header(mpeg3audio_t *audio)
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/bitstream.h b/Cross/plugins/Mpeg3Plugin/libmpeg/bitstream.h
|
|
index 90e1f29..71e62d4 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/bitstream.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/bitstream.h
|
|
@@ -24,6 +24,22 @@ typedef struct
|
|
|
|
unsigned int mpeg3demux_read_char_packet(mpeg3_demuxer_t *demuxer);
|
|
unsigned int mpeg3demux_read_prev_char_packet(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3bits_seek_end(mpeg3_bits_t* stream);
|
|
+int mpeg3bits_seek_start(mpeg3_bits_t* stream);
|
|
+int mpeg3bits_seek_time(mpeg3_bits_t* stream, double time_position);
|
|
+int mpeg3bits_seek_byte(mpeg3_bits_t* stream, long position);
|
|
+int mpeg3bits_seek_percentage(mpeg3_bits_t* stream, double percentage);
|
|
+void mpeg3bits_start_reverse(mpeg3_bits_t* stream);
|
|
+void mpeg3bits_start_forward(mpeg3_bits_t* stream);
|
|
+
|
|
+int mpeg3bits_byte_align(mpeg3_bits_t *stream);
|
|
+int mpeg3bits_delete_stream(mpeg3_bits_t *stream);
|
|
+int mpeg3bits_getbitoffset(mpeg3_bits_t *stream);
|
|
+int mpeg3bits_read_buffer(mpeg3_bits_t *stream, unsigned char *buffer, int bytes);
|
|
+int mpeg3bits_refill(mpeg3_bits_t *stream);
|
|
+int mpeg3bits_refill_backwards(mpeg3_bits_t *stream);
|
|
+int mpeg3bits_use_demuxer(mpeg3_bits_t *stream);
|
|
+int mpeg3bits_use_ptr(mpeg3_bits_t *stream, unsigned char *buffer);
|
|
|
|
/* ======================================================================== */
|
|
/* Entry Points */
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c b/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c
|
|
index d240988..cc5fe96 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c
|
|
@@ -34,7 +34,9 @@
|
|
// May 31st, 2002 JMM a few additions to make it compile on the mac with latest code
|
|
|
|
#include <string.h>
|
|
+#include <stdlib.h>
|
|
#include "mpeg3private.h"
|
|
+#include "mpeg3protos.h"
|
|
#include "changesForSqueak.h"
|
|
|
|
#if defined(TARGET_OS_MAC) && !defined ( __APPLE__ ) && !defined ( __MACH__ )
|
|
@@ -175,7 +177,7 @@ int mpeg3_generate_toc_for_Squeak(mpeg3_t *file, int timecode_search, int print_
|
|
sprintf(temp_buffer, "PACKETSIZE: %ld\n", demuxer->packet_size);
|
|
appendStringToBufferIfPossible(buffer,temp_buffer,bufferSize);
|
|
|
|
- mpeg3demux_print_timecodes(demuxer->titles[demuxer->current_title], buffer);
|
|
+ mpeg3demux_print_timecodes_for_Squeak(demuxer->titles[demuxer->current_title], buffer, bufferSize);
|
|
|
|
mpeg3_delete_demuxer(demuxer);
|
|
return 0;
|
|
@@ -316,6 +318,29 @@ int mpeg3demux_print_streams_for_Squeak(mpeg3_demuxer_t *demuxer, char *buffer,i
|
|
return 0;
|
|
}
|
|
|
|
+int mpeg3demux_print_timecodes_for_Squeak(mpeg3_title_t *title, char *buffer,int buffer_size)
|
|
+{
|
|
+ mpeg3demux_timecode_t *timecode;
|
|
+ int i;
|
|
+ char temp_buffer[256];
|
|
+
|
|
+ if(title->timecode_table)
|
|
+ {
|
|
+ for(i = 0; i < title->timecode_table_size; i++)
|
|
+ {
|
|
+ timecode = &title->timecode_table[i];
|
|
+
|
|
+ sprintf(temp_buffer, "REGION: %ld %ld %f %f\n",
|
|
+ timecode->start_byte,
|
|
+ timecode->end_byte,
|
|
+ timecode->start_time,
|
|
+ timecode->end_time);
|
|
+ appendStringToBufferIfPossible(buffer,temp_buffer,buffer_size);
|
|
+ }
|
|
+ }
|
|
+ return 0;
|
|
+}
|
|
+
|
|
mpeg3_css_t* mpeg3_new_css()
|
|
{
|
|
return 0;
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/libmpeg3.c b/Cross/plugins/Mpeg3Plugin/libmpeg/libmpeg3.c
|
|
index 350dfed..3f5018f 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/libmpeg3.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/libmpeg3.c
|
|
@@ -35,6 +35,7 @@
|
|
|
|
#include "libmpeg3.h"
|
|
#include "mpeg3protos.h"
|
|
+#include "video/mpeg3videoprotos.h"
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
@@ -52,7 +53,7 @@ mpeg3_t* mpeg3_new(char *path,int size)
|
|
return file;
|
|
}
|
|
|
|
-int mpeg3_delete(mpeg3_t *file)
|
|
+void mpeg3_delete(mpeg3_t *file)
|
|
{
|
|
int i;
|
|
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.c b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.c
|
|
index ebc86f2..e8ce5ae 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.c
|
|
@@ -57,7 +57,7 @@ mpeg3_atrack_t* mpeg3_new_atrack(mpeg3_t *file, int stream_id, int format, mpeg3
|
|
return new_atrack;
|
|
}
|
|
|
|
-int mpeg3_delete_atrack(mpeg3_t *file, mpeg3_atrack_t *atrack)
|
|
+void mpeg3_delete_atrack(mpeg3_t *file, mpeg3_atrack_t *atrack)
|
|
{
|
|
if(atrack->audio)
|
|
mpeg3audio_delete(atrack->audio);
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.h b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.h
|
|
index 22b306d..836041b 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3atrack.h
|
|
@@ -17,4 +17,8 @@ typedef struct
|
|
long total_samples;
|
|
} mpeg3_atrack_t;
|
|
|
|
+mpeg3_atrack_t* mpeg3_new_atrack(mpeg3_t *file, int stream_id, int is_ac3, mpeg3_demuxer_t *demuxer);
|
|
+void mpeg3_delete_atrack(mpeg3_t *file, mpeg3_atrack_t *atrack);
|
|
+mpeg3audio_t* mpeg3audio_new(mpeg3_t *file, mpeg3_atrack_t *track, int is_ac3);
|
|
+
|
|
#endif
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3demux.c b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3demux.c
|
|
index 5084ab4..cb2f517 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3demux.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3demux.c
|
|
@@ -1365,7 +1365,7 @@ mpeg3_demuxer_t* mpeg3_new_demuxer(mpeg3_t *file, int do_audio, int do_video, in
|
|
return demuxer;
|
|
}
|
|
|
|
-int mpeg3_delete_demuxer(mpeg3_demuxer_t *demuxer)
|
|
+void mpeg3_delete_demuxer(mpeg3_demuxer_t *demuxer)
|
|
{
|
|
int i;
|
|
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.c b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.c
|
|
index 46ec6d4..57d6087 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.c
|
|
@@ -40,6 +40,7 @@
|
|
|
|
|
|
*/
|
|
+#include "mpeg3io.h"
|
|
#include "mpeg3private.h"
|
|
#include "mpeg3protos.h"
|
|
|
|
@@ -47,11 +48,7 @@
|
|
#include <mntent.h>
|
|
#endif
|
|
|
|
-#if defined( TARGET_OS_MAC) && !defined ( __APPLE__ ) && !defined ( __MACH__ )
|
|
-#include <stat.h>
|
|
-#else
|
|
#include <sys/stat.h>
|
|
-#endif
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
@@ -331,18 +328,3 @@ int mpeg3io_end_of_file(mpeg3_fs_t *fs ) {
|
|
|
|
return ( ! fs->fd ) || feof(fs->fd);
|
|
}
|
|
-
|
|
-inline int mpeg3io_fgetc(mpeg3_fs_t *fs) {
|
|
- if (fs->mpeg_is_in_buffer) {
|
|
- unsigned int value;
|
|
- fs->mpeg_is_in_buffer_file_position++;
|
|
- if (fs->mpeg_is_in_buffer_file_position >= fs->mpeg_buffer_size) {
|
|
- fs->mpeg_is_in_buffer_file_position = fs->mpeg_buffer_size;
|
|
- return 0;
|
|
- }
|
|
- value = (unsigned int) fs->mpeg_is_in_buffer[fs->mpeg_is_in_buffer_file_position-1];
|
|
- return value;
|
|
- }
|
|
- return (fs->fd ? fgetc(fs->fd) : 0);
|
|
-}
|
|
-
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.h b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.h
|
|
index bb93dc2..db38639 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3io.h
|
|
@@ -35,9 +35,25 @@ typedef struct
|
|
#endif
|
|
|
|
#define mpeg3io_total_bytes(fs) (((mpeg3_fs_t *)(fs))->total_bytes)
|
|
-inline int mpeg3io_fgetc(mpeg3_fs_t *fs);
|
|
|
|
-static inline unsigned int mpeg3io_read_int32(mpeg3_fs_t *fs)
|
|
+static inline int
|
|
+mpeg3io_fgetc(mpeg3_fs_t *fs) {
|
|
+ if (fs->mpeg_is_in_buffer) {
|
|
+ unsigned int value;
|
|
+ fs->mpeg_is_in_buffer_file_position++;
|
|
+ if (fs->mpeg_is_in_buffer_file_position >= fs->mpeg_buffer_size) {
|
|
+ fs->mpeg_is_in_buffer_file_position = fs->mpeg_buffer_size;
|
|
+ return 0;
|
|
+ }
|
|
+ value = (unsigned int) fs->mpeg_is_in_buffer[fs->mpeg_is_in_buffer_file_position-1];
|
|
+ return value;
|
|
+ }
|
|
+ return (fs->fd ? fgetc(fs->fd) : 0);
|
|
+}
|
|
+
|
|
+
|
|
+static inline unsigned int
|
|
+mpeg3io_read_int32(mpeg3_fs_t *fs)
|
|
{
|
|
int a, b, c, d;
|
|
unsigned int result;
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3private.h b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3private.h
|
|
index 207b24f..073493c 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3private.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3private.h
|
|
@@ -4,6 +4,8 @@
|
|
#ifndef MPEG3PRIVATE_H
|
|
#define MPEG3PRIVATE_H
|
|
|
|
+void * memoryAllocate(int number,unsigned size);
|
|
+void memoryFree(void *stuff);
|
|
|
|
/** configuration **/
|
|
#if defined(__MWERKS__)
|
|
@@ -33,6 +35,8 @@
|
|
#endif
|
|
|
|
|
|
+typedef struct mpeg3 mpeg3_t;
|
|
+
|
|
#include "mpeg3atrack.h"
|
|
#include "mpeg3css.h"
|
|
#include "mpeg3io.h"
|
|
@@ -40,7 +44,7 @@
|
|
#include "mpeg3title.h"
|
|
#include "mpeg3vtrack.h"
|
|
|
|
-typedef struct
|
|
+struct mpeg3
|
|
{
|
|
mpeg3_fs_t *fs; /* Store entry path here */
|
|
mpeg3_demuxer_t *demuxer; /* Master tables */
|
|
@@ -66,9 +70,6 @@ typedef struct
|
|
int program; /* Number of program to play */
|
|
int cpus;
|
|
int have_mmx;
|
|
-} mpeg3_t;
|
|
-
|
|
-
|
|
-
|
|
+};
|
|
|
|
#endif
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3protos.h b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3protos.h
|
|
index 69cb0b3..e095c84 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3protos.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3protos.h
|
|
@@ -8,7 +8,7 @@ mpeg3_css_t* mpeg3_new_css();
|
|
/* DEMUX */
|
|
|
|
mpeg3_demuxer_t* mpeg3_new_demuxer(mpeg3_t *file, int do_audio, int do_video, int stream_id);
|
|
-int mpeg3_delete_demuxer(mpeg3_demuxer_t *demuxer);
|
|
+void mpeg3_delete_demuxer(mpeg3_demuxer_t *demuxer);
|
|
int mpeg3demux_read_data(mpeg3_demuxer_t *demuxer, unsigned char *output, long size);
|
|
unsigned int mpeg3demux_read_int32(mpeg3_demuxer_t *demuxer);
|
|
unsigned int mpeg3demux_read_int24(mpeg3_demuxer_t *demuxer);
|
|
@@ -26,23 +26,19 @@ int mpeg3demux_bof(mpeg3_demuxer_t *demuxer);
|
|
mpeg3_title_t* mpeg3_new_title(mpeg3_t *file, char *path);
|
|
|
|
|
|
-/* ATRACK */
|
|
-
|
|
-mpeg3_atrack_t* mpeg3_new_atrack(mpeg3_t *file, int stream_id, int is_ac3, mpeg3_demuxer_t *demuxer);
|
|
-int mpeg3_delete_atrack(mpeg3_t *file, mpeg3_atrack_t *atrack);
|
|
-
|
|
-/* VTRACK */
|
|
-
|
|
-mpeg3_vtrack_t* mpeg3_new_vtrack(mpeg3_t *file, int stream_id, mpeg3_demuxer_t *demuxer);
|
|
-int mpeg3_delete_vtrack(mpeg3_t *file, mpeg3_vtrack_t *vtrack);
|
|
|
|
/* AUDIO */
|
|
-mpeg3audio_t* mpeg3audio_new(mpeg3_t *file, mpeg3_atrack_t *track, int is_ac3);
|
|
+#if defined(MPEG3AUDIO_H)
|
|
int mpeg3audio_delete(mpeg3audio_t *audio);
|
|
+int mpeg3audio_seek_percentage(mpeg3audio_t *audio, double percentage);
|
|
+int mpeg3audio_seek_sample(mpeg3audio_t *audio, long sample);
|
|
+int mpeg3audio_read_raw(mpeg3audio_t *audio, unsigned char *output, long *size, long max_size);
|
|
+int mpeg3audio_decode_audio(mpeg3audio_t *audio, float *output_f, short *output_i, int channel, long start_position, long len);
|
|
+#endif
|
|
|
|
|
|
/* VIDEO */
|
|
-mpeg3video_t* mpeg3video_new(mpeg3_t *file, mpeg3_vtrack_t *track);
|
|
+#if defined(MPEGVIDEO_H)
|
|
int mpeg3video_delete(mpeg3video_t *video);
|
|
int mpeg3video_read_frame(mpeg3video_t *video,
|
|
long frame_number,
|
|
@@ -54,6 +50,7 @@ int mpeg3video_read_frame(mpeg3video_t *video,
|
|
int out_w,
|
|
int out_h,
|
|
int color_model);
|
|
+#endif
|
|
|
|
/* FILESYSTEM */
|
|
|
|
@@ -65,11 +62,110 @@ int mpeg3io_read_data(unsigned char *buffer, long bytes, mpeg3_fs_t *fs);
|
|
int mpeg3io_end_of_file(mpeg3_fs_t *fs);
|
|
int mpeg3io_scanf (mpeg3_fs_t *fs,char *format, void * string1, void * string2);
|
|
int mpeg3io_scanf5 (mpeg3_fs_t *fs,char *format, void * string1, void * string2, void * string3, void * string4, void * string5);
|
|
-int mpeg3io_fgetc(mpeg3_fs_t *fs);
|
|
|
|
/* BITSTREAM */
|
|
mpeg3_bits_t* mpeg3bits_new_stream(mpeg3_t *file, mpeg3_demuxer_t *demuxer);
|
|
unsigned int mpeg3bits_getbits(mpeg3_bits_t* stream, int n);
|
|
|
|
-
|
|
+/* Other prototypes added eem '19/7/30, extracted using cproto */
|
|
+/* changesForSqueak.c */
|
|
+int mpeg3_generate_toc_for_Squeak(mpeg3_t *file, int timecode_search, int print_streams, char *buffer, int bufferSize);
|
|
+int mpeg3demux_create_title_for_Squeak(mpeg3_demuxer_t *demuxer, int timecode_search, char *buffer, int buffer_size);
|
|
+int mpeg3demux_print_streams_for_Squeak(mpeg3_demuxer_t *demuxer, char *buffer, int buffer_size);
|
|
+int mpeg3demux_print_timecodes_for_Squeak(mpeg3_title_t *title, char *buffer,int buffer_size);
|
|
+int mpeg3_delete_css(mpeg3_css_t *css);
|
|
+int mpeg3_get_keys(mpeg3_css_t *css, char *path);
|
|
+int mpeg3_decrypt_packet(mpeg3_css_t *css, unsigned char *sector);
|
|
+int IsImageName(char *name);
|
|
+/* libmpeg3.c */
|
|
+mpeg3_t *mpeg3_new(char *path, int size);
|
|
+void mpeg3_delete(mpeg3_t *file);
|
|
+int mpeg3_check_sig(char *path);
|
|
+mpeg3_t *mpeg3_open_copy(char *path, mpeg3_t *old_file, int size);
|
|
+mpeg3_t *mpeg3_open(char *path, int size);
|
|
+int mpeg3_close(mpeg3_t *file);
|
|
+int mpeg3_set_cpus(mpeg3_t *file, int cpus);
|
|
+int mpeg3_set_mmx(mpeg3_t *file, int use_mmx);
|
|
+int mpeg3_generate_toc(FILE *output, char *path, int timecode_search, int print_streams);
|
|
+int mpeg3_read_toc(mpeg3_t *file);
|
|
+int mpeg3_has_audio(mpeg3_t *file);
|
|
+int mpeg3_total_astreams(mpeg3_t *file);
|
|
+int mpeg3_audio_channels(mpeg3_t *file, int stream);
|
|
+int mpeg3_sample_rate(mpeg3_t *file, int stream);
|
|
+long mpeg3_get_sample(mpeg3_t *file, int stream);
|
|
+int mpeg3_set_sample(mpeg3_t *file, long sample, int stream);
|
|
+long mpeg3_audio_samples(mpeg3_t *file, int stream);
|
|
+int mpeg3_has_video(mpeg3_t *file);
|
|
+int mpeg3_total_vstreams(mpeg3_t *file);
|
|
+int mpeg3_video_width(mpeg3_t *file, int stream);
|
|
+int mpeg3_video_height(mpeg3_t *file, int stream);
|
|
+float mpeg3_frame_rate(mpeg3_t *file, int stream);
|
|
+long mpeg3_video_frames(mpeg3_t *file, int stream);
|
|
+long mpeg3_get_frame(mpeg3_t *file, int stream);
|
|
+int mpeg3_set_frame(mpeg3_t *file, long frame, int stream);
|
|
+int mpeg3_seek_percentage(mpeg3_t *file, double percentage);
|
|
+int mpeg3_previous_frame(mpeg3_t *file, int stream);
|
|
+double mpeg3_tell_percentage(mpeg3_t *file);
|
|
+double mpeg3_get_time(mpeg3_t *file);
|
|
+int mpeg3_end_of_audio(mpeg3_t *file, int stream);
|
|
+int mpeg3_end_of_video(mpeg3_t *file, int stream);
|
|
+int mpeg3_read_frame(mpeg3_t *file, unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, int color_model, int stream);
|
|
+int mpeg3_drop_frames(mpeg3_t *file, long frames, int stream);
|
|
+int mpeg3_read_yuvframe(mpeg3_t *file, char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h, int stream);
|
|
+int mpeg3_read_audio(mpeg3_t *file, float *output_f, short *output_i, int channel, long samples, int stream);
|
|
+int mpeg3_reread_audio(mpeg3_t *file, float *output_f, short *output_i, int channel, long samples, int stream);
|
|
+int mpeg3_read_audio_chunk(mpeg3_t *file, unsigned char *output, long *size, long max_size, int stream);
|
|
+int mpeg3_read_video_chunk(mpeg3_t *file, unsigned char *output, long *size, long max_size, int stream);
|
|
+/* mpeg3atrack.c */
|
|
+/* mpeg3demux.c */
|
|
+unsigned char mpeg3packet_read_char(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_get_adaptation_field(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_get_program_association_table(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3packet_get_data_buffer(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_get_pes_packet_header(mpeg3_demuxer_t *demuxer, unsigned long *pts, unsigned long *dts);
|
|
+int get_unknown_data(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_get_pes_packet_data(mpeg3_demuxer_t *demuxer, unsigned int stream_id);
|
|
+int mpeg3_get_pes_packet(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_get_payload(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_read_transport(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_get_system_header(mpeg3_demuxer_t *demuxer);
|
|
+unsigned long mpeg3_get_timestamp(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_get_pack_header(mpeg3_demuxer_t *demuxer, unsigned int *header);
|
|
+int mpeg3_get_ps_pes_packet(mpeg3_demuxer_t *demuxer, unsigned int *header);
|
|
+int mpeg3_read_program(mpeg3_demuxer_t *demuxer);
|
|
+double mpeg3_lookup_time_offset(mpeg3_demuxer_t *demuxer, long byte);
|
|
+int mpeg3_advance_timecode(mpeg3_demuxer_t *demuxer, int reverse);
|
|
+int mpeg3_read_next_packet(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3_read_prev_packet(mpeg3_demuxer_t *demuxer);
|
|
+unsigned int mpeg3demux_read_char_packet(mpeg3_demuxer_t *demuxer);
|
|
+unsigned int mpeg3demux_read_prev_char_packet(mpeg3_demuxer_t *demuxer);
|
|
+mpeg3demux_timecode_t *mpeg3_append_timecode(mpeg3_demuxer_t *demuxer, mpeg3_title_t *title, long prev_byte, double prev_time, long next_byte, double next_time, int dont_store);
|
|
+mpeg3demux_timecode_t *mpeg3demux_next_timecode(mpeg3_demuxer_t *demuxer, int *current_title, int *current_timecode, int current_program);
|
|
+mpeg3demux_timecode_t *mpeg3demux_prev_timecode(mpeg3_demuxer_t *demuxer, int *current_title, int *current_timecode, int current_program);
|
|
+int mpeg3demux_open_title(mpeg3_demuxer_t *demuxer, int title_number);
|
|
+int mpeg3demux_assign_programs(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3demux_create_title(mpeg3_demuxer_t *demuxer, int timecode_search, FILE *toc);
|
|
+int mpeg3demux_print_timecodes(mpeg3_title_t *title, FILE *output);
|
|
+int mpeg3demux_read_titles(mpeg3_demuxer_t *demuxer);
|
|
+int mpeg3demux_copy_titles(mpeg3_demuxer_t *dst, mpeg3_demuxer_t *src);
|
|
+int mpeg3demux_print_streams(mpeg3_demuxer_t *demuxer, FILE *toc);
|
|
+int mpeg3demux_seek_byte(mpeg3_demuxer_t *demuxer, long byte);
|
|
+int mpeg3demux_seek_time(mpeg3_demuxer_t *demuxer, double new_time);
|
|
+int mpeg3demux_seek_percentage(mpeg3_demuxer_t *demuxer, double percentage);
|
|
+long mpeg3demuxer_total_bytes(mpeg3_demuxer_t *demuxer);
|
|
+/* mpeg3io.c */
|
|
+int mpeg3_copy_fs(mpeg3_fs_t *dst, mpeg3_fs_t *src);
|
|
+long mpeg3io_get_total_bytes(mpeg3_fs_t *fs);
|
|
+int mpeg3io_get_id3v2_size(mpeg3_fs_t *fs);
|
|
+int mpeg3io_device(char *path, char *device);
|
|
+int mpeg3io_seek(mpeg3_fs_t *fs, long byte);
|
|
+int mpeg3io_seek_relative(mpeg3_fs_t *fs, long bytes);
|
|
+int mpeg3io_scanf(mpeg3_fs_t *fs, char *format, void *string1, void *string2);
|
|
+int mpeg3io_scanf5(mpeg3_fs_t *fs, char *format, void *string1, void *string2, void *string3, void *string4, void *string5);
|
|
+/* mpeg3title.c */
|
|
+int mpeg3_delete_title(mpeg3_title_t *title);
|
|
+void mpeg3_copy_title(mpeg3_title_t *dst, mpeg3_title_t *src);
|
|
+void mpeg3_dump_title(mpeg3_title_t *title);
|
|
+/* video/mmxtest.c */
|
|
+int mpeg3_mmx_test(void);
|
|
#endif
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3title.c b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3title.c
|
|
index 7257bdb..5e5c7ed 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3title.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3title.c
|
|
@@ -61,7 +61,7 @@ int mpeg3_delete_title(mpeg3_title_t *title)
|
|
}
|
|
|
|
|
|
-int mpeg3_copy_title(mpeg3_title_t *dst, mpeg3_title_t *src)
|
|
+void mpeg3_copy_title(mpeg3_title_t *dst, mpeg3_title_t *src)
|
|
{
|
|
int i;
|
|
|
|
@@ -81,13 +81,13 @@ int mpeg3_copy_title(mpeg3_title_t *dst, mpeg3_title_t *src)
|
|
}
|
|
}
|
|
|
|
-int mpeg3_dump_title(mpeg3_title_t *title)
|
|
+void mpeg3_dump_title(mpeg3_title_t *title)
|
|
{
|
|
int i;
|
|
|
|
for(i = 0; i < title->timecode_table_size; i++)
|
|
{
|
|
- printf("%f: %d - %d %f %f %d\n",
|
|
+ printf("%f: %ld - %ld %f %f %d\n",
|
|
title->timecode_table[i].absolute_start_time,
|
|
title->timecode_table[i].start_byte,
|
|
title->timecode_table[i].end_byte,
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.c b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.c
|
|
index 4c96e62..2b3d3af 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.c
|
|
@@ -55,7 +55,7 @@ mpeg3_vtrack_t* mpeg3_new_vtrack(mpeg3_t *file, int stream_id, mpeg3_demuxer_t *
|
|
return new_vtrack;
|
|
}
|
|
|
|
-int mpeg3_delete_vtrack(mpeg3_t *file, mpeg3_vtrack_t *vtrack)
|
|
+void mpeg3_delete_vtrack(mpeg3_t *file, mpeg3_vtrack_t *vtrack)
|
|
{
|
|
if(vtrack->video)
|
|
mpeg3video_delete(vtrack->video);
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.h b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.h
|
|
index c5025ae..3a4234a 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/mpeg3vtrack.h
|
|
@@ -17,4 +17,8 @@ typedef struct
|
|
long total_frames; /* Total frames in the file */
|
|
} mpeg3_vtrack_t;
|
|
|
|
+mpeg3video_t* mpeg3video_new(mpeg3_t *file, mpeg3_vtrack_t *track);
|
|
+mpeg3_vtrack_t* mpeg3_new_vtrack(mpeg3_t *file, int stream_id, mpeg3_demuxer_t *demuxer);
|
|
+void mpeg3_delete_vtrack(mpeg3_t *file, mpeg3_vtrack_t *vtrack);
|
|
+
|
|
#endif
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/getpicture.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/getpicture.c
|
|
index 6b3d9f7..4c2db3a 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/getpicture.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/getpicture.c
|
|
@@ -30,14 +30,18 @@
|
|
/* Changed Sept 15th by John M McIntosh to support Macintosh & Squeak
|
|
*/
|
|
#include "mpeg3private.h"
|
|
-
|
|
+#include "mpeg3protos.h"
|
|
#include "mpeg3video.h"
|
|
+#include "mpeg3videoprotos.h"
|
|
#include "vlc.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
+/* Import from slice.c */
|
|
+void mpeg3_slice_loop(mpeg3_slice_t *slice);
|
|
+
|
|
int mpeg3video_get_cbp(mpeg3_slice_t *slice)
|
|
{
|
|
int code;
|
|
@@ -73,23 +77,7 @@ int mpeg3video_get_cbp(mpeg3_slice_t *slice)
|
|
int mpeg3video_clearblock(mpeg3_slice_t *slice, int comp, int size)
|
|
{
|
|
slice->sparse[comp] = 1;
|
|
-
|
|
-/* Compiler error */
|
|
-/*
|
|
- * for(i = 0; i < size; i++)
|
|
- * {
|
|
- * bzero(slice->block[comp] + sizeof(short) * 64 * i, sizeof(short) * 64);
|
|
- * }
|
|
- */
|
|
-
|
|
- if(size == 6)
|
|
- {
|
|
- bzero(slice->block[comp], sizeof(short) * 64 * 6);
|
|
- }
|
|
- else
|
|
- {
|
|
- memset(slice->block[comp], 0, sizeof(short) * 64 * size);
|
|
- }
|
|
+ memset(slice->block[comp], 0, sizeof(short) * 64 * size);
|
|
return 0;
|
|
}
|
|
|
|
@@ -154,7 +142,7 @@ int mpeg3video_getdcchrom(mpeg3_slice_buffer_t *slice_buffer)
|
|
|
|
/* decode one intra coded MPEG-1 block */
|
|
|
|
-int mpeg3video_getintrablock(mpeg3_slice_t *slice,
|
|
+void mpeg3video_getintrablock(mpeg3_slice_t *slice,
|
|
mpeg3video_t *video,
|
|
int comp,
|
|
int dc_dct_pred[])
|
|
@@ -179,7 +167,7 @@ int mpeg3video_getintrablock(mpeg3_slice_t *slice,
|
|
bp[0] <<= 4;
|
|
#endif
|
|
|
|
- if(slice->fault) return 1;
|
|
+ if(slice->fault) return;
|
|
|
|
/* decode AC coefficients */
|
|
for(i = 1; ; i++)
|
|
@@ -265,7 +253,6 @@ int mpeg3video_getintrablock(mpeg3_slice_t *slice,
|
|
/* not a sparse matrix ! */
|
|
slice->sparse[comp] = 0;
|
|
}
|
|
- return 0;
|
|
}
|
|
|
|
|
|
@@ -369,7 +356,7 @@ int mpeg3video_getinterblock(mpeg3_slice_t *slice,
|
|
|
|
|
|
/* decode one intra coded MPEG-2 block */
|
|
-int mpeg3video_getmpg2intrablock(mpeg3_slice_t *slice,
|
|
+void mpeg3video_getmpg2intrablock(mpeg3_slice_t *slice,
|
|
mpeg3video_t *video,
|
|
int comp,
|
|
int dc_dct_pred[])
|
|
@@ -444,7 +431,7 @@ int mpeg3video_getmpg2intrablock(mpeg3_slice_t *slice,
|
|
{
|
|
/* fprintf(stderr,"mpeg3video_getmpg2intrablock: invalid Huffman code\n"); */
|
|
slice->fault = 1;
|
|
- return 1;
|
|
+ return;
|
|
}
|
|
|
|
mpeg3slice_flushbits(slice_buffer, tab->len);
|
|
@@ -492,13 +479,12 @@ int mpeg3video_getmpg2intrablock(mpeg3_slice_t *slice,
|
|
/* not a sparse matrix ! */
|
|
slice->sparse[comp] = 0;
|
|
}
|
|
- return 1;
|
|
}
|
|
|
|
|
|
/* decode one non-intra coded MPEG-2 block */
|
|
|
|
-int mpeg3video_getmpg2interblock(mpeg3_slice_t *slice,
|
|
+void mpeg3video_getmpg2interblock(mpeg3_slice_t *slice,
|
|
mpeg3video_t *video,
|
|
int comp)
|
|
{
|
|
@@ -563,7 +549,7 @@ int mpeg3video_getmpg2interblock(mpeg3_slice_t *slice,
|
|
{
|
|
/* fprintf(stderr, "mpeg3video_getmpg2interblock: invalid signed_level (escape)\n"); */
|
|
slice->fault = 1;
|
|
- return 1;
|
|
+ return;
|
|
}
|
|
if((sign = (val >= 2048)) != 0) val = 4096 - val;
|
|
}
|
|
@@ -591,7 +577,6 @@ int mpeg3video_getmpg2interblock(mpeg3_slice_t *slice,
|
|
{
|
|
slice->sparse[comp] = 0;
|
|
}
|
|
- return 0;
|
|
}
|
|
|
|
|
|
@@ -707,7 +692,7 @@ int mpeg3video_allocate_decoders(mpeg3video_t *video, int decoder_count)
|
|
{
|
|
for(i = 0; i < video->total_slice_decoders; i++)
|
|
{
|
|
- mpeg3_delete_slice_decoder(video->slice_decoders[i]);
|
|
+ mpeg3_delete_slice_decoder(&(video->slice_decoders[i]));
|
|
}
|
|
|
|
for(i = 0; i < file->cpus && i < MPEG3_MAX_CPUS; i++)
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/headers.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/headers.c
|
|
index d21122b..8239df6 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/headers.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/headers.c
|
|
@@ -32,6 +32,8 @@
|
|
#include "mpeg3demux.h"
|
|
#include "mpeg3private.h"
|
|
#include "mpeg3video.h"
|
|
+#include "mpeg3videoprotos.h"
|
|
+#include "mpeg3protos.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
@@ -92,7 +94,7 @@ int mpeg3video_getseqhdr(mpeg3video_t *video)
|
|
|
|
/* decode sequence extension */
|
|
|
|
-int mpeg3video_sequence_extension(mpeg3video_t *video)
|
|
+void mpeg3video_sequence_extension(mpeg3video_t *video)
|
|
{
|
|
int prof_lev;
|
|
int horizontal_size_extension, vertical_size_extension;
|
|
@@ -120,7 +122,7 @@ int mpeg3video_sequence_extension(mpeg3video_t *video)
|
|
|
|
/* decode sequence display extension */
|
|
|
|
-int mpeg3video_sequence_display_extension(mpeg3video_t *video)
|
|
+void mpeg3video_sequence_display_extension(mpeg3video_t *video)
|
|
{
|
|
int colour_primaries = 0, transfer_characteristics = 0;
|
|
int display_horizontal_size, display_vertical_size;
|
|
@@ -143,7 +145,7 @@ int mpeg3video_sequence_display_extension(mpeg3video_t *video)
|
|
|
|
/* decode quant matrix entension */
|
|
|
|
-int mpeg3video_quant_matrix_extension(mpeg3video_t *video)
|
|
+void mpeg3video_quant_matrix_extension(mpeg3video_t *video)
|
|
{
|
|
int i;
|
|
int load_intra_quantiser_matrix, load_non_intra_quantiser_matrix;
|
|
@@ -187,7 +189,7 @@ int mpeg3video_quant_matrix_extension(mpeg3video_t *video)
|
|
|
|
/* decode sequence scalable extension */
|
|
|
|
-int mpeg3video_sequence_scalable_extension(mpeg3video_t *video)
|
|
+void mpeg3video_sequence_scalable_extension(mpeg3video_t *video)
|
|
{
|
|
int layer_id;
|
|
|
|
@@ -212,7 +214,7 @@ int mpeg3video_sequence_scalable_extension(mpeg3video_t *video)
|
|
|
|
/* decode picture display extension */
|
|
|
|
-int mpeg3video_picture_display_extension(mpeg3video_t *video)
|
|
+void mpeg3video_picture_display_extension(mpeg3video_t *video)
|
|
{
|
|
int n, i;
|
|
short frame_centre_horizontal_offset[3];
|
|
@@ -235,7 +237,7 @@ int mpeg3video_picture_display_extension(mpeg3video_t *video)
|
|
|
|
/* decode picture coding extension */
|
|
|
|
-int mpeg3video_picture_coding_extension(mpeg3video_t *video)
|
|
+void mpeg3video_picture_coding_extension(mpeg3video_t *video)
|
|
{
|
|
int chroma_420_type, composite_display_flag;
|
|
int v_axis = 0, field_sequence = 0, sub_carrier = 0, burst_amplitude = 0, sub_carrier_phase = 0;
|
|
@@ -297,7 +299,7 @@ int mpeg3video_picture_coding_extension(mpeg3video_t *video)
|
|
|
|
/* decode picture spatial scalable extension */
|
|
|
|
-int mpeg3video_picture_spatial_scalable_extension(mpeg3video_t *video)
|
|
+void mpeg3video_picture_spatial_scalable_extension(mpeg3video_t *video)
|
|
{
|
|
video->pict_scal = 1; /* use spatial scalability in this picture */
|
|
|
|
@@ -320,7 +322,7 @@ int mpeg3video_picture_spatial_scalable_extension(mpeg3video_t *video)
|
|
*
|
|
*/
|
|
|
|
-int mpeg3video_picture_temporal_scalable_extension(mpeg3video_t *video)
|
|
+void mpeg3video_picture_temporal_scalable_extension(mpeg3video_t *video)
|
|
{
|
|
fprintf(stderr, "mpeg3video_picture_temporal_scalable_extension: temporal scalability not supported\n");
|
|
}
|
|
@@ -328,7 +330,7 @@ int mpeg3video_picture_temporal_scalable_extension(mpeg3video_t *video)
|
|
|
|
/* decode extension and user data */
|
|
|
|
-int mpeg3video_ext_user_data(mpeg3video_t *video)
|
|
+void mpeg3video_ext_user_data(mpeg3video_t *video)
|
|
{
|
|
int code = mpeg3bits_next_startcode(video->vstream);
|
|
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/idct.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/idct.c
|
|
index 7c394ea..a0a2945 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/idct.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/idct.c
|
|
@@ -70,7 +70,7 @@
|
|
|
|
|
|
inline
|
|
-int mpeg3video_idctrow(short *blk)
|
|
+void mpeg3video_idctrow(short *blk)
|
|
{
|
|
int x0, x1, x2, x3, x4, x5, x6, x7, x8;
|
|
|
|
@@ -134,7 +134,7 @@ int mpeg3video_idctrow(short *blk)
|
|
|
|
|
|
inline
|
|
-int mpeg3video_idctcol(short *blk)
|
|
+void mpeg3video_idctcol(short *blk)
|
|
{
|
|
int x0, x1, x2, x3, x4, x5, x6, x7, x8;
|
|
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/macroblocks.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/macroblocks.c
|
|
index cd5b1a1..7664ae1 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/macroblocks.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/macroblocks.c
|
|
@@ -28,6 +28,7 @@
|
|
http://www.squeak.org/license.html
|
|
*/
|
|
#include "mpeg3video.h"
|
|
+#include "mpeg3videoprotos.h"
|
|
#include "slice.h"
|
|
#include "vlc.h"
|
|
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/motion.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/motion.c
|
|
index 1b0fb66..16fafb1 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/motion.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/motion.c
|
|
@@ -31,6 +31,7 @@
|
|
*/
|
|
#include "mpeg3private.h"
|
|
#include "mpeg3video.h"
|
|
+#include "mpeg3videoprotos.h"
|
|
#include "vlc.h"
|
|
|
|
#include <stdio.h>
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3video.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3video.c
|
|
index 6b1072c..223c342 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3video.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3video.c
|
|
@@ -296,7 +296,7 @@ mpeg3video_t* mpeg3video_allocate_struct(mpeg3_t *file, mpeg3_vtrack_t *track)
|
|
return video;
|
|
}
|
|
|
|
-int mpeg3video_delete_struct(mpeg3video_t *video)
|
|
+void mpeg3video_delete_struct(mpeg3video_t *video)
|
|
{
|
|
int i;
|
|
mpeg3bits_delete_stream(video->vstream);
|
|
@@ -312,7 +312,7 @@ int mpeg3video_delete_struct(mpeg3video_t *video)
|
|
if(video->total_slice_decoders)
|
|
{
|
|
for(i = 0; i < video->total_slice_decoders; i++)
|
|
- mpeg3_delete_slice_decoder(video->slice_decoders[i]);
|
|
+ mpeg3_delete_slice_decoder(&(video->slice_decoders[i]));
|
|
}
|
|
for(i = 0; i < video->slice_buffers_initialized; i++)
|
|
mpeg3_delete_slice_buffer(&(video->slice_buffers[i]));
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3videoprotos.h b/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3videoprotos.h
|
|
index 0710c72..9942ddb 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3videoprotos.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/mpeg3videoprotos.h
|
|
@@ -4,4 +4,56 @@
|
|
void mpeg3video_idct_conversion(short* block);
|
|
unsigned int mpeg3slice_showbits(mpeg3_slice_buffer_t *slice_buffer, int bits);
|
|
|
|
+int mpeg3video_get_cbp(mpeg3_slice_t *slice);
|
|
+int mpeg3video_clearblock(mpeg3_slice_t *slice, int comp, int size);
|
|
+void mpeg3video_getintrablock(mpeg3_slice_t *slice, mpeg3video_t *video, int comp, int dc_dct_pred[]);
|
|
+int mpeg3video_getinterblock(mpeg3_slice_t *slice, mpeg3video_t *video, int comp);
|
|
+void mpeg3video_getmpg2intrablock(mpeg3_slice_t *slice, mpeg3video_t *video, int comp, int dc_dct_pred[]);
|
|
+void mpeg3video_getmpg2interblock(mpeg3_slice_t *slice, mpeg3video_t *video, int comp);
|
|
+int mpeg3video_getpicture(mpeg3video_t *video, int framenum);
|
|
+int mpeg3video_getgophdr(mpeg3video_t *video);
|
|
+int mpeg3video_getpicturehdr(mpeg3video_t *video);
|
|
+int mpeg3video_get_header(mpeg3video_t *video, int dont_repeat);
|
|
+int mpeg3video_getslicehdr(mpeg3_slice_t *slice, mpeg3video_t *video);
|
|
+int mpeg3video_get_macroblock_address(mpeg3_slice_t *slice);
|
|
+int mpeg3video_macroblock_modes(mpeg3_slice_t *slice, mpeg3video_t *video, int *pmb_type, int *pstwtype, int *pstwclass, int *pmotion_type, int *pmv_count, int *pmv_format, int *pdmv, int *pmvscale, int *pdct_type);
|
|
+int mpeg3_mmx_test(void);
|
|
+void mpeg3video_calc_dmv(mpeg3video_t *video, int DMV[][2], int *dmvector, int mvx, int mvy);
|
|
+void mpeg3video_motion_vector(mpeg3_slice_t *slice, mpeg3video_t *video, int *PMV, int *dmvector, int h_r_size, int v_r_size, int dmv, int mvscale, int full_pel_vector);
|
|
+int mpeg3video_motion_vectors(mpeg3_slice_t *slice, mpeg3video_t *video, int PMV[2][2][2], int dmvector[2], int mv_field_sel[2][2], int s, int mv_count, int mv_format, int h_r_size, int v_r_size, int dmv, int mvscale);
|
|
+int mpeg3video_read_frame_backend(mpeg3video_t *video, int skip_bframes);
|
|
+int mpeg3video_set_cpus(mpeg3video_t *video, int cpus);
|
|
+int mpeg3video_set_mmx(mpeg3video_t *video, int use_mmx);
|
|
+int mpeg3video_seek_percentage(mpeg3video_t *video, double percentage);
|
|
+int mpeg3video_previous_frame(mpeg3video_t *video);
|
|
+int mpeg3video_seek_frame(mpeg3video_t *video, long frame);
|
|
+int mpeg3video_read_raw(mpeg3video_t *video, unsigned char *output, long *size, long max_size);
|
|
+int mpeg3video_read_yuvframe(mpeg3video_t *video, long frame_number, char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h);
|
|
+int mpeg3video_init_output(void);
|
|
+int mpeg3video_ditherframeFastRGBA(mpeg3video_t *video, unsigned char **src, unsigned char **output_rows);
|
|
+int mpeg3video_ditherframeFastRGB555(mpeg3video_t *video, unsigned char **src, unsigned char **output_rows);
|
|
+int mpeg3video_present_frame(mpeg3video_t *video);
|
|
+int mpeg3video_display_second_field(mpeg3video_t *video);
|
|
+int mpeg3video_reconstruct(mpeg3video_t *video, int bx, int by, int mb_type, int motion_type, int PMV[2][2][2], int mv_field_sel[2][2], int dmvector[2], int stwtype);
|
|
+int mpeg3video_match_refframes(mpeg3video_t *video);
|
|
+int mpeg3video_seek(mpeg3video_t *video);
|
|
+int mpeg3video_drop_frames(mpeg3video_t *video, long frames);
|
|
+int mpeg3_new_slice_buffer(mpeg3_slice_buffer_t *slice_buffer);
|
|
+int mpeg3_delete_slice_buffer(mpeg3_slice_buffer_t *slice_buffer);
|
|
+int mpeg3_expand_slice_buffer(mpeg3_slice_buffer_t *slice_buffer);
|
|
+int mpeg3_new_slice_decoder(void *video, mpeg3_slice_t *slice);
|
|
+int mpeg3_delete_slice_decoder(mpeg3_slice_t *slice);
|
|
+/* mpeg3video.c */
|
|
+int mpeg3video_set_cpus(mpeg3video_t *video, int cpus);
|
|
+int mpeg3video_set_mmx(mpeg3video_t *video, int use_mmx);
|
|
+int mpeg3video_seek_percentage(mpeg3video_t *video, double percentage);
|
|
+int mpeg3video_previous_frame(mpeg3video_t *video);
|
|
+int mpeg3video_seek_frame(mpeg3video_t *video, long frame);
|
|
+int mpeg3video_read_raw(mpeg3video_t *video, unsigned char *output, long *size, long max_size);
|
|
+int mpeg3video_read_yuvframe(mpeg3video_t *video, long frame_number, char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h);
|
|
+/* seek.c */
|
|
+unsigned int mpeg3bits_next_startcode(mpeg3_bits_t *stream);
|
|
+int mpeg3video_next_code(mpeg3_bits_t *stream, unsigned int code);
|
|
+int mpeg3video_prev_code(mpeg3_bits_t *stream, unsigned int code);
|
|
+int mpeg3video_drop_frames(mpeg3video_t *video, long frames);
|
|
#endif
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/output.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/output.c
|
|
index 4cda6ea..5a71424 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/output.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/output.c
|
|
@@ -37,6 +37,7 @@
|
|
*/
|
|
#include "libmpeg3.h"
|
|
#include "mpeg3video.h"
|
|
+#include "mpeg3videoprotos.h"
|
|
#include <string.h>
|
|
|
|
unsigned char gClipArray[1026];
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/reconstruct.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/reconstruct.c
|
|
index 04c587a..419a59f 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/reconstruct.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/reconstruct.c
|
|
@@ -28,6 +28,7 @@
|
|
http://www.squeak.org/license.html
|
|
*/
|
|
#include "mpeg3video.h"
|
|
+#include "mpeg3videoprotos.h"
|
|
#include <stdio.h>
|
|
|
|
#ifdef HAVE_MMX
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/seek.c b/Cross/plugins/Mpeg3Plugin/libmpeg/video/seek.c
|
|
index 5636193..526c01c 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/seek.c
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/seek.c
|
|
@@ -32,6 +32,7 @@
|
|
#include "mpeg3private.h"
|
|
#include "mpeg3protos.h"
|
|
#include "mpeg3video.h"
|
|
+#include "mpeg3videoprotos.h"
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
diff --git a/Cross/plugins/Mpeg3Plugin/libmpeg/video/slice.h b/Cross/plugins/Mpeg3Plugin/libmpeg/video/slice.h
|
|
index 9b28c86..d21984e 100755
|
|
--- a/Cross/plugins/Mpeg3Plugin/libmpeg/video/slice.h
|
|
+++ b/Cross/plugins/Mpeg3Plugin/libmpeg/video/slice.h
|
|
@@ -6,6 +6,7 @@
|
|
#ifdef USE_PTHREADS
|
|
#include <pthread.h>
|
|
#endif
|
|
+
|
|
/* Array of these feeds the slice decoders */
|
|
typedef struct
|
|
{
|
|
@@ -77,40 +78,37 @@ static inline unsigned int mpeg3slice_getbit(mpeg3_slice_buffer_t *buffer)
|
|
{
|
|
if(buffer->bits_size)
|
|
return (buffer->bits >> (--buffer->bits_size)) & 0x1;
|
|
- else
|
|
- if(buffer->current_position < buffer->buffer_size)
|
|
- {
|
|
+ if(buffer->current_position < buffer->buffer_size) {
|
|
buffer->bits = buffer->data[buffer->current_position++];
|
|
buffer->bits_size = 7;
|
|
return (buffer->bits >> 7) & 0x1;
|
|
}
|
|
+ return 0; /* eem '19/7/30 */
|
|
}
|
|
|
|
static inline unsigned int mpeg3slice_getbits2(mpeg3_slice_buffer_t *buffer)
|
|
{
|
|
if(buffer->bits_size >= 2)
|
|
return (buffer->bits >> (buffer->bits_size -= 2)) & 0x3;
|
|
- else
|
|
- if(buffer->current_position < buffer->buffer_size)
|
|
- {
|
|
+ if(buffer->current_position < buffer->buffer_size) {
|
|
buffer->bits <<= 8;
|
|
buffer->bits |= buffer->data[buffer->current_position++];
|
|
buffer->bits_size += 6;
|
|
return (buffer->bits >> buffer->bits_size) & 0x3;
|
|
}
|
|
+ return 0; /* eem '19/7/30 */
|
|
}
|
|
|
|
static inline unsigned int mpeg3slice_getbyte(mpeg3_slice_buffer_t *buffer)
|
|
{
|
|
if(buffer->bits_size >= 8)
|
|
return (buffer->bits >> (buffer->bits_size -= 8)) & 0xff;
|
|
- else
|
|
- if(buffer->current_position < buffer->buffer_size)
|
|
- {
|
|
+ if(buffer->current_position < buffer->buffer_size) {
|
|
buffer->bits <<= 8;
|
|
buffer->bits |= buffer->data[buffer->current_position++];
|
|
return (buffer->bits >> buffer->bits_size) & 0xff;
|
|
}
|
|
+ return 0; /* eem '19/7/30 */
|
|
}
|
|
|
|
|
|
@@ -125,44 +123,41 @@ static inline unsigned int mpeg3slice_showbits16(mpeg3_slice_buffer_t *buffer)
|
|
{
|
|
if(buffer->bits_size >= 16)
|
|
return (buffer->bits >> (buffer->bits_size - 16)) & 0xffff;
|
|
- else
|
|
- if(buffer->current_position < buffer->buffer_size)
|
|
- {
|
|
+ if(buffer->current_position < buffer->buffer_size) {
|
|
buffer->bits <<= 16;
|
|
buffer->bits_size += 16;
|
|
buffer->bits |= (unsigned int)buffer->data[buffer->current_position++] << 8;
|
|
buffer->bits |= buffer->data[buffer->current_position++];
|
|
return (buffer->bits >> (buffer->bits_size - 16)) & 0xffff;
|
|
}
|
|
+ return 0; /* eem '19/7/30 */
|
|
}
|
|
|
|
static inline unsigned int mpeg3slice_showbits9(mpeg3_slice_buffer_t *buffer)
|
|
{
|
|
if(buffer->bits_size >= 9)
|
|
return (buffer->bits >> (buffer->bits_size - 9)) & 0x1ff;
|
|
- else
|
|
- if(buffer->current_position < buffer->buffer_size)
|
|
- {
|
|
+ if(buffer->current_position < buffer->buffer_size) {
|
|
buffer->bits <<= 16;
|
|
buffer->bits_size += 16;
|
|
buffer->bits |= (unsigned int)buffer->data[buffer->current_position++] << 8;
|
|
buffer->bits |= buffer->data[buffer->current_position++];
|
|
return (buffer->bits >> (buffer->bits_size - 9)) & 0x1ff;
|
|
}
|
|
+ return 0; /* eem '19/7/30 */
|
|
}
|
|
|
|
static inline unsigned int mpeg3slice_showbits5(mpeg3_slice_buffer_t *buffer)
|
|
{
|
|
if(buffer->bits_size >= 5)
|
|
return (buffer->bits >> (buffer->bits_size - 5)) & 0x1f;
|
|
- else
|
|
- if(buffer->current_position < buffer->buffer_size)
|
|
- {
|
|
+ if(buffer->current_position < buffer->buffer_size) {
|
|
buffer->bits <<= 8;
|
|
buffer->bits_size += 8;
|
|
buffer->bits |= buffer->data[buffer->current_position++];
|
|
return (buffer->bits >> (buffer->bits_size - 5)) & 0x1f;
|
|
}
|
|
+ return 0; /* eem '19/7/30 */
|
|
}
|
|
|
|
static inline unsigned int mpeg3slice_showbits(mpeg3_slice_buffer_t *slice_buffer, int bits)
|
|
diff --git a/Cross/plugins/SerialPlugin/SerialPlugin.h b/Cross/plugins/SerialPlugin/SerialPlugin.h
|
|
index 73ff7cd..3df41e2 100755
|
|
--- a/Cross/plugins/SerialPlugin/SerialPlugin.h
|
|
+++ b/Cross/plugins/SerialPlugin/SerialPlugin.h
|
|
@@ -6,9 +6,12 @@ int serialPortShutdown(void);
|
|
|
|
#pragma export on
|
|
int serialPortClose(int portNum);
|
|
+int serialPortCloseByName(const char *portName);
|
|
int serialPortCount(void);
|
|
int serialPortOpen(int portNum, int baudRate, int stopBitsType, int parityType, int dataBits,
|
|
int inFlowCtrl, int outFlowCtrl, int xOnChar, int xOffChar);
|
|
+int serialPortOpenByName(char *portName, int dataRate, int stopBitsType, int parityType, int dataBits,
|
|
+ int inFlowCtrl, int outFlowCtrl, int xOnChar, int xOffChar);
|
|
int serialPortReadInto(int portNum, int count, void *bufferPtr);
|
|
int serialPortReadIntoByName(const char *portName, int count, void *bufferPtr);
|
|
int serialPortWriteFrom(int portNum, int count, void *bufferPtr);
|
|
diff --git a/Cross/plugins/Squeak3D/b3dMain.c b/Cross/plugins/Squeak3D/b3dMain.c
|
|
index 2716d4a..b920906 100644
|
|
--- a/Cross/plugins/Squeak3D/b3dMain.c
|
|
+++ b/Cross/plugins/Squeak3D/b3dMain.c
|
|
@@ -63,7 +63,7 @@ int maxEdges = 0;
|
|
/*************************************************************/
|
|
|
|
void b3dAbort(char *msg){
|
|
- printf(msg);
|
|
+ printf("%s", msg);
|
|
exit(-1);
|
|
}
|
|
|
|
diff --git a/Cross/vm/sq.h b/Cross/vm/sq.h
|
|
index 4006e00..9f0a865 100644
|
|
--- a/Cross/vm/sq.h
|
|
+++ b/Cross/vm/sq.h
|
|
@@ -177,6 +177,7 @@ sqInt ioScreenDepth(void);
|
|
sqInt ioSeconds(void);
|
|
sqInt ioSetCursor(sqInt cursorBitsIndex, sqInt offsetX, sqInt offsetY);
|
|
sqInt ioSetCursorWithMask(sqInt cursorBitsIndex, sqInt cursorMaskIndex, sqInt offsetX, sqInt offsetY);
|
|
+sqInt ioSetCursorARGB(sqInt cursorBitsIndex, sqInt extentX, sqInt extentY, sqInt offsetX, sqInt offsetY);
|
|
sqInt ioShowDisplay(sqInt dispBitsIndex, sqInt width, sqInt height, sqInt depth,
|
|
sqInt affectedL, sqInt affectedR, sqInt affectedT, sqInt affectedB);
|
|
sqInt ioHasDisplayDepth(sqInt depth);
|
|
diff --git a/Cross/vm/sqVirtualMachine.c b/Cross/vm/sqVirtualMachine.c
|
|
index 59b6a6e..2a6d263 100644
|
|
--- a/Cross/vm/sqVirtualMachine.c
|
|
+++ b/Cross/vm/sqVirtualMachine.c
|
|
@@ -4,6 +4,7 @@
|
|
#include <string.h>
|
|
#include <time.h>
|
|
#include <setjmp.h>
|
|
+#include <unistd.h>
|
|
|
|
#include "sqVirtualMachine.h"
|
|
|
|
@@ -485,10 +486,7 @@ struct VirtualMachine* sqGetInterpreterProxy(void)
|
|
/* This lives here for now but belongs somewhere else.
|
|
* platforms/Cross/vm/sqStuff.c??
|
|
*/
|
|
-#define STDOUT_STACK_SZ 5
|
|
-static int stdoutStackIdx = -1;
|
|
-static FILE stdoutStack[STDOUT_STACK_SZ];
|
|
-
|
|
+
|
|
/* N.B. As of cygwin 1.5.25 fopen("crash.dmp","a") DOES NOT WORK! crash.dmp
|
|
* contains garbled output as if the file pointer gets set to the start of the
|
|
* file, not the end. So we synthesize our own append mode.
|
|
@@ -521,10 +519,6 @@ pushOutputFile(char *filenameOrStdioIndex)
|
|
|
|
FILE *output;
|
|
|
|
- if (stdoutStackIdx + 2 >= STDOUT_STACK_SZ) {
|
|
- fprintf(stderr,"output file stack is full.\n");
|
|
- return;
|
|
- }
|
|
switch ((unsigned)filenameOrStdioIndex) {
|
|
case STDOUT_FILENO: output = stdout; break;
|
|
case STDERR_FILENO: output = stderr; break;
|
|
@@ -536,17 +530,11 @@ pushOutputFile(char *filenameOrStdioIndex)
|
|
return;
|
|
}
|
|
}
|
|
- stdoutStack[++stdoutStackIdx] = *stdout;
|
|
- *stdout = *output;
|
|
}
|
|
|
|
void
|
|
popOutputFile()
|
|
{
|
|
- if (stdoutStackIdx < 0) {
|
|
- fprintf(stderr,"output file stack is empty.\n");
|
|
- return;
|
|
- }
|
|
fflush(stdout);
|
|
if (fileno(stdout) > STDERR_FILENO) {
|
|
/* as of Feb 2011 with fclose@@GLIBC_2.1 under e.g. CentOS 5.3, fclose
|
|
@@ -558,5 +546,4 @@ popOutputFile()
|
|
fclose(stdout);
|
|
#endif
|
|
}
|
|
- *stdout = stdoutStack[stdoutStackIdx--];
|
|
}
|
|
diff --git a/unix/CMakeLists.txt b/unix/CMakeLists.txt
|
|
index 74831a4..eb6f35b 100644
|
|
--- a/unix/CMakeLists.txt
|
|
+++ b/unix/CMakeLists.txt
|
|
@@ -2,9 +2,9 @@
|
|
#
|
|
# Last edited: 2012-09-16 21:19:57 by piumarta on linux64
|
|
|
|
-PROJECT (squeak)
|
|
+CMAKE_MINIMUM_REQUIRED (VERSION 3.13)
|
|
|
|
-CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)
|
|
+PROJECT (squeak)
|
|
|
|
IF (NOT DEFINED VM_HOST OR NOT DEFINED VM_VERSION)
|
|
MESSAGE (FATAL_ERROR "
|
|
@@ -155,8 +155,6 @@ INCLUDE (${unix}/vm/build.cmake)
|
|
|
|
BUILD_PLUGINS ()
|
|
|
|
-ADD_SUBDIRECTORY (${unix}/npsqueak)
|
|
-
|
|
SET (cmake ${unix}/../../cmake)
|
|
|
|
IF (EXISTS ${cmake}/Packages.cmake)
|
|
diff --git a/unix/cmake/PluginInternal.cmake b/unix/cmake/PluginInternal.cmake
|
|
index 4ee0e33..d80f5ec 100644
|
|
--- a/unix/cmake/PluginInternal.cmake
|
|
+++ b/unix/cmake/PluginInternal.cmake
|
|
@@ -13,3 +13,5 @@ INCLUDE_DIRECTORIES (${@plugin@_include_directories}
|
|
)
|
|
|
|
ADD_LIBRARY (@plugin@ STATIC @plugin_sources@)
|
|
+TARGET_LINK_LIBRARIES (@plugin@ ${@plugin@_link_libraries})
|
|
+TARGET_LINK_LIBRARIES (squeakvm${scriptsuffix} @plugin@)
|
|
diff --git a/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c b/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c
|
|
index 788287f..feeed2b 100644
|
|
--- a/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c
|
|
+++ b/unix/plugins/AsynchFilePlugin/sqUnixAsynchFile.c
|
|
@@ -142,7 +142,7 @@ INLINE static FilePtr newFileRec(int fd, int sema)
|
|
return fp;
|
|
}
|
|
|
|
-INLINE static allocateBuffer(struct FileBuf *buf, int size)
|
|
+INLINE static int allocateBuffer(struct FileBuf *buf, int size)
|
|
{
|
|
if (buf->capacity >= size)
|
|
return 1;
|
|
@@ -184,7 +184,7 @@ FilePtr asyncFileAttach(AsyncFile *f, int fd, int semaIndex)
|
|
/*** public functions ***/
|
|
|
|
|
|
-int asyncFileOpen(AsyncFile *f, int fileNamePtr, int fileNameSize,
|
|
+int asyncFileOpen(AsyncFile *f, char *fileNamePtr, int fileNameSize,
|
|
int writeFlag, int semaIndex)
|
|
{
|
|
int fd= 0;
|
|
@@ -239,7 +239,7 @@ int asyncFileRecordSize(void)
|
|
}
|
|
|
|
|
|
-int asyncFileReadResult(AsyncFile *f, int bufferPtr, int bufferSize)
|
|
+int asyncFileReadResult(AsyncFile *f, char *bufferPtr, int bufferSize)
|
|
{
|
|
FilePtr fp= 0;
|
|
int n= 0;
|
|
@@ -333,7 +333,7 @@ static void writeHandler(int fd, void *data, int flags)
|
|
}
|
|
|
|
|
|
-int asyncFileWriteStart(AsyncFile *f, int fPosition, int bufferPtr, int count)
|
|
+int asyncFileWriteStart(AsyncFile *f, int fPosition, char *bufferPtr, int count)
|
|
{
|
|
FilePtr fp= 0;
|
|
validate(f);
|
|
diff --git a/unix/plugins/CameraPlugin/sqCamera-linux.c b/unix/plugins/CameraPlugin/sqCamera-linux.c
|
|
index 218322f..aa7792e 100644
|
|
--- a/unix/plugins/CameraPlugin/sqCamera-linux.c
|
|
+++ b/unix/plugins/CameraPlugin/sqCamera-linux.c
|
|
@@ -84,7 +84,7 @@ void *hLibv4l2 = NULL;
|
|
int (*vd_open)(const char *, int, ...);
|
|
int (*vd_close)(int);
|
|
int (*vd_dup)(int);
|
|
-int (*vd_ioctl)(int, unsigned long int, ...);
|
|
+int (*vd_ioctl)(int, int, ...);
|
|
ssize_t (*vd_read)(int, void *, size_t);
|
|
void * (*vd_mmap)(void *, size_t, int, int, int, int64_t);
|
|
int (*vd_munmap)(void *, size_t);
|
|
diff --git a/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c b/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c
|
|
index c963f53..8b3232e 100644
|
|
--- a/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c
|
|
+++ b/unix/plugins/HostWindowPlugin/sqUnixHostWindowPlugin.c
|
|
@@ -69,7 +69,7 @@ sqInt createWindowWidthheightoriginXyattrlength(
|
|
* Return true if ok, false if not, but not currently checked
|
|
*/
|
|
sqInt ioShowDisplayOnWindow(
|
|
- unsigned char *dispBitsIndex,
|
|
+ unsigned *dispBitsIndex,
|
|
sqInt width, sqInt height, sqInt depth,
|
|
sqInt affectedL, sqInt affectedR, sqInt affectedT, sqInt affectedB,
|
|
sqInt windowIndex)
|
|
diff --git a/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc b/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc
|
|
index cc4bbad..acf9375 100644
|
|
--- a/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc
|
|
+++ b/unix/plugins/MIDIPlugin/sqUnixMIDIALSA.inc
|
|
@@ -219,7 +219,7 @@ int sqMIDIGetPortDirectionality(int portNum)
|
|
address. Copy at most length characters, and return the number of
|
|
characters copied. Fail if there is no port of the given number.
|
|
*/
|
|
-int sqMIDIGetPortName(int portNum, int namePtr, int length)
|
|
+int sqMIDIGetPortName(int portNum, char * namePtr, int length)
|
|
{
|
|
static char *userName[] = { "out", "in" };
|
|
|
|
@@ -333,7 +333,7 @@ int sqMIDIParameter(int whichParameter, int modify, int newValue)
|
|
{
|
|
snd_seq_queue_tempo_t *tempo= 0;
|
|
snd_seq_queue_tempo_alloca(&tempo);
|
|
- snd_seq_get_queue_tempo(seq, queue, &tempo);
|
|
+ snd_seq_get_queue_tempo(seq, queue, tempo);
|
|
return snd_seq_queue_tempo_get_tempo(tempo) / 1000.0;
|
|
}
|
|
break;
|
|
diff --git a/unix/plugins/MIDIPlugin/sqUnixMIDINone.inc b/unix/plugins/MIDIPlugin/sqUnixMIDINone.inc
|
|
index 0c4908e..4003a63 100644
|
|
--- a/unix/plugins/MIDIPlugin/sqUnixMIDINone.inc
|
|
+++ b/unix/plugins/MIDIPlugin/sqUnixMIDINone.inc
|
|
@@ -81,7 +81,7 @@ int sqMIDIGetPortDirectionality(int portNum)
|
|
/* Copy the name of the given MIDI port into the string at the given
|
|
address. Copy at most length characters, and return the number of
|
|
characters copied. Fail if there is no port of the given number.*/
|
|
-int sqMIDIGetPortName(int portNum, int namePtr, int length)
|
|
+int sqMIDIGetPortName(int portNum, char * namePtr, int length)
|
|
{
|
|
success(false);
|
|
return 0;
|
|
diff --git a/unix/plugins/WeDoPlugin/WeDoLinux.c b/unix/plugins/WeDoPlugin/WeDoLinux.c
|
|
index 973c2d3..62e55be 100644
|
|
--- a/unix/plugins/WeDoPlugin/WeDoLinux.c
|
|
+++ b/unix/plugins/WeDoPlugin/WeDoLinux.c
|
|
@@ -38,7 +38,7 @@
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
#include <linux/hiddev.h>
|
|
-
|
|
+#include <unistd.h>
|
|
|
|
#define true 1
|
|
#define false 0
|
|
diff --git a/unix/src/plugins.int b/unix/src/plugins.int
|
|
index 82a3c42..e62d096 100644
|
|
--- a/unix/src/plugins.int
|
|
+++ b/unix/src/plugins.int
|
|
@@ -1,2 +1,2 @@
|
|
# Automatically generated makefile include for internal plugins
|
|
-INTERNAL_PLUGINS = ADPCMCodecPlugin AsynchFilePlugin BMPReadWriterPlugin B2DPlugin BitBltPlugin CroquetPlugin DSAPrims ZipPlugin DropPlugin FFTPlugin FT2Plugin FilePlugin FloatArrayPlugin FloatMathPlugin GeniePlugin JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin Klatt LargeIntegers LocalePlugin Matrix2x3Plugin MiscPrimitivePlugin RePlugin SecurityPlugin SerialPlugin SlangTestSupportPlugin SocketPlugin SoundCodecPrims SoundGenerationPlugin SoundPlugin StarSqueakPlugin SurfacePlugin
|
|
+INTERNAL_PLUGINS = ADPCMCodecPlugin AsynchFilePlugin BMPReadWriterPlugin B2DPlugin BitBltPlugin CroquetPlugin DSAPrims ZipPlugin DropPlugin FFTPlugin FT2Plugin FilePlugin FloatArrayPlugin FloatMathPlugin GeniePlugin JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin Klatt LargeIntegers LocalePlugin Matrix2x3Plugin MiscPrimitivePlugin RePlugin SecurityPlugin SerialPlugin SocketPlugin SoundCodecPrims SoundGenerationPlugin SoundPlugin StarSqueakPlugin SurfacePlugin
|
|
diff --git a/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c b/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c
|
|
index 4c71420..85050e0 100644
|
|
--- a/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c
|
|
+++ b/unix/src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c
|
|
@@ -30,6 +30,12 @@
|
|
|
|
#include "sqMemoryAccess.h"
|
|
|
|
+void sqPasteboardPutItemFlavordatalengthformatTypeformatLength ( sqInt inPasteboard, char * data, int ndata, char * typeName, int ntypeName);
|
|
+void sqPasteboardClear( sqInt inPasteboard );
|
|
+sqInt sqCreateClipboard( void );
|
|
+int sqPasteboardGetItemCount(sqInt inPasteboard);
|
|
+int sqPasteboardCopyItemFlavorsitemNumber (sqInt inPasteboard, int formatNumber);
|
|
+int sqPasteboardCopyItemFlavorDataformatformatLength (sqInt inPasteboard, char* format, int formatLength);
|
|
|
|
/*** Constants ***/
|
|
|
|
diff --git a/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c b/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c
|
|
index e2f1b5a..694226a 100644
|
|
--- a/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c
|
|
+++ b/unix/src/plugins/FileCopyPlugin/FileCopyPlugin.c
|
|
@@ -28,6 +28,7 @@
|
|
#define EXPORT(returnType) static returnType
|
|
#endif
|
|
|
|
+#include "FileCopyPlugin.h"
|
|
#include "sqMemoryAccess.h"
|
|
|
|
|
|
diff --git a/unix/src/plugins/MIDIPlugin/MIDIPlugin.c b/unix/src/plugins/MIDIPlugin/MIDIPlugin.c
|
|
index a3fae58..1a5509f 100644
|
|
--- a/unix/src/plugins/MIDIPlugin/MIDIPlugin.c
|
|
+++ b/unix/src/plugins/MIDIPlugin/MIDIPlugin.c
|
|
@@ -161,7 +161,7 @@ EXPORT(sqInt) primitiveMIDIGetPortName(void) {
|
|
if (interpreterProxy->failed()) {
|
|
return null;
|
|
}
|
|
- sz = sqMIDIGetPortName(portNum, &portName, 255);
|
|
+ sz = sqMIDIGetPortName(portNum, portName, 255);
|
|
nameObj = interpreterProxy->instantiateClassindexableSize(interpreterProxy->classString(), sz);
|
|
if (interpreterProxy->failed()) {
|
|
return null;
|
|
diff --git a/unix/src/plugins/RomePlugin/RomePlugin.c b/unix/src/plugins/RomePlugin/RomePlugin.c
|
|
index aed0e19..986ed13 100644
|
|
--- a/unix/src/plugins/RomePlugin/RomePlugin.c
|
|
+++ b/unix/src/plugins/RomePlugin/RomePlugin.c
|
|
@@ -1191,7 +1191,7 @@ EXPORT(sqInt) primitivePangoComposeString2(void) {
|
|
}
|
|
inStringSize = interpreterProxy->stSizeOf(inStringOop);
|
|
if (inStringSize == 0) {
|
|
- primitiveFail();
|
|
+ interpreterProxy->primitiveFail();
|
|
return null;
|
|
}
|
|
aString = alloca(inStringSize);
|
|
@@ -2432,12 +2432,12 @@ EXPORT(sqInt) primitiveLanguageAttributes(void) {
|
|
return null;
|
|
}
|
|
if (!(interpreterProxy->isWords(stringOop))) {
|
|
- primitiveFail();
|
|
+ interpreterProxy->primitiveFail();
|
|
return null;
|
|
}
|
|
arraySize = interpreterProxy->stSizeOf(arrayOop);
|
|
if (arraySize <= 0) {
|
|
- primitiveFail();
|
|
+ interpreterProxy->primitiveFail();
|
|
return null;
|
|
}
|
|
stringSize = interpreterProxy->stSizeOf(stringOop);
|
|
@@ -2501,7 +2501,7 @@ l1: /* end utf8CountFor: */;
|
|
array[arrayIndex] = array4Oop;
|
|
arrayIndex += 1;
|
|
if (arrayIndex >= arraySize) {
|
|
- primitiveFail();
|
|
+ interpreterProxy->primitiveFail();
|
|
return null;
|
|
}
|
|
currentTag = leadingChar;
|
|
@@ -3038,7 +3038,7 @@ EXPORT(sqInt) primitiveUTF8StringWith2Indexes(void) {
|
|
arrayOop = oArrayOop;
|
|
stringOop = oStringOop;
|
|
if (interpreterProxy->isPointers(stringOop)) {
|
|
- primitiveFail();
|
|
+ interpreterProxy->primitiveFail();
|
|
return null;
|
|
}
|
|
bytes = interpreterProxy->isBytes(stringOop);
|
|
@@ -3162,7 +3162,7 @@ EXPORT(sqInt) primitiveUTF8StringWithIndex(void) {
|
|
arrayOop = oArrayOop;
|
|
stringOop = oStringOop;
|
|
if (interpreterProxy->isPointers(stringOop)) {
|
|
- primitiveFail();
|
|
+ interpreterProxy->primitiveFail();
|
|
return null;
|
|
}
|
|
bytes = interpreterProxy->isBytes(stringOop);
|
|
diff --git a/unix/src/plugins/Squeak3D/Squeak3D.c b/unix/src/plugins/Squeak3D/Squeak3D.c
|
|
index 3732e62..2df5487 100644
|
|
--- a/unix/src/plugins/Squeak3D/Squeak3D.c
|
|
+++ b/unix/src/plugins/Squeak3D/Squeak3D.c
|
|
@@ -197,7 +197,7 @@ static sqInt transformVBcountbyandflags(float *vtxArray, sqInt vtxCount, float *
|
|
static void* vbLoadArraysize(sqInt oop, sqInt count);
|
|
/*** Variables ***/
|
|
static char bbPluginName[256] = "BitBltPlugin";
|
|
-static sqInt copyBitsFn;
|
|
+static void *copyBitsFn;
|
|
|
|
#ifdef SQUEAK_BUILTIN_PLUGIN
|
|
extern
|
|
@@ -209,7 +209,7 @@ static double l2vSpecDir[3];
|
|
static sqInt lightFlags;
|
|
static double lightScale;
|
|
static float* litVertex;
|
|
-static sqInt loadBBFn;
|
|
+static void *loadBBFn;
|
|
static const char *moduleName =
|
|
#ifdef SQUEAK_BUILTIN_PLUGIN
|
|
"B3DEnginePlugin (i)"
|
|
diff --git a/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c b/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
|
|
index 24601e4..cdd333c 100644
|
|
--- a/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
|
|
+++ b/unix/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
|
|
@@ -31,6 +31,7 @@
|
|
|
|
#include "sqMemoryAccess.h"
|
|
|
|
+void initSurfacePluginFunctionPointers();
|
|
|
|
/*** Constants ***/
|
|
#define FFIAtomicTypeMask 251658240
|
|
diff --git a/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c b/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c
|
|
index 1a53f09..7b359d6 100644
|
|
--- a/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c
|
|
+++ b/unix/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c
|
|
@@ -31,6 +31,12 @@
|
|
|
|
#include "sqMemoryAccess.h"
|
|
|
|
+/* XDisplayControlPlugin class>>preambleCCode */
|
|
+extern void openXDisplay(void);
|
|
+extern void disconnectXDisplay(void);
|
|
+extern void synchronizeXDisplay(void);
|
|
+extern void forgetXDisplay(void);
|
|
+/* end XDisplayControlPlugin class>>preambleCCode */
|
|
|
|
/*** Constants ***/
|
|
|
|
diff --git a/unix/src/vm/interp.c b/unix/src/vm/interp.c
|
|
index 85f416d..c308f57 100644
|
|
--- a/unix/src/vm/interp.c
|
|
+++ b/unix/src/vm/interp.c
|
|
@@ -428,7 +428,7 @@ sqInt nilObject(void);
|
|
sqInt nonWeakFieldsOf(sqInt oop);
|
|
sqInt normalizeFloatOrderingInImage(void);
|
|
sqInt noteAsRootheaderLoc(sqInt oop, sqInt headerLoc);
|
|
-sqInt nullCompilerHook(void);
|
|
+sqInt nullCompilerHook(...);
|
|
sqInt objectAfter(sqInt oop);
|
|
sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop);
|
|
sqInt okayFields(sqInt oop);
|
|
@@ -930,7 +930,8 @@ struct foo * foo = &fum;
|
|
|
|
sqInt extraVMMemory;
|
|
const char *interpreterVersion = "Squeak4.3 of 22 December 2011 [latest update: #11860]";
|
|
-sqInt (*compilerHooks[16])();
|
|
+// FIXME this would break if anybody tries to use compilerHooks
|
|
+sqInt (*compilerHooks[16])(...);
|
|
struct VirtualMachine* interpreterProxy;
|
|
sqInt imageFormatVersionNumber = 0;
|
|
void *primitiveTable[577] = {
|
|
@@ -14444,7 +14445,7 @@ register struct foo * foo = &fum;
|
|
|
|
/* This should never be called: either the compiler is uninitialised (in which case the hooks should never be reached) or the compiler initialisation should have replaced all the hook with their external implementations. */
|
|
|
|
-sqInt nullCompilerHook(void) {
|
|
+sqInt nullCompilerHook(...) {
|
|
error("uninitialised compiler hook called");
|
|
return 0;
|
|
}
|
|
diff --git a/unix/src/vm/intplugins/FilePlugin/FilePlugin.c b/unix/src/vm/intplugins/FilePlugin/FilePlugin.c
|
|
index 0495a0f..551a62b 100644
|
|
--- a/unix/src/vm/intplugins/FilePlugin/FilePlugin.c
|
|
+++ b/unix/src/vm/intplugins/FilePlugin/FilePlugin.c
|
|
@@ -734,7 +734,7 @@ EXPORT(sqInt) primitiveFileStdioHandles(void) {
|
|
return interpreterProxy->primitiveFail();
|
|
}
|
|
}
|
|
- validMask = sqFileStdioHandlesInto((&fileRecords));
|
|
+ validMask = sqFileStdioHandlesInto(fileRecords);
|
|
if (validMask == 0) {
|
|
return interpreterProxy->primitiveFail();
|
|
}
|
|
diff --git a/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c b/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
|
|
index 501077a..936387d 100644
|
|
--- a/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
|
|
+++ b/unix/src/vm/intplugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
|
|
@@ -48,6 +48,7 @@
|
|
#define sizeOfSTArrayFromCPrimitive(cPtr) (interpreterProxy->sizeOfSTArrayFromCPrimitive(cPtr))
|
|
#define storeIntegerofObjectwithValue(idx,oop,value) (interpreterProxy->storeIntegerofObjectwithValue(idx,oop,value))
|
|
#define primitiveFail() interpreterProxy->primitiveFail()
|
|
+#define isBytes(v) interpreterProxy->isBytes(v)
|
|
/* allows accessing Strings in both C and Smalltalk */
|
|
#define asciiValue(c) c
|
|
|
|
diff --git a/unix/src/vm/intplugins/RePlugin/RePlugin.c b/unix/src/vm/intplugins/RePlugin/RePlugin.c
|
|
index 97a99c9..fd3ac2a 100644
|
|
--- a/unix/src/vm/intplugins/RePlugin/RePlugin.c
|
|
+++ b/unix/src/vm/intplugins/RePlugin/RePlugin.c
|
|
@@ -252,7 +252,7 @@ EXPORT(sqInt) primPCREExec(void) {
|
|
/* begin rcvrExtraPtr */
|
|
extraObj = interpreterProxy->fetchPointerofObject(3, rcvr);
|
|
if (extraObj == (interpreterProxy->nilObject())) {
|
|
- extraPtr = NULL;
|
|
+ extraPtr = 0;
|
|
goto l1;
|
|
}
|
|
extraPtr = ((int) (interpreterProxy->arrayValueOf(extraObj)));
|
|
@@ -317,7 +317,7 @@ EXPORT(sqInt) primPCREExecfromto(void) {
|
|
/* begin rcvrExtraPtr */
|
|
extraObj = interpreterProxy->fetchPointerofObject(3, rcvr);
|
|
if (extraObj == (interpreterProxy->nilObject())) {
|
|
- extraPtr = NULL;
|
|
+ extraPtr = 0;
|
|
goto l1;
|
|
}
|
|
extraPtr = ((int) (interpreterProxy->arrayValueOf(extraObj)));
|
|
diff --git a/unix/src/vm/sqNamedPrims.h b/unix/src/vm/sqNamedPrims.h
|
|
index 7a6e27e..59dac39 100644
|
|
--- a/unix/src/vm/sqNamedPrims.h
|
|
+++ b/unix/src/vm/sqNamedPrims.h
|
|
@@ -31,7 +31,6 @@ extern sqExport MiscPrimitivePlugin_exports[];
|
|
extern sqExport RePlugin_exports[];
|
|
extern sqExport SecurityPlugin_exports[];
|
|
extern sqExport SerialPlugin_exports[];
|
|
-extern sqExport SlangTestSupportPlugin_exports[];
|
|
extern sqExport SocketPlugin_exports[];
|
|
extern sqExport SoundCodecPrims_exports[];
|
|
extern sqExport SoundGenerationPlugin_exports[];
|
|
@@ -68,7 +67,6 @@ sqExport *pluginExports[] = {
|
|
RePlugin_exports,
|
|
SecurityPlugin_exports,
|
|
SerialPlugin_exports,
|
|
- SlangTestSupportPlugin_exports,
|
|
SocketPlugin_exports,
|
|
SoundCodecPrims_exports,
|
|
SoundGenerationPlugin_exports,
|
|
diff --git a/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c b/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c
|
|
index 18d0f7f..86763e1 100644
|
|
--- a/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c
|
|
+++ b/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c
|
|
@@ -214,7 +214,7 @@ static int mixer_setSwitch(char *name, int captureFlag, int parameter);
|
|
static int mixer_getSwitch(char *name, int captureFlag, int channel);
|
|
static void sound_Volume(double *left, double *right);
|
|
static void sound_SetVolume(double left, double right);
|
|
-static sqInt sound_SetRecordLevel(sqInt level);
|
|
+static void sound_SetRecordLevel(sqInt level);
|
|
static sqInt sound_SetDevice(sqInt id, char *arg);
|
|
static sqInt sound_GetSwitch(sqInt id, sqInt captureFlag, sqInt channel);
|
|
static sqInt sound_SetSwitch(sqInt id, sqInt captureFlag, sqInt parameter);
|
|
@@ -995,10 +995,10 @@ DBGMSG("<sound_StartRecording()");
|
|
static sqInt sound_StopRecording(void) {
|
|
DBGMSG(">sound_StopRecording()");
|
|
|
|
- if (!audioIn.open) return;
|
|
+ if (!audioIn.open) return 0;
|
|
audioIn.open = false;
|
|
|
|
- if (NULL == audioIn.pa_conn) return;
|
|
+ if (NULL == audioIn.pa_conn) return 1;
|
|
|
|
ioThreadStall(&audioIn);
|
|
|
|
@@ -1087,10 +1087,8 @@ static void sound_SetVolume(double left, double right) {
|
|
trace();
|
|
}
|
|
|
|
-static sqInt sound_SetRecordLevel(sqInt level) {
|
|
+static void sound_SetRecordLevel(sqInt level) {
|
|
trace();
|
|
- return 1;
|
|
- return level;
|
|
}
|
|
|
|
static sqInt sound_SetDevice(sqInt id, char *arg) {
|
|
diff --git a/unix/vm/aio.c b/unix/vm/aio.c
|
|
index 57e054e..f133c8e 100644
|
|
--- a/unix/vm/aio.c
|
|
+++ b/unix/vm/aio.c
|
|
@@ -31,6 +31,7 @@
|
|
*/
|
|
|
|
#include "sqaio.h"
|
|
+#include "sq.h"
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
diff --git a/unix/vm/sqUnixMain.c b/unix/vm/sqUnixMain.c
|
|
index 98ea3bc..9a88085 100644
|
|
--- a/unix/vm/sqUnixMain.c
|
|
+++ b/unix/vm/sqUnixMain.c
|
|
@@ -35,6 +35,7 @@
|
|
#include "sqaio.h"
|
|
#include "sqUnixCharConv.h"
|
|
#include "debug.h"
|
|
+#include "sqUnixGlobals.h"
|
|
|
|
#ifdef ioMSecs
|
|
# undef ioMSecs
|
|
@@ -53,6 +54,7 @@
|
|
#include <errno.h>
|
|
#include <signal.h>
|
|
#include <fcntl.h>
|
|
+#include <ctype.h>
|
|
|
|
#if defined(__alpha__) && defined(__osf__)
|
|
# include <sys/sysinfo.h>
|
|
@@ -118,6 +120,7 @@ int runInterpreter = 1;
|
|
struct SqDisplay *dpy= 0;
|
|
struct SqSound *snd= 0;
|
|
|
|
+sqInt printCallStack(void);
|
|
|
|
/*** timer support ***/
|
|
|