1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-08 10:32:51 +00:00

cosmetics: make some arguments const, "unsigned char"->uint8_t

Mark input-only buffers as const.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32652 b3059339-0415-0410-9bf9-f77b7e298cf2

Use uint8_t type instead of unsigned char.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32653 b3059339-0415-0410-9bf9-f77b7e298cf2

Mark input buffer that is never modified as const.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32654 b3059339-0415-0410-9bf9-f77b7e298cf2

Mark input-only buffer as const.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32655 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-11-27 10:07:19 +00:00 committed by Uoti Urpala
parent bb4cca9b32
commit e23bf53fad
5 changed files with 13 additions and 11 deletions

View File

@ -862,7 +862,7 @@ static int ty_XDSdecode( char b1, char b2 )
// =========================================================================== // ===========================================================================
// Callback from Video Display Processing to put up the OSD // Callback from Video Display Processing to put up the OSD
// =========================================================================== // ===========================================================================
void ty_processuserdata( unsigned char* buf, int len ) void ty_processuserdata( const unsigned char* buf, int len )
{ {
int index; int index;

View File

@ -20,6 +20,6 @@
#define MPLAYER_DEMUX_TY_OSD_H #define MPLAYER_DEMUX_TY_OSD_H
void ty_ClearOSD(int start); void ty_ClearOSD(int start);
void ty_processuserdata(unsigned char *buf, int len); void ty_processuserdata(const unsigned char *buf, int len);
#endif /* MPLAYER_DEMUX_TY_OSD_H */ #endif /* MPLAYER_DEMUX_TY_OSD_H */

View File

@ -407,7 +407,7 @@ mpeg_header_parser:
return 1; return 1;
} }
static void process_userdata(unsigned char* buf,int len){ static void process_userdata(const unsigned char* buf,int len){
int i; int i;
/* if the user data starts with "CC", assume it is a CC info packet */ /* if the user data starts with "CC", assume it is a CC info packet */
if(len>2 && buf[0]=='C' && buf[1]=='C'){ if(len>2 && buf[0]=='C' && buf[1]=='C'){

View File

@ -182,8 +182,8 @@ static void cc_decode_EIA608(unsigned short int data)
{ {
static unsigned short int lastcode=0x0000; static unsigned short int lastcode=0x0000;
unsigned char c1 = data & 0x7f; uint8_t c1 = data & 0x7f;
unsigned char c2 = (data >> 8) & 0x7f; uint8_t c2 = (data >> 8) & 0x7f;
if (c1 & 0x60) { /* normal character, 0x20 <= c1 <= 0x7f */ if (c1 & 0x60) { /* normal character, 0x20 <= c1 <= 0x7f */
if (channel != (selected_channel() & 1)) if (channel != (selected_channel() & 1))
@ -254,7 +254,7 @@ static void cc_decode_EIA608(unsigned short int data)
lastcode=data; lastcode=data;
} }
static void subcc_decode(unsigned char *inputbuffer, unsigned int inputlength) static void subcc_decode(const uint8_t *inputbuffer, unsigned int inputlength)
{ {
/* The first number may denote a channel number. I don't have the /* The first number may denote a channel number. I don't have the
* EIA-708 standard, so it is hard to say. * EIA-708 standard, so it is hard to say.
@ -287,10 +287,10 @@ static void subcc_decode(unsigned char *inputbuffer, unsigned int inputlength)
* *
* until end of packet * until end of packet
*/ */
unsigned char *current = inputbuffer; const uint8_t *current = inputbuffer;
unsigned int curbytes = 0; unsigned int curbytes = 0;
unsigned char data1, data2; uint8_t data1, data2;
unsigned char cc_code; uint8_t cc_code;
int odd_offset = 1; int odd_offset = 1;
while (curbytes < inputlength) { while (curbytes < inputlength) {
@ -338,7 +338,7 @@ static void subcc_decode(unsigned char *inputbuffer, unsigned int inputlength)
} }
void subcc_process_data(unsigned char *inputdata,unsigned int len) void subcc_process_data(const uint8_t *inputdata, unsigned int len)
{ {
if(!subcc_enabled) return; if(!subcc_enabled) return;
if(!initialized) subcc_init(); if(!initialized) subcc_init();

View File

@ -19,9 +19,11 @@
#ifndef MPLAYER_SUB_CC_H #ifndef MPLAYER_SUB_CC_H
#define MPLAYER_SUB_CC_H #define MPLAYER_SUB_CC_H
#include <stdint.h>
extern int subcc_enabled; extern int subcc_enabled;
void subcc_init(void); void subcc_init(void);
void subcc_process_data(unsigned char *inputdata,unsigned int len); void subcc_process_data(const uint8_t *inputdata, unsigned int len);
#endif /* MPLAYER_SUB_CC_H */ #endif /* MPLAYER_SUB_CC_H */