mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-05-18 00:58:26 -04:00
Replace "long long"s with an appropriate type from <stdint.h>
This commit is contained in:
parent
de004670c3
commit
1f6a0a497f
@ -20,6 +20,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -50,7 +51,7 @@
|
|||||||
#define EBML_SLICE_SIZE 4096
|
#define EBML_SLICE_SIZE 4096
|
||||||
|
|
||||||
/* A value that no EBML var-int is allowed to take. */
|
/* A value that no EBML var-int is allowed to take. */
|
||||||
#define EBML_UNKNOWN ((unsigned long long) -1)
|
#define EBML_UNKNOWN ((uint_least64_t) -1)
|
||||||
|
|
||||||
/* The magic numbers for each element we are interested in.
|
/* The magic numbers for each element we are interested in.
|
||||||
* Defined here:
|
* Defined here:
|
||||||
@ -129,7 +130,7 @@ typedef struct ebml_st {
|
|||||||
|
|
||||||
ebml_read_mode output_state;
|
ebml_read_mode output_state;
|
||||||
ebml_parsing_state parse_state;
|
ebml_parsing_state parse_state;
|
||||||
unsigned long long copy_len;
|
uint_least64_t copy_len;
|
||||||
|
|
||||||
ssize_t cluster_start;
|
ssize_t cluster_start;
|
||||||
ebml_keyframe_status cluster_starts_with_keyframe;
|
ebml_keyframe_status cluster_starts_with_keyframe;
|
||||||
@ -146,8 +147,8 @@ typedef struct ebml_st {
|
|||||||
size_t header_read_position;
|
size_t header_read_position;
|
||||||
unsigned char *header;
|
unsigned char *header;
|
||||||
|
|
||||||
unsigned long long keyframe_track_number;
|
uint_least64_t keyframe_track_number;
|
||||||
unsigned long long parsing_track_number;
|
uint_least64_t parsing_track_number;
|
||||||
int parsing_track_is_video;
|
int parsing_track_is_video;
|
||||||
} ebml_t;
|
} ebml_t;
|
||||||
|
|
||||||
@ -181,15 +182,15 @@ static unsigned char *ebml_get_write_buffer(ebml_t *ebml, size_t *bytes);
|
|||||||
static ssize_t ebml_wrote(ebml_t *ebml, size_t len);
|
static ssize_t ebml_wrote(ebml_t *ebml, size_t len);
|
||||||
static ssize_t ebml_parse_tag(unsigned char *buffer,
|
static ssize_t ebml_parse_tag(unsigned char *buffer,
|
||||||
unsigned char *buffer_end,
|
unsigned char *buffer_end,
|
||||||
unsigned long long *payload_length);
|
uint_least64_t *payload_length);
|
||||||
static ssize_t ebml_parse_var_int(unsigned char *buffer,
|
static ssize_t ebml_parse_var_int(unsigned char *buffer,
|
||||||
unsigned char *buffer_end,
|
unsigned char *buffer_end,
|
||||||
unsigned long long *out_value);
|
uint_least64_t *out_value);
|
||||||
static ssize_t ebml_parse_sized_int(unsigned char *buffer,
|
static ssize_t ebml_parse_sized_int(unsigned char *buffer,
|
||||||
unsigned char *buffer_end,
|
unsigned char *buffer_end,
|
||||||
size_t len,
|
size_t len,
|
||||||
int is_signed,
|
int is_signed,
|
||||||
unsigned long long *out_value);
|
uint_least64_t *out_value);
|
||||||
static inline void ebml_check_track(ebml_t *ebml);
|
static inline void ebml_check_track(ebml_t *ebml);
|
||||||
|
|
||||||
int format_ebml_get_plugin(source_t *source)
|
int format_ebml_get_plugin(source_t *source)
|
||||||
@ -608,9 +609,9 @@ static ssize_t ebml_wrote(ebml_t *ebml, size_t len)
|
|||||||
ssize_t tag_length;
|
ssize_t tag_length;
|
||||||
ssize_t value_length;
|
ssize_t value_length;
|
||||||
ssize_t track_number_length;
|
ssize_t track_number_length;
|
||||||
unsigned long long payload_length;
|
uint_least64_t payload_length;
|
||||||
unsigned long long data_value;
|
uint_least64_t data_value;
|
||||||
unsigned long long track_number;
|
uint_least64_t track_number;
|
||||||
unsigned char flags;
|
unsigned char flags;
|
||||||
ebml_parsing_state copy_state;
|
ebml_parsing_state copy_state;
|
||||||
|
|
||||||
@ -869,11 +870,11 @@ static inline void ebml_check_track(ebml_t *ebml)
|
|||||||
|
|
||||||
static ssize_t ebml_parse_tag(unsigned char *buffer,
|
static ssize_t ebml_parse_tag(unsigned char *buffer,
|
||||||
unsigned char *buffer_end,
|
unsigned char *buffer_end,
|
||||||
unsigned long long *payload_length)
|
uint_least64_t *payload_length)
|
||||||
{
|
{
|
||||||
size_t type_length;
|
size_t type_length;
|
||||||
size_t size_length;
|
size_t size_length;
|
||||||
unsigned long long value;
|
uint_least64_t value;
|
||||||
|
|
||||||
*payload_length = 0;
|
*payload_length = 0;
|
||||||
|
|
||||||
@ -902,13 +903,13 @@ static ssize_t ebml_parse_tag(unsigned char *buffer,
|
|||||||
*/
|
*/
|
||||||
static ssize_t ebml_parse_var_int(unsigned char *buffer,
|
static ssize_t ebml_parse_var_int(unsigned char *buffer,
|
||||||
unsigned char *buffer_end,
|
unsigned char *buffer_end,
|
||||||
unsigned long long *out_value)
|
uint_least64_t *out_value)
|
||||||
{
|
{
|
||||||
size_t size = 1;
|
size_t size = 1;
|
||||||
size_t i;
|
size_t i;
|
||||||
unsigned char mask = 0x80;
|
unsigned char mask = 0x80;
|
||||||
unsigned long long value;
|
uint_least64_t value;
|
||||||
unsigned long long unknown_marker;
|
uint_least64_t unknown_marker;
|
||||||
|
|
||||||
if (buffer >= buffer_end) {
|
if (buffer >= buffer_end) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -966,16 +967,16 @@ static ssize_t ebml_parse_var_int(unsigned char *buffer,
|
|||||||
* value to *out_value.
|
* value to *out_value.
|
||||||
* If is_signed is true, then the int is assumed to be two's complement
|
* If is_signed is true, then the int is assumed to be two's complement
|
||||||
* signed, negative values will be correctly promoted, and the returned
|
* signed, negative values will be correctly promoted, and the returned
|
||||||
* long long can be safely cast to a signed number on systems using
|
* unsigned number can be safely cast to a signed number on systems using
|
||||||
* two's complement arithmatic.
|
* two's complement arithmatic.
|
||||||
*/
|
*/
|
||||||
static ssize_t ebml_parse_sized_int(unsigned char *buffer,
|
static ssize_t ebml_parse_sized_int(unsigned char *buffer,
|
||||||
unsigned char *buffer_end,
|
unsigned char *buffer_end,
|
||||||
size_t len,
|
size_t len,
|
||||||
int is_signed,
|
int is_signed,
|
||||||
unsigned long long *out_value)
|
uint_least64_t *out_value)
|
||||||
{
|
{
|
||||||
unsigned long long value;
|
uint_least64_t value;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (len < 1 || len > 8) {
|
if (len < 1 || len > 8) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user